/* ── RESET & VARIABLES ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:         #58CC02;
  --green-dark:    #45A000;
  --green-light:   #D7F5B1;
  --blue:          #1CB0F6;
  --blue-light:    #DCF2FF;
  --red:           #FF4B4B;
  --red-light:     #FFEAEA;
  --yellow:        #FFC800;
  --orange-light:  #FFF3DC;
  --purple:        #764ba2;
  --purple-dark:   #5a3580;
  --purple-mid:    #667eea;
  --purple-text:   #5b2d8e;
  --purple-light:  #F3E8FF;
  --bg:            #FAFAFA;
  --white:         #FFFFFF;
  --card-bg:       #FFFFFF;
  --border:        #EBEBEB;
  --text:          #1A1A2E;
  --muted:         #888;
  --shadow:        0 1px 6px rgba(0,0,0,0.05);
  --radius:        16px;
}

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(180deg, #FAFAFA 0%, #F5F3FF 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}

.thai-text {
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
}

/* ── SCREENS ──────────────────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

.inner { max-width: 560px; margin: 0 auto; padding: 0 20px; }

/* ── NO-AUDIO BANNER ─────────────────────────────────────────────────────── */
.no-audio-banner {
  background: #fff8e1;
  border-bottom: 2px solid #ffe082;
  color: #7a5900;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  padding: 10px 20px;
  flex-shrink: 0;
}


/* ── LESSON TOPBAR ────────────────────────────────────────────────────────── */
#screen-lesson { background: var(--white); }

