/* Feel Understood — Your Conversation Partner — App Styles */

:root {
  /* Light mode — happy, positive, approachable */
  --bg: #ffffff;
  --surface: #faf8f3;
  --surface-2: #ececec;
  --accent: #ffd21f;
  --accent-rgb: 255, 210, 31;
  --accent-dim: rgba(var(--accent-rgb), 0.18);
  --text: #1a1a1a;
  --text-dim: #6b6b6b;
  --red: #e74c3c;
  --red-rgb: 231, 76, 60;
  --green: #7cb518;
  --green-rgb: 124, 181, 24;
  --blue-rgb: 88, 148, 224;
  --shadow-rgb: 0, 0, 0;
  --on-accent: #1a1a1a;
  --accent-ink: #8a6f00;
  --green-ink: #4a7a1a;
  --red-ink: #b83228;
  --radius: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

[data-theme="dark"] {
  /* Dark mode — pure black + greyscale only */
  --bg: #0a0a0a;
  --surface: #161616;
  --surface-2: #262626;
  --accent: #e8e8e8;
  --accent-rgb: 232, 232, 232;
  --accent-dim: rgba(var(--accent-rgb), 0.12);
  --text: #f0f0f0;
  --text-dim: #8a8a8a;
  --red: #c74a3c;
  --red-rgb: 199, 74, 60;
  --green: #b0b0b0;
  --green-rgb: 176, 176, 176;
  --blue-rgb: 160, 160, 160;
  --shadow-rgb: 0, 0, 0;
  --on-accent: #0a0a0a;
  --accent-ink: #e8e8e8;
  --green-ink: #b0b0b0;
  --red-ink: #d85a4e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ===== ONBOARDING ===== */
.onboarding {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.onboarding-content {
  text-align: center;
  max-width: 380px;
  width: 100%;
  animation: fadeInUp 0.6s ease-out;
}

.onboarding-logo {
  margin-bottom: 28px;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.onboarding-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.onboarding-title {
  font-size: 32px;
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  font-family: Arial, sans-serif;
}

.onboarding-sub {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 40px;
}

.onboarding-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
  text-align: left;
}

.onboarding-feature {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--surface-2);
}

.feature-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 10px;
}

.doodle-icon {
  filter: brightness(0);
  opacity: 0.85;
}
[data-theme="dark"] .doodle-icon {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.feature-icon .doodle-icon {
  filter: none;
  opacity: 1;
}

.avatar .doodle-icon {
  filter: none;
  opacity: 0.85;
}

.header-icon .doodle-icon {
  filter: none;
  opacity: 0.9;
}

.onboarding-feature strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.onboarding-feature span {
  font-size: 13px;
  color: var(--text-dim);
}

.start-btn {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
}
.start-btn:active { transform: scale(0.98); }

.onboarding-note {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 16px;
}

/* ===== PROFILE QUIZ ===== */
.quiz-container {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

.quiz-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(16px + var(--safe-top)) 20px 8px;
  flex-shrink: 0;
}

.quiz-back-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.quiz-back-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.quiz-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 100px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Screen container & animations */
.quiz-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.quiz-enter {
  animation: quizSlideIn 0.3s ease-out both;
}
.quiz-exit {
  animation: quizSlideOut 0.3s ease-in both;
}
.quiz-enter-back {
  animation: quizSlideInBack 0.3s ease-out both;
}
.quiz-exit-back {
  animation: quizSlideOutBack 0.3s ease-in both;
}

@keyframes quizSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes quizSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-40px); }
}
@keyframes quizSlideInBack {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes quizSlideOutBack {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* Splash screen */
.quiz-splash {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: calc(24px + var(--safe-top));
}

.quiz-splash-content {
  max-width: 340px;
  animation: fadeInUp 0.6s ease-out;
}

.quiz-splash-icon {
  margin: 0 auto 28px;
  width: 100%;
  max-width: 260px;
}
.quiz-splash-icon img {
  width: 100%;
  height: auto;
  display: block;
}

.quiz-splash-title {
  font-family: Arial, sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}

.quiz-splash-desc {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 36px;
}

.quiz-splash-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
  text-align: left;
}

.quiz-splash-feat {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
  opacity: 0.8;
}

.quiz-feat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* CTA button */
.quiz-cta {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  font-family: inherit;
}
.quiz-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
}
.quiz-cta:active { transform: scale(0.98); }
.quiz-cta-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Quiz titles */
.quiz-title {
  font-family: Arial, sans-serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--text);
}

