:root {
  /* Bookish — warm paper, deep ink, warm brown accent (from reference projects) */
  --cream: #F4EFE6;
  --cream-2: #EDE5D6;
  --cream-3: #E4D9C3;
  --surface: #FBF8F2;
  --surface-2: #EDE5D6;
  --ink: #2A2620;
  --ink-soft: #6B6355;
  --ink-faint: #A39A88;
  --ink-70: rgba(42, 38, 32, 0.72);
  --ink-50: rgba(42, 38, 32, 0.5);
  --ink-30: rgba(42, 38, 32, 0.3);
  --ink-10: rgba(42, 38, 32, 0.1);
  --ink-5: rgba(42, 38, 32, 0.05);

  --accent-coral: #C96F4A;
  --accent-coral-tint: #F1E0D3;
  --accent-coral-ink: #8A3F21;

  --accent-lavender: #7A5A3A;
  --accent-lavender-tint: #E9DEC9;
  --accent-lavender-ink: #5A3E1F;

  --accent-sage: #5B7A4A;
  --accent-sage-tint: #DDE6CF;
  --accent-sage-ink: #3D5630;

  --accent-marigold: #C89C4A;
  --accent-marigold-tint: #EFE1C1;
  --accent-marigold-ink: #7A5A26;

  --bg: var(--cream);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(42,38,32,0.04), 0 2px 6px rgba(42,38,32,0.04);
  --shadow: 0 1px 2px rgba(42,38,32,0.03), 0 8px 24px rgba(42,38,32,0.05);
  --shadow-lg: 0 2px 4px rgba(42,38,32,0.04), 0 16px 40px rgba(42,38,32,0.08);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-serif-body: "Iowan Old Style", "Charter", Georgia, serif;
  --font-ui: "Geist", -apple-system, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="mint"]     { --cream: #eaf4ee; --cream-2: #dfeee5; --surface: #f3faf5; --bg: var(--cream); --ink: #1b2a22; }
[data-theme="lavender-bg"] { --cream: #f2eefa; --cream-2: #e8e0f5; --surface: #f8f4ff; --bg: var(--cream); --ink: #2a1f3d; }
[data-theme="midnight"] {
  --cream: #1a1d2b; --cream-2: #242838; --cream-3: #313750; --surface: #222636; --surface-2: #2b3044;
  --bg: var(--cream); --ink: #f0ecde;
  --ink-70: rgba(240, 236, 222, 0.7); --ink-50: rgba(240, 236, 222, 0.5);
  --ink-30: rgba(240, 236, 222, 0.3); --ink-10: rgba(240, 236, 222, 0.12); --ink-5: rgba(240, 236, 222, 0.06);
  --ink-soft: rgba(240, 236, 222, 0.7); --ink-faint: rgba(240, 236, 222, 0.4);
  --accent-marigold-tint: #3d3420; --accent-coral-tint: #3d2620;
  --accent-sage-tint: #2a3528; --accent-lavender-tint: #322b1e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-ui); color: var(--ink);
  background: var(--cream-2); /* page frame color behind the mobile shell */
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

/* Mobile shell — fixed 500px, cream bg, centered on any viewport */
#stage {
  width: 100vw; min-height: 100vh;
  display: flex; justify-content: center;
  background: var(--cream-2);
}
#root {
  width: 100%; max-width: 500px; min-height: 100vh;
  position: relative; background: var(--bg);
  box-shadow: 0 0 0 1px var(--ink-10);
}
::-webkit-scrollbar { width: 0; height: 0; }

.app { min-height: 100vh; background: var(--bg); }
.app-main { padding: 0 0 60px; }

/* ---------- SHARED: TOPBAR + CARDS ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 12px;
}
.topbar-back {
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--ink-10);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink); padding: 0; flex-shrink: 0;
}
.topbar-back:hover { background: var(--cream-2); }
.topbar-title {
  flex: 1; font-family: var(--font-display);
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.1;
}
.topbar-right { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }

.icon-btn {
  background: var(--surface); border: 1px solid var(--ink-10); border-radius: 999px;
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink); transition: background .15s;
}
.icon-btn:hover { background: var(--cream-2); }
.icon-btn.small { width: 28px; height: 28px; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; border: 1px solid transparent;
  border-radius: 14px; padding: 12px 18px; font-size: 15px;
  background: var(--surface); color: var(--ink);
  transition: transform .1s, background .15s, box-shadow .15s;
}
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 16px 22px; font-size: 16px; border-radius: 16px; }
.btn-primary { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink-10); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink-30); }
.btn-success { background: var(--accent-sage); color: #fff; border-color: var(--accent-sage); }
.btn-danger { background: var(--accent-coral-tint); color: var(--accent-coral-ink); border-color: var(--accent-coral-tint); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- BADGES ---------- */
.diff-badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 999px; font-weight: 700;
}
.pos-badge {
  font-family: var(--font-display); font-style: italic; font-size: 13px;
  color: var(--ink-50);
}

/* ================= HOME SCREEN ================= */
.home-screen { padding: 0 20px 40px; }