.lesson-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px 14px 108px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-exit {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  font-size: 1rem;
  font-weight: 900;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.btn-exit:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

.lesson-prog-track {
  flex: 1;
  height: 14px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.lesson-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 100px;
  transition: width 0.4s ease;
  width: 0%;
}


.lesson-sublabel {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 20px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.lesson-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 40px;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

/* ── EXERCISE CARD ────────────────────────────────────────────────────────── */
.ex-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: ex-enter 0.25s ease;
}

@keyframes ex-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.ex-direction {
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
}

/* ── PROMPT AREAS ─────────────────────────────────────────────────────────── */
.ex-thai-prompt {
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
  font-size: clamp(2rem, 12vw, 5.5rem);
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
  word-break: break-word;
  padding: 0 8px;
}

.ex-english-prompt {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 14px;
}

.btn-listen-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 auto 18px;
  padding: 10px 18px;
  min-height: 44px;
  background: var(--purple-light);
  border: 1.5px solid var(--purple);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple-text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  align-self: center;
}
.btn-listen-inline:hover { background: #e8d5f5; }

/* ── LISTEN EXERCISE ──────────────────────────────────────────────────────── */
.btn-listen-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 auto 24px;
  width: 100px;
  height: 100px;
  background: var(--purple-light);
  border: 3px solid var(--purple);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--purple-text);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.btn-listen-big:hover  { background: #e8d5f5; }
.btn-listen-big:active { transform: translateY(1px); }
.listen-icon { font-size: 2.2rem; }

/* ── OPTION BUTTONS ───────────────────────────────────────────────────────── */
.ex-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.opt-btn {
  padding: 14px 10px;
  font-size: 0.87rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.3;
  text-align: center;
}

.opt-btn.opt-thai {
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
  font-size: 1.5rem;
  padding: 16px 10px;
}

.opt-btn:hover:not(:disabled) {
  border-color: var(--purple);
  background: var(--purple-light);
  color: var(--purple-text);
}

.opt-btn.correct {
  background: var(--green-light);
  border-color: var(--green);
  color: #2a6a00;
}

.opt-btn.wrong {
  background: var(--red-light);
  border-color: var(--red);
  color: #8a0000;
}

.opt-btn:disabled { cursor: default; }

/* ── MATCH PAIRS ──────────────────────────────────────────────────────────── */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-btn {
  padding: 13px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  line-height: 1.3;
  text-align: center;
  min-height: 52px;
}

.match-thai {
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
  font-size: 1.5rem;
  padding: 10px 8px;
}

.match-btn:hover:not(:disabled) {
  border-color: var(--purple);
  background: var(--purple-light);
}

.match-btn.selected {
  border-color: var(--purple);
  background: var(--purple-light);
  color: var(--purple-text);
  transform: scale(1.03);
}

.match-btn.matched {
  background: var(--green-light);
  border-color: var(--green);
  color: #2a6a00;
  cursor: default;
}

.match-btn.matched-settled {
  background-color: var(--purple-light, #F3E8FF);
  color: var(--purple-text, #5b2d8e);
  border-color: var(--purple, #764ba2);
  opacity: 1;
  cursor: default;
}

.match-btn.wrong-flash {
  background: var(--red-light);
  border-color: var(--red);
  color: #8a0000;
}

.match-btn:disabled { cursor: default; }

/* ── FEEDBACK ─────────────────────────────────────────────────────────────── */
.ex-feedback {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.5;
}

.ex-feedback.ok  { background: var(--green-light); border: 1.5px solid var(--green); color: #2a6a00; }
.ex-feedback.bad { background: var(--red-light);   border: 1.5px solid var(--red);   color: #8a0000; }

/* ── CONTINUE BUTTON ──────────────────────────────────────────────────────── */
.btn-continue {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-continue:hover  { opacity: 0.9; }
.btn-continue:active { transform: translateY(1px); }

/* ── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes bounce {
  0%, 100% { transform: scale(1); }
  35%       { transform: scale(1.12); }
  65%       { transform: scale(0.94); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-7px); }
  45%       { transform: translateX(7px); }
  65%       { transform: translateX(-4px); }
  82%       { transform: translateX(4px); }
}

.bounce { animation: bounce 0.42s ease; }
.shake  { animation: shake  0.42s ease; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .ex-thai-prompt { font-size: 4.2rem; }

  .ex-options { grid-template-columns: 1fr 1fr; }
  .opt-btn.opt-thai { font-size: 1.3rem; }

  .match-thai { font-size: 1.3rem; }
  .match-btn  { font-size: 0.78rem; min-height: 48px; }

  .lesson-topbar { padding: 10px 16px 10px 108px; gap: 10px; }
}

/* ── INTRO CARDS ─────────────────────────────────────────────────────────── */
.intro-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: ex-enter 0.25s ease;
}

.intro-card-tones {
  padding: 20px 18px 20px;
}

.intro-dots {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 18px;
}

.intro-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}

.intro-dot.active { background: var(--purple); }

.intro-title {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.25;
}

.intro-body {
  font-size: 0.96rem;
  font-weight: 600;
  color: #333;
  line-height: 1.65;
  text-align: center;
  margin-bottom: 16px;
}

.intro-body-small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
}

.btn-intro-next {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 16px;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-intro-next:hover  { opacity: 0.9; }
.btn-intro-next:active { transform: translateY(1px); }

/* ── MID-LESSON CONCEPT CARD (card 2) BADGE ─────────────────────────────── */
/* Sits above the dots; signals "teacher stepping in" without changing the card shape */
.lesson-note-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 14px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--purple-text);
  background: var(--purple-light);
  border-radius: 20px;
}

/* ── STUDY STATE CARD (new-word flash card) ─────────────────────────────── */
/* Intentionally lighter than intro cards — feels like a reference card, not a quiz */
.study-state-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: ex-enter 0.25s ease;
}

.study-state-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #aaa;
  text-align: center;
  margin: 0 0 20px;
  font-weight: 600;
}

.study-state-english {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin: 10px 0 22px;
}

/* Outlined purple button — distinct from the full-gradient btn-intro-next */
.btn-got-it {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
  border-radius: 12px;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.15s, transform 0.1s;
}
.btn-got-it:hover  { background: var(--purple-light); }
.btn-got-it:active { transform: translateY(1px); }

/* ── CALLOUT BOXES ───────────────────────────────────────────────────────── */
.callout-box {
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 600;
}

.callout-purple,
.callout-blue {
  background: var(--purple-light);
  border: 1.5px solid var(--purple);
  color: var(--purple-text);
}

.callout-yellow {
  background: var(--purple-light);
  border: 1.5px solid rgba(118,75,162,0.4);
  color: var(--purple-text);
}

.callout-title {
  font-weight: 900;
  font-size: 0.88rem;
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}

.callout-text { font-weight: 600; line-height: 1.55; }

/* Callout as a standalone exercise step */
.callout-card { padding: 20px; }
.callout-card .callout-box { margin-bottom: 0; }
.btn-callout-got-it {
  background: var(--purple) !important;
  border-bottom-color: var(--purple-dark) !important;
  margin-top: 16px;
}

/* ── TONE CHART ──────────────────────────────────────────────────────────── */
.tone-chart {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
  width: 100%;
}

.tone-row {
  display: grid;
  grid-template-columns: 70px 90px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 10px;
  border: 1.5px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}

.tone-row:hover { border-color: #c0d8f0; background: #f0f8ff; }

.tone-name-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tone-en-name {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
}

.tone-th-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  font-family: 'Sarabun', system-ui, sans-serif;
}

.tone-curve-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tone-svg { display: block; }

.tone-example-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.tone-example-word {
  font-family: 'Sarabun', 'Leelawadee UI', system-ui, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.tone-example-meaning {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

.btn-tone-hear {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.btn-tone-hear:hover  { background: rgba(0,0,0,0.06); }
.btn-tone-hear:active { transform: scale(0.9); }

/* ── COMPLETE SCREEN (redesigned) ────────────────────────────────────────── */
#screen-complete {
  background: linear-gradient(160deg, #e8f5ff 0%, #f5fff0 100%);
  justify-content: flex-start;
  align-items: center;
}

.complete-scroll {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  overflow-y: auto;
}

.complete-card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  border: 2px solid var(--border);
  padding: 36px 28px 32px;
  text-align: center;
  animation: ex-enter 0.4s ease;
}

/* ── REDESIGNED LESSON COMPLETION SCREEN ──────────────────────────────────── */

.cpl-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.2;
}
.cpl-title--levelup { color: #764ba2; }

/* Animated semicircle arc */
.cpl-arc-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
}
.cpl-arc-svg { display: block; }
.cpl-arc-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 8px;
}
.cpl-arc-level {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.cpl-arc-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 5px;
}
.cpl-arc-cefr {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  color: #764ba2;
  background: rgba(118,75,162,0.10);
  padding: 2px 8px;
  border-radius: 20px;
}
.cpl-arc-pct {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

/* Word progress stat cards */
.cpl-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.cpl-stat-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}
.cpl-stat-n {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.cpl-stat-highlight { color: #764ba2; }
.cpl-stat-l {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Accuracy line */
.cpl-accuracy {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}

/* Continue button */
.btn-cpl-continue {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(118,75,162,0.2);
  transition: opacity 0.15s, transform 0.1s;
}
.btn-cpl-continue:hover  { opacity: 0.9; }
.btn-cpl-continue:active { transform: translateY(1px); }

/* Streak on completion screen */
.cpl-streak {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════════════════════════════════════
   HOME SCREEN
   ══════════════════════════════════════════════════════════════════════════ */

.home-scroll {
  flex: 1;
  overflow-y: auto;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* Flex spacers push content to ~40% from top / 60% from bottom */
.home-scroll::before {
  content: '';
  flex-grow: 2;
  flex-shrink: 0;
  min-height: 52px; /* never less than floating-icon clearance */
}
.home-scroll::after {
  content: '';
  flex-grow: 3;
  flex-shrink: 0;
  min-height: 32px;
}

#home-content {
  flex-shrink: 0;
  width: 100%;
  padding: 0 16px;
}

.path-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.path-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}
.path-card:hover  { border-color: var(--pc); transform: translateY(-1px); }
.path-card:active { transform: translateY(1px); }

.path-card-icon {
  font-size: 2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0F0F0;
  border-radius: 14px;
  flex-shrink: 0;
}

.path-card-body {
  flex: 1;
  min-width: 0;
}

.path-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.path-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.path-card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #764ba2;
  background: #EDE9F6;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.path-card-for-who {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.35;
}

.path-card-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.path-card-prog-track {
  flex: 1;
  height: 6px;
  background: #e5e5e5;
  border-radius: 99px;
  overflow: hidden;
}

.path-card-prog-fill {
  height: 100%;
  background: #CCC;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.path-card-prog-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.path-card-arrow {
  font-size: 1.5rem;
  color: var(--muted);
  margin-left: 4px;
}

/* ── CURRICULUM NAV BUTTON (home → curriculum screen) ─────────────────────── */
.curriculum-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: var(--shadow);
  transition: background 0.12s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.curriculum-nav-btn:active { transform: scale(0.985); }
.curriculum-nav-body { flex: 1; min-width: 0; }
.curriculum-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 2px;
}
.curriculum-nav-sub {
  font-size: 0.8rem;
  color: #AAA;
  font-weight: 600;
}
.curriculum-nav-arrow {
  font-size: 1.4rem;
  color: #CCC;
  flex-shrink: 0;
}

/* ── CURRICULUM SCREEN ─────────────────────────────────────────────────────── */
.curriculum-topbar-title {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #888;
  margin-right: 36px;
}
.curriculum-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 16px 48px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════════════════
   PATH SCREEN
   ══════════════════════════════════════════════════════════════════════════ */

.path-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 12px 108px;
  background: transparent;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-back {
  font-size: 1.4rem;
  font-weight: 900;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  padding: 8px 12px;
  min-height: 44px;
  border-radius: 8px;
  transition: color 0.15s;
  line-height: 1;
  display: flex;
  align-items: center;
}
.btn-back:hover { color: var(--text); }

.path-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 40px;
}

.path-hero {
  background: var(--pc);
  color: white;
  padding: 28px 20px 24px;
  text-align: center;
}

.path-hero-icon {
  font-size: 2.5rem;
  margin-bottom: 6px;
}

.path-hero-title {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 2px;
}

.path-hero-sub {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 14px;
}

.path-hero-prog-track {
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 99px;
  overflow: hidden;
  max-width: 240px;
  margin: 0 auto 6px;
}

.path-hero-prog-fill {
  height: 100%;
  background: white;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.path-hero-prog-label {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.88;
}

.lesson-list {
  padding: 16px 16px 0;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: default;
}

.lesson-row--current,
.lesson-row--complete {
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}
.lesson-row--current:hover,
.lesson-row--complete:hover  { border-color: var(--pc); transform: translateY(-1px); }
.lesson-row--current:active,
.lesson-row--complete:active { transform: translateY(1px); }

.lesson-row--locked {
  opacity: 0.5;
}

.lesson-row-icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  flex-shrink: 0;
}

.lesson-row--complete .lesson-row-icon {
  background: var(--pc);
  color: white;
}

.lesson-row-text {
  flex: 1;
  min-width: 0;
}

.lesson-row-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.lesson-row-badge {
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--pc);
  color: white;
  padding: 3px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

.lesson-row-tones-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #9B59B6;
  color: white;
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

/* ── TONE HOOK — italic emotional anchor below romanization ───────────────── */
.tone-hook {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted, #888);
  margin: 2px 0 10px;
  text-align: center;
}

/* ── PROMINENT HEAR IT — for audioFirst tone lessons ─────────────────────── */
.btn-listen-prominent {
  display: block;
  width: auto;
  margin: 10px auto 6px;
  padding: 12px 36px;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 0.08s, opacity 0.08s;
}
.btn-listen-prominent:active {
  transform: translateY(1px);
  opacity: 0.9;
}

.lesson-row-chevron {
  font-size: 1.3rem;
  color: var(--muted);
  flex-shrink: 0;
}

.path-continue-wrap {
  padding: 20px 16px 0;
  max-width: 520px;
  margin: 0 auto;
}

.btn-path-continue {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-path-continue:hover  { opacity: 0.9; }
.btn-path-continue:active { transform: translateY(1px); }

/* ══════════════════════════════════════════════════════════════════════════
   COMPLETE SCREEN — path-complete additions
   ══════════════════════════════════════════════════════════════════════════ */


.complete-path-done-badge {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
}

.complete-path-done-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin-bottom: 16px;
}

.path-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.path-suggest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 13px;
  padding: 13px 15px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}
