/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #71717a;
  --text-tertiary: #a1a1aa;
  --border: #e4e4e7;
  --border-light: #f4f4f5;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.12);
  --accent: #8b5cf6;
  --success: #10b981;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;
  --ai-bubble: #f4f4f5;
  --user-bubble: #6366f1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========== Phase Management ========== */
.phase {
  display: none;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.phase.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  opacity: 1;
}
.phase.active:has(.chat-wrapper) {
  padding: 0;
  align-items: stretch;
}
.phase.active:has(.landing),
.phase.active:has(.instruction-screen) {
  align-items: center;
}

/* ========== Progress Bar ========== */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-light);
  z-index: 100;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 2px 2px 0;
}

/* ========== Instruction Screen ========== */
.instruction-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}
.instruction-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: 0 0 0 8px var(--primary-glow);
}
.instruction-screen h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.instruction-screen p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  max-width: 420px;
}
.instruction-screen .instruction-detail {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}
.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.5rem 0;
  text-align: left;
  width: 100%;
  max-width: 380px;
}
.instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}
.step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}
.instruction-screen .btn-primary { max-width: 280px; margin-top: 1.5rem; }

/* ========== Form Container ========== */
.form-container {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 640px;
  width: 100%;
  padding: 2.5rem;
  border: 1px solid var(--border-light);
}
.form-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.form-container h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  color: var(--text);
}
.form-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--primary);
}

.consent-text, .debrief-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.consent-text p, .debrief-text p { margin-bottom: 0.75rem; }
.debrief-text ul { margin: 0.5rem 0 0.75rem 1.5rem; }
.debrief-text li { margin-bottom: 0.25rem; }

/* ========== Form Elements ========== */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.form-group select,
.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-group select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  padding: 0.75rem 1rem;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: border-color var(--transition);
}
.checkbox-label:has(input:checked) { border-color: var(--primary); }
.checkbox-label input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }

.scale-instruction {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  padding: 0.6rem 0.85rem;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.scale-section { margin-bottom: 2rem; }

/* ========== Likert Scale ========== */
.likert-item {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.likert-item:last-child { border-bottom: none; }
.likert-label { font-size: 0.9rem; margin-bottom: 0.5rem; font-weight: 400; line-height: 1.5; }
.likert-options {
  display: flex;
  gap: 0;
  justify-content: space-between;
  margin-top: 0.4rem;
}
.likert-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  cursor: pointer;
}
.likert-option input[type="radio"] { display: none; }
.likert-option .radio-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  background: var(--surface);
}
.likert-option:hover .radio-circle {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.likert-option input[type="radio"]:checked + .radio-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.likert-anchors {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: 0.35rem;
  padding: 0 0.25rem;
}

/* ========== Buttons ========== */
.btn-primary {
  display: block;
  width: 100%;
  padding: 0.8rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px var(--primary-glow);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

/* ========== Chat Interface ========== */
.chat-wrapper {
  width: 100%;
  max-width: 700px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
  flex-shrink: 0;
}
.chat-header-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.chat-header-title { font-weight: 600; font-size: 0.92rem; }
.chat-header-status { font-size: 0.78rem; color: var(--success); display: flex; align-items: center; gap: 0.3rem; }
.chat-header-status::before { content: ''; width: 6px; height: 6px; background: var(--success); border-radius: 50%; }

.chat-messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg);
}