.home-greeting {
  padding-top: 18px; margin-bottom: 18px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.home-date {
  font-size: 12px; color: var(--ink-soft); font-weight: 500; letter-spacing: 0.3px;
}
.home-hello {
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em; margin-top: 4px; line-height: 1.1;
}

/* Hero card — mastery ring + streak */
.home-hero-card {
  background: var(--surface);
  border: 1px solid var(--ink-10); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.04);
  display: flex; align-items: center; gap: 18px;
}
.ring-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num {
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  line-height: 1; color: var(--ink);
}
.ring-sub {
  font-size: 10px; color: var(--ink-soft); letter-spacing: 0.4px;
  text-transform: uppercase; margin-top: 2px; font-weight: 600;
}
.hero-info { flex: 1; min-width: 0; }
.hero-kicker {
  font-size: 11px; color: var(--ink-soft); letter-spacing: 0.4px;
  text-transform: uppercase; font-weight: 600;
}
.hero-status {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  margin: 3px 0 10px; line-height: 1.25;
}
.weekdots { display: flex; gap: 5px; }
.weekdot { flex: 1; text-align: center; }
.weekdot-label {
  font-size: 10px; color: var(--ink-faint); font-weight: 700; margin-bottom: 3px;
}
.weekdot.today .weekdot-label { color: var(--ink); }
.weekdot-cell {
  width: 100%; aspect-ratio: 1; border-radius: 6px;
  background: var(--cream-2); border: 1px solid var(--ink-10);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--accent-coral);
  font-variant-numeric: tabular-nums;
}
.weekdot.today .weekdot-cell { border: 1.5px solid var(--accent-coral); }
.weekdot.active .weekdot-cell { background: var(--accent-coral); color: var(--cream); border-color: var(--accent-coral); }
.weekdot.partial .weekdot-cell { background: var(--accent-coral-tint); color: var(--accent-coral-ink); }

/* Streak + Level row */
.mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.mini-card {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-sm);
}
.mini-head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
  font-size: 11px; color: var(--ink-soft); text-transform: uppercase;
  letter-spacing: 0.4px; font-weight: 600;
}
.mini-big {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  line-height: 1; color: var(--ink);
}
.mini-big small {
  font-size: 13px; color: var(--ink-soft); font-weight: 500; font-family: var(--font-ui);
  margin-left: 4px;
}
.xp-bar {
  height: 6px; background: var(--cream-3); border-radius: 99px;
  overflow: hidden; margin-top: 8px;
}
.xp-bar-fill { height: 100%; background: var(--accent-coral); transition: width .4s; }

/* Primary dark CTA */
.dark-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--ink); color: var(--cream);
  border-radius: var(--radius-lg); padding: 18px 20px;
  margin-bottom: 12px; cursor: pointer; border: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  font-family: inherit; text-align: left; width: 100%;
  transition: transform .15s;
}
.dark-cta:hover { transform: translateY(-2px); }
.dark-cta-kicker {
  font-size: 11px; opacity: 0.6; text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}
.dark-cta-title {
  font-family: var(--font-display); font-size: 20px; font-weight: 700;
  margin: 3px 0 4px; line-height: 1.15; letter-spacing: -0.01em;
}
.dark-cta-sub { font-size: 12px; opacity: 0.7; }
.dark-cta-play {
  width: 48px; height: 48px; border-radius: 999px;
  background: var(--accent-coral); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Modes list */
.modes-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.mode-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; font-family: inherit; color: inherit;
  text-align: left; transition: transform .15s, box-shadow .15s;
  width: 100%; box-shadow: var(--shadow-sm);
}
.mode-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.mode-row-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--cream);
}
/* Practice mode icons — distinct hues at matched oklch L/C so the four
   icons read as a colorful set (not 3 browns + 1 green) while still
   sitting in the warm cream/ink world. */
.mode-row.mode-lavender .mode-row-icon { background: oklch(0.55 0.13 295); } /* violet  — Definition Quiz */
.mode-row.mode-coral    .mode-row-icon { background: oklch(0.62 0.16 35);  } /* terracotta — Fill in the Blank */
.mode-row.mode-sage     .mode-row-icon { background: oklch(0.55 0.12 155); } /* green   — Synonym Match */
.mode-row.mode-marigold .mode-row-icon { background: oklch(0.62 0.13 75);  } /* amber   — Flashcards */
.mode-row.mode-teal     .mode-row-icon { background: oklch(0.55 0.10 200); } /* teal    — Words in Context */
.mode-row.mode-plum     .mode-row-icon { background: oklch(0.50 0.13 340); } /* plum    — Analogies */
.mode-row.mode-ink .mode-row-icon { background: var(--ink); }
.mode-row-body { flex: 1; min-width: 0; }
.mode-row-title {
  font-family: var(--font-display); font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.15;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.mode-row-resume {
  font-family: var(--font-ui, inherit);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px 2.5px; border-radius: 99px;
  background: var(--ink); color: var(--cream, #fff);
  flex-shrink: 0;
}
.mode-row-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; line-height: 1.35; }
.mode-row-arrow { color: var(--ink-30); flex-shrink: 0; }
.mode-row:hover .mode-row-arrow { color: var(--ink); }

/* Sections */
.section-h {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 24px 0 12px;
}
.section-h h2 {
  font-family: var(--font-display); font-size: 18px;
  font-weight: 600; letter-spacing: -0.01em; margin: 0;
}
.section-sub { font-size: 11px; color: var(--ink-soft); }
.link-btn {
  background: none; border: none; font-family: inherit; font-size: 12px;
  color: var(--accent-coral-ink); cursor: pointer; font-weight: 600;
  padding: 0;
}

/* Word of the day */
.wotd-card {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  margin-bottom: 8px;
}
.wotd-card::before {
  content: ""; position: absolute; top: -30px; right: -30px;
  width: 100px; height: 100px; background: var(--accent-marigold-tint);
  border-radius: 50%; z-index: 0;
}
.wotd-label {
  font-size: 11px; color: var(--ink-soft); letter-spacing: 0.4px;
  text-transform: uppercase; font-weight: 600; margin-bottom: 10px;
  position: relative; z-index: 1;
}
.wotd-head { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; position: relative; z-index: 1; }
.wotd-word {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 4px;
  position: relative; z-index: 1;
}
.wotd-phon {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft);
  margin-bottom: 12px; position: relative; z-index: 1;
}
.wotd-def { font-size: 14px; line-height: 1.5; margin-bottom: 8px; position: relative; z-index: 1; }
.wotd-ex {
  font-family: var(--font-display); font-style: italic;
  font-size: 14px; color: var(--ink-70); line-height: 1.45;
  position: relative; z-index: 1;
}