.path-suggest-card:hover  { border-color: var(--pc); transform: translateY(-1px); }
.path-suggest-card:active { transform: translateY(1px); }

.path-suggest-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pc);
  border-radius: 10px;
  flex-shrink: 0;
  opacity: 0.9;
}

.path-suggest-body {
  flex: 1;
  min-width: 0;
}

.path-suggest-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}

.path-suggest-progress {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.path-suggest-arrow {
  font-size: 1.3rem;
  color: var(--muted);
}

/* ══════════════════════════════════════════════════════════════════════════
   PHONETIC ROMANIZATION
   ══════════════════════════════════════════════════════════════════════════ */

/* Inline roman below a Thai prompt (MC exercise) */
.ex-thai-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.thai-text {
  /* inherits existing ex-thai-prompt sizing */
}

/* Base roman style — overridden per-context below */
.roman-text {
  display: block;
  font-size: 0.8rem;   /* rem = absolute, not relative to large Thai prompt size */
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

/* Roman in MC thai prompt — needs a bit more size since it sits under giant text */
.ex-thai-prompt .roman-text {
  font-size: 0.95rem;
  margin-top: 2px;
}

/* Roman inside Thai option buttons */
.opt-thai {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.opt-thai-text {
  line-height: 1.2;
}

.opt-thai .roman-text {
  font-size: 0.72rem;
}

/* Roman inside match Thai buttons */
.match-thai {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.match-thai-word {
  line-height: 1.2;
}

.match-thai .roman-text {
  font-size: 0.65rem;
}

/* Roman inside tone card examples */
.tone-example-roman {
  display: block;
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.1;
  margin: 1px 0 0;
}

/* Roman on the complete screen item grid */
.complete-item-roman {
  display: block;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--muted);
  line-height: 1.1;
  margin-top: 1px;
}

/* ══════════════════════════════════════════════════════════════════════════
   TWO-STEP ANSWER SELECTION
   ══════════════════════════════════════════════════════════════════════════ */

/* Preview state — tapped but not yet confirmed */
.opt-btn.previewed {
  border-color: var(--purple);
  background: rgba(118, 75, 162, 0.06);
  box-shadow: 0 0 0 2px rgba(118, 75, 162, 0.25);
}

/* Confirm Answer button */
.btn-confirm {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 15px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-confirm:hover  { opacity: 0.9; }
.btn-confirm:active { transform: translateY(1px); }

/* ══════════════════════════════════════════════════════════════════════════
   VOLUME TOGGLE
   ══════════════════════════════════════════════════════════════════════════ */

#btn-volume {
  position: fixed;
  top: 12px;
  left: 12px;
  right: auto;
  z-index: 9999;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  font-size: 1.15rem;
  line-height: 1;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  transition: color 0.15s, transform 0.1s;
  padding: 0;
  overflow: visible;
}

#btn-volume:hover  { color: var(--text); }
#btn-volume:active { transform: scale(0.92); }
#btn-volume.volume-btn--muted::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: #FF4B4B;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 1px;
  pointer-events: none;
}

#btn-roman {
  position: fixed;
  top: 12px;
  left: 60px;
  z-index: 9999;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  transition: color 0.15s, transform 0.1s;
  padding: 0;
  overflow: visible;
  touch-action: manipulation;
  pointer-events: auto;
}

#btn-roman:hover  { color: var(--text); }
#btn-roman:active { transform: scale(0.92); }
#btn-roman.roman-btn--hidden::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: #FF4B4B;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 1px;
  pointer-events: none;
}


/* ── ROMANIZATION HIDE RULE ──────────────────────────────────────────────── */
/* Hides all romanization text globally when body.hide-roman is set.
   Classes confirmed via codebase audit: roman-text (primary wrapper used by
   romanTag() helper), opt-u1-roman, u1-match-roman, tone-example-roman,
   sl-breakdown-roman, complete-item-roman, missed-card-roman (last two are
   legacy CSS with no active renderer — included for safety).
   First-encounter study cards are intentionally included in v1 (could be
   exempted in a future version to preserve the see-hear-connect triad). */
body.hide-roman .roman-text,
body.hide-roman .opt-u1-roman,
body.hide-roman .u1-match-roman,
body.hide-roman .sl-breakdown-roman,
body.hide-roman .complete-item-roman,
body.hide-roman .missed-card-roman { display: none !important; }
body.hide-roman .roman-teach { display: inline !important; }
body.hide-roman .tone-example-roman { display: block !important; }
.input-blocked .opt-btn { pointer-events: none; }

