/* AI Workshop - Parent-Child AI Building Tool */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #6C5CE7;
  --primary-light: #E8E4FF;
  --secondary: #00B894;
  --accent: #FDCB6E;
  --pink: #FD79A8;
  --bg: #F8F9FD;
  --card: #FFFFFF;
  --text: #2D3436;
  --text-light: #636E72;
  --border: #E8E8F0;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(108,92,231,0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  padding-bottom: 40px;
  margin: 0;
  min-height: 100vh;
}

/* Container for smaller screens */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .phase {
    padding: 16px;
    padding-bottom: 32px;
  }

  .phase-header h2 {
    font-size: 20px;
  }

  .card {
    padding: 16px;
    margin-bottom: 12px;
  }

  .hero-icon {
    font-size: 60px;
  }

  .phase-hero h1 {
    font-size: 22px;
  }

  .big-input {
    padding: 12px 16px;
    font-size: 18px;
  }

  .choice-btn {
    padding: 8px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .topnav {
    padding: 10px 16px;
  }

  .nav-title {
    font-size: 16px;
  }

  .nav-dot {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .phase-tag {
    font-size: 12px;
    padding: 3px 12px;
  }

  .phase-header h2 {
    font-size: 18px;
  }

  .card {
    padding: 16px;
  }

  .card h3 {
    font-size: 16px;
  }

  .btn-primary {
    padding: 12px 24px;
    font-size: 15px;
  }

  .btn-secondary {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* ===== Top Nav ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  padding: 12px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  flex-wrap: wrap;
}

.nav-title {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
  white-space: nowrap;
}

.nav-dots {
  display: flex;
  gap: 6px;
}

.nav-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  flex-shrink: 0;
}

.nav-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.nav-dot.done {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

/* ===== Phases ===== */
.phase {
  display: none;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 40px;
}

.phase.active { display: block; }

.phase-header {
  margin-bottom: 20px;
}

.phase-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.phase-header h2 {
  font-size: 24px;
  line-height: 1.4;
}

/* ===== Hero ===== */
.phase-hero {
  text-align: center;
  padding: 50px 20px 30px;
}

.hero-icon {
  font-size: 80px;
  margin-bottom: 16px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.phase-hero h1 {
  font-size: 26px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-light);
}

/* ===== Roadmap ===== */
.roadmap {
  max-width: 500px;
  margin: 30px auto;
}

.road-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-left: 3px solid var(--border);
  margin-left: 16px;
  padding-left: 24px;
  position: relative;
}

.road-num {
  position: absolute;
  left: -16px;
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.road-step strong { font-size: 16px; }
.road-step p { font-size: 14px; color: var(--text-light); margin-top: 2px; }

/* ===== Cards ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.card p { color: var(--text-light); margin-bottom: 12px; }

.parent-note {
  background: #FFF8E1;
  border-left: 4px solid var(--accent);
  font-size: 14px;
  line-height: 1.6;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
}

.phase-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 680px) {
  .phase-nav {
    flex-direction: column;
  }

  .phase-nav .btn-primary,
  .phase-nav .btn-secondary {
    width: 100%;
  }
}

/* ===== Experiment Boxes ===== */
.experiment1-box {
  background: #F8F7FF;
  border-radius: 12px;
  padding: 0px;
  margin: 12px 0;
}
.experiment-box {
  background: #F8F7FF;
  border-radius: 12px;
  padding: 20px;
  margin: 12px 0;
}
.prompt-choices, .test-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.choice-btn {
  padding: 10px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
}

.choice-btn:hover { border-color: var(--primary); }
.choice-btn.active { border-color: var(--primary); background: var(--primary-light); }
.choice-btn.loading { cursor: progress; }
.choice-btn.loading .button-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.choice-btn.loading .button-loading::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 1s infinite ease-in-out;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(0.8); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}
.choice-btn.disabled,
.choice-btn:disabled {
  background: #F0F0F3;
  border-color: #D8D8D8;
  color: var(--text-light);
  cursor: not-allowed;
  pointer-events: none;
}
.choice-btn.active.disabled,
.choice-btn.active:disabled {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--text);
  cursor: not-allowed;
  pointer-events: none;
}
.choice-btn.disabled:hover,
.choice-btn:disabled:hover {
  border-color: #D8D8D8;
  background: #F0F0F3;
  color: var(--text-light);
}

/* Input field disabled state */
input:disabled {
  background: #F8F8F8;
  color: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

input:disabled::placeholder {
  color: #CCC;
}

.experiment-question {
  margin-top: 12px;
}

.question-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.question-row input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
}

.result-box {
  margin-top: 16px;
  padding: 16px;
  background: white;
  border-radius: 10px;
  border: 2px solid var(--secondary);
}

.result-box.hidden { display: none; }

.result-label {
  font-size: 13px;
  color: var(--secondary);
  font-weight: 700;
  margin-bottom: 6px;
}