.quiz-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 28px;
}

/* Name input */
.quiz-name {
  justify-content: center;
}

.quiz-name-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.quiz-name-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 20px;
  font-family: inherit;
  background: var(--surface);
  border: 2px solid var(--surface-2);
  border-radius: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
}
.quiz-name-input:focus {
  border-color: var(--accent-ink);
}
.quiz-name-input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

/* Multiple choice options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px;
  background: var(--surface);
  border: 2px solid var(--surface-2);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.quiz-option:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: var(--surface-2);
}
.quiz-option:active {
  transform: scale(0.98);
}
.quiz-option-selected {
  border-color: var(--accent-ink);
  background: var(--accent-dim);
}

.quiz-option-label {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.quiz-option-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.4;
}

.quiz-insight {
  font-size: 12px;
  color: var(--accent-ink);
  opacity: 0.7;
  line-height: 1.4;
  padding: 10px 14px;
  background: var(--accent-dim);
  border-radius: 10px;
  margin-top: auto;
}

/* Profile reveal */
.quiz-reveal {
  align-items: center;
  text-align: center;
}

.quiz-reveal-header {
  margin-bottom: 28px;
  animation: fadeInUp 0.5s ease-out;
}

.quiz-reveal-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-family: Arial, sans-serif;
}

.quiz-reveal-name {
  font-family: Arial, sans-serif;
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 4px;
}

.quiz-reveal-tagline {
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.quiz-reveal-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 32px;
}

.quiz-reveal-card {
  padding: 18px;
  border-radius: 14px;
  text-align: left;
  animation: fadeInUp 0.5s ease-out both;
}
.quiz-reveal-card:nth-child(1) { animation-delay: 0.2s; }
.quiz-reveal-card:nth-child(2) { animation-delay: 0.4s; }

.quiz-strength-card {
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

.quiz-growth-card {
  background: rgba(var(--green-rgb), 0.08);
  border: 1px solid rgba(var(--green-rgb), 0.15);
}

.quiz-card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.quiz-badge-strength {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-ink);
}

.quiz-badge-growth {
  background: rgba(var(--green-rgb), 0.15);
  color: var(--green-ink);
}

.quiz-reveal-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.quiz-reveal-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.quiz-cta-final {
  animation: fadeInUp 0.5s ease-out both;
  animation-delay: 0.6s;
}

/* ===== MODE SELECT ===== */
.quiz-mode-select {
  padding-top: calc(20px + var(--safe-top));
}

.mode-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-top: 4px;
  margin-bottom: 12px;
}

.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 20px;
  background: var(--surface);
  border: 2px solid var(--surface-2);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}
.mode-card:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--surface-2);
  transform: translateY(-1px);
}
.mode-card:active { transform: scale(0.99); }
.mode-card-selected {
  border-color: var(--accent-ink);
  background: var(--accent-dim);
}

.mode-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  background: rgba(var(--accent-rgb), 0.12);
}
.mode-icon-facilitator {
  color: var(--green-ink);
  background: rgba(var(--green-rgb), 0.12);
}

.mode-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.mode-card-pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-ink);
  margin-bottom: 2px;
}
.mode-card-pill-pair {
  background: rgba(var(--green-rgb), 0.15);
  color: var(--green-ink);
}

.mode-card-title {
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
}

.mode-card-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.mode-card-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mode-card-list li {
  font-size: 12px;
  color: var(--text);
  opacity: 0.85;
  position: relative;
  padding-left: 14px;
  line-height: 1.4;
}
.mode-card-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.mode-card-facilitator .mode-card-list li::before {
  background: var(--green);
}

/* Pair avatar for facilitator reveal */
.quiz-reveal-avatar-pair {
  background: rgba(var(--green-rgb), 0.15);
  color: var(--green-ink);
}

/* ===== FEEL UNDERSTOOD QUESTIONNAIRE ===== */

/* Small label that sits above the title, e.g. "Part 1 of 3" */
.quiz-section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-ink);
  background: var(--accent-dim);
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  align-self: flex-start;
}