/* ── ROMAN WALKTHROUGH ───────────────────────────────────────────────────── */
.roman-walkthrough {
  position: fixed;
  top: 60px;
  left: 8px;
  background: var(--purple-light);
  color: var(--purple-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 9998;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.roman-walkthrough--out { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes roman-pulse-ring {
    0%   { transform: scale(1);   opacity: 0.75; }
    70%  { transform: scale(2.4); opacity: 0; }
    100% { transform: scale(2.4); opacity: 0; }
  }

  #btn-roman.roman-btn--pulse::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid var(--purple);
    animation: roman-pulse-ring 1.6s ease-out infinite;
    pointer-events: none;
  }
}

/* ── AUTO-SUGGEST BANNER ─────────────────────────────────────────────────── */
.roman-autosuggest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.roman-autosuggest-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.roman-autosuggest-btn {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.roman-autosuggest-dismiss {
  background: none;
  border: none;
  color: var(--purple-text);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
}

/* Separator between roman syllable colour-groups */
.syl-sep { color: var(--muted); font-style: normal; }

/* ══════════════════════════════════════════════════════════════════════════
   INSTALL BANNER (PWA)
   ══════════════════════════════════════════════════════════════════════════ */

.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9997;
  background: var(--white);
  border-top: 2px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  animation: slide-up-banner 0.3s ease;
}

@keyframes slide-up-banner {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}

.install-banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-text strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.install-banner-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.35;
}

.install-banner-cta {
  padding: 10px 18px;
  min-width: 54px;
  min-height: 44px;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
}
.install-banner-cta:hover  { opacity: 0.9; }
.install-banner-cta:active { transform: translateY(1px); }

.install-banner-dismiss {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  padding: 0;
  transition: background 0.15s;
}
.install-banner-dismiss:hover { background: var(--bg); }

/* ── STREAK PILL ────────────────────────────────────────────────────────────── */

#streak-pill {
  display: none !important; /* streak shown on completion screen instead */
}

#streak-pill span:first-child {
  font-size: 1.2rem;
  line-height: 1;
}

.streak-count {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  min-width: 10px;
  text-align: center;
}

/* ── STREAK CELEBRATION OVERLAY ─────────────────────────────────────────────── */

.streak-celebration {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  animation: streak-cel-in 0.3s ease both;
  overflow: hidden;
}

@keyframes streak-cel-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.streak-celebration.streak-cel-out {
  animation: streak-cel-fade-out 0.4s ease both;
}

@keyframes streak-cel-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.streak-cel-card {
  position: relative;
  z-index: 2;
  background: var(--white);
  border-radius: 24px;
  padding: 40px 36px 36px;
  text-align: center;
  max-width: 320px;
  width: calc(100% - 48px);
  box-shadow: 0 12px 48px rgba(0,0,0,0.28);
  animation: streak-card-pop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes streak-card-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.streak-cel-flames {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 12px;
  animation: streak-flame-pulse 0.6s ease-in-out infinite alternate;
}

.streak-cel-flames::before { content: '🔥'; }

@keyframes streak-flame-pulse {
  from { transform: scale(1);    filter: brightness(1); }
  to   { transform: scale(1.15); filter: brightness(1.2); }
}

.streak-cel-msg {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 8px;
}

.streak-cel-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}

/* Floating emoji particles */
.streak-particle {
  position: absolute;
  z-index: 1;
  top: 100%;
  font-size: 1.5rem;
  animation: streak-particle-float linear both;
  pointer-events: none;
  user-select: none;
}

@keyframes streak-particle-float {
  0%   { transform: translateY(0)   rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* ── SRS: I'M GUESSING CHECKBOX ─────────────────────────────────────────────── */

.guess-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
  font-weight: 600;
  margin-top: 6px;
  margin-bottom: 4px;
  cursor: pointer;
  user-select: none;
}
.guess-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: #9B59B6;
  flex-shrink: 0;
}

/* ── SRS: NEW WORD BADGE ─────────────────────────────────────────────────────── */

.srs-new-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #9B59B6;
  color: white;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
  font-style: normal;
}

/* ── MISSED WORDS SCREEN ─────────────────────────────────────────────────────── */

#screen-missed-words {
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.missed-topbar {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  padding: 16px 20px;
  text-align: center;
  flex-shrink: 0;
}
.missed-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
}
.missed-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 80px;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
}
.missed-card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 20px 18px;
  margin-bottom: 12px;
  text-align: center;
}
.missed-card-thai {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
  line-height: 1.2;
}
.missed-card-roman {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.missed-card-english {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.missed-card-hint {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--purple-text);
  background: var(--purple-light);
  border: 1.5px solid var(--purple);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  text-align: left;
  line-height: 1.55;
}
.btn-hear-missed {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 99px;
  padding: 8px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.15s;
}
.btn-hear-missed:hover { background: var(--purple-light); }
.missed-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.btn-missed-retry {
  flex: 1;
  padding: 14px;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: inherit;
  background: var(--red-light);
  color: #8a0000;
  border: 2px solid var(--red);
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
  transition: opacity 0.15s;
}
.btn-missed-retry:hover { opacity: 0.85; }
.btn-missed-continue {
  flex: 2;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-missed-continue:hover  { opacity: 0.9; }
.btn-missed-continue:active { transform: translateY(1px); }

/* ── DAILY REVIEW SCREEN ─────────────────────────────────────────────────────── */

#screen-daily-review {
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.review-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-bottom: 2px solid var(--border);
  padding: 10px 14px;
  flex-shrink: 0;
}
.review-topbar-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
}
.review-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 14px 60px;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
}
.review-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.review-stat {
  flex: 1;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 8px;
  text-align: center;
}
.review-stat-value {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.review-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.review-empty { text-align: center; padding: 28px 8px; }
.review-empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.review-empty-msg {
  font-size: 1.05rem;
  font-weight: 800;
  color: #764ba2;
  margin-bottom: 24px;
}
.review-empty-hint {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 10px;
}
.review-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: #9B59B6;
  color: white;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0 6px;
}
.review-badge-none {
  font-size: 0.8rem;
  font-weight: 800;
  color: #764ba2;
}
.review-due-count {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 16px;
}
.btn-start-review {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  background: #9B59B6;
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  min-height: 52px;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-start-review:hover  { opacity: 0.9; }
.btn-start-review:active { transform: translateY(1px); }
.review-start-wrap { text-align: center; }

/* Daily Review card on home screen */
.review-card {
  border-color: #C39BD3;
  --pc: #9B59B6;
  --pcd: #7D3C98;
}

/* ── U1 STAGE INDICATOR ──────────────────────────────────────────────────────── */

.lesson-stage-label {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 12px 0;
  flex-shrink: 0;
}
.lesson-stage-label.stage-1 { color: #764ba2; }
.lesson-stage-label.stage-2 { color: #E67E22; }
.lesson-stage-label.stage-3 { color: #9B59B6; }

/* ── U1 QUESTION CARD ────────────────────────────────────────────────────────── */

.u1-prompt-char {
  font-size: 5rem;
  line-height: 1.1;
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
}

/* ── U1 OPTION BUTTONS ───────────────────────────────────────────────────────── */

/* Stage 1 & 2: tall options with stacked content */
.opt-btn.opt-u1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  font-family: inherit;
}
.opt-u1-char {
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
  font-size: 1.8rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.opt-u1-roman {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  display: block;
  font-style: italic;
}
.opt-u1-english {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  display: block;
  line-height: 1.3;
}

/* Stage 3: large char only */
.opt-btn.opt-u1-s3 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 6px;
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
  font-size: 2.2rem;
}
.opt-btn.opt-u1-s3 .opt-u1-char {
  font-size: 2.2rem;
}

/* ── U1 MATCH EXERCISE ───────────────────────────────────────────────────────── */

.u1-match-char {
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}
.u1-match-roman {
  display: block;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--muted);
  font-weight: 600;
}
.u1-match-eng {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.3;
}
.match-eng-u1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
}

/* ══════════════════════════════════════════════════════════════════════════
   ACCOUNT BUTTON
   ══════════════════════════════════════════════════════════════════════════ */

#btn-account {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 50%;
  border: none;
  background: none;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.1s;
  padding: 0;
}
#btn-account:hover  { color: var(--text); }
#btn-account:active { transform: scale(0.92); }