.result-content {
  font-size: 16px;
  line-height: 1.6;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.result-content::-webkit-scrollbar {
  width: 8px;
}

.result-content::-webkit-scrollbar-thumb {
  background: rgba(111, 66, 193, 0.35);
  border-radius: 999px;
}

.result-content::-webkit-scrollbar-track {
  background: rgba(111, 66, 193, 0.08);
}

.insight {
  background: linear-gradient(135deg, #E8E4FF, #F0E6FF);
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
  font-size: 15px;
}

/* ===== Guess Game ===== */
.guess-game { margin: 16px 0; }

.guess-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.guess-text { font-size: 17px; font-weight: 600; }

.guess-input {
  width: 80px;
  padding: 8px 12px;
  border: 2px dashed var(--primary);
  border-radius: 8px;
  font-size: 16px;
  text-align: center;
}

.guess-feedback { font-size: 20px; }

/* ===== Design Phase ===== */
.big-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.big-input:focus { border-color: var(--primary); outline: none; }

.hint { font-size: 13px; color: var(--text-light); margin-top: 8px; text-align: center; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.avatar-option {
  padding: 14px 8px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  font-size: 32px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

@media (max-width: 680px) {
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.avatar-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.avatar-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.avatar-option small {
  font-size: 12px;
  color: var(--text-light);
  display: block;
  margin-top: 4px;
}

.avatar-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.05);
}

.selection-indicator {
  margin-top: 10px;
  padding: 8px 12px;
  background: #F0F9FF;
  border-radius: 8px;
  font-size: 14px;
  color: var(--primary);
  text-align: center;
}

.trait-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

@media (max-width: 680px) {
  .trait-grid {
    gap: 6px;
  }

  .trait-btn {
    padding: 6px 14px;
    font-size: 13px;
  }
}

.trait-btn {
  padding: 8px 18px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
}

.trait-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.trait-btn.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}


.design-field textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}

.design-field textarea:focus { border-color: var(--primary); outline: none; }

/* Design Preview */
.preview-card {
  background: linear-gradient(135deg, #F8F7FF, #FFF0F5);
  position: relative;
  overflow: hidden;
}

.preview-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
}

.preview-style {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-20px, -20px) rotate(180deg); }
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 4px;
}

.preview-status {
  font-size: 12px;
  padding: 4px 12px;
  background: #FFE4E1;
  color: #FF6B6B;
  border-radius: 12px;
  font-weight: 600;
}

.preview-progress {
  font-size: 12px;
  color: var(--text-light);
}

.preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.save-feedback {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
}

.save-feedback.show {
  opacity: 1;
}

.save-feedback.success {
  background: #D4EDDA;
  color: #155724;
}

.save-feedback.error {
  background: #F8D7DA;
  color: #721C24;
}

.style-tips {
  margin-top: 12px;
  padding: 12px;
  background: #F8F9FA;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.style-tips p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--text);
}

.style-tips ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-light);
}

.style-tips li {
  margin-bottom: 4px;
}

.design-preview {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: white;
  border-radius: 14px;
}

.preview-avatar { font-size: 56px; }
.preview-name { font-size: 22px; font-weight: 800; }
.preview-traits, .preview-abilities { font-size: 14px; color: var(--text-light); margin-top: 4px; }

/* ===== Prompt Builder ===== */
.prompt-builder { margin: 16px 0; }

.prompt-section {
  margin-bottom: 20px;
}

.prompt-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.prompt-section textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.prompt-section textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.prompt-section textarea:focus { border-color: var(--primary); outline: none; }

.prompt-final {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px dashed var(--border);
}

.prompt-final textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--primary);
  border-radius: 12px;
  font-size: 14px;
  font-family: "SF Mono", "Fira Code", monospace, "PingFang SC";
  line-height: 1.6;
  background: #FAFAFF;
  resize: vertical;
}

.prompt-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

/* Improvement log */
.improvement-log {
  margin-top: 16px;
}

.log-entry-input {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.log-entry-input input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.log-entry-input button {
  padding: 10px 20px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.issues-list {
  max-height: 200px;
  overflow-y: auto;
}

.issue-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.issue-content {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.issue-item button {
  padding: 6px 12px;
  font-size: 12px;
}

.iterate-hint {
  margin-top: 16px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: 8px;
  font-size: 14px;
  color: var(--primary);
}

.iterate-hint a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}

/* Loading animation */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Save feedback */
.save-feedback {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  transition: all 0.3s ease;
  transform: translateX(400px);
}

.save-feedback.show {
  transform: translateX(0);
}

.save-feedback.success {
  background: #D4EDDA;
  color: #155724;
  border: 1px solid #C3E6CB;
}

.save-feedback.error {
  background: #F8D7DA;
  color: #721C24;
  border: 1px solid #F5C6CB;
}

/* Test Chat */
.test-chat {
  background: var(--card);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

.test-messages {
  height: 220px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg);
  border-radius: 16px;
  scroll-behavior: smooth;
}

.message {
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  max-width: 75%;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  animation: msgIn 0.3s ease-out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-message {
  background: #78a9ed;
  color: white;
  margin-left: auto;
  margin-right: 0;
  text-align: right;
}

.ai-message {
  background: white;
  color: var(--text);
  border: 1px solid rgba(56, 64, 147, 0.08);
  margin-right: auto;
  margin-left: 0;
}

.ai-message.loading {
  color: var(--text-light);
  font-style: italic;
}

.char-count {
  font-size: 13px;
  color: var(--text-light);
  display: block;
  text-align: right;
  margin-top: 8px;
}

/* Final chat styling */
.chat-messages-final {
  height: 320px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 18px;
  background: var(--bg);
  border-radius: 16px;
  scroll-behavior: smooth;
}

.final-input-area {
  display: flex;
  gap: 8px;
  align-items: center;
}

#final-input {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}

#final-input:disabled {
  background: #F8F8F8;
  color: #999;
  cursor: not-allowed;
}

.voice-btn-final {
  padding: 12px;
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.voice-btn-final:hover {
  background: var(--primary);
  color: white;
}

.voice-btn-final.recording {
  background: #E74C3C;
  color: white;
}

.send-btn-final {
  padding: 12px 24px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.send-btn-final:hover {
  background: var(--primary);
  transform: translateY(-1px);
}

.send-btn-final:disabled {
  background: #CCC;
  cursor: not-allowed;
  transform: none;
}

.test-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}

.test-input-row input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  background: white;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.05);
}

.test-input-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(90, 63, 237, 0.08);
}