/* Intro screen (text only) */
.quiz-intro {
  justify-content: center;
}
.quiz-intro-body {
  font-size: 15px;
  color: var(--text);
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Scale list: one row per area, 5 dots each */
.scale-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}
.scale-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 14px;
}
.scale-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scale-row-label {
  font-size: 15px;
  font-weight: 600;
}
.scale-row-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.scale-dots {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.scale-dot {
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--surface-2);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.scale-dot:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  color: var(--text);
}
.scale-dot:active { transform: scale(0.94); }
.scale-dot-filled {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent-ink);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.scale-dot-selected {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent-ink);
}
.scale-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 4px 16px;
}

/* Multi-select chips */
.quiz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.quiz-chip {
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--surface-2);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.quiz-chip:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
}
.quiz-chip:active { transform: scale(0.97); }
.quiz-chip-selected {
  background: var(--accent-dim);
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}

/* Section reflection / summary card */
.quiz-summary {
  justify-content: center;
}
.quiz-summary-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 18px;
  padding: 24px 22px;
  margin-bottom: 28px;
  position: relative;
  animation: fadeInUp 0.5s ease-out;
}
.quiz-summary-avatar {
  position: absolute;
  top: -18px;
  left: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-accent);
}
.quiz-summary-heading {
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  margin-top: 10px;
  margin-bottom: 10px;
}
.quiz-summary-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  opacity: 0.92;
}

/* Profile reveal extras (unseen-aspects card + outro) */
.quiz-aspects-card {
  background: rgba(var(--blue-rgb), 0.06);
  border: 1px solid rgba(var(--blue-rgb), 0.18);
}
.quiz-badge-aspects {
  background: rgba(var(--blue-rgb), 0.15);
  color: #8ab4f8;
}
.quiz-reveal-outro {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 20px;
  text-align: center;
  padding: 0 4px;
}

/* Next-steps cards */
.quiz-next-steps {
  padding-top: calc(12px + var(--safe-top));
}
.next-step-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 12px;
}
.next-step-card {
  position: relative;
  padding: 18px 46px 20px 18px;
  background: var(--surface);
  border: 1.5px solid var(--surface-2);
  border-radius: 16px;
  color: var(--text);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.next-step-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-ink);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.next-step-card:active { transform: scale(0.99); }
.next-step-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent-ink);
  margin-bottom: 10px;
}
.next-step-card-facilitator .next-step-tag {
  background: rgba(var(--green-rgb), 0.15);
  color: var(--green-ink);
}
.next-step-card-helpline .next-step-tag {
  background: rgba(var(--blue-rgb), 0.15);
  color: #8ab4f8;
}
.next-step-title {
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 6px;
}
.next-step-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}
.next-step-arrow {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--accent-ink);
  opacity: 0.7;
  transition: transform 0.15s, opacity 0.15s;
}
.next-step-card:hover .next-step-arrow {
  opacity: 1;
  transform: translate(4px, -50%);
}

/* Quiz responsive */
@media (max-width: 480px) {
  .quiz-splash-title { font-size: 26px; }
  .quiz-title { font-size: 22px; }
  .quiz-screen { padding: 20px 20px 28px; }
  .quiz-option { padding: 14px 16px; }
  .quiz-name-input { font-size: 18px; }
  .mode-card-title { font-size: 20px; }
  .mode-card { padding: 16px; }
  .scale-dot { height: 34px; font-size: 12px; }
  .scale-row { padding: 12px 14px; }
  .quiz-summary-heading { font-size: 20px; }
  .next-step-title { font-size: 20px; }
}

/* ===== APP SHELL ===== */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
}

/* ===== HEADER ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-top)) 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--surface-2);
  flex-shrink: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.header-title-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
}
.header-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-subtitle {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 380px) {
  .header-subtitle { display: none; }
  .basecamp-btn, .new-chat-btn { padding: 6px 10px; font-size: 12px; }
  .header-left { gap: 6px; }
}

.mode-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 4px;
  white-space: nowrap;
}
.mode-badge-coach {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-ink);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}
.mode-badge-facilitator {
  background: rgba(var(--green-rgb), 0.15);
  color: var(--green-ink);
  border: 1px solid rgba(var(--green-rgb), 0.25);
}

.mode-hint {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 16px;
  text-align: center;
  line-height: 1.4;
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
}
.mode-hint strong { font-weight: 600; }

.mode-hint-lessons {
  background: var(--surface-2);
  border-bottom-color: var(--surface-2);
}
.mode-hint-lessons strong { color: var(--text); }

.mode-hint-helpline {
  background: rgba(var(--accent-rgb), 0.1);
  border-bottom-color: rgba(var(--accent-rgb), 0.2);
}
.mode-hint-helpline strong { color: var(--accent-ink); }

.mode-hint-facilitator {
  background: rgba(var(--green-rgb), 0.08);
  border-bottom-color: rgba(var(--green-rgb), 0.18);
}
.mode-hint-facilitator strong { color: var(--green-ink); }

.history-toggle-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.history-toggle-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.new-chat-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent-dim);
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.new-chat-btn:hover { background: rgba(var(--accent-rgb), 0.25); }

.basecamp-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--green-ink);
  background: rgba(var(--green-rgb), 0.15);
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.basecamp-btn:hover { background: rgba(var(--green-rgb), 0.25); }

/* ===== HISTORY DRAWER ===== */
.history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  animation: fadeIn 0.2s ease-out;
}