.btn-account--in {
  background: var(--purple) !important;
  border: 1px solid var(--purple-dark) !important;
  color: #fff !important;
}
.btn-account--in:hover { opacity: 0.9; }

/* ══════════════════════════════════════════════════════════════════════════
   ACCOUNT DROPDOWN
   ══════════════════════════════════════════════════════════════════════════ */

.account-dropdown {
  position: fixed;
  top: 60px;
  right: 12px;
  z-index: 9998;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  min-width: 220px;
  padding: 14px 0 8px;
  display: none;
}

.account-dd-email {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  padding: 0 18px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  word-break: break-all;
}

.account-dd-sync {
  font-size: 0.82rem;
  color: var(--purple);
  font-weight: 700;
  padding: 4px 18px 8px;
}

.account-dd-logout {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #E05C5C;
  cursor: pointer;
  font-family: inherit;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.account-dd-logout:hover { background: #fff5f5; }

.account-dd-settings {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.account-dd-settings:hover { background: var(--bg); }

.account-dd-signin {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  text-align: left;
  padding: 8px 18px;
  margin-top: 2px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--purple);
  cursor: pointer;
  font-family: inherit;
}
.account-dd-signin:hover { background: var(--purple-light); }

/* ══════════════════════════════════════════════════════════════════════════
   SETTINGS SCREEN
   ══════════════════════════════════════════════════════════════════════════ */

.settings-topbar-title {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #888;
  margin-right: 36px;
}

.settings-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 16px 48px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 18px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background 0.12s;
  min-height: 52px;
}
.settings-row:active { background: var(--bg); }

.settings-row-label {
  font-weight: 600;
  color: var(--text);
}

.settings-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-row-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--purple);
}

.settings-row-chevron {
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════════════════
   ARCHETYPE SWITCH MODAL
   ══════════════════════════════════════════════════════════════════════════ */

.archetype-modal {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.archetype-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.archetype-modal-card {
  position: relative;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22);
  padding: 28px 24px 22px;
  width: 100%;
  max-width: 400px;
  z-index: 1;
}

.archetype-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}
.archetype-modal-close:hover { background: var(--bg); color: var(--text); }

.archetype-modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
  padding-right: 32px;
}

.archetype-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.archetype-option:hover { border-color: var(--purple); background: var(--purple-light); }
.archetype-option--active { border-color: var(--purple); background: var(--purple-light); }

.archetype-option-main { flex: 1; }

.archetype-option-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.archetype-option--active .archetype-option-name { color: var(--purple); }

.archetype-option-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.archetype-option-sub {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.archetype-option-check {
  font-size: 1rem;
  font-weight: 900;
  color: var(--purple);
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
  margin-left: 12px;
}
.archetype-option--active .archetype-option-check { opacity: 1; }

.archetype-modal-surang {
  font-size: 0.84rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.55;
  margin-top: 16px;
  padding: 0 2px;
}

/* ── Archetype confirmation modal ──────────────────────────────────────────── */

.archetype-confirm-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.archetype-confirm-bullets li {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
  padding-left: 18px;
  position: relative;
}

.archetype-confirm-bullets li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--purple);
  font-weight: 900;
}

.archetype-confirm-reassurance {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.archetype-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archetype-confirm-btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.archetype-confirm-btn-primary:hover  { opacity: 0.9; }
.archetype-confirm-btn-primary:active { transform: scale(0.98); }

.archetype-confirm-btn-secondary {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.archetype-confirm-btn-secondary:hover  { background: var(--purple-light); }
.archetype-confirm-btn-secondary:active { transform: translateY(1px); }

/* ── Mid-lesson archetype switch toast ─────────────────────────────────────── */

.archetype-switch-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 9000;
  background: rgba(22, 18, 36, 0.95);
  color: #F0EEFF;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 12px 18px;
  border-radius: 12px;
  max-width: min(360px, calc(100vw - 32px));
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: pointer;
  pointer-events: auto;
}
.archetype-switch-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════════════════════════════════
   AUTH MODAL
   ══════════════════════════════════════════════════════════════════════════ */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.auth-modal-card {
  position: relative;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22);
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 400px;
  z-index: 1;
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}
.auth-modal-close:hover { background: var(--bg); color: var(--text); }