/* Recent sessions */
.session-list { display: flex; flex-direction: column; gap: 8px; }
.session-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius);
  font-family: inherit; color: inherit; text-align: left;
  width: 100%; box-sizing: border-box;
}
.session-row-clickable {
  cursor: pointer;
  grid-template-columns: 1fr auto auto auto;
  transition: border-color 0.15s, background 0.15s;
}
.session-row-clickable:hover { border-color: var(--accent, #c6623c); }
.session-row-chev { color: var(--ink-soft); flex-shrink: 0; }
.session-mode {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-score { font-variant-numeric: tabular-nums; font-size: 13px; }
.score-big { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.score-small { color: var(--ink-soft); font-size: 12px; }
.session-date { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.session-bar { display: none; } /* hide bar in narrow layout */

/* Word chips grid */
.word-chip-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}
.word-chip {
  background: var(--surface); border: 1px solid var(--ink-10); border-radius: 10px;
  padding: 9px 12px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  color: var(--ink); text-align: left; font-size: 13px;
  transition: border-color .15s;
}
.word-chip:hover { border-color: var(--ink-30); }
.wc-word { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Difficulty marker — 3-bar climbing meter so easy/medium/hard differ in
   shape AND color (color alone is hard to read on tiny dots, especially for
   colorblind users). */
.wc-diff {
  display: inline-flex; align-items: flex-end; gap: 1.5px;
  width: 12px; height: 10px; flex-shrink: 0;
}
.wc-diff::before, .wc-diff::after, .wc-diff > i {
  content: ""; display: block; width: 3px; border-radius: 1px;
  background: var(--ink-10);
}
.wc-diff::before { height: 4px; }
.wc-diff > i { height: 7px; }
.wc-diff::after { height: 10px; }
.wc-diff[data-d="easy"]::before { background: var(--accent-sage); }
.wc-diff[data-d="medium"]::before,
.wc-diff[data-d="medium"] > i { background: var(--accent-marigold); }
.wc-diff[data-d="hard"]::before,
.wc-diff[data-d="hard"] > i,
.wc-diff[data-d="hard"]::after { background: var(--accent-coral); }
.word-chip-mastered { background: var(--accent-sage-tint); border-color: transparent; }
.word-chip-mastered .wc-word { color: var(--accent-sage-ink); }
.word-chip-learning { background: var(--accent-marigold-tint); border-color: transparent; }

/* ================= MODE SCREENS (shared) ================= */
.mode-screen { padding: 0 0 40px; min-height: 100vh; }

.mode-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px 10px;
}
.home-link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: none; padding: 0; cursor: pointer;
  color: var(--accent-coral); font-size: 15px; font-weight: 600;
  font-family: var(--font-ui, inherit);
  flex-shrink: 0;
}
.home-link-btn:hover { opacity: 0.8; }
.mode-header-title {
  flex: 1; font-family: var(--font-display);
  font-size: 18px; font-weight: 600; line-height: 1.1;
  text-align: left; padding-left: 4px;
}
.mode-header-right { display: flex; align-items: center; gap: 8px; }
.mode-header-meta { display: flex; gap: 6px; }
.ses-stat { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ses-known { color: var(--accent-sage-ink); font-weight: 700; }
.ses-studying { color: var(--accent-coral-ink); font-weight: 600; }
.mode-progress-chip {
  background: var(--ink); color: var(--cream); font-variant-numeric: tabular-nums;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
}

.progress-bar-track {
  height: 5px; background: var(--ink-5); border-radius: 99px; overflow: hidden;
  margin: 0 20px 18px;
}
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent-coral), var(--accent-marigold));
  transition: width .4s ease;
}

.mode-body { padding: 0 20px; }

/* ================= FLASHCARDS ================= */
.flashcards-screen {
  display: flex; flex-direction: column; gap: 14px;
}
.flashcards-screen .progress-bar-track,
.flashcards-screen .flashcard-stage,
.flashcards-screen .rate-row { margin-left: 20px; margin-right: 20px; }
.flashcard-stage {
  perspective: 1200px; min-height: 360px;
  display: flex; align-items: center; justify-content: center;
}
.flashcard {
  width: 100%; min-height: 360px; position: relative;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2,.8,.2,1); cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg); padding: 22px;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.flashcard-front { background: linear-gradient(135deg, var(--surface) 0%, var(--cream-2) 100%); }