.message {
  max-width: 82%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.6;
  word-wrap: break-word;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.system-message {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  max-width: 100%;
  font-size: 0.85rem;
  color: var(--warning-text);
  padding: 0.85rem 1rem;
}
.user-message {
  background: var(--user-bubble);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.ai-message {
  background: var(--surface);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 0.85rem 1rem;
  align-self: flex-start;
  background: var(--surface);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  animation: msgIn 0.25s ease;
}
.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Progress text */
.progress-text {
  padding: 0.75rem 1rem;
  align-self: flex-start;
  background: var(--surface);
  border-radius: var(--radius);
  border-bottom-left-radius: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  animation: msgIn 0.25s ease;
}
.progress-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Chat input */
.chat-input-area {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  flex-shrink: 0;
}
.chat-input-area:has(.round-rating) {
  display: block;
  padding: 0.75rem 1.25rem;
}
.chat-input-area .round-rating {
  margin: 0;
  box-shadow: none;
  border: none;
  padding: 0.25rem 0;
  max-height: none;
}
.chat-input-area textarea {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  line-height: 1.4;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.chat-input-area textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.btn-send {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.btn-send:hover { background: var(--primary-hover); transform: scale(1.05); }
.btn-send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* Continue button */
.btn-continue {
  display: block;
  margin: 1.25rem auto 0;
  padding: 0.65rem 2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-continue:hover { background: var(--primary-hover); box-shadow: 0 4px 14px var(--primary-glow); }

/* ========== Landing Page ========== */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  width: 100%;
  padding: 1rem 0;
}
.landing-content {
  text-align: center;
  max-width: 520px;
  width: 100%;
}
.landing-badge {
  display: inline-block;
  padding: 0.25rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.85rem;
}
.landing-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.landing-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1rem;
}
.landing-features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  text-align: left;
}
.landing-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.landing-feature strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.05rem;
}
.landing-feature span:not(.feature-icon) {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.landing-content .btn-primary {
  max-width: 280px;
  margin: 0 auto;
}
.landing-footnote {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
}

/* ========== Landing Bilingual ========== */
.landing-title-en {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}
.landing-desc-en {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ========== Language Selection ========== */
.lang-options {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 380px;
}
.lang-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.lang-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.lang-label {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.lang-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ========== Section Tag ========== */
.section-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 0.75rem;
}

/* ========== Consent Cards ========== */
.consent-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}
.consent-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.consent-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}
.consent-item strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}
.consent-item div {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ========== Likert Anchor Bar ========== */
.likert-anchor-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  padding: 0.5rem 0.85rem;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

/* ========== Debrief ========== */
.debrief-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}
.debrief-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  max-width: 520px;
  box-shadow: var(--shadow-sm);
}
.debrief-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.debrief-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.debrief-conditions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}
.debrief-cond {
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.debrief-cond strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.2rem;
}
.debrief-cond span {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.instruction-icon-done {
  background: var(--success);
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.12);
}

/* ========== Responsive ========== */
@media (min-width: 700px) {
  .chat-wrapper {
    height: calc(100vh - 2rem);
    max-height: 820px;
    margin: 1rem auto;
  }
  .chat-container {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
  }
  .phase.active:has(.chat-wrapper) { padding: 0; align-items: center; }
}

@media (max-width: 480px) {
  .form-container { padding: 1.5rem; }
  .likert-option .radio-circle { width: 30px; height: 30px; font-size: 0.75rem; }
  .instruction-screen h1 { font-size: 1.35rem; }
  .landing-title { font-size: 1.6rem; }
  .consent-card { grid-template-columns: 1fr; }
  .debrief-conditions { grid-template-columns: 1fr; }
  .choice-btn { font-size: 0.85rem; padding: 0.7rem 0.8rem; }
  .rating-numbers { gap: 4px; }
  .rating-num { width: 34px; height: 34px; font-size: 0.85rem; }
}

/* ========== Choice Buttons (Round 2 & 3 input) ========== */
.choice-buttons {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.choice-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.choice-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  line-height: 1.5;
}
.choice-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ========== Prefilled Input (Round 1) ========== */
.chat-input-prefilled {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-light);
}
.prefilled-text {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  line-height: 1.5;
}

/* ========== Round Rating Card ========== */
.round-rating {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  box-shadow: var(--shadow-md);
  animation: slideInUp 0.3s ease;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  max-height: 600px;
}
.round-rating.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.round-rating-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-align: center;
}
.round-rating-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.rating-anchor {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}
.rating-numbers {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.rating-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rating-num:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.rating-num.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.rating-confirm-btn {
  display: block;
  margin: 0 auto;
  padding: 0.45rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}
.rating-confirm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.rating-confirm-btn:not(:disabled):hover {
  background: var(--primary-hover);
}

/* ========== Chat End Message ========== */
.chat-end-msg {
  text-align: center;
}

/* ========== Checkbox Group (ai_tools) ========== */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  transition: border-color var(--transition);
}
.checkbox-item:hover { border-color: var(--primary); }
.checkbox-item input[type="checkbox"] { accent-color: var(--primary); }

/* ========== Radio Group (manipulation check) ========== */
.radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.radio-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.radio-item input[type="radio"] { accent-color: var(--primary); }

/* ========== Debug Overlay ========== */
.debug-overlay {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(0,0,0,0.82);
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 0.75rem;
  border-radius: 8px;
  z-index: 9999;
  line-height: 1.4;
  pointer-events: none;
}
.debug-overlay pre {
  white-space: pre-wrap;
  word-break: break-all;
}