.auth-tabs-row {
  display: flex;
  gap: 0;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  background: none;
  border: none;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab--active {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.auth-tagline {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  margin: 0 0 16px;
  line-height: 1.5;
}

.auth-status {
  font-size: 0.87rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.auth-status--error {
  background: #fff0f0;
  color: #c0392b;
  border: 1px solid #f5c6c6;
}
.auth-status--info {
  background: #f0f7ff;
  color: #1a6db5;
  border: 1px solid #b3d5f7;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  box-sizing: border-box;
  transition: border-color 0.15s;
  outline: none;
}
.auth-input:focus { border-color: var(--purple); }

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 2px;
}
.auth-submit-btn:hover   { opacity: 0.9; }
.auth-submit-btn:active  { transform: scale(0.98); }
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-skip-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  padding: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-skip-btn:hover { color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════════
   SYNC OVERLAY
   ══════════════════════════════════════════════════════════════════════════ */

.sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  padding: 20px;
}

.sync-overlay-card {
  background: var(--white);
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.sync-overlay-msg {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FLUENCY METER
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── HOME SCREEN FLUENCY HERO ──────────────────────────────────────────────── */
.fluency-hero {
  text-align: center;
  padding: 8px 0 20px;
  cursor: pointer;
  outline: none;
}
.fluency-hero:active { opacity: 0.85; }

.fluency-hero-ring { display: block; margin: 0 auto; }
.fluency-hero-arc  { display: block; margin: 0 auto; filter: drop-shadow(0 0 20px rgba(118,75,162,0.2)); }

.fluency-hero-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.fluency-hero-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #764ba2;
  margin-top: 10px;
}

.fluency-hero-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
}

.fluency-cefr-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #EDE9F6;
  color: #764ba2;
  border: 1px solid #D4C5F0;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

.fluency-hero-link {
  font-size: 0.75rem;
  color: #764ba2;
  white-space: nowrap;
}

/* ── FLUENCY SCREEN LAYOUT ─────────────────────────────────────────────────── */
.fluency-topbar-title {
  flex: 1;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #888;
  margin-right: 36px; /* offset for the back button */
}
.fluency-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.fluency-content-inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* ── VIEW TOGGLE ───────────────────────────────────────────────────────────── */
.fluency-toggle {
  display: flex;
  gap: 8px;
  background: var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}
.fluency-toggle-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.fluency-toggle-btn.active {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

/* ── LARGE ARC (Next Milestone View) ──────────────────────────────────────── */
.fluency-arc-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}
.fluency-arc-large {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  position: relative;
  /* background set inline with conic-gradient */
}
.fluency-arc-large-hole {
  position: absolute;
  inset: 26px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 4px;
}
.fluency-arc-large-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.fluency-arc-large-thai {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.2;
}
.fluency-cefr-large {
  font-size: 0.68rem;
  padding: 2px 8px;
}
.fluency-arc-pct {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ── NEXT MILESTONE SECTION ────────────────────────────────────────────────── */
.fluency-next-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}
.fluency-next-label {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 6px;
}
.fluency-next-action {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 4px;
  padding-left: 4px;
}
.fluency-next-time {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

/* ── SIGNAL BREAKDOWN ──────────────────────────────────────────────────────── */
.signal-breakdown {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 20px;
}
.signal-breakdown-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.signal-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.signal-bar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  width: 130px;
  flex-shrink: 0;
}
.signal-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.signal-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.signal-bar-score {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ── FULL JOURNEY VIEW ─────────────────────────────────────────────────────── */
.journey-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
}
.journey-row {
  display: flex;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 12px;
  transition: background 0.1s;
}
.journey-row--current {
  background: rgba(118,75,162,0.07);
  border: 1px solid rgba(118,75,162,0.22);
}
.journey-row--done   { opacity: 0.7; }
.journey-row--future { opacity: 0.45; }
.journey-dot {
  font-size: 1.2rem;
  width: 24px;
  flex-shrink: 0;
  color: #764ba2;
  line-height: 1.4;
}
.journey-row--future .journey-dot { color: var(--muted); }
.journey-body { flex: 1; min-width: 0; }
.journey-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.journey-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
}
.journey-hours {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: auto;
}
.journey-thai {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 3px;
}
.journey-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}
.journey-honest-note {
  background: var(--purple-light);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.journey-honest-note p {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 8px;
}
.journey-honest-note p:last-child { margin-bottom: 0; }

/* ── MILESTONE CELEBRATION OVERLAY ────────────────────────────────────────── */
.milestone-celebration {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
  animation: cel-in 0.35s ease;
  cursor: pointer;
}
@keyframes cel-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.milestone-cel-out { animation: cel-out 0.4s ease forwards; }
@keyframes cel-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.05); }
}
.milestone-cel-card {
  background: var(--white);
  border-radius: 24px;
  padding: 36px 28px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: cel-card-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes cel-card-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.milestone-cel-level {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #764ba2;
  margin-bottom: 8px;
}
.milestone-cel-thai {
  font-size: 2.2rem;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}
.milestone-cel-name {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}
.milestone-cel-cefr {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #EDE9F6;
  color: #764ba2;
  border: 1px solid #D4C5F0;
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 14px;
}
.milestone-cel-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.milestone-cel-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── CONFETTI ──────────────────────────────────────────────────────────────── */
.confetti-piece {
  position: absolute;
  animation: confetti-fall var(--dur, 1.8s) var(--delay, 0s) ease-in forwards;
  pointer-events: none;
  user-select: none;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(100vh) rotate(540deg); opacity: 0; }
}

.ai-ex-pulse {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  animation: ai-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.18); opacity: 0.6; }
}

/* ── SENTENCE LISTENING EXERCISE ──────────────────────────────────────────── */

.sl-audio-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.sl-speed-btn {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 800;
  font-family: inherit;
  background: var(--white);
  color: var(--muted);
  border: 2px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.sl-speed-btn:hover {
  border-color: var(--purple);
  color: var(--purple-text);
  background: var(--purple-light);
}
.sl-speed-btn--active {
  background: var(--purple-light);
  border-color: var(--purple);
  color: var(--purple-text);
}

/* ── Word tile grid ── */
.sl-word-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.sl-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px 10px;
  background: var(--white);
  border: 2.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  min-height: 64px;
}
.sl-tile:hover:not(:disabled) {
  border-color: var(--purple);
  background: var(--purple-light);
}
.sl-tile--selected {
  border-color: #7C3AED;
  background: #F3E8FF;
  transform: scale(1.03);
}
.sl-tile--correct {
  background: var(--green-light);
  border-color: var(--green);
}
.sl-tile--wrong {
  background: var(--red-light);
  border-color: var(--red);
}
.sl-tile--missed {
  background: #FFF3DC;
  border-color: #FFC800;
}
.sl-tile:disabled { cursor: default; }