.flashcard-back { transform: rotateY(180deg); overflow-y: auto; }
.card-corner { display: flex; gap: 6px; align-items: center; }
.card-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.card-word {
  font-family: var(--font-display); font-size: 44px;
  font-weight: 700; line-height: 1; text-align: center; letter-spacing: -0.02em;
  word-break: break-word;
}
.card-phon { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }
.speak-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cream); border: 1px solid var(--ink-10); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font-family: inherit; font-size: 12px;
  color: var(--ink); margin-top: 10px;
}
.card-hint {
  text-align: center; font-size: 10px; color: var(--ink-30);
  letter-spacing: 0.08em; text-transform: uppercase;
}

.card-back-body { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.back-word { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -0.02em; }
.back-def { font-size: 15px; line-height: 1.45; }
.back-section { border-top: 1px solid var(--ink-10); padding-top: 10px; }
.back-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; font-weight: 700; }
.back-example { font-family: var(--font-display); font-style: italic; font-size: 14px; color: var(--ink-70); line-height: 1.4; }
.back-mnemonic { font-size: 13px; color: var(--ink); }
.back-etym { font-size: 12px; color: var(--ink-70); line-height: 1.4; }
.back-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.pill-sage { background: var(--accent-sage-tint); color: var(--accent-sage-ink); }
.pill-coral { background: var(--accent-coral-tint); color: var(--accent-coral-ink); }

.rate-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rate-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 14px 14px; min-height: 62px;
  border: 2px solid var(--ink-10); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-family: inherit; cursor: pointer; transition: all .15s;
}
.rate-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.rate-btn-label { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.rate-btn-sub { font-size: 11px; color: var(--ink-soft); }
.rate-skip { border-color: var(--ink-10); }
.rate-reviewed { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.rate-reviewed .rate-btn-label { color: var(--cream); }
.rate-reviewed .rate-btn-sub { color: rgba(244, 239, 230, 0.6); }
.rate-reviewed.is-disabled,
.rate-reviewed:disabled {
  background: var(--ink-10); border-color: var(--ink-10); color: var(--ink-30);
  cursor: not-allowed; transform: none; box-shadow: none;
}
.rate-reviewed.is-disabled .rate-btn-label,
.rate-reviewed:disabled .rate-btn-label { color: var(--ink-30); }
.rate-reviewed.is-disabled .rate-btn-sub,
.rate-reviewed:disabled .rate-btn-sub { color: var(--ink-30); }

/* ================= QUIZ ================= */
.quiz-screen { display: flex; flex-direction: column; }
.quiz-screen .quiz-body { padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }
.quiz-prompt-card {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm);
}
.quiz-instr {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 12px; font-weight: 700;
}
.quiz-word-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.quiz-word {
  font-family: var(--font-display); font-size: 36px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1; word-break: break-word;
}
.quiz-sentence {
  font-size: 17px; line-height: 1.5; font-family: var(--font-serif-body);
}
.quiz-sentence strong {
  font-weight: 700;
}
.quiz-subprompt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }

.quiz-options { display: grid; gap: 8px; }
.quiz-opt {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: start; gap: 12px;
  background: var(--surface); border: 2px solid var(--ink-10); border-radius: var(--radius);
  padding: 13px 14px; cursor: pointer; font-family: inherit; color: var(--ink);
  text-align: left; transition: all .15s; font-size: 14px; line-height: 1.4;
}
.opt-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.opt-def { font-size: 12px; color: var(--ink-70); line-height: 1.4; }
.opt-src { color: var(--ink-soft); }
.opt-src em { font-family: var(--font-display); font-style: italic; color: var(--ink-70); }
.quiz-opt.dim-soft { opacity: 0.75; }
.quiz-opt:hover:not(:disabled) { border-color: var(--ink-30); }
.quiz-opt .opt-letter { align-self: center; }
.quiz-opt .opt-mark { align-self: center; }
.quiz-opt.correct { background: var(--accent-sage-tint); border-color: var(--accent-sage); color: var(--accent-sage-ink); }
.quiz-opt.wrong { background: var(--accent-coral-tint); border-color: var(--accent-coral); color: var(--accent-coral-ink); }
.quiz-opt.shake { animation: shake .35s; }
@keyframes shake { 0%,100% {transform: translateX(0);} 25% {transform: translateX(-6px);} 75% {transform: translateX(6px);} }

/* Eliminate-an-answer affordance: matches Reading/Math. Tapping the small
   ✕ on the right strikes through the choice; tapping again restores it.
   Eliminated choices stay clickable on the ✕ but ignore body taps. */