.test-input-row input:disabled {
  background: #F4F5FF;
  color: #777;
  cursor: not-allowed;
}

.test-input-row button {
  padding: 14px 24px;
  min-width: 110px;
  align-self: center;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.18);
}

.test-input-row button:hover {
  background: #4F46E5;
  transform: translateY(-1px);
}

.test-input-row button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  background: #A5B4FC;
}

.iterate-hint {
  background: #E8FFE8;
  padding: 14px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 14px;
}

.iterate-hint a { color: var(--primary); font-weight: 600; }

/* ===== Phase 4: Voice ===== */
.pipeline-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.pipe-step {
  text-align: center;
  padding: 16px;
  background: white;
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 140px;
}

.pipe-icon { font-size: 36px; margin-bottom: 8px; }
.pipe-label { font-size: 14px; font-weight: 700; }
.pipe-label small { font-weight: 400; color: var(--text-light); }
.pipe-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.pipe-arrow { font-size: 24px; color: var(--primary); font-weight: 700; }

.voice-btn-big {
  display: block;
  width: 100%;
  padding: 20px;
  border: 3px dashed var(--primary);
  border-radius: 16px;
  background: var(--primary-light);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  margin: 16px 0;
  transition: all 0.2s;
}

.voice-btn-big.recording {
  background: var(--primary);
  color: white;
  border-style: solid;
  animation: recording-pulse 1s infinite;
}

@keyframes recording-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,92,231,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(108,92,231,0); }
}

.pipeline-live {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipe-live-step {
  padding: 14px;
  background: #F8F7FF;
  border-radius: 10px;
  border-left: 4px solid var(--border);
  transition: border-color 0.3s;
}

.pipe-live-step.active { border-left-color: var(--primary); }
.pipe-live-step.done { border-left-color: var(--secondary); }
.pipe-live-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.pipe-live-content { font-size: 15px; }

.voice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.voice-option {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 14px;
}

.voice-option.selected { border-color: var(--primary); background: var(--primary-light); }

.voice-settings {
  margin-top: 16px;
}

.voice-settings label {
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin-top: 10px;
}

.voice-settings input[type="range"] {
  width: 100%;
  margin-top: 4px;
  accent-color: var(--primary);
}

/* ===== Phase 5: Final Chat ===== */
.final-character {
  text-align: center;
  padding: 24px;
}

.final-avatar { font-size: 64px; }
.final-name { font-size: 24px; font-weight: 800; margin-top: 8px; }

.chat-messages-final {
  height: 300px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F8F7FF;
  border-radius: 14px;
  margin: 12px 0;
}

.final-input-area {
  display: flex;
  gap: 8px;
}

.voice-btn-final {
  width: 50px;
  height: 50px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--primary-light);
  font-size: 22px;
  cursor: pointer;
}

.voice-btn-final.recording {
  background: var(--primary);
  animation: recording-pulse 1s infinite;
}

.final-input-area input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
}

.send-btn-final {
  padding: 12px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Improvement log */
.log-entry-input {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.log-entry-input input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

.log-entry-input button {
  padding: 10px 16px;
  background: var(--pink);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.issues-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issue-item {
  padding: 10px 14px;
  background: #FFF0F5;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.issue-item .issue-status { font-size: 12px; color: var(--text-light); }

/* Loading */
.loading-dots::after {
  content: '';
  animation: dots 1.5s infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* Analogy box */
.analogy-box {
  margin: 12px 0;
}
.analogy-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: #F8F7FF;
  border-radius: 12px;
}
.analogy-icon { font-size: 32px; flex-shrink: 0; }
.analogy-item p { font-size: 14px; margin-top: 4px; }

.hidden { display: none !important; }

@media (max-width: 500px) {
  .pipeline-demo { flex-direction: column; }
  .pipe-arrow { transform: rotate(90deg); }
  .pipe-step { width: 100%; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
}