.sl-tile-thai {
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
.sl-tile-eng {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

/* ── Results section ── */
.sl-breakdown {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  text-align: center;
}
.sl-breakdown-thai {
  font-family: 'Sarabun', 'Leelawadee UI', 'Leelawadee', 'Thonburi', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}
.sl-breakdown-roman {
  font-size: 0.83rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.sl-breakdown-english {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

/* ── Meaning guess section ── */
.sl-meaning-section {
  background: #F8F5FF;
  border: 2px solid #E5D4FF;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sl-meaning-prompt {
  font-size: 0.85rem;
  font-weight: 700;
  color: #5B21B6;
  margin: 0;
}
.sl-meaning-input {
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  border: 2px solid #D8B4FE;
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
  resize: none;
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}
.sl-meaning-input:focus {
  outline: none;
  border-color: #7C3AED;
}
.sl-reveal-btn {
  align-self: flex-start;
  padding: 9px 18px;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: inherit;
  background: var(--white);
  color: #5B21B6;
  border: 2px solid #D8B4FE;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sl-reveal-btn:hover {
  background: #F3E8FF;
  border-color: #7C3AED;
}
.sl-meaning-reveal {
  padding: 10px 14px;
  background: #EDE9FE;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #4C1D95;
}

@media (min-width: 480px) {
  .sl-word-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── ONBOARDING SCREEN ────────────────────────────────────────────────────── */
#screen-onboarding {
  background: linear-gradient(180deg, #FAFAFA 0%, #F5F3FF 100%);
}

.ob-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── SLIDES ───────────────────────────────────────────────────────────────── */
.ob-slides-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100vh;
}

.ob-slides-track {
  display: flex;
  flex: 1;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ob-slide {
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 28px 32px;
  text-align: center;
  gap: 20px;
  min-height: 100vh;
  box-sizing: border-box;
}

.ob-slide-visual {
  font-size: 4.5rem;
  line-height: 1;
  position: relative;
  margin-bottom: 8px;
}

.ob-sparkle {
  font-size: 2rem;
  position: absolute;
  top: -8px;
  right: -16px;
}

.ob-slide-headline {
  font-size: 1.75rem;
  font-weight: 900;
  color: #1A1A2E;
  line-height: 1.2;
  max-width: 320px;
}

.ob-slide-body {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  line-height: 1.6;
  max-width: 360px;
}

.ob-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 380px;
  text-align: left;
}

.ob-feature-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.ob-feature-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ob-feature-text {
  font-size: 0.93rem;
  font-weight: 700;
  color: #333;
  line-height: 1.45;
}

.ob-slide-footer {
  margin-top: 8px;
  width: 100%;
  max-width: 360px;
}

/* "Already have an account? Sign in" — first slide only */
.ob-signin-link {
  margin-top: 16px;
  font-size: 14px;
  color: #888;
  text-align: center;
}
.ob-signin-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--purple-text, #5b2d8e);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-ob-next,
.btn-ob-cta {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-ob-next {
  background: #EDE9F6;
  color: #764ba2;
}

.btn-ob-cta {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.btn-ob-next:hover,
.btn-ob-cta:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ob-next:active,
.btn-ob-cta:active { transform: translateY(0); }

/* Slide dots */
.ob-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 0 32px;
  background: transparent;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #D8D0EE;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.ob-dot--active {
  background: #764ba2;
  transform: scale(1.3);
}

/* ── LEVEL SELECT ─────────────────────────────────────────────────────────── */
.ob-level-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 40px;
  gap: 20px;
  min-height: 100vh;
  box-sizing: border-box;
}

.ob-level-header {
  text-align: center;
  max-width: 360px;
}

.ob-level-headline {
  font-size: 1.6rem;
  font-weight: 900;
  color: #1A1A2E;
  margin-bottom: 8px;
}

.ob-level-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.ob-level-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

.ob-level-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--shadow);
}

.ob-level-card:hover {
  border-color: #C4B5F5;
  box-shadow: 0 4px 12px rgba(118,75,162,0.12);
  transform: translateY(-1px);
}

.ob-level-card--selected {
  border-color: #764ba2;
  box-shadow: 0 0 0 3px rgba(118,75,162,0.15);
  background: #F8F5FF;
}

.ob-level-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.ob-level-body {
  flex: 1;
}

.ob-level-label {
  font-size: 0.97rem;
  font-weight: 800;
  color: #1A1A2E;
}

.ob-level-subtitle {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

.btn-ob-start {
  width: 100%;
  max-width: 420px;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 4px;
}

.btn-ob-start:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-ob-start:not(:disabled):hover  { opacity: 0.9; transform: translateY(-1px); }
.btn-ob-start:not(:disabled):active { transform: translateY(0); }

/* ── ONBOARDING ARCHETYPE SCREEN ──────────────────────────────────────────── */
.ob-archetype-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px 40px;
  gap: 20px;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Reuse .ob-level-header / .ob-level-headline for the archetype headline  */
/* Reuse .ob-level-cards for the option list container                     */
/* Reuse .archetype-option / --active for each button                      */
/* Reuse .btn-ob-start for the confirm button                              */

.ob-archetype-wrap .archetype-modal-surang {
  max-width: 420px;
  width: 100%;
  margin-top: 20px;
}

/* ── ARCHETYPE MIGRATION MODAL ────────────────────────────────────────────── */
.archetype-migration-intro {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.55;
  margin-bottom: 4px;
  padding: 0 2px;
}

.archetype-migration-confirm-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s, transform 0.1s;
}
.archetype-migration-confirm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.archetype-migration-confirm-btn:not(:disabled):hover  { opacity: 0.9; }
.archetype-migration-confirm-btn:not(:disabled):active { transform: scale(0.98); }

/* ── POST-LESSON ACCOUNT PROMPT ───────────────────────────────────────────── */
.cpl-account-prompt {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-top: 4px;
  width: 100%;
  max-width: 400px;
  align-self: center;
}

.cpl-account-headline {
  font-size: 1rem;
  font-weight: 800;
  color: #1A1A2E;
  margin-bottom: 8px;
}

.cpl-account-body {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  line-height: 1.5;
  margin-bottom: 16px;
}

.btn-cpl-account {
  display: block;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.15s;
}

.btn-cpl-account:hover { opacity: 0.9; }

.btn-cpl-account-skip {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.btn-cpl-account-skip:hover { color: #555; }

/* ── DARK MODE: ONBOARDING ────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --text:    #F0EEFF;
    --muted:   #A0A0A8;
    --bg:      #111118;
    --border:  #2C2C35;
    --card-bg: #1C1C1E;
  }

  /* Journey view dark mode */
  .journey-name { color: #F0EEFF; }
  .journey-desc { color: #AAA; }
  .journey-hours { color: #AAA; }
  .journey-dot { color: #AAA; }
  .journey-row--done .journey-name { color: #C4B5E0; }
  .journey-row--done .journey-dot { color: #C4B5E0; }
  .journey-row--current .journey-name { color: #FFFFFF; }
  .journey-row--future .journey-name { color: #777; }
  .journey-row--future .journey-desc { color: #666; }
  .journey-honest-note { color: #AAA; }

  #screen-onboarding {
    background: linear-gradient(180deg, #0F0F1A 0%, #1A1428 100%);
  }

  .ob-slide-headline { color: #F0EEFF; }
  .ob-slide-body     { color: #AAA; }

  .ob-feature-row {
    background: #1C1C2E;
    border-color: #2D2D44;
  }
  .ob-feature-text { color: #DDD; }

  .btn-ob-next {
    background: #2A2040;
    color: #C4B5F5;
  }

  .ob-dot        { background: #3D3558; }
  .ob-dot--active { background: #9F7AEA; }

  .ob-level-headline { color: #F0EEFF; }
  .ob-level-sub      { color: #888; }

  .ob-level-card {
    background: #1C1C2E;
    border-color: #2D2D44;
  }
  .ob-level-card:hover {
    border-color: #6D5ADE;
  }
  .ob-level-card--selected {
    background: #251D3A;
    border-color: #9F7AEA;
  }
  .ob-level-label    { color: #F0EEFF; }
  .ob-level-subtitle { color: #888; }

  .cpl-account-prompt {
    background: #1C1C2E;
    border-color: #2D2D44;
  }
  .cpl-account-headline { color: #F0EEFF; }
  .cpl-account-body     { color: #999; }
  .btn-cpl-account-skip { color: #666; }

  /* ── DARK MODE: LESSON SCREEN ─────────────────────────────────────────────── */
  #screen-lesson { background: #131016; }

  .lesson-topbar { border-color: #2A2A30; }

  .ex-card,
  .intro-card,
  .study-state-card {
    background: #1E1E1C;
    border-color: #2A2A30;
  }

  .intro-body  { color: #DDD; }
  .intro-title { color: #F0EEFF; }

  .opt-btn {
    background: #2A2A28;
    border-color: #3A3A38;
    color: #F0EEFF;
  }
  .opt-btn:hover:not(:disabled) {
    background: #332A50;
    border-color: #9F7AEA;
    color: #C4B5F5;
  }
  .opt-btn.correct {
    background: #1A3A1A;
    border-color: #27AE60;
    color: #7CDF9A;
  }
  .opt-btn.wrong {
    background: #3A1A1A;
    border-color: #E05C5C;
    color: #F5A0A0;
  }

  .match-btn {
    background: #2A2A28;
    border-color: #3A3A38;
    color: #F0EEFF;
  }
  .match-btn:hover:not(:disabled),
  .match-btn.selected {
    background: #332A50;
    border-color: #9F7AEA;
    color: #C4B5F5;
  }
  .match-btn.matched {
    background: #1A3A1A;
    border-color: #27AE60;
    color: #7CDF9A;
  }
  .match-btn.matched-settled {
    background-color: #3d2060;
    color: #e0c8ff;
    border-color: #9b6bc7;
  }
  .match-btn.wrong-flash {
    background: #3A1A1A;
    border-color: #E05C5C;
    color: #F5A0A0;
  }

  .ex-feedback.ok  { background: #1A3A1A; border-color: #27AE60; color: #7CDF9A; }
  .ex-feedback.bad { background: #3A1A1A; border-color: #E05C5C; color: #F5A0A0; }

  .btn-exit { border-color: #3A3A38; color: #888; }
  .btn-exit:hover { background: #3A1A1A; color: #F5A0A0; border-color: #E05C5C; }

  .lesson-prog-track { background: #2A2A30; }

  .opt-btn.previewed { background: #332A50; border-color: #9F7AEA; color: #F0EEFF; }

  #screen-complete { background: linear-gradient(160deg, #0d1117 0%, #111a0f 100%); }
  .complete-card   { background: #1C1C1E; border-color: #3A3A38; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
  .cpl-stat-card   { background: #2A2A2C; border-color: #3A3A38; }

  .cpl-title    { color: #F0EEFF; }
  .cpl-arc-name { color: #F0EEFF; }
  .cpl-stat-n   { color: #F0EEFF; }

  .cpl-arc-level { color: #AAAAAA; }
  .cpl-arc-pct   { color: #AAAAAA; }
  .cpl-stat-l    { color: #AAAAAA; }
  .cpl-accuracy  { color: #AAAAAA; }
  .cpl-streak    { color: #AAAAAA; }

  .cpl-account-prompt   { background: #2A2A2C; border-color: #3A3A38; }
  .cpl-account-headline { color: #F0EEFF; }
  .cpl-account-body     { color: #AAAAAA; }

  /* Onboarding wordmark */
  .ob-wordmark { color: #9F7AEA; }

  /* Callout boxes */
  .callout-purple,
  .callout-blue  { background: #1e1a2e; border-color: #553d8a; color: #C4B5F5; }
  .callout-yellow { background: #1e1a2e; border-color: #553d8a; color: #C4B5F5; }

  /* Tone card hover */
  .tone-row:hover { background: #1e1a2e; border-color: #553d8a; }

  /* Fluency toggle */
  .fluency-toggle               { background: #2C2C35; }
  .fluency-toggle-btn.active    { background: #2a2040; color: #F0EEFF; }

  /* Auth modal status messages */
  .auth-status--error { background: #2d1515; border-color: #6b2020; color: #ff8080; }
  .auth-status--info  { background: #151a2d; border-color: #2a3a6b; color: #80a8ff; }

  /* Account dropdown */
  .account-dd-logout:hover   { background: #2d1515; }
  .account-dd-settings:hover { background: #2C2C35; }
  .account-dd-signin:hover   { background: #2a1f3d; }

  /* Settings screen */
  .settings-section { background: var(--card-bg); border-color: #3A3A38; }
  .settings-row:active { background: #2C2C35; }

  /* Archetype switch modal */
  .archetype-modal-card { background: #1C1C1E; }
  .archetype-option { border-color: #3A3A38; }
  .archetype-option:hover { background: #2a1f3d; border-color: var(--purple); }
  .archetype-option--active { background: #2a1f3d; border-color: var(--purple); }

  /* Archetype confirmation modal */
  .archetype-confirm-btn-secondary:hover { background: #2a1f3d; }

  /* No-audio banner */
  .no-audio-banner { background: #2d2500; border-bottom-color: #6b5500; color: #ffd080; }

  /* Listen buttons */
  .btn-listen-inline:hover { background: #2a1f3d; }
  .btn-listen-big:hover    { background: #2a1f3d; }

  /* Account dropdown */
  .account-dropdown {
    background: #1C1C1E;
    border-color: #3A3A38;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  }

  /* Auth modal */
  .auth-modal-card { background: #1C1C1E; }
  .auth-tab--active { background: #2A2A2C; color: #F0EEFF; box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
  .auth-input { background: #111118; border-color: #3A3A38; color: #F0EEFF; }
  .auth-input:focus { border-color: #9F7AEA; }

  /* Curriculum lesson rows */
  .lesson-row { background: #1C1C1E; border-color: #3A3A38; }

  /* Path suggest cards */
  .path-suggest-card { background: #1C1C1E; border-color: #3A3A38; }

  /* Level-up / milestone celebration modal */
  .milestone-cel-card { background: #1C1C1E; }
  .milestone-cel-cefr { background: #2a1f3d; color: #B08BED; border-color: #3a2d5a; }

  /* Fluency detail cards */
  .fluency-next-section { background: #1C1C1E; border-color: #3A3A38; }
  .signal-breakdown     { background: #1C1C1E; border-color: #3A3A38; }

  /* Sentence listening tiles */
  .sl-tile                     { background: #2C2C2E; border-color: #3A3A38; }
  .sl-tile:hover:not(:disabled){ background: #332A50; border-color: var(--purple); }
  .sl-tile--selected           { background: #2a1f3d; border-color: #9F7AEA; }
  .sl-tile--correct            { background: #1A3A1A; border-color: var(--green); }
  .sl-tile--wrong              { background: #3A1A1A; border-color: var(--red); }
  .sl-tile--missed             { background: #2d2000; border-color: #FFC800; }

  /* Sentence listening speed button */
  .sl-speed-btn                { background: var(--card-bg); }
  .sl-speed-btn:hover          { background: #332A50; }
  .sl-speed-btn--active        { background: #2a1f3d; }

  /* Sentence listening meaning-guess section */
  .sl-meaning-section          { background: #1e1a2e; border-color: #3a2d5a; }
  .sl-meaning-prompt           { color: #B08BED; }
  .sl-meaning-input            { background: #1C1C1E; border-color: #3a2d5a; color: #F0EEFF; }
  .sl-meaning-input:focus      { border-color: var(--purple); }
  .sl-reveal-btn               { background: #2a1f3d; color: #B08BED; border-color: #3a2d5a; }
  .sl-reveal-btn:hover         { background: #332A50; border-color: var(--purple); }
  .sl-meaning-reveal           { background: #2a1f3d; color: var(--text); }
}