.quiz-opt.eliminated { opacity: 0.5; cursor: default; }
.quiz-opt.eliminated .opt-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--ink-30);
}
.opt-elim {
  align-self: center;
  width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--ink-10);
  background: transparent; color: var(--ink-30);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; transition: all .15s;
}
.opt-elim:hover { border-color: var(--ink-30); color: var(--ink-soft); }
.opt-elim.is-on {
  background: var(--accent-coral-tint);
  border-color: var(--accent-coral);
  color: var(--accent-coral-ink);
}
.opt-letter {
  background: var(--ink-10); color: var(--ink-70); border-radius: 8px;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; font-family: var(--font-mono);
}
.correct .opt-letter { background: var(--accent-sage); color: #fff; }
.wrong .opt-letter { background: var(--accent-coral); color: #fff; }
.opt-mark { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.opt-mark-correct { background: var(--accent-sage); color: #fff; }
.opt-mark-wrong { background: var(--accent-coral); color: #fff; }

/* McItem .mc-* rules retired here in favor of the canonical unscoped
 * rules in components/items/mc-item.css (Sub-phase D). Vocab inherits the
 * canonical visual; no surface-specific tweaks needed. */

/* AnalogyItem .an-* rules retired here in favor of the canonical
 * unscoped rules in components/items/analogy-item.css (Sub-phase D part 2).
 * Vocab quiz inherits the canonical visual; .exam-screen overrides below
 * still apply for vocab-exam-specific tweaks (eyebrow hide, box-shadow
 * selected). */

/* Exam scope — analogy section shares the .exam-screen tree (set on
   ExamScreen's root). Map .an-* onto the existing .exam-opt visual so
   the section feels identical to synonym/completion items. The exam
   uses text tags (rendered via renderRightAdornment), not pill icons. */
.exam-screen .an-eyebrow { display: none; }
.exam-review .an-eyebrow { display: none; }
.exam-screen .an-stem,
.exam-review .an-stem {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600; letter-spacing: -0.005em;
  line-height: 1.3; margin: 0 0 12px;
  text-wrap: pretty;
}
.exam-screen .an-stem-a, .exam-screen .an-stem-b { text-transform: uppercase; }
.exam-screen .an-stem-as { color: var(--ink-70); font-style: italic; font-weight: 500; }
.exam-screen .an-stem-blank { color: var(--ink-soft); }
.exam-screen .an-choices { display: grid; gap: 8px; }
.exam-screen .an-choice {
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--ink-10); border-radius: var(--radius);
  padding: 11px 14px; cursor: pointer; color: inherit;
  text-align: left; transition: all .15s; font-size: 14px; line-height: 1.4;
}
.exam-screen .an-choice:hover:not(:disabled) { border-color: var(--ink-30); }
.exam-screen .an-choice:disabled { cursor: default; }
.exam-screen .an-choice.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(184,110,62,0.18); }
.exam-screen .an-letter {
  background: var(--ink-10); color: var(--ink-70); border-radius: 6px;
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; font-family: var(--font-mono);
}
.exam-screen .an-choice.is-selected .an-letter { background: var(--accent); color: #fff; }
.exam-screen .an-choice-main { min-width: 0; }
.exam-screen .an-choice-as { color: var(--ink-soft); font-style: italic; }
.exam-screen .an-choice.is-correct { background: var(--accent-sage-tint); border-color: var(--accent-sage); color: var(--accent-sage-ink); }
.exam-screen .an-choice.is-correct .an-letter { background: var(--accent-sage); color: #fff; }
.exam-screen .an-choice.is-wrong { background: var(--accent-coral-tint); border-color: var(--accent-coral); color: var(--accent-coral-ink); }
.exam-screen .an-choice.is-wrong .an-letter { background: var(--accent-coral); color: #fff; }
.exam-screen .an-choice.is-eliminated { opacity: 0.5; }
.exam-screen .an-choice.is-eliminated .an-choice-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--ink-30);
}
.exam-screen .an-elim {
  width: 26px; height: 26px; border-radius: 999px;
  border: 1.5px solid var(--ink-10); background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-30); cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 600;
}
.exam-screen .an-elim.is-on {
  background: var(--accent-coral-tint);
  border-color: var(--accent-coral);
  color: var(--accent-coral-ink);
}

.quiz-reveal {
  background: var(--accent-marigold-tint); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
  animation: slideUp .3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } }
.reveal-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.reveal-word { font-family: var(--font-display); font-size: 20px; font-style: italic; font-weight: 600; }
.reveal-phon { font-family: var(--font-mono); font-size: 12px; color: var(--ink-70); }
.reveal-def { font-size: 14px; line-height: 1.4; }
.reveal-ex { font-family: var(--font-display); font-style: italic; font-size: 13px; color: var(--ink-70); line-height: 1.4; }
.reveal-hint { font-size: 12px; padding: 8px 12px; background: rgba(255,255,255,0.55); border-radius: 10px; }
.reveal-cta { margin-top: 8px; }
.reveal-cta .btn { width: 100%; }

/* ================= SESSION COMPLETE ================= */
.session-complete {
  text-align: center; padding: 40px 20px 60px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.sc-burst { animation: pop .5s cubic-bezier(.2,1.2,.4,1); }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.sc-title {
  font-family: var(--font-display); font-size: 30px; font-style: italic;
  font-weight: 500; margin: 0;
}
.sc-stats { display: flex; gap: 26px; margin: 16px 0; }
.sc-stat { text-align: center; }
.sc-num {
  font-family: var(--font-display); font-size: 36px; font-style: italic;
  line-height: 1; color: var(--accent-coral-ink);
}
.sc-lbl { font-size: 11px; color: var(--ink-soft); margin-top: 4px; letter-spacing: 0.06em; }
.sc-actions { display: flex; gap: 10px; margin-top: 16px; width: 100%; }
.sc-actions > * { flex: 1; }

.empty-state { text-align: center; padding: 60px 20px; }
.empty-state h2 { font-family: var(--font-display); font-size: 22px; font-weight: 600; }

/* ================= STATS ================= */
.stats-hero {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg); padding: 20px; margin: 0 20px 14px;
  display: flex; flex-direction: column; gap: 18px;
}
.level-big { display: flex; align-items: center; gap: 14px; }
.level-ring-wrap { position: relative; flex-shrink: 0; }
.level-ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.lv-kicker { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.lv-num { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1; }
.level-meta { flex: 1; min-width: 0; }
.lvl-xp { font-weight: 700; font-size: 14px; }
.lvl-total { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

.stats-hero-right {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.big-stat {}
.bs-num { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; }
.bs-lbl { font-size: 12px; font-weight: 600; margin-top: 3px; }
.bs-sub { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }

.stats-section {
  background: var(--surface); border: 1px solid var(--ink-10); border-radius: var(--radius);
  padding: 18px; margin: 0 20px 12px;
}
.stats-section h3 {
  font-family: var(--font-display); font-size: 16px;
  font-weight: 600; margin: 0 0 14px;
}

.diff-bars { display: flex; flex-direction: column; gap: 10px; }
.diff-bar-row { display: grid; grid-template-columns: 60px 1fr 50px; align-items: center; gap: 10px; }
.diff-bar-track { height: 8px; background: var(--ink-5); border-radius: 99px; overflow: hidden; }
.diff-bar-fill { height: 100%; border-radius: 99px; transition: width .6s; }
.diff-bar-easy { background: var(--accent-sage); }
.diff-bar-medium { background: var(--accent-marigold); }
.diff-bar-hard { background: var(--accent-coral); }
.diff-bar-count { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; font-size: 13px; }

.box-viz { display: flex; gap: 6px; align-items: flex-end; min-height: 120px; }
.box-col { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.box-count { font-family: var(--font-display); font-size: 18px; font-weight: 700; line-height: 1; }
.box-bar { width: 70%; background: linear-gradient(180deg, var(--accent-lavender), var(--accent-lavender-tint)); border-radius: 4px 4px 0 0; min-height: 6px; }
.box-lbl { font-size: 11px; font-weight: 600; }
.box-sub { font-size: 9px; color: var(--ink-soft); }
.box-legend { font-size: 11px; color: var(--ink-soft); text-align: center; margin-top: 10px; line-height: 1.4; }

.heatmap { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; }
.heat-cell { aspect-ratio: 1; border-radius: 3px; }

.empty-inline { color: var(--ink-soft); font-size: 13px; padding: 14px 0; text-align: center; }
.reset-btn {
  background: transparent; color: var(--accent-coral-ink); border: 1px solid var(--accent-coral-tint);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 13px;
}
.reset-btn:hover { background: var(--accent-coral-tint); }

/* ================= TWEAKS ================= */
.tweaks-overlay {
  position: fixed; inset: 0; background: rgba(43,36,25,0.35); z-index: 100;
  display: flex; justify-content: center;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } }
.tweaks-panel {
  width: 100%; max-width: 500px; height: 100vh;
  background: var(--bg); overflow-y: auto;
  animation: slideInR .25s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
@keyframes slideInR { from { transform: translateX(100%); } }
.tweaks-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--ink-10);
}
.tweaks-header h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 0; }
.tweaks-tabs {
  display: flex; gap: 2px; padding: 10px 20px 0;
  border-bottom: 1px solid var(--ink-10);
  overflow-x: auto; white-space: nowrap;
}
.tab {
  background: none; border: none; padding: 9px 10px; font-family: inherit; font-size: 13px;
  color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--accent-coral); font-weight: 600; }
.tweaks-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; flex: 1; }

.field {}
.field-label { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.field-hint { font-size: 11px; color: var(--ink-soft); margin-bottom: 8px; }

.theme-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--ink-10);
  background: var(--surface); cursor: pointer; font-family: inherit; font-size: 12px; color: var(--ink);
}
.theme-chip.active { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.theme-sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--ink-10); }