.history-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--surface);
  border-right: 1px solid var(--surface-2);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.history-drawer.history-open {
  transform: translateX(0);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + var(--safe-top)) 16px 12px;
  border-bottom: 1px solid var(--surface-2);
  flex-shrink: 0;
}
.history-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.history-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
}
.history-close-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 12px;
}

.drawer-section {
  padding: 8px 0;
}
.drawer-section + .drawer-section {
  border-top: 1px solid var(--surface-2);
  margin-top: 4px;
}

.drawer-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 6px 16px 8px;
}

.drawer-mode-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-mode-item:hover { background: var(--surface-2); }
.drawer-mode-item-active { background: var(--accent-dim); }
.drawer-mode-item-active:hover { background: rgba(var(--accent-rgb), 0.22); }
.drawer-mode-facilitator.drawer-mode-item-active { background: rgba(var(--green-rgb), 0.15); }
.drawer-mode-facilitator.drawer-mode-item-active:hover { background: rgba(var(--green-rgb), 0.22); }

.drawer-mode-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.drawer-mode-facilitator .drawer-mode-dot { background: var(--green); }

.drawer-mode-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-mode-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.drawer-mode-sub {
  font-size: 11px;
  color: var(--text-dim);
}
.drawer-mode-check {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-ink);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.2);
  flex-shrink: 0;
}
.drawer-mode-facilitator .drawer-mode-check {
  color: var(--green-ink);
  background: rgba(var(--green-rgb), 0.2);
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-link:hover {
  background: var(--surface-2);
  color: var(--accent-ink);
}
.drawer-link svg {
  color: var(--text-dim);
  flex-shrink: 0;
}
.drawer-link:hover svg { color: var(--accent-ink); }

.drawer-theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--surface-2);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-dim);
  font-size: 13px;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-theme-toggle:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--text-dim);
}

.history-list {
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.history-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 32px 16px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.history-item:hover {
  background: var(--surface-2);
}
.history-item-active {
  background: var(--accent-dim);
  border-left-color: var(--accent-ink);
}

.history-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-time {
  font-size: 11px;
  color: var(--text-dim);
}

.history-item-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.history-item:hover .history-item-delete {
  opacity: 1;
}
.history-item-delete:hover {
  color: var(--red-ink);
  background: rgba(var(--red-rgb), 0.1);
}

.history-footer {
  padding: 12px 16px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--surface-2);
  flex-shrink: 0;
}

.history-start-over-btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface-2);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
}
.history-start-over-btn:hover {
  color: var(--red-ink);
  background: rgba(var(--red-rgb), 0.1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== CHAT AREA ===== */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Messages */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: fadeInUp 0.25s ease-out;
  margin-bottom: 4px;
}
.msg-row.user { justify-content: flex-end; }
.msg-row.assistant { justify-content: flex-start; }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
}

.user-bubble {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 16px 16px 4px 16px;
}

.assistant-bubble {
  background: var(--surface-2);
  color: var(--text);
  border-radius: 16px 16px 16px 4px;
}

.interim-bubble {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-ink);
  border-radius: 16px 16px 4px 16px;
  border: 1px dashed rgba(var(--accent-rgb), 0.3);
  font-style: italic;
}

/* Typing dots */
.typing-bubble {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
}
.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 1.4s ease-in-out infinite;
}

/* ===== ERROR BAR ===== */
.error-bar {
  padding: 8px 16px;
  background: rgba(var(--red-rgb), 0.12);
  color: var(--red-ink);
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* ===== CONTROLS ===== */
.controls {
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mic-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  position: relative;
}

.mic-btn.idle {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3);
  animation: pulse 2.5s ease-in-out infinite;
}