.chip-group { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ink-10);
  background: var(--surface); cursor: pointer; font-family: inherit; font-size: 12px; color: var(--ink);
  text-transform: capitalize;
}
.chip.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.toggle {
  width: 40px; height: 22px; border-radius: 999px; background: var(--ink-10); border: none;
  position: relative; cursor: pointer; padding: 0; transition: background .2s;
}
.toggle.on { background: var(--accent-sage); }
.toggle-dot {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff;
  border-radius: 50%; transition: left .2s;
}
.toggle.on .toggle-dot { left: 20px; }

.add-word-box {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.add-word-box h4 { margin: 0 0 2px; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 6px; }
input, select, textarea {
  font-family: inherit; font-size: 13px; padding: 8px 12px; border: 1px solid var(--ink-10);
  border-radius: 10px; background: var(--bg); color: var(--ink); width: 100%;
}
textarea { font-family: var(--font-mono); font-size: 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-coral); outline-offset: -1px; border-color: transparent; }
.name-input { width: 100%; padding: 9px 12px; font-size: 14px; background: var(--cream); border: 1px solid var(--ink-10); border-radius: 10px; font-family: inherit; color: var(--ink); }
.name-input:focus { outline: none; border-color: var(--accent-coral); box-shadow: 0 0 0 3px var(--accent-coral-tint); }

.word-list-wrap h4 { font-family: var(--font-display); font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.word-list-scroll { max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--ink-10); border-radius: var(--radius); }
.word-row {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; align-items: center;
  padding: 9px 12px; border-bottom: 1px solid var(--ink-5); font-size: 12px;
}
.word-row:last-child { border-bottom: none; }
.wr-word { font-weight: 600; }
.wr-def { color: var(--ink-70); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remove-btn { background: none; border: none; color: var(--ink-50); cursor: pointer; font-size: 18px; padding: 0 4px; }

.info-box { background: var(--accent-marigold-tint); border-radius: var(--radius); padding: 14px 16px; font-size: 13px; line-height: 1.5; color: var(--ink); }
.info-box h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.info-box p { margin: 0 0 8px; }
.info-box ol { margin: 6px 0 0; padding-left: 18px; }
.info-box li { margin-bottom: 4px; }

.msg { font-size: 12px; color: var(--accent-sage-ink); padding: 7px 10px; background: var(--accent-sage-tint); border-radius: 8px; }

/* ================= EXAM ================= */
.exam-intro {
  padding: 0 20px 40px;
}
.exam-intro-card {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg); padding: 22px;
}
.exam-badge {
  display: inline-block; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; background: var(--ink); color: var(--cream);
  padding: 5px 10px; border-radius: 999px; font-weight: 700; margin-bottom: 14px;
}
.exam-intro-title {
  font-family: var(--font-display); font-size: 26px; line-height: 1.1;
  font-weight: 700; margin: 0 0 10px;
}
.exam-intro-title em { font-style: italic; }
.exam-intro-sub { font-size: 14px; line-height: 1.5; color: var(--ink-70); margin: 0 0 18px; }
.exam-format-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px;
  padding: 14px; background: var(--bg); border-radius: 14px;
}
.exam-format-item { text-align: center; }
.efi-big {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.efi-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-top: 2px; }
.exam-sections { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.exam-section-row {
  padding: 12px 14px; background: var(--bg); border-radius: 12px;
  border: 1px solid var(--ink-10);
}
.exam-section-row strong {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  display: block; margin-bottom: 3px;
}
.ex-sm { font-size: 12px; color: var(--ink-soft); }
.exam-rules {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px;
  padding-top: 14px; border-top: 1px dashed var(--ink-10);
}
.ex-rule { font-size: 12px; color: var(--ink-70); line-height: 1.4; }
.exam-cta-row { display: flex; gap: 8px; }
.exam-cta-row > * { flex: 1; }

/* Exam time picker */
.exam-time-picker {
  margin-bottom: 18px; padding: 14px; background: var(--bg);
  border-radius: 14px; border: 1px solid var(--ink-10);
}
.etp-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); font-weight: 700; margin-bottom: 10px; }
.etp-options { display: flex; flex-direction: column; gap: 6px; }
.etp-btn {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 11px 12px; padding-right: 40px;
  background: var(--surface); border: 1.5px solid var(--ink-10); border-radius: 10px;
  cursor: pointer; font-family: inherit; text-align: left; color: var(--ink);
  transition: all .15s;
}
.etp-btn.active { border-color: var(--ink); background: var(--ink); }
.etp-btn.active .etp-btn-label, .etp-btn.active .etp-btn-sub { color: var(--cream); }
.etp-btn.active .etp-btn-badge { background: rgba(250,246,238,0.15); color: var(--cream); }
.etp-btn-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.etp-btn-label { font-weight: 700; font-size: 13px; }
.etp-btn-badge {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-70);
  font-variant-numeric: tabular-nums;
}
.etp-btn-sub { font-size: 11px; color: var(--ink-soft); }
.etp-check {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 999px;
  background: var(--accent-coral); color: white;
  display: flex; align-items: center; justify-content: center;
}
.etp-hint { margin-top: 8px; font-size: 11px; color: var(--ink-soft); font-style: italic; }

/* Exam active — header now via the shared <ModeHeader>; only the
   counter typography rules remain here (passed through the `meta` slot). */
.exam-screen { padding: 0 0 40px; }
.exam-counter { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.exam-counter strong { color: var(--ink); font-size: 14px; }
.exam-answered { display: none; }

.exam-progress-track {
  display: flex; gap: 3px; margin: 0 20px 18px; flex-wrap: wrap;
}
.exam-dot {
  flex: 1; min-width: 10px; height: 5px; border-radius: 3px;
  background: var(--ink-10); border: none; cursor: pointer; padding: 0;
}
.exam-dot.done { background: var(--accent-sage); }
.exam-dot.active { height: 7px; background: var(--ink); }

.exam-body { padding: 0 20px 20px; }
.exam-qtype {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); margin-bottom: 14px; font-weight: 700;
}
.exam-prompt-syn {
  font-family: var(--font-display); font-size: 36px; font-weight: 700;
  letter-spacing: 0.02em; color: var(--ink); text-align: center;
  padding: 26px 16px; background: var(--surface);
  border-radius: var(--radius-lg); margin-bottom: 20px;
  border: 1px solid var(--ink-10);
}
.exam-prompt-sent {
  font-size: 17px; line-height: 1.55; color: var(--ink);
  padding: 20px; background: var(--surface);
  border-radius: var(--radius-lg); margin-bottom: 20px;
  border: 1px solid var(--ink-10);
  font-family: var(--font-display); font-weight: 500;
}
.exam-options { display: flex; flex-direction: column; gap: 8px; }
.exam-opt {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 2px solid var(--ink-10);
  border-radius: 12px; padding: 12px 14px;
  cursor: pointer; font-family: inherit; color: var(--ink);
  text-align: left; transition: all .12s; font-size: 14px;
  position: relative;
}
.exam-opt.picked { border-color: var(--ink); background: var(--bg); }
.exam-opt.eliminated { opacity: 0.5; cursor: default; }
.exam-opt.eliminated .exam-opt-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--ink-30);
}
.exam-opt-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--ink-10);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.exam-opt.picked .exam-opt-letter { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.exam-opt-text { flex: 1; line-height: 1.4; }
.exam-opt-tag {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 7px; border-radius: 999px; font-weight: 700; flex-shrink: 0;
}
.tag-correct { background: var(--accent-sage); color: white; }
.tag-wrong { background: var(--accent-coral); color: white; }
.tag-correct-picked { background: var(--accent-sage); color: white; }

.exam-nav {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--ink-10);
}