.mic-btn.listening {
  background: var(--red);
  color: white;
  box-shadow: 0 0 24px rgba(var(--red-rgb), 0.4);
  animation: none;
}

.mic-btn.processing {
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: default;
  animation: none;
}

.mic-btn.speaking {
  background: var(--accent);
  color: var(--on-accent);
  animation: pulse 1.5s ease-in-out infinite;
}

.mic-label {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Wave */
.wave-viz {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  height: 24px;
}
.wave-bar {
  width: 3px;
  background: var(--red);
  border-radius: 2px;
  animation: waveBar 0.8s ease-in-out infinite;
}

/* Text input */
.text-form {
  display: flex;
  gap: 8px;
  width: 100%;
}

.text-input {
  flex: 1;
  padding: 10px 16px;
  border-radius: 24px;
  border: 1px solid var(--surface-2);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.text-input:focus {
  border-color: var(--accent-ink);
}
.text-input::placeholder {
  color: var(--text-dim);
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.send-btn.active {
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}

.browser-warn {
  font-size: 11px;
  color: var(--red-ink);
  text-align: center;
  padding: 2px 8px;
  background: rgba(var(--red-rgb), 0.08);
  border-radius: 6px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

@keyframes waveBar {
  0%, 100% { height: 6px; }
  50% { height: 20px; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .onboarding-title { font-size: 24px; }
  .bubble { max-width: 85%; font-size: 14px; }
  .mic-btn { width: 56px; height: 56px; }
}

@media (min-width: 641px) {
  .app-shell {
    border-left: 1px solid var(--surface-2);
    border-right: 1px solid var(--surface-2);
  }
}

/* Scrollbar */
.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 4px; }

/* ===== THEME TOGGLE ===== */
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 4px;
}
.theme-toggle-btn:hover {
  color: var(--text);
  background: var(--surface-2);
}
.theme-toggle-btn:active {
  transform: rotate(-30deg) scale(0.92);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Dark-mode: desaturate colored decorative SVGs to stay greyscale */
[data-theme="dark"] .onboarding-logo img,
[data-theme="dark"] .feature-icon img,
[data-theme="dark"] .mode-card-icon img,
[data-theme="dark"] .avatar img,
[data-theme="dark"] .header-icon img {
  filter: grayscale(1) brightness(1.05);
}

/* Splash logo: black-on-white doodle — invert to white-on-black for dark mode */
[data-theme="dark"] .quiz-splash-icon img {
  filter: invert(1);
}

/* Light-mode: soften heavy shadows inherited from original dark theme */
.next-step-card:hover {
  box-shadow: 0 6px 24px rgba(var(--shadow-rgb), 0.08);
}
[data-theme="dark"] .next-step-card:hover {
  box-shadow: 0 6px 24px rgba(var(--shadow-rgb), 0.35);
}

.history-overlay {
  background: rgba(var(--shadow-rgb), 0.35);
}
[data-theme="dark"] .history-overlay {
  background: rgba(var(--shadow-rgb), 0.6);
}

/* ===== HOME / BASECAMP BUTTON ===== */
.home-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.home-btn:hover {
  color: var(--accent-ink);
  background: var(--accent-dim);
}
.home-btn:active { transform: scale(0.92); }

/* ===== BASECAMP SCREEN ===== */
.basecamp-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: basecampFade 0.3s ease-out;
  padding: calc(16px + var(--safe-top)) 20px calc(32px + var(--safe-bottom));
}

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

.basecamp-close {
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  color: var(--text-dim);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}
.basecamp-close:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--text-dim);
}
.basecamp-close:active { transform: scale(0.94); }

.basecamp-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeInUp 0.45s ease-out;
}

.basecamp-eyebrow {
  align-self: center;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent-ink);
  background: var(--accent-dim);
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 12px;
}

.basecamp-title {
  font-family: Arial, sans-serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--text);
  text-align: center;
  margin: 4px 0 0;
}

.basecamp-lede {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  text-align: center;
  max-width: 440px;
  margin: 0 auto;
}

.basecamp-pillars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px auto 4px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
}

.basecamp-pillar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}
.basecamp-pillar strong { font-weight: 600; }

.basecamp-pillar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.basecamp-pillar-dot-green {
  background: var(--green);
}

.basecamp-prompt {
  font-family: Arial, sans-serif;
  font-size: 22px;
  color: var(--text);
  text-align: center;
  margin: 12px 0 4px;
}

.basecamp-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.basecamp-cards .next-step-card {
  width: 100%;
  font-family: inherit;
  animation: fadeInUp 0.45s ease-out both;
}
.basecamp-cards .next-step-card:nth-child(1) { animation-delay: 0.05s; }
.basecamp-cards .next-step-card:nth-child(2) { animation-delay: 0.12s; }
.basecamp-cards .next-step-card:nth-child(3) { animation-delay: 0.19s; }

.next-step-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.next-step-card-active.next-step-card-facilitator {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb), 0.18);
}

.basecamp-quote {
  font-style: italic;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin: 20px auto 0;
  max-width: 380px;
  line-height: 1.55;
}

@media (max-width: 480px) {
  .basecamp-title { font-size: 30px; }
  .basecamp-prompt { font-size: 20px; }
  .basecamp-inner { padding-top: 16px; gap: 18px; }
}

/* ===== MODE SWITCHER DROPDOWN ===== */
.mode-switcher {
  position: relative;
  display: inline-flex;
  margin-left: 4px;
}

.mode-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 8px 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.mode-switcher-btn:hover {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(var(--accent-rgb), 0.4);
}
.mode-switcher-btn:active { transform: scale(0.97); }

.mode-switcher-btn.mode-badge-facilitator {
  background: rgba(var(--green-rgb), 0.15);
  border-color: rgba(var(--green-rgb), 0.25);
  color: var(--green-ink);
}
.mode-switcher-btn.mode-badge-facilitator:hover {
  background: rgba(var(--green-rgb), 0.22);
  border-color: rgba(var(--green-rgb), 0.4);
}

.mode-switcher-chev {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.mode-switcher-chev.open { transform: rotate(180deg); }

.mode-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.mode-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  width: min(300px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(var(--shadow-rgb), 0.15);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: modeMenuIn 0.16s ease-out;
  overflow: hidden;
}
[data-theme="dark"] .mode-menu {
  box-shadow: 0 10px 30px rgba(var(--shadow-rgb), 0.5);
}

@keyframes modeMenuIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mode-menu-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.mode-menu-item:hover {
  background: var(--surface-2);
}
.mode-menu-item-active {
  background: var(--accent-dim);
}
.mode-menu-item-active:hover {
  background: rgba(var(--accent-rgb), 0.25);
}

.mode-menu-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-ink);
}
.mode-menu-item:nth-child(3) .mode-menu-tag {
  color: var(--green-ink);
}

.mode-menu-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.mode-menu-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ===== INFO SCREENS (About / Insights) ===== */
.info-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: basecampFade 0.3s ease-out;
  padding: calc(16px + var(--safe-top)) 20px calc(32px + var(--safe-bottom));
}

.info-close {
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: 16px;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  color: var(--text-dim);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
}
.info-close:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--text-dim);
}
.info-close:active { transform: scale(0.94); }

.info-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeInUp 0.45s ease-out;
}

.info-eyebrow {
  align-self: center;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent-ink);
  background: var(--accent-dim);
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 12px;
}

.info-title {
  font-family: Arial, sans-serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--text);
  text-align: center;
  margin: 4px 0 0;
}

.info-lede {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  text-align: center;
  max-width: 440px;
  margin: 0 auto;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 14px;
  padding: 18px 20px;
}
.info-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.info-card p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

.info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.info-list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
  padding-left: 14px;
  position: relative;
}
.info-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.info-list li strong {
  color: var(--text);
  font-weight: 600;
}

.info-footnote {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin: 4px auto 0;
  max-width: 380px;
  line-height: 1.5;
  font-style: italic;
}

.info-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.info-stat {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: 12px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.info-stat-num {
  font-family: Arial, sans-serif;
  font-size: 36px;
  line-height: 1;
  color: var(--accent-ink);
}
.info-stat-num-sm {
  font-family: Arial, sans-serif;
  font-size: 22px;
  line-height: 1.1;
  color: var(--accent-ink);
  min-height: 36px;
  display: flex;
  align-items: center;
}
.info-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.3;
}

@media (max-width: 480px) {
  .info-title { font-size: 28px; }
  .info-stat-num { font-size: 30px; }
  .info-stat-num-sm { font-size: 18px; }
}