/* Review */
.exam-review { padding: 0 0 40px; }
.exam-score-card {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius-lg); padding: 20px; margin: 0 20px 12px;
  display: flex; flex-direction: column; gap: 14px; align-items: stretch;
}
.exam-score-main { display: flex; align-items: baseline; gap: 12px; }
.exam-score-pct {
  font-family: var(--font-display); font-size: 48px; font-weight: 700;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.ex-pct-sign { font-size: 24px; color: var(--ink-soft); margin-left: 2px; }
.exam-score-sub { font-size: 13px; color: var(--ink-70); }
.exam-score-stanine {
  display: flex; align-items: center; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--ink-10);
}
.ex-stanine-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--accent-coral); }
.ex-stanine-lbl {
  font-size: 11px; color: var(--ink-70); text-transform: uppercase;
  letter-spacing: 0.08em; line-height: 1.3;
}
.exam-score-actions { display: flex; gap: 8px; }
.exam-score-actions > * { flex: 1; }

.exam-review-grid { display: flex; flex-direction: column; gap: 10px; padding: 0 20px; }
.exam-review-sidebar {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius); padding: 8px;
  display: flex; flex-direction: row; gap: 4px;
  overflow-x: auto;
}
.ex-sidebar-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); padding: 6px 4px; font-weight: 700;
  flex-shrink: 0; align-self: center;
}
.ex-sidebar-item {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg); border: 1px solid var(--ink-10);
  cursor: pointer; padding: 6px 9px; border-radius: 8px;
  font-family: inherit; font-size: 12px; color: var(--ink);
  flex-shrink: 0;
}
.ex-sidebar-item.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.ex-si-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.ex-si-preview { display: none; }
.ex-si-mark { font-weight: 700; font-size: 11px; }
.ex-sidebar-item.correct { border-color: var(--accent-sage); color: var(--accent-sage-ink); }
.ex-sidebar-item.wrong { border-color: var(--accent-coral); color: var(--accent-coral-ink); }
.ex-sidebar-item.skipped { color: var(--ink-50); }
.ex-sidebar-item.active.correct, .ex-sidebar-item.active.wrong, .ex-sidebar-item.active.skipped { color: var(--cream); }

.exam-review-main {
  background: var(--surface); border: 1px solid var(--ink-10);
  border-radius: var(--radius); padding: 18px;
}
.exam-options-review .exam-opt { cursor: default; }
.exam-options-review .exam-opt.is-correct { border-color: var(--accent-sage); background: var(--accent-sage-tint); }
.exam-options-review .exam-opt.is-wrong { border-color: var(--accent-coral); background: var(--accent-coral-tint); }
/* Revealed exam options stay disabled (no further interaction) but should
   stay fully visible — without this, the browser dims the green/red feedback
   to ~50% which makes it hard to read. */
.exam-options-review .exam-opt:disabled,
.exam-options-review .exam-opt[disabled] {
  opacity: 1; cursor: default;
}
/* Inline-feedback explanation card sits between the options and the action
   bar (instant mode). Same look as the end-of-test review, just placed
   in-flow so the answer/feedback/next sit together. */
.exam-explain-inline { margin-top: 14px; }

.exam-explain {
  margin-top: 16px; padding: 14px; background: var(--bg);
  border-radius: 12px; border: 1px dashed var(--ink-10);
}
.ex-explain-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); font-weight: 700; margin-bottom: 6px;
}
.exam-explain p { margin: 0 0 12px; font-size: 13px; line-height: 1.55; }
.ex-word-card { background: var(--surface); border: 1px solid var(--ink-10); border-radius: 10px; padding: 12px; }
.ex-word-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.ex-word-term { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.ex-word-pos { font-family: var(--font-display); font-style: italic; font-size: 12px; color: var(--ink-soft); }
.ex-word-def { font-size: 12px; line-height: 1.5; color: var(--ink-70); margin-bottom: 4px; }
.ex-word-ex {
  font-family: var(--font-display); font-style: italic; font-size: 12px; color: var(--ink-70);
  border-left: 2px solid var(--ink-10); padding-left: 8px; line-height: 1.4;
}
.exam-review-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ink-10);
}
.ex-review-count { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
