/* ====================================================
   KORVA Design System v3
   Warm cream · Editorial · Full-viewport
   ----------------------------------------------------
   The legacy component layer below (~2000 lines) is written against these
   token names, which is why the blue-* names survive: they are now WARM
   values, so every legacy component re-skins from this block alone rather
   than needing 2000 lines of find-and-replace.
   Layout is NOT handled here — see the KORVA v3 FULL-VIEWPORT LAYER at the
   end of this file, which deliberately loads last so it wins on source order.
   ==================================================== */

:root {
  /* Surfaces — warm cream, never cold white */
  --bg: #FAF6F0;
  --bg-soft: #F2EBE1;
  --surface: #FCFCFB;
  --surface-elev: #FFFFFF;

  /* Brand — warm orange, used SPARINGLY. The blue-* names are legacy
     aliases; the values are the Korva accent ramp. */
  --blue-900: #7A2E12;
  --blue-700: #C4653A;   /* terracotta — secondary accent */
  --blue-600: #E85D2F;   /* warm orange — PRIMARY, strategic use only */
  --blue-500: #E85D2F;
  --blue-100: #F7DCCF;
  --blue-50:  #FCEFE8;

  /* Korva semantic accents (prefer these in new work) */
  --accent:        #E85D2F;
  --accent-hover:  #D14E23;
  --accent-soft:   #FCEFE8;
  --accent-border: #F3C9B5;
  --terracotta:    #C4653A;
  --terracotta-soft:#F6E5DC;

  /* Supporting — desaturated to sit inside a warm palette */
  --mint:     #4A7C59;
  --mint-50:  #E8F0E9;
  --gold:     #B8860B;
  --gold-50:  #FAF2DF;
  --coral:    #C0563C;
  --coral-50: #F9E7E2;
  --lilac:    #8B6F8E;
  --lilac-50: #F2EBF3;

  /* Text — deep charcoal on warm neutrals */
  --ink:      #1A1A1A;
  --ink-soft: #4A453F;
  --ink-mute: #8B8378;
  --ink-faint:#B3ABA0;

  /* Lines */
  --line:     #E5DDD1;
  --line-soft:#F0E9DF;

  /* Shadows — warm-tinted, low and wide. Premium = soft, not heavy. */
  --shadow-xs: 0 1px 2px rgba(90, 70, 50, 0.04);
  --shadow-sm: 0 1px 3px rgba(90, 70, 50, 0.05), 0 4px 12px rgba(90, 70, 50, 0.04);
  --shadow-md: 0 2px 6px rgba(90, 70, 50, 0.05), 0 12px 28px rgba(90, 70, 50, 0.07);
  --shadow-lg: 0 6px 14px rgba(90, 70, 50, 0.07), 0 24px 56px rgba(90, 70, 50, 0.10);
  --shadow-glow: 0 6px 24px rgba(232, 93, 47, 0.18);
  --shadow-success: 0 6px 24px rgba(74, 124, 89, 0.18);

  /* Radii — Apple concentric scale */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-xxl: 40px;
  --r-pill: 999px;

  /* Spacing */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 72px;

  /* Motion */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ====================================================
   RESET + BASE
   ==================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  /* Sticky-footer scaffold — keeps .korva-footer pinned to the viewport
     bottom on short pages, pushed below content on long pages. */
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > .korva-footer { flex-shrink: 0; margin-top: auto; }

/* Soft ambient gradient on body for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px circle at 8% -12%, rgba(232, 93, 47, 0.045), transparent 55%),
    radial-gradient(1000px circle at 108% 108%, rgba(196, 101, 58, 0.04), transparent 55%);
  z-index: -1;
}

h1, h2, h3, h4, h5 {
  font-family: 'Fraunces', 'Manrope', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

h1 { font-size: 44px; font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.025em; }
h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: 17px; font-weight: 600; }

p { color: var(--ink-soft); }

a { color: var(--blue-600); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--blue-700); }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--ink);
}

img, svg { display: block; max-width: 100%; }

/* ====================================================
   LAYOUT
   ==================================================== */

.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

.page-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

.page-narrowest {
  max-width: 480px;
  margin: 0 auto;
  padding: 56px 24px;
}

/* `flex-wrap: wrap` added Session 6. Without it a .row can only ever overflow:
   /settings puts Privacy Policy + Terms + Log out in one, and at 375px they ran
   4px past the viewport, taking Log out partly off-screen. Wrapping is also the
   only sane narrow-screen behaviour for the other three uses, and it changes
   nothing at widths where the children already fit. */
.row { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--s-4); }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.center { display: flex; align-items: center; justify-content: center; }
.stack-tight { display: flex; flex-direction: column; gap: var(--s-2); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-loose { display: flex; flex-direction: column; gap: var(--s-7); }

/* ====================================================
   NAV
   ==================================================== */

.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(252, 251, 250, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.025em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-brand .brand-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #F5B656 0%, #E08A1C 100%);
  border-radius: 10px;
  display: grid; place-items: center;
  color: white;
  font-size: 17px;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  box-shadow: 0 3px 10px rgba(224, 138, 28, 0.30);
}

/* Big logo variant for landing hero */
.brand-mark-lg {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #F5B656 0%, #E08A1C 100%);
  border-radius: 18px;
  display: grid; place-items: center;
  color: white;
  font-size: 36px;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.04em;
  box-shadow: 0 6px 20px rgba(224, 138, 28, 0.35);
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--blue-50); color: var(--blue-700); }
.nav-link.active { background: var(--blue-100); color: var(--blue-700); }

.nav-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  align-items: center;
  justify-content: center;
  background: transparent;
  margin-left: auto;
}
.nav-burger:hover { background: var(--blue-50); }
.nav-burger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  margin: 3px 0;
  border-radius: 2px;
  transition: transform 0.2s;
}

/* ====================================================
   CARDS
   ==================================================== */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s-6);
  transition: box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.card-lift:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-xl { border-radius: var(--r-xl); padding: var(--s-7); }
.card-pad-lg { padding: var(--s-7); }
.card-pad-xl { padding: var(--s-8) var(--s-7); }

.card-tinted {
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--surface) 100%);
}

.card-feature {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
  color: white;
  box-shadow: var(--shadow-glow);
}
.card-feature h2, .card-feature h3, .card-feature h4 { color: white; }
.card-feature p { color: rgba(255,255,255,0.85); }

/* ====================================================
   BUTTONS — capsule pills
   ==================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  min-height: 48px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
  color: white;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(59,130,246,0.32); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  min-height: 40px;
  padding: 10px 18px;
}
.btn-ghost:hover { background: var(--blue-50); color: var(--blue-700); }

.btn-soft {
  background: var(--blue-50);
  color: var(--blue-700);
  box-shadow: none;
}
.btn-soft:hover { background: var(--blue-100); }

.btn-success {
  background: linear-gradient(135deg, var(--mint) 0%, #34D399 100%);
  color: white;
  box-shadow: var(--shadow-success);
}

.btn-danger {
  background: var(--coral-50);
  color: var(--coral);
}
.btn-danger:hover { background: var(--coral); color: white; }

.btn-lg { padding: 18px 32px; font-size: 16px; min-height: 56px; }
.btn-xl { padding: 22px 40px; font-size: 17px; min-height: 64px; border-radius: var(--r-pill); }
.btn-sm { padding: 10px 18px; font-size: 13px; min-height: 38px; }

.btn-full { width: 100%; }
.btn-icon { padding: 14px; min-width: 48px; }

/* ====================================================
   INPUTS
   ==================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.005em;
}

.input, .textarea, .select {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.18s, background 0.18s;
  outline: none;
}

.input:hover, .textarea:hover, .select:hover {
  box-shadow: inset 0 0 0 1px var(--blue-100);
}

.input:focus, .textarea:focus, .select:focus {
  box-shadow: inset 0 0 0 2px var(--blue-500), 0 0 0 4px rgba(59,130,246,0.12);
  background: var(--surface-elev);
}

.input::placeholder, .textarea::placeholder {
  color: var(--ink-faint);
}

.textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
  font-family: inherit;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%236B7798' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
  cursor: pointer;
}

.field-hint {
  font-size: 12.5px;
  color: var(--ink-mute);
}

/* PIN input */
.pin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 280px;
}
.pin-cell {
  height: 64px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}
.pin-cell:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--blue-500);
}

/* ====================================================
   BADGES, CHIPS, PILLS
   ==================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.003em;
}
.chip-mint { background: var(--mint-50); color: var(--mint); }
.chip-gold { background: var(--gold-50); color: var(--gold); }
.chip-coral { background: var(--coral-50); color: var(--coral); }
.chip-lilac { background: var(--lilac-50); color: var(--lilac); }
.chip-ghost { background: var(--bg-soft); color: var(--ink-soft); }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-600);
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--mint-50);
  color: var(--mint);
  font-size: 13px;
  font-weight: 600;
}

/* ====================================================
   FORTA MASCOT "FO"
   Subtle, soft squircle character used in corners
   ==================================================== */

.fo {
  display: inline-block;
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #6FA8FF 0%, #E85D2F 100%);
  border-radius: 32% / 38%;
  position: relative;
  box-shadow: var(--shadow-md), inset 0 -8px 16px rgba(15, 31, 77, 0.15);
  flex-shrink: 0;
}
.fo::before, .fo::after {
  content: '';
  position: absolute;
  top: 32%;
  width: 9px; height: 12px;
  background: var(--ink);
  border-radius: 50%;
}
.fo::before { left: 28%; }
.fo::after { right: 28%; }
.fo .mouth {
  position: absolute;
  bottom: 28%;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 11px;
  border-bottom: 2.5px solid var(--ink);
  border-radius: 0 0 22px 22px;
}
.fo .cheek {
  position: absolute;
  top: 50%;
  width: 9px; height: 6px;
  background: rgba(255, 180, 180, 0.7);
  border-radius: 50%;
}
.fo .cheek-l { left: 14%; }
.fo .cheek-r { right: 14%; }

.fo-sm { width: 44px; height: 44px; }
.fo-sm::before, .fo-sm::after { width: 6px; height: 8px; top: 32%; }
.fo-sm::before { left: 28%; }
.fo-sm::after { right: 28%; }
.fo-sm .mouth { width: 14px; height: 7px; bottom: 28%; border-bottom-width: 2px; }
.fo-sm .cheek { width: 6px; height: 4px; }

.fo-lg { width: 120px; height: 120px; }
.fo-lg::before, .fo-lg::after { width: 14px; height: 18px; }
.fo-lg .mouth { width: 32px; height: 16px; border-bottom-width: 3.5px; }
.fo-lg .cheek { width: 14px; height: 8px; }

.fo-xl { width: 180px; height: 180px; }
.fo-xl::before, .fo-xl::after { width: 22px; height: 28px; }
.fo-xl .mouth { width: 50px; height: 26px; border-bottom-width: 5px; }
.fo-xl .cheek { width: 22px; height: 12px; }

@keyframes fo-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.fo-bouncing { animation: fo-bounce 2.4s ease-in-out infinite; }

@keyframes fo-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}
.fo-wiggle { animation: fo-wiggle 0.6s ease-in-out; }

/* ====================================================
   STAT CARDS, PROGRESS, RINGS
   ==================================================== */

.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 36px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-trend {
  font-size: 12.5px;
  color: var(--mint);
  font-weight: 600;
}

.progress-ring {
  --size: 96px;
  --pct: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(var(--blue-500) calc(var(--pct) * 1%), var(--blue-50) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.progress-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--surface);
  border-radius: 50%;
}
.progress-ring-text {
  position: relative;
  z-index: 1;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 24px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--blue-50);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
  border-radius: var(--r-pill);
  transition: width 0.6s var(--ease-out);
}

/* ====================================================
   SECTION TILES — main practice section pickers
   ==================================================== */

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}

.section-tile {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--s-7);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}
.section-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.section-tile-icon {
  width: 56px; height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
}
.section-tile-reading .section-tile-icon { background: var(--blue-50); color: var(--blue-700); }
.section-tile-quantitative .section-tile-icon { background: var(--mint-50); color: var(--mint); }
.section-tile-writing .section-tile-icon { background: var(--lilac-50); color: var(--lilac); }
.section-tile h3 { font-size: 20px; }
.section-tile-meta { font-size: 13px; color: var(--ink-mute); }

/* Decorative blob in tile corner */
.section-tile::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, var(--blue-50) 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}
.section-tile-quantitative::before { background: radial-gradient(circle, var(--mint-50) 0%, transparent 70%); }
.section-tile-writing::before { background: radial-gradient(circle, var(--lilac-50) 0%, transparent 70%); }

/* ====================================================
   PRACTICE QUESTION VIEW
   ==================================================== */

.q-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--s-7) var(--s-5) var(--s-9);
}

.q-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-6);
}

.q-passage {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-7);
  box-shadow: var(--shadow-sm);
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: var(--s-6);
}

.q-question {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: var(--s-6);
}

.options {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px transparent;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
  font-size: 15.5px;
  color: var(--ink);
  text-align: left;
  width: 100%;
}
.option:hover {
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--blue-100);
  transform: translateY(-1px);
}
.option-letter {
  width: 32px; height: 32px;
  background: var(--blue-50);
  color: var(--blue-700);
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.option.selected {
  box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--blue-500);
  background: var(--blue-50);
}
.option.correct {
  box-shadow: var(--shadow-success), inset 0 0 0 2px var(--mint);
  background: var(--mint-50);
}
.option.correct .option-letter { background: var(--mint); color: white; }
.option.incorrect {
  box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--coral);
  background: var(--coral-50);
}
.option.incorrect .option-letter { background: var(--coral); color: white; }
.option.disabled { pointer-events: none; opacity: 0.65; }

/* Feedback */
.feedback-card {
  margin-top: var(--s-6);
  padding: var(--s-6) var(--s-6);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  background: var(--surface);
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  animation: feedback-rise 0.4s var(--ease-spring);
}
@keyframes feedback-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.feedback-card.success { background: linear-gradient(135deg, var(--mint-50) 0%, var(--surface) 100%); }
.feedback-card.gentle { background: linear-gradient(135deg, var(--blue-50) 0%, var(--surface) 100%); }
.feedback-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}
.feedback-body { color: var(--ink-soft); font-size: 15px; line-height: 1.6; }

/* ====================================================
   PARENT MONITORED BADGE — trust signal in kid view
   ==================================================== */

.monitored-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.monitored-pill .dot {
  width: 8px; height: 8px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

/* ====================================================
   LANDING SPECIFIC
   ==================================================== */

.hero {
  text-align: center;
  padding: var(--s-9) var(--s-5) var(--s-8);
  position: relative;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: var(--surface);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: var(--s-6);
}
.hero h1 {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 860px;
  margin: 0 auto var(--s-5);
}
.hero h1 .hl {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--lilac) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto var(--s-7);
  line-height: 1.5;
}
.hero-cta {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--s-8);
}
.hero-trust-row {
  display: flex;
  gap: var(--s-7);
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-mute);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  padding: var(--s-7) 0;
}
.feature {
  padding: var(--s-6);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--blue-50);
  color: var(--blue-700);
  display: grid; place-items: center;
  font-size: 24px;
  margin-bottom: var(--s-4);
}

.pricing-section {
  padding: var(--s-9) 0;
}
.pricing-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--s-8) var(--s-7);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
}
.pricing-amount {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.pricing-period {
  font-size: 16px;
  color: var(--ink-mute);
  font-weight: 500;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: var(--s-6) 0;
  text-align: left;
}
.pricing-features li {
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--ink-soft);
}
.pricing-features li::before {
  content: '';
  width: 22px; height: 22px;
  flex-shrink: 0;
  background: var(--mint);
  border-radius: 50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'><path d='M2 7l3 3 7-7' stroke='white' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

/* ====================================================
   TOAST + MESSAGES
   ==================================================== */

.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--mint); }
.toast.error { background: var(--coral); }

.alert {
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: var(--s-4);
}
.alert-error { background: var(--coral-50); color: var(--coral); }
.alert-info { background: var(--blue-50); color: var(--blue-700); }
.alert-warn { background: var(--gold-50); color: var(--gold); }

/* ====================================================
   ANIMATIONS
   ==================================================== */

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise-in { animation: rise-in 0.5s var(--ease-out) both; }
.rise-in-1 { animation: rise-in 0.5s var(--ease-out) 0.05s both; }
.rise-in-2 { animation: rise-in 0.5s var(--ease-out) 0.12s both; }
.rise-in-3 { animation: rise-in 0.5s var(--ease-out) 0.20s both; }
.rise-in-4 { animation: rise-in 0.5s var(--ease-out) 0.28s both; }
.rise-in-5 { animation: rise-in 0.5s var(--ease-out) 0.36s both; }

@keyframes soft-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.celebrate { animation: soft-pulse 0.6s var(--ease-spring); }

/* ====================================================
   UTILITIES
   ==================================================== */

.t-center { text-align: center; }
.t-right { text-align: right; }
.t-muted { color: var(--ink-mute); }
.t-faint { color: var(--ink-faint); }
.t-strong { font-weight: 600; }
.t-mono { font-variant-numeric: tabular-nums; }
.t-sm { font-size: 13.5px; }
.t-lg { font-size: 17px; }

.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }
.mt-8 { margin-top: var(--s-8); }

.mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); }

.hidden { display: none !important; }

/* ====================================================
   RESPONSIVE
   ==================================================== */

@media (max-width: 900px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .hero h1 { font-size: 44px; }
  .hero-sub { font-size: 17px; }
  .feature-grid { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; }
  .page, .page-narrow { padding: 24px 20px 56px; }
  .card { padding: var(--s-5); }
  .card-xl { padding: var(--s-6); }
  .q-page { padding: var(--s-5) var(--s-4) var(--s-8); }
  .q-passage { padding: var(--s-5); font-size: 15.5px; }
  .q-question { font-size: 20px; }
}

@media (max-width: 700px) {
  .nav-inner { padding: 14px 18px; }
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 16px; right: 16px;
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 10px;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    align-items: stretch;
    gap: 2px;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link { width: 100%; padding: 12px 16px; font-size: 14.5px; }
  .hero { padding: var(--s-7) var(--s-4) var(--s-7); }
  .hero h1 { font-size: 36px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ====================================================
   v2 ADDITIONS — gamification UI
   ==================================================== */

/* XP bar / streak chip / fo skin variants */

/* Fo skin color overrides — set CSS vars from server */
.fo[data-skin="classic"] { background: linear-gradient(135deg, #6FA8FF 0%, #E85D2F 100%); }
.fo[data-skin="mint"]    { background: linear-gradient(135deg, #6EE7B7 0%, #4A7C59 100%); }
.fo[data-skin="gold"]    { background: linear-gradient(135deg, #FCD34D 0%, #B8860B 100%); }
.fo[data-skin="rose"]    { background: linear-gradient(135deg, #F9A8D4 0%, #F472B6 100%); }
.fo[data-skin="lilac"]   { background: linear-gradient(135deg, #C4B5FD 0%, #8B6F8E 100%); }
.fo[data-skin="galaxy"]  { background: linear-gradient(135deg, #4338CA 0%, #2A2622 100%); position: relative; overflow: hidden; }
.fo[data-skin="galaxy"]::after { box-shadow: 0 0 12px rgba(124, 58, 237, 0.6); }

/* Stat strip: streak + XP + goal ring in compact row */
.kid-stat-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  background: linear-gradient(135deg, #FFF7E0 0%, #FFE0B0 100%);
  color: #B45309;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}
.streak-flame {
  width: 22px; height: 22px;
  background: radial-gradient(circle at 50% 60%, #B8860B, #C0563C);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C9 6 6 9 6 13a6 6 0 0012 0c0-3-2-5-3-7-1 2-2 3-3 2 0-2 0-4 0-6z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2C9 6 6 9 6 13a6 6 0 0012 0c0-3-2-5-3-7-1 2-2 3-3 2 0-2 0-4 0-6z'/></svg>") center/contain no-repeat;
}
.streak-chip.frozen {
  background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
  color: #075985;
}

.xp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--blue-50) 0%, var(--blue-100) 100%);
  color: var(--blue-700);
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 14px;
}
.xp-chip .xp-star {
  display: inline-block;
  width: 16px; height: 16px;
  background: var(--blue-500);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l3 7 7 1-5 5 1 7-6-4-6 4 1-7-5-5 7-1z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l3 7 7 1-5 5 1 7-6-4-6 4 1-7-5-5 7-1z'/></svg>") center/contain no-repeat;
}

/* Daily goal ring (small) */
.goal-ring {
  --size: 56px;
  --pct: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(var(--mint) calc(var(--pct) * 1%), var(--mint-50) 0);
  display: grid;
  place-items: center;
  position: relative;
}
.goal-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  background: var(--surface);
  border-radius: 50%;
}
.goal-ring-text {
  position: relative;
  z-index: 1;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

/* GATE countdown banner */
.countdown-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #FAF2DF 0%, #FED7AA 100%);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: #92400E;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}
.countdown-banner .pulse-dot {
  width: 8px; height: 8px;
  background: #B8860B;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.05); }
}

/* Quest cards */
.quest-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s, transform 0.2s;
}
.quest-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.quest-card.completed {
  background: linear-gradient(135deg, var(--mint-50) 0%, var(--surface) 100%);
}
.quest-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-700);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
}
.quest-card.completed .quest-icon {
  background: var(--mint);
  color: white;
}
.quest-body { flex: 1; min-width: 0; }
.quest-label { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.quest-progress {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quest-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.quest-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
  border-radius: var(--r-pill);
  transition: width 0.6s var(--ease-out);
}
.quest-card.completed .quest-fill { background: var(--mint); }
.quest-meta { font-size: 12px; color: var(--ink-mute); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.quest-reward {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-700);
  background: var(--blue-50);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

/* Mistake bank chip */
.mistake-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #FAF2DF 0%, var(--surface) 100%);
  color: #B45309;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.mistake-chip:hover { color: #92400E; }

/* Test-Ready Score card (the headline parent metric) */
.trs-card {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 70%, var(--lilac) 100%);
  border-radius: var(--r-xl);
  padding: var(--s-7) var(--s-7);
  color: white;
  position: relative;
  overflow: hidden;
}
.trs-card::before {
  content: '';
  position: absolute;
  right: -60px; bottom: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.trs-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.75); margin-bottom: 6px; }
.trs-score {
  font-family: 'Fraunces', serif;
  font-size: 88px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: white;
  font-variant-numeric: tabular-nums;
}
.trs-score .denom { font-size: 28px; font-weight: 500; color: rgba(255,255,255,0.7); }
.trs-breakdown { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 20px; position: relative; z-index: 1; }
.trs-cell {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.trs-cell-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.75); }
.trs-cell-value { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; color: white; font-variant-numeric: tabular-nums; }

/* Skill mastery dots / heatmap */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.skill-cell {
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.skill-cell-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.skill-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  font-variant-numeric: tabular-nums;
}
.skill-dot[data-level="0"] { background: var(--line); color: var(--ink-faint); }
.skill-dot[data-level="1"] { background: var(--coral); }
.skill-dot[data-level="2"] { background: #FB923C; }
.skill-dot[data-level="3"] { background: var(--gold); }
.skill-dot[data-level="4"] { background: #84CC16; }
.skill-dot[data-level="5"] { background: var(--mint); }

/* Hint button + hint bubble */
.hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--gold-50);
  color: var(--gold);
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.hint-btn:hover { background: #FAF2DF; }
.hint-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hint-bubble {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #FAF2DF 0%, var(--gold-50) 100%);
  border-radius: var(--r-lg);
  margin-top: 16px;
  animation: feedback-rise 0.4s var(--ease-spring);
}
.hint-bubble-body {
  font-size: 14.5px;
  color: #78350F;
  line-height: 1.55;
  font-weight: 500;
}

/* XP popup animation */
.xp-popup {
  position: fixed;
  top: 80px;
  right: 24px;
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
  color: white;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow-glow);
  z-index: 200;
  animation: xp-popup 2s var(--ease-spring) forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}
@keyframes xp-popup {
  0% { opacity: 0; transform: translateY(-20px) scale(0.8); }
  15%, 80% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.95); }
}

.quest-popup {
  position: fixed;
  top: 80px;
  right: 24px;
  background: linear-gradient(135deg, var(--mint) 0%, #34D399 100%);
  color: white;
  padding: 16px 22px;
  border-radius: var(--r-lg);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-success);
  z-index: 199;
  animation: xp-popup 3s var(--ease-spring) forwards;
  max-width: 280px;
}
.quest-popup .quest-popup-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
  margin-bottom: 4px;
}

/* Shop skin grid */
.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.skin-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px 16px 16px;
  box-shadow: var(--shadow-xs);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.skin-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.skin-card.locked { opacity: 0.7; }
.skin-card.equipped {
  box-shadow: inset 0 0 0 2px var(--blue-500), var(--shadow-sm);
}
.skin-card .fo { margin: 0 auto 12px; }
.skin-name { font-size: 13.5px; font-weight: 600; }
.skin-cost {
  font-size: 12px;
  color: var(--blue-700);
  background: var(--blue-50);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

/* Section tile with skill mastery preview */
.section-tile-stats {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.section-tile-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.section-tile-dot.active { background: var(--mint); }

/* Subtle floating action button for hint */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: white;
  display: grid;
  place-items: center;
  font-size: 24px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.2s var(--ease-spring);
}
.fab:hover { transform: scale(1.08); }

/* Confetti for big wins (CSS-only) */
.confetti-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 8px; height: 14px;
  background: var(--blue-500);
  opacity: 0;
  animation: confetti-fall 2.5s ease-out forwards;
}
@keyframes confetti-fall {
  0% { opacity: 1; transform: translateY(-100vh) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* Section path - kid practice home redesigned as journey */
.practice-path {
  position: relative;
  padding: 32px 0;
}
.practice-path-line {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 4px;
  margin-left: -2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--blue-100) 0,
    var(--blue-100) 8px,
    transparent 8px,
    transparent 16px
  );
  z-index: 0;
}
.practice-node {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}
.practice-node:nth-child(odd) { justify-content: flex-start; padding-left: 4%; }
.practice-node:nth-child(even) { justify-content: flex-end; padding-right: 4%; }

@media (max-width: 700px) {
  .trs-score { font-size: 64px; }
  .trs-breakdown { grid-template-columns: 1fr; gap: 8px; }
  .kid-stat-strip { grid-template-columns: 1fr; gap: 12px; text-align: center; }
  .skill-grid { grid-template-columns: 1fr 1fr; }
}

/* ========================================================================

/* ========================================================================
   KID THEME v2 — disciplined warm. ONE primary (amber), restraint elsewhere.
   ======================================================================== */

body.theme-kid {
  /* v3: the kid theme is no longer a separate palette. It is the same Korva
     system with one deliberate difference — a fractionally warmer page tint —
     so a child and their parent are recognisably inside the same product.
     The old amber primary is gone; the single primary is the Korva orange. */
  --bg: #FAF6F0;
  --bg-soft: #F2EBE1;
  --surface: #FCFCFB;
  --line: #E5DDD1;
  --line-soft: #F0E9DF;

  --ink: #1A1A1A;
  --ink-soft: #4A453F;
  --ink-mute: #8B8378;
  --ink-faint: #B3ABA0;

  /* SINGLE primary: Korva orange. */
  --primary: #E85D2F;
  --primary-dark: #C4653A;
  --primary-light: #F09571;
  --primary-50: #FCEFE8;
  --primary-100: #F7DCCF;

  /* Muted forest green for "correct" — reads as considered, not arcade. */
  --mint: #4A7C59;
  --mint-50: #E8F0E9;

  /* Muted brick for "not yet" — never alarm red to a child. */
  --error: #C0563C;
  --error-50: #F9E7E2;

  --shadow-xs: 0 1px 2px rgba(90, 70, 50, 0.04);
  --shadow-sm: 0 1px 3px rgba(90, 70, 50, 0.05), 0 4px 12px rgba(90, 70, 50, 0.04);
  --shadow-md: 0 2px 6px rgba(90, 70, 50, 0.05), 0 12px 28px rgba(90, 70, 50, 0.07);
  --shadow-lg: 0 6px 14px rgba(90, 70, 50, 0.07), 0 24px 56px rgba(90, 70, 50, 0.10);

  background-color: var(--bg);
  background-image: none;
}

body.theme-kid h1, body.theme-kid h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-style: normal;
  color: var(--ink);
  letter-spacing: -0.02em;
}
body.theme-kid h3 { font-family: 'Fraunces', serif; font-weight: 600; color: var(--ink); }

body.theme-kid { font-family: 'Lexend', 'Manrope', sans-serif; color: var(--ink-soft); }

body.theme-kid .t-muted { color: var(--ink-mute); }
body.theme-kid .t-faint { color: var(--ink-faint); }

/* Nav */
body.theme-kid .nav {
  background: rgba(253, 250, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
body.theme-kid .brand-mark {
  background: var(--primary);
  color: white;
}

/* Buttons */
body.theme-kid .btn {
  font-family: 'Lexend', sans-serif;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.15s ease;
}
body.theme-kid .btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(224, 138, 28, 0.20);
}
body.theme-kid .btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(224, 138, 28, 0.30);
}
body.theme-kid .btn-soft {
  background: var(--primary-50);
  color: var(--primary-dark);
}
body.theme-kid .btn-soft:hover { background: var(--primary-100); }
body.theme-kid .btn-ghost { color: var(--ink-mute); }
body.theme-kid .btn-ghost:hover { background: var(--bg-soft); }

/* Cards */
body.theme-kid .card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line-soft);
}

/* Chips — single accent style, no rotation */
body.theme-kid .chip {
  background: var(--primary-50);
  color: var(--primary-dark);
  border-radius: 999px;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  padding: 5px 12px;
}
body.theme-kid .chip-mint { background: var(--mint-50); color: var(--mint); }
body.theme-kid .chip-lilac { background: #F2EBE1; color: var(--ink-soft); }

body.theme-kid .monitored-pill {
  background: var(--mint-50);
  color: var(--mint);
}

body.theme-kid .eyebrow {
  color: var(--primary);
  font-family: 'Lexend', sans-serif;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
}

/* Fo — subtle idle animation only */
body.theme-kid .fo {
  filter: drop-shadow(0 2px 8px rgba(60, 30, 8, 0.10));
}
body.theme-kid .fo[data-skin="classic"] {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

/* Streak chip — flat, no rotation */
body.theme-kid .streak-chip {
  background: var(--primary-50);
  color: var(--primary-dark);
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  padding: 8px 14px 8px 10px;
  box-shadow: none;
  border-radius: 999px;
  transform: none;
}
body.theme-kid .streak-flame {
  background: var(--primary);
}

/* XP chip — flat, no rotation */
body.theme-kid .xp-chip {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  padding: 8px 14px;
  box-shadow: none;
  border-radius: 999px;
  transform: none;
}
body.theme-kid .xp-chip .xp-star { background: var(--primary); }

/* Stat strip */
body.theme-kid .kid-stat-strip {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 18px 22px;
  box-shadow: var(--shadow-xs);
}

/* Goal ring */
body.theme-kid .goal-ring {
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--bg-soft) 0);
}
body.theme-kid .goal-ring-text {
  font-family: 'Fraunces', serif;
  color: var(--ink);
  font-weight: 600;
}

/* Countdown — quieter */
body.theme-kid .countdown-banner {
  background: var(--surface);
  color: var(--primary-dark);
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  border: 1px solid var(--primary-100);
  padding: 7px 14px;
  font-size: 12.5px;
  border-radius: 999px;
}
body.theme-kid .countdown-banner .pulse-dot {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(224, 138, 28, 0.20);
  width: 7px;
  height: 7px;
}

/* Quest cards */
body.theme-kid .quest-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px 18px;
  transition: border-color 0.15s, transform 0.15s;
}
body.theme-kid .quest-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
body.theme-kid .quest-card.completed {
  background: var(--mint-50);
  border-color: #A7F3D0;
}
body.theme-kid .quest-icon {
  background: var(--bg-soft);
  color: var(--ink-mute);
  font-size: 17px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
body.theme-kid .quest-card.completed .quest-icon { background: var(--mint); color: white; }
body.theme-kid .quest-label { font-family: 'Lexend', sans-serif; font-weight: 600; font-size: 14.5px; color: var(--ink); }
body.theme-kid .quest-fill { background: var(--primary); }
body.theme-kid .quest-reward {
  background: var(--bg-soft);
  color: var(--primary-dark);
  font-family: 'Lexend', sans-serif;
  border-radius: 999px;
}

/* Mistake chip */
body.theme-kid .mistake-chip {
  background: var(--surface);
  color: var(--ink-soft);
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
body.theme-kid .mistake-chip:hover { border-color: var(--primary); color: var(--primary-dark); }

/* Section tiles — much more restrained, white cards with small color accent */
body.theme-kid .section-grid {
  gap: 12px;
}
body.theme-kid .section-tile {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}
body.theme-kid .section-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
/* Each section gets ONLY a tiny color stripe at top, not a giant gradient */
body.theme-kid .section-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
body.theme-kid .section-tile-reading::before { background: #B8860B; }
body.theme-kid .section-tile-quantitative::before { background: #06B6D4; }
body.theme-kid .section-tile-writing::before { background: #8B6F8E; }
body.theme-kid .section-tile-abstract::before { background: #4A7C59; }
body.theme-kid .section-tile h3 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  margin-top: 10px;
  color: var(--ink);
}
body.theme-kid .section-tile-icon {
  font-size: 28px;
  filter: none;
}
body.theme-kid .section-tile-meta {
  color: var(--ink-mute);
  font-family: 'Lexend', sans-serif;
  font-size: 13px;
}

/* Hint button */
body.theme-kid .hint-btn {
  background: var(--primary-50);
  color: var(--primary-dark);
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 20px;
  border: 1px solid var(--primary-100);
}
body.theme-kid .hint-btn:hover {
  background: var(--primary-100);
}
body.theme-kid .hint-bubble {
  background: var(--primary-50);
  border-radius: 16px;
  padding: 16px 20px;
  border: 1px solid var(--primary-100);
}
body.theme-kid .hint-bubble-body {
  color: var(--ink-soft);
  font-family: 'Lexend', sans-serif;
  font-size: 14.5px;
}

/* Question passage / question */
body.theme-kid .q-passage {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 22px 24px;
  font-family: 'Lexend', sans-serif;
  line-height: 1.7;
  color: var(--ink-soft);
}
body.theme-kid .q-question {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink);
  margin: 24px 0 16px;
}

/* MC options — white cards, amber accent on hover/correct */
body.theme-kid .option {
  background: var(--surface);
  border-radius: 14px;
  border: 1.5px solid var(--line);
  padding: 16px 20px;
  font-family: 'Lexend', sans-serif;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.15s ease;
  cursor: pointer;
}
body.theme-kid .option:hover:not(.disabled) {
  border-color: var(--primary);
  background: var(--primary-50);
}
body.theme-kid .option-letter {
  background: var(--bg-soft);
  color: var(--ink-mute);
  font-family: 'Fraunces', serif;
  font-weight: 600;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}
body.theme-kid .option:hover:not(.disabled) .option-letter {
  background: var(--primary);
  color: white;
}
body.theme-kid .option.correct {
  background: var(--mint-50);
  border-color: var(--mint);
  color: #064E3B;
}
body.theme-kid .option.correct .option-letter { background: var(--mint); color: white; }
body.theme-kid .option.incorrect {
  background: var(--error-50);
  border-color: var(--error);
  color: #7F1D1D;
}
body.theme-kid .option.incorrect .option-letter { background: var(--error); color: white; }

/* Feedback cards */
body.theme-kid .feedback-card {
  border-radius: 18px;
  padding: 20px 22px;
  margin-top: 24px;
  border: 1px solid transparent;
}
body.theme-kid .feedback-card.success {
  background: var(--mint-50);
  border-color: var(--mint);
}
body.theme-kid .feedback-card.attempt {
  background: var(--primary-50);
  border-color: var(--primary-100);
}
body.theme-kid .feedback-heading {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}

/* XP popup */
body.theme-kid .xp-popup {
  background: var(--primary);
  font-family: 'Lexend', sans-serif;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 16px;
  box-shadow: 0 6px 18px rgba(224, 138, 28, 0.35);
}
body.theme-kid .quest-popup {
  background: var(--mint);
  font-family: 'Lexend', sans-serif;
  border-radius: 14px;
  padding: 16px 20px;
}

/* Textarea / input */
body.theme-kid .textarea, body.theme-kid .input {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-family: 'Lexend', sans-serif;
  padding: 14px 18px;
  color: var(--ink);
}
body.theme-kid .textarea:focus, body.theme-kid .input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
body.theme-kid .field-label {
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  color: var(--ink);
}

/* Shop skins */
body.theme-kid .skin-card {
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 20px 16px 16px;
  transition: all 0.15s ease;
}
body.theme-kid .skin-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
body.theme-kid .skin-card.equipped {
  background: var(--mint-50);
  border-color: var(--mint);
}
body.theme-kid .skin-card.locked {
  background: var(--bg-soft);
  opacity: 0.7;
}
body.theme-kid .skin-name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
}
body.theme-kid .skin-cost {
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
}

/* Decorative — use VERY sparingly */
body.theme-kid .squiggle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 6'%3E%3Cpath d='M0 3 Q 20 0, 40 3 T 80 3 T 120 3' stroke='%23E08A1C' stroke-width='2' fill='none' stroke-linecap='round' opacity='0.6'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: bottom left;
  padding-bottom: 10px;
}

/* Encouragement card */
body.theme-kid .card-encourage {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 22px;
}

/* Mobile */
@media (max-width: 700px) {
  body.theme-kid .section-tile { padding: 20px 18px; }
  body.theme-kid .q-question { font-size: 18px; }
  body.theme-kid .option { font-size: 14.5px; padding: 14px 16px; }
}


/* ========================================================================
   PARENT THEME — slight refinement, still calm
   ======================================================================== */

body.theme-parent {
  background: var(--bg);
}
body.theme-parent h1, body.theme-parent h2 {
  letter-spacing: -0.03em;
  font-weight: 600;
}
body.theme-parent .card {
  border: 1px solid var(--line-soft);
}
body.theme-parent .nav {
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(250, 246, 240, 0.88);
}

/* ════════════════════════════════════════════════════════════
   PHASE 3 — Question UI redesign (spec: korva_question_ui_spec rev.2)
   Section 3A: Reading. q-header + bundled passage + Part cards.
   ════════════════════════════════════════════════════════════ */

:root {
  /* Section accents — four distinguishable hues that all sit inside the warm
     palette. Deliberately muted: the section is an orientation cue, not a
     decoration, and the orange is reserved for actions. */
  --sec-reading:  #C4653A;   /* terracotta */
  --sec-quant:    #4A7C59;   /* forest */
  --sec-abstract: #8B6F8E;   /* mauve */
  --sec-writing:  #B8860B;   /* ochre */
  --sec-reading-soft:  #F6E5DC;
  --sec-quant-soft:    #E8F0E9;
  --sec-abstract-soft: #F2EBF3;
  --sec-writing-soft:  #FAF2DF;
  /* Difficulty palette */
  --diff-easy-bg: var(--mint-50);  --diff-easy-fg: var(--mint);
  --diff-medium-bg: var(--bg-soft);  --diff-medium-fg: var(--ink-soft);
  --diff-hard-bg: var(--gold-50);  --diff-hard-fg: #8A6508;
  --diff-challenge-bg: var(--coral-50, #FFE9EC);  --diff-challenge-fg: #9A2740;
  /* Figure surface (used by Quant/Abstract) */
  --figure-bg: #FDFBF7;  --figure-border: var(--line);
}

/* ── Consistent question header (spec §3) ── */
.q-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 48px;
  padding: 0 var(--s-4) 0 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--s-5);
  overflow: hidden;
}
.q-header__spine {
  width: 4px;
  align-self: stretch;
  border-radius: var(--r-pill);
  background: var(--ink-faint);
  flex-shrink: 0;
}
.q-header--reading .q-header__spine { background: var(--sec-reading); }
.q-header__section {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: var(--s-3);
}
.q-header--reading .q-header__section { color: var(--sec-reading); }
.q-header__progress {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  margin-right: auto;
}
.q-header__timer {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  min-width: 56px;
  text-align: right;
}
.diff-pill {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.diff-easy      { background: var(--diff-easy-bg); color: var(--diff-easy-fg); }
.diff-medium    { background: var(--diff-medium-bg); color: var(--diff-medium-fg); }
.diff-hard      { background: var(--diff-hard-bg); color: var(--diff-hard-fg); }
.diff-challenge { background: var(--diff-challenge-bg); color: var(--diff-challenge-fg); }

/* ── Passage panel — grows to content, caps at viewport, scrolls only on overflow ── */
.q-passage-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--s-5);
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.q-passage-shell__title {
  flex-shrink: 0;
  padding: var(--s-3) var(--s-6);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-elev);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.q-passage-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-5) var(--s-6);
}
.q-passage-scroll .q-passage {
  font-family: 'Manrope', system-ui, sans-serif;
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.passage-pre { font-family: inherit; white-space: pre-wrap; margin: 0; }

/* ── Passage content — Option A: natural-wrap prose + left-gutter line numbers ──
   Each paragraph is one naturally-wrapping <p>; the browser wraps at word
   boundaries. A line-number marker (.ln) is emitted inline at every 5th logical
   chunk and absolutely-positioned into the left gutter at the line where that
   chunk begins. Logical line numbers stay valid for question references even
   though the visual wrapping is fluid. */
.passage-body { color: var(--ink); }
.passage-para {
  position: relative;
  padding-left: 34px;            /* gutter width for the line-number column */
  margin: 0 0 var(--s-4);
  line-height: 1.75;
}
.passage-para:last-child { margin-bottom: 0; }
.passage-para .ln {
  position: absolute;
  left: 0;
  width: 24px;
  text-align: right;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  user-select: none;
}
@media (max-width: 560px) {
  .passage-para { padding-left: 26px; }
  .passage-para .ln { width: 18px; }
}

/* survey_responses passage */
.survey-response {
  margin: 0 0 var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-soft);
  border-left: 3px solid var(--ink-mute);
  border-radius: var(--r-xs);
}
.survey-response:last-child { margin-bottom: 0; }
.response-label {
  font-family: 'Lexend', system-ui, sans-serif;
  font-weight: 600; font-size: 13px;
  color: var(--mint); margin-bottom: 4px; letter-spacing: 0.02em;
}
.response-attribution { color: var(--ink-mute); font-weight: 400; font-size: 12px; }
.response-text { color: var(--ink); line-height: 1.6; }

/* opinion_quotes passage */
.opinion-quote {
  margin: 0 0 var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--gold-50);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-xs);
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
}
.opinion-quote:last-child { margin-bottom: 0; }
.quote-label {
  font-family: 'Lexend', system-ui, sans-serif;
  font-style: normal; font-weight: 600; font-size: 12px;
  color: #B45309; margin-bottom: 4px; letter-spacing: 0.03em; text-transform: uppercase;
}
.quote-text { color: var(--ink); line-height: 1.6; font-size: 16px; }
.quote-attribution {
  margin-top: 6px; font-family: 'Lexend', system-ui, sans-serif;
  font-style: normal; font-size: 12.5px; color: var(--ink-mute);
}
.passage-type-poetry { font-family: 'Fraunces', Georgia, serif; font-style: italic; }
.passage-type-poetry .passage-para { line-height: 1.9; }

/* ── Part cards (Part A / B / C / D) ── */
.parts { display: flex; flex-direction: column; gap: var(--s-4); }
.part-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  padding: var(--s-6);
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
/* All Parts are interactive from the start and answerable in any order.
   The Part the student is currently working in gets a subtle accent outline. */
.part-card:focus-within {
  border-color: var(--sec-reading);
  box-shadow: var(--shadow-sm);
}
.part-card--answered { background: var(--surface-elev); }

.part-card__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.part-card__label {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sec-reading);
}
.part-card__skill {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-faint);
  background: var(--bg-soft);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.part-card__status {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  margin-left: auto;
}
.part-card__status.is-correct { color: var(--mint); }
.part-card__status.is-incorrect { color: var(--coral); }

.part-card .q-question {
  font-size: 24px;
  margin-bottom: var(--s-5);
}
.part-card__tools {
  display: flex;
  gap: var(--s-2);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--s-4);
}
.hint-btn--ghost {
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
}
.part-hint:not(:empty), .part-feedback:not(:empty) { margin-top: var(--s-4); }
.part-hint__loading { font-size: 14px; color: var(--ink-mute); text-align: center; }
.feedback-text { color: var(--ink-soft); margin-top: 6px; line-height: 1.55; }

.next-row {
  margin-top: var(--s-7);
  display: flex;
  gap: var(--s-3);
  justify-content: center;
}
.next-row.hidden { display: none; }

/* Option focus ring (keyboard a11y — spec §9) */
.option:focus-visible {
  outline: 2px solid var(--sec-reading);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .part-card { padding: var(--s-4); }
  .part-card .q-question { font-size: 20px; }
  .q-header { gap: var(--s-3); }
}
@media (prefers-reduced-motion: reduce) {
  .part-card { transition: none; }
}

/* ════════════════════════════════════════════════════════════
   PART 2.5 — Quant packs: q-header--quant + shared stimulus + figures
   Reuses .q-header, .diff-pill, .part-card, .option from the reading work.
   ════════════════════════════════════════════════════════════ */
.q-header--quant .q-header__spine { background: var(--sec-quant); }
.q-header--quant .q-header__section { color: var(--sec-quant); }

/* Shared stimulus panel — grows to content, caps at viewport, scrolls only on overflow */
.q-stimulus-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--s-5);
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.q-stimulus-shell__title {
  flex-shrink: 0;
  padding: var(--s-3) var(--s-6);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-elev);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sec-quant);
}
.q-stimulus-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--s-5) var(--s-6);
}
.q-stimulus-scroll > :last-child { margin-bottom: 0; }
.q-stimulus-text {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 var(--s-4);
}

/* Figures — diagrams + tables */
.q-figure {
  background: var(--figure-bg);
  border: 1px solid var(--figure-border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  margin: 0 0 var(--s-4);
  max-height: 320px;
  overflow: auto;
  text-align: center;
}
.q-figure svg { max-width: 100%; max-height: 288px; height: auto; }
.q-figure--table { padding: 0; }
.q-figure--table .q-data-table { max-width: 100%; }
@media (max-width: 560px) {
  .q-figure { max-height: 240px; }
  .q-figure svg { max-height: 208px; }
}

.q-data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 14px;
}
.q-data-table th, .q-data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}
.q-data-table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  background: var(--surface-elev);
}
.q-data-table tr:last-child td { border-bottom: none; }
.q-formula-cond { font-weight: 600; color: var(--ink-soft); }

/* Per-question stimulus pointer + standalone scenario pill */
.stimulus-ref {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-mute);
  margin-bottom: var(--s-3);
}
.scenario-name {
  display: inline-block;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--sec-quant);
  background: var(--mint-50);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  margin-bottom: var(--s-3);
}

/* Logic-puzzle constraints — broken out of the stem into a readable list */
.q-constraints {
  margin: var(--s-3) 0;
  padding-left: 1.5em;
  list-style: disc;
}
.q-constraints li {
  margin: 4px 0;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ════════════════════════════════════════════════════════════
   PART 1 (polish pass) — Stimulus-left / Q+options-right.
   Mobile (default): everything stacks. Stimulus on top, then the
   question + options below.
   Wide (≥900px): the page widens, and wherever a STIMULUS exists
   (reading passage, quant shared shell, per-question diagram or
   table, abstract SVG puzzle) the stimulus sits on the LEFT and
   the question + options sit on the RIGHT. Text-only quant
   questions (no stimulus) stay single-column.
   ════════════════════════════════════════════════════════════ */

/* --- Mobile-first defaults: explicit single-column stacks ---------------- */

.q-split,
.part-card__body--split,
.part-card__stim,
.part-card__ans,
.part-card__foot,
.abstract-layout {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.abstract-layout { gap: var(--s-4); margin-top: var(--s-5); }
.abstract-prompt {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  text-align: center;
}

/* --- Wide screens: stimulus left, Q+options right ----------------------- */

@media (min-width: 900px) {
  /* Text-only practice pages keep a comfortable reading width. */
  .q-page { max-width: 1080px; }
  /* Layouts with a stimulus on the left get to use the available width
     more generously — split into two real columns. Capped so even on a
     27" monitor the right-column reading length stays sane. */
  .q-page--split { max-width: min(95vw, 1500px); }

  /* Reading: passage on the left, Part-card column on the right. */
  .q-split--reading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--s-6);
    align-items: start;
  }
  .q-split--reading > .q-passage-shell {
    position: sticky;
    top: 72px; /* clears the sticky q-header — max-height is on .q-passage-shell already */
  }

  /* Quant packs (shared stimulus): stim shell left, Part-card column right. */
  .q-split--quant-pack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--s-6);
    align-items: start;
  }
  .q-split--quant-pack > .q-stimulus-shell {
    position: sticky;
    top: 72px;
    /* max-height + internal scroll are on .q-stimulus-shell + .q-stimulus-scroll already */
  }

  /* Quant standalone with a per-question diagram / table: split the card
     body into stim-left / ans-right; foot (tools, hint, feedback) spans
     full width below. Text-only standalone cards do NOT get this class
     and render single-column. */
  .part-card__body--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "stim ans"
      "foot foot";
    column-gap: var(--s-6);
    row-gap: var(--s-4);
    align-items: start;
  }
  .part-card__body--split .scenario-name,
  .part-card__body--split .stimulus-ref { grid-column: 1 / -1; }
  .part-card__body--split .part-card__stim { grid-area: stim; }
  .part-card__body--split .part-card__ans  { grid-area: ans; }
  .part-card__body--split .part-card__foot { grid-area: foot; }
  .part-card__body--split .q-question { margin-bottom: var(--s-3); }

  /* Abstract: SVG puzzle left, prompt + 2×2 options right. */
  .abstract-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas:
      "stim prompt"
      "stim opts";
    column-gap: var(--s-6);
    row-gap: var(--s-4);
    align-items: start;
  }
  .abstract-layout > .abstract-stage {
    grid-area: stim;
    margin-top: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .abstract-stage svg { max-width: 520px; height: auto; }
  .abstract-layout > .abstract-prompt  { grid-area: prompt; margin: 0; text-align: left; }
  .abstract-layout > .abstract-options {
    grid-area: opts;
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ════════════════════════════════════════════════════════════════════════
   KORVA v3 — FULL-VIEWPORT LAYER
   ------------------------------------------------------------------------
   Loads LAST on purpose. The legacy sheet above centres everything inside a
   1140px column, which letterboxes the product on any screen wider than a
   laptop and makes it read as a document rather than a service. Rather than
   surgically unpicking ~2000 lines, this layer overrides the layout
   primitives at the same specificity and wins on source order.

   The rule this whole layer enforces: STRUCTURE spans the viewport, TEXT
   does not. A grid row runs edge to edge; a paragraph inside it is capped at
   a readable measure. Those are different jobs, and the old sheet conflated
   them by capping the row.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* Fluid gutter — grows with the viewport instead of snapping at
     breakpoints. 20px on a phone, ~64px on a desktop, capped so ultrawide
     does not drift. */
  --gutter: clamp(20px, 4vw, 64px);
  --gutter-lg: clamp(24px, 6vw, 96px);

  /* Readable measure. Text blocks get one of these; layout rows never do. */
  --measure: 68ch;
  --measure-tight: 58ch;
  --measure-wide: 78ch;

  /* Fluid type scale — clamp() so there is no dead zone between breakpoints */
  --fs-display: clamp(2.5rem, 1.4rem + 4.4vw, 5rem);
  --fs-h1: clamp(2rem, 1.3rem + 2.6vw, 3.5rem);
  --fs-h2: clamp(1.5rem, 1.15rem + 1.4vw, 2.25rem);
  --fs-h3: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  --fs-lead: clamp(1.05rem, 0.98rem + 0.4vw, 1.3rem);
  --fs-body: clamp(0.98rem, 0.95rem + 0.15vw, 1.06rem);
  --fs-sm: 0.875rem;
  --fs-xs: 0.78rem;

  /* Vertical rhythm between full-width bands */
  --band-y: clamp(48px, 7vw, 120px);
}

/* ── 1. Kill the letterbox ────────────────────────────────────────────── */

body { overflow-x: hidden; }

.page,
.page-narrow,
.page-narrowest {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(24px, 3.5vw, 56px) var(--gutter) clamp(56px, 7vw, 96px);
}

/* The narrow variants keep their *reading* constraint, but as an inner
   measure rather than an outer container — so the background still bleeds. */
.page-narrow > *,
.page-narrowest > * {
  max-width: var(--measure-wide);
  margin-left: auto;
  margin-right: auto;
}
.page-narrowest > * { max-width: 460px; }

/* Full-bleed helper: escape any padded parent, edge to edge. */
.k-bleed {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

/* A band is a full-width horizontal stripe. Its CHILD gets the padding. */
.k-band { width: 100%; padding: var(--band-y) var(--gutter); }
.k-band--flush { padding-top: 0; }
.k-band--cream { background: var(--bg); }
.k-band--soft { background: var(--bg-soft); }
.k-band--ink { background: #211E1B; color: #F5F0E8; }
.k-band--ink h1, .k-band--ink h2, .k-band--ink h3 { color: #FDFBF7; }
.k-band--ink p { color: #C9C0B4; }

/* Text measure helpers — the ONLY things that get a max-width. */
.k-measure { max-width: var(--measure); }
.k-measure-tight { max-width: var(--measure-tight); }
.k-measure-wide { max-width: var(--measure-wide); }
.k-center-measure { max-width: var(--measure); margin-inline: auto; }

/* ── 2. Nav — full width, logo left, links right ──────────────────────── */

.nav {
  width: 100%;
  border-bottom: 1px solid var(--line-soft);
  /* Was rgba(250, 246, 240, .88) — the cream, hardcoded rather than read from
     --bg, so re-pointing the token left a warm bar above every cool page. */
  background: rgba(252, 251, 250, 0.88);
}
.nav-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 40px);
}
.nav-brand { margin-right: auto; font-size: 1.25rem; }
.nav-links { display: flex; align-items: center; gap: clamp(4px, 1.4vw, 26px); }
.nav-link {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: var(--r-xs);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--ink); background: var(--bg-soft); }
.nav-link.active { color: var(--accent); font-weight: 600; }

.brand-mark {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 18px; font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* ── 3. Footer — full width ───────────────────────────────────────────── */

.korva-footer {
  width: 100%;
  margin-top: var(--band-y);
  padding: clamp(32px, 4vw, 56px) var(--gutter);
  background: #211E1B;
  border-top: none;
  color: #A79E92;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 0.85rem;
}
.korva-footer-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
}
.korva-footer-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-size: 1.05rem; color: #F5F0E8;
}
.korva-footer-sep { color: #55504A; }
.korva-footer-meta { flex: 1 1 auto; min-width: 220px; color: #8B8378; }
.korva-footer-links { display: flex; gap: clamp(12px, 1.6vw, 26px); flex-wrap: wrap; }
.korva-footer-links a { color: #C9C0B4; }
.korva-footer-links a:hover { color: var(--accent); text-decoration: none; }

/* ── 4. Fluid grid system ─────────────────────────────────────────────── */

/* Auto-fit grid: columns appear as room allows, no breakpoint needed.
   This is what makes ultrawide fill instead of stretching two huge cards. */
.k-grid { display: grid; gap: clamp(16px, 1.8vw, 32px); }
.k-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.k-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.k-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.k-grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* Editorial split: asymmetric, collapses to stacked below 900px. */
.k-split {
  display: grid;
  gap: clamp(28px, 4vw, 72px);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .k-split { grid-template-columns: 1.05fr 0.95fr; }
  .k-split--wide-left { grid-template-columns: 1.35fr 0.65fr; }
  .k-split--wide-right { grid-template-columns: 0.65fr 1.35fr; }
}

/* Sidebar layout — the dashboard/practice shell. Sidebar is a fixed rail,
   main takes ALL remaining space at every width. */
.k-shell { display: grid; grid-template-columns: 1fr; gap: clamp(20px, 2.2vw, 40px); width: 100%; }
@media (min-width: 1024px) {
  .k-shell { grid-template-columns: minmax(240px, 20vw) minmax(0, 1fr); align-items: start; }
  .k-shell--rail { grid-template-columns: minmax(230px, 18vw) minmax(0, 1fr) minmax(260px, 22vw); }
  .k-shell__aside { position: sticky; top: 84px; }
}
/* Between 1024 and 1320 the right rail would squeeze main too hard — drop it
   under main instead of shrinking everything. */
@media (min-width: 1024px) and (max-width: 1319px) {
  .k-shell--rail { grid-template-columns: minmax(230px, 22vw) minmax(0, 1fr); }
  .k-shell--rail > .k-shell__rail { grid-column: 2; }
}

/* ── 5. Typography ────────────────────────────────────────────────────── */

body { font-size: var(--fs-body); line-height: 1.65; }
h1 { font-size: var(--fs-h1); line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; }
h2 { font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; }
h3 { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; }
p  { line-height: 1.7; }

.k-display {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.k-lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--ink-soft); }
.k-eyebrow {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.k-serif { font-family: 'Fraunces', Georgia, serif; }
/* Editorial accent — a single word set in italic serif, our one flourish. */
.k-accent-word { font-style: italic; color: var(--accent); }

/* ── 6. Buttons ───────────────────────────────────────────────────────── */

.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 0.97rem; font-weight: 500;
  padding: 14px 26px;
  border-radius: var(--r-xs);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .16s var(--ease-out), border-color .16s, color .16s, transform .16s var(--ease-out), box-shadow .16s;
}
.k-btn:active { transform: translateY(1px); }
.k-btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs); }
.k-btn--primary:hover { background: var(--accent-hover); color: #fff; box-shadow: var(--shadow-glow); }
.k-btn--secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.k-btn--secondary:hover { border-color: var(--ink-mute); background: var(--surface); color: var(--ink); }
.k-btn--ghost { background: transparent; color: var(--ink-soft); padding-inline: 12px; }
.k-btn--ghost:hover { color: var(--accent); }
.k-btn--lg { padding: 17px 34px; font-size: 1.03rem; }
.k-btn--block { width: 100%; }

/* ── 7. Cards + surfaces ──────────────────────────────────────────────── */

.k-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: clamp(20px, 2vw, 32px);
  transition: border-color .18s, box-shadow .18s, transform .18s var(--ease-out);
}
.k-card--interactive:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.k-card--flush { padding: 0; overflow: hidden; }
.k-card--quiet { background: transparent; border-color: var(--line); }

/* Numbered step marker — replaces emoji bullets. */
.k-step-num {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.95rem; font-weight: 600;
}

/* Icon frame for inline SVG icons — replaces emoji. */
.k-icon {
  width: 22px; height: 22px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.k-icon-frame {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.k-icon-frame--quiet { background: var(--bg-soft); color: var(--ink-soft); }

/* Hairline divider that spans its container. */
.k-rule { height: 1px; background: var(--line); border: 0; width: 100%; }

/* ── 8. Data display ──────────────────────────────────────────────────── */

.k-stat { display: flex; flex-direction: column; gap: 4px; }
.k-stat__value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.6rem);
  font-weight: 600; line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.k-stat__label { font-size: var(--fs-sm); color: var(--ink-mute); }

.k-meter { height: 6px; width: 100%; background: var(--bg-soft); border-radius: var(--r-pill); overflow: hidden; }
.k-meter__fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .5s var(--ease-out); }
.k-meter__fill--quiet { background: var(--ink-faint); }
.k-meter__fill--good { background: var(--mint); }

.k-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 500;
  padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--bg-soft); color: var(--ink-soft);
}
.k-tag--accent { background: var(--accent-soft); color: var(--accent); }
.k-tag--outline { background: transparent; border: 1px solid var(--line); color: var(--ink-mute); }

/* ── 9. Forms ─────────────────────────────────────────────────────────── */

.k-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.k-label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.k-input {
  width: 100%;
  padding: 13px 15px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  transition: border-color .15s, box-shadow .15s;
}
.k-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.k-input::placeholder { color: var(--ink-faint); }
.k-hint { font-size: var(--fs-sm); color: var(--ink-mute); }
.k-error {
  padding: 12px 15px; border-radius: var(--r-xs);
  background: var(--coral-50); color: #8C3A26;
  border: 1px solid #EFCFC5; font-size: var(--fs-sm);
}

/* Focus ring — accessibility, applied globally. */
a:focus-visible, button:focus-visible, .k-btn:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── 10. Auth shell — full viewport, centred form, edge-to-edge bg ────── */

.k-auth {
  min-height: calc(100vh - 70px);
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}
.k-auth__form-col {
  padding: clamp(40px, 6vw, 80px) var(--gutter);
  display: flex; flex-direction: column; justify-content: center;
  width: 100%;
}
.k-auth__inner { width: 100%; max-width: 420px; margin-inline: auto; }
.k-auth__aside { display: none; }
@media (min-width: 900px) {
  .k-auth { grid-template-columns: 1fr 1fr; }
  .k-auth__aside {
    display: flex; flex-direction: column; justify-content: center;
    padding: var(--gutter-lg);
    /* Was #211E1B / #E8E1D7 — a warm near-black left over from the cream
       palette, which read as brown next to the new blue. Now the ink token. */
    background: var(--k-ink, #1A1128);
    color: #E4E0EE;                 /* 14.2:1 on --k-ink */
    min-height: calc(100vh - 70px);
  }
  .k-auth__inner { margin-inline: 0 auto; }
}
@media (min-width: 1440px) {
  .k-auth { grid-template-columns: 1fr 1.1fr; }
  .k-auth__inner { max-width: 460px; }
}

/* ── 11. Practice shell ───────────────────────────────────────────────── */

/* Overrides the legacy .q-page cap so the question area fills the viewport. */
.q-page {
  max-width: none !important;
  width: 100%;
  padding: clamp(18px, 2.2vw, 36px) var(--gutter) clamp(48px, 6vw, 80px);
}
.k-practice {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 2.4vw, 44px);
  align-items: start;
}
@media (min-width: 1100px) {
  /* Stimulus left, interaction right — the ACER paper split. */
  .k-practice--split { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
  .k-practice__aside { position: sticky; top: 84px; }
}
@media (min-width: 1600px) {
  .k-practice--split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
}
/* Passage text keeps a reading measure even though its container is fluid. */
.k-passage { max-width: var(--measure-wide); font-size: 1.02rem; line-height: 1.8; }

/* Option buttons — restrained, no toy gradients. */
.k-option {
  display: flex; align-items: flex-start; gap: 14px;
  width: 100%; text-align: left;
  padding: 15px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 1rem; color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s var(--ease-out);
}
.k-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.k-option:disabled { cursor: default; }
.k-option__key {
  width: 27px; height: 27px; flex: none;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--bg-soft); color: var(--ink-soft);
  font-family: 'Lexend', sans-serif; font-size: 0.82rem; font-weight: 600;
  transition: background .15s, color .15s;
}
.k-option:hover .k-option__key { background: var(--accent); color: #fff; }
.k-option--correct { border-color: var(--mint); background: var(--mint-50); }
.k-option--correct .k-option__key { background: var(--mint); color: #fff; }
.k-option--wrong { border-color: var(--coral); background: var(--coral-50); }
.k-option--wrong .k-option__key { background: var(--coral); color: #fff; }

/* Progress — a hairline, not a game bar. */
.k-progress { display: flex; align-items: center; gap: 14px; width: 100%; }
.k-progress__track { flex: 1; height: 3px; background: var(--line); border-radius: var(--r-pill); overflow: hidden; }
.k-progress__fill { height: 100%; background: var(--accent); transition: width .4s var(--ease-out); }
.k-progress__label { font-size: var(--fs-xs); color: var(--ink-mute); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── 12. Responsive — the five tested breakpoints ─────────────────────── */

/* 375px — mobile portrait. Single column everywhere. */
@media (max-width: 640px) {
  .nav-inner { padding: 12px var(--gutter); }
  .k-split, .k-shell, .k-practice { grid-template-columns: 1fr !important; }
  .k-btn--block-mobile { width: 100%; }
  .korva-footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .k-shell__aside, .k-practice__aside { position: static; }
}

/* 768px — tablet. Two-up grids, nav still horizontal. */
@media (min-width: 641px) and (max-width: 1023px) {
  .k-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* 1440px — desktop. Wider gutters; grids gain a column naturally via auto-fit. */
@media (min-width: 1440px) {
  .k-band { padding-inline: var(--gutter-lg); }
  .page, .page-narrow, .page-narrowest, .q-page, .nav-inner, .korva-footer { padding-inline: var(--gutter-lg); }
}

/* 1920px+ — ultrawide. Content must FILL, not stretch: gutters grow a little
   and grids gain columns, but nothing is centred into a letterbox. */
@media (min-width: 1920px) {
  :root { --gutter-lg: clamp(96px, 7vw, 160px); }
  .k-grid--3 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
  .k-grid--4 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .k-shell--rail { grid-template-columns: minmax(260px, 16vw) minmax(0, 1fr) minmax(300px, 20vw); }
}

/* Motion respect */
@media (prefers-reduced-motion: reduce) {
  .k-card--interactive:hover { transform: none; }
  .k-btn:active { transform: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   KORVA v3 — LANDING PAGE
   Every section is a full-width band; only text carries a measure.
   ════════════════════════════════════════════════════════════════════════ */

.lp-hero { padding-top: clamp(40px, 5vw, 88px); padding-bottom: clamp(48px, 6vw, 104px); }
.lp-hero__copy { min-width: 0; }

.lp-hero__meta {
  display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 52px);
  padding-top: 28px; border-top: 1px solid var(--line);
}
.lp-meta-item { display: flex; flex-direction: column; gap: 2px; }
.lp-meta-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.5rem, 1.1rem + 1.1vw, 2rem);
  font-weight: 600; color: var(--ink); line-height: 1;
}
.lp-meta-label { font-size: var(--fs-sm); color: var(--ink-mute); }

/* Proof panel — a question card rendered as the child sees it. */
.lp-proof {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-width: 0;
}
.lp-proof__chrome {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.lp-proof__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.lp-proof__chrome-label {
  margin-left: auto; font-size: var(--fs-xs); color: var(--ink-mute);
  font-family: 'Lexend', sans-serif; letter-spacing: .02em;
}
.lp-proof__body { padding: clamp(20px, 2vw, 30px); }
.lp-proof__stem {
  font-size: 1.02rem; line-height: 1.6; color: var(--ink);
  margin-bottom: 18px; font-weight: 500;
}
.lp-proof__opts { display: flex; flex-direction: column; gap: 9px; }
.lp-proof__opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font-size: .94rem; color: var(--ink-soft);
}
.lp-proof__opt.is-correct {
  border-color: var(--mint); background: var(--mint-50); color: var(--ink);
}
.lp-proof__key {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center; border-radius: 6px;
  background: var(--bg-soft); color: var(--ink-mute);
  font-size: .76rem; font-weight: 600; font-family: 'Lexend', sans-serif;
}
.lp-proof__opt.is-correct .lp-proof__key { background: var(--mint); color: #fff; }
.lp-proof__why {
  margin-top: 18px; padding: 15px 16px;
  background: var(--bg-soft); border-radius: var(--r-xs);
  font-size: .9rem; line-height: 1.6; color: var(--ink-soft);
}

/* Argument band */
.lp-argument__lead { margin-bottom: clamp(32px, 4vw, 56px); }
.lp-contrast {
  padding: 22px 24px;
  border: 1px solid #3A3530;
  border-radius: var(--r-sm);
  background: #262320;
}
.lp-contrast__label {
  font-family: 'Lexend', sans-serif; font-size: .68rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: #7C736A; margin-bottom: 10px;
}
.lp-contrast p { margin: 0; color: #B8AFA3; font-size: .96rem; }
.lp-contrast--ours { border-color: rgba(232, 93, 47, .45); background: #2C241F; }
.lp-contrast--ours .lp-contrast__label { color: var(--accent); }
.lp-contrast--ours p { color: #EFE8DE; }

/* Section heads */
.lp-section-head { margin-bottom: clamp(32px, 4vw, 60px); }

/* Approach cards */
.lp-step { display: flex; flex-direction: column; gap: 12px; }
.lp-step h3 { margin: 4px 0 0; }
.lp-step p { margin: 0; font-size: .96rem; }
.lp-step__skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }

/* Sample band */
.lp-passage-card { min-width: 0; }
.lp-passage__head { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-passage__body p { margin-bottom: 14px; }
.lp-passage__body p:last-child { margin-bottom: 0; }
.lp-marking { display: flex; flex-direction: column; gap: 22px; }
.lp-marking__item p { font-size: .97rem; color: var(--ink-soft); }

/* Dashboard preview */
.lp-dash-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: clamp(22px, 2.4vw, 34px);
  box-shadow: var(--shadow-md);
  min-width: 0;
}
.lp-dash__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.lp-dash__skills { display: flex; flex-direction: column; gap: 18px; }
.lp-dash__skill span { font-size: .93rem; color: var(--ink-soft); }

/* Check lists — a hairline rule, not a tick emoji. */
.lp-check-list { list-style: none; padding: 0; margin: 0; }
.lp-check-list li {
  position: relative; padding: 11px 0 11px 26px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft); font-size: .98rem;
}
.lp-check-list li:last-child { border-bottom: 0; }
.lp-check-list li::before {
  content: ''; position: absolute; left: 2px; top: 19px;
  width: 11px; height: 2px; background: var(--accent); border-radius: 2px;
}

/* Trust grid */
.lp-trust { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.lp-trust .k-icon { width: 26px; height: 26px; color: var(--accent); stroke-width: 1.5; }
.lp-trust h3 { font-size: 1.06rem; margin: 6px 0 0; }
.lp-trust p { margin: 0; font-size: .95rem; }

/* Pricing */
.lp-price-card {
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-lg);
  padding: clamp(28px, 3vw, 44px);
  box-shadow: var(--shadow-lg);
}
.lp-price { display: flex; align-items: baseline; gap: 8px; }
.lp-price__amount {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(3rem, 2rem + 3vw, 4.4rem);
  font-weight: 600; line-height: 1; color: var(--ink); letter-spacing: -0.03em;
}
.lp-price__period { font-size: 1.05rem; color: var(--ink-mute); }

/* FAQ */
.lp-faq__item {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 0;
  overflow: hidden;
}
.lp-faq__item summary {
  cursor: pointer; list-style: none;
  padding: 18px 20px;
  font-weight: 500; color: var(--ink); font-size: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.lp-faq__item summary::-webkit-details-marker { display: none; }
.lp-faq__item summary::after {
  content: ''; flex: none; width: 9px; height: 9px;
  border-right: 1.8px solid var(--ink-mute); border-bottom: 1.8px solid var(--ink-mute);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s var(--ease-out);
}
.lp-faq__item[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.lp-faq__item[open] summary { color: var(--accent); }
.lp-faq__item p { margin: 0; padding: 0 20px 20px; font-size: .96rem; color: var(--ink-soft); }

/* Closing CTA */
.lp-close { text-align: center; }
.lp-close .k-display { font-size: clamp(2rem, 1.4rem + 2.8vw, 3.6rem); }

/* Landing responsive tuning */
@media (max-width: 899px) {
  .lp-hero__meta { gap: 20px 32px; }
  .lp-proof { margin-top: 8px; }
}
@media (max-width: 640px) {
  .lp-hero { padding-top: 32px; }
  .lp-meta-item { flex: 1 1 40%; }
  .lp-price-card { padding: 26px 22px; }
}

/* ════════════════════════════════════════════════════════════════════════
   KORVA v3 — MOBILE NAV + OVERFLOW GUARDS
   ------------------------------------------------------------------------
   The v3 layer above sets `.nav-links { display: flex }`. Media queries add
   no specificity, so that plain rule beat the legacy
   `@media (max-width:700px) { .nav-links { display:none } }` purely on source
   order — which left the mobile menu permanently open, overlapping the hero.
   These rules restore the collapse and restyle the panel warm. They must stay
   AFTER the v3 layer.
   ════════════════════════════════════════════════════════════════════════ */

/* Grid/flex children must be allowed to shrink below their content width, or
   a long unbroken string forces the whole page wider than the viewport. */
.k-split > *, .k-shell > *, .k-grid > *, .k-practice > * { min-width: 0; }
.k-band { max-width: 100vw; overflow-wrap: break-word; }

.nav-burger {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: var(--r-xs);
  background: transparent; border: 1px solid var(--line);
  margin-left: auto;
}
.nav-burger:hover { background: var(--bg-soft); }
.nav-burger span { display: block; width: 16px; height: 1.6px; background: var(--ink); border-radius: 2px; }

@media (max-width: 860px) {
  .nav-burger { display: flex; }
  .nav-brand { margin-right: 0; }

  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: var(--gutter); right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 14px; border-radius: var(--r-xs); }
  .nav-links .k-btn { width: 100%; margin-top: 6px; }
  .nav { position: sticky; }
  .nav-inner { position: relative; }
}

/* Landing hero: stack cleanly and never exceed the viewport on small screens. */
@media (max-width: 640px) {
  .lp-hero__copy .k-btn { width: 100%; }
  .lp-hero__meta { gap: 18px 24px; }
  .lp-meta-item { flex: 1 1 100%; }
  .lp-proof__opt { font-size: .9rem; }
  .lp-argument__grid { gap: 12px; }
}

/* ════════════════════════════════════════════════════════════════════════
   KORVA v3 — AUTH + SUBSCRIBE
   ════════════════════════════════════════════════════════════════════════ */

/* The dark aside panel on login/register */
.auth-quote {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.75rem);
  line-height: 1.4;
  color: #FFFFFF;
  letter-spacing: -0.015em;
}
/* ⚑ These all sit on .k-auth__aside, which is near-black. --accent is the
   text-on-LIGHT blue (#2f5fa8) and measures ~2.6:1 here, so it is deliberately
   NOT used on this panel — a light purple carries the same brand read at 9.9:1.
   The same trap applies to any future addition inside the aside. */
.auth-quote em { font-style: italic; color: #C9BCFA; }

.auth-points { list-style: none; padding: 0; margin: 0; }
.auth-points li {
  position: relative;
  padding: 10px 0 10px 24px;
  color: #ABA4C0;                 /* 7.4:1 on --k-ink */
  font-size: .96rem;
}
.auth-points li::before {
  content: ''; position: absolute; left: 0; top: 19px;
  width: 11px; height: 2px; background: #7e3df4; border-radius: 2px;
}

.auth-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 22px; }
.auth-steps li { display: flex; gap: 16px; align-items: flex-start; }
.auth-steps__n {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  /* These rgba()s hardcoded the old orange rather than reading --accent, so
     re-pointing the token left three brown discs on a near-black panel. They
     are the purple now, and --accent is not used here because it is a
     text-on-LIGHT blue that would disappear against this background. */
  border: 1px solid rgba(126, 61, 244, .55);
  background: rgba(126, 61, 244, .22);
  color: #C9BCFA;                 /* 9.9:1 on --k-ink */
  font-family: 'Fraunces', Georgia, serif; font-size: .9rem; font-weight: 600;
}
.auth-steps strong { color: #FFFFFF; font-weight: 600; display: block; margin-bottom: 3px; }
.auth-steps p { margin: 0; color: #ABA4C0; font-size: .9rem; line-height: 1.55; }

/* Guardian consent block */
.auth-consent {
  margin-top: 6px;
  padding: 15px 17px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.auth-consent label {
  display: flex; gap: 12px; align-items: flex-start;
  cursor: pointer; font-size: .87rem; line-height: 1.55; color: var(--ink-soft);
}
.auth-consent input[type="checkbox"] {
  margin-top: 3px; flex: none;
  width: 17px; height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}
.auth-consent strong { color: var(--ink); font-weight: 600; }
.auth-consent a { color: var(--accent); text-decoration: underline; }

/* On short viewports the auth panel should not force a scroll for no reason. */
@media (max-width: 899px) {
  .k-auth { min-height: 0; }
  .k-auth__form-col { padding-block: clamp(36px, 8vw, 64px); }
}

/* ── Subscribe ────────────────────────────────────────────────────────── */

.sub-hero { padding-top: clamp(36px, 4.5vw, 72px); }
.sub-confirm { padding-block: clamp(64px, 10vw, 140px); }

.sub-features { list-style: none; padding: 0; margin: 0 0 32px; }
.sub-features li {
  position: relative;
  padding: 12px 0 12px 26px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: .98rem;
}
.sub-features li:last-child { border-bottom: 0; }
.sub-features li::before {
  content: ''; position: absolute; left: 2px; top: 21px;
  width: 11px; height: 2px; background: var(--accent); border-radius: 2px;
}

.sub-disclosure {
  padding: 20px 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--terracotta);
  border-radius: var(--r-sm);
}
.sub-disclosure h4 {
  margin: 0 0 12px;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: .82rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink);
}
.sub-disclosure ul { list-style: none; padding: 0; margin: 0; }
.sub-disclosure li {
  position: relative;
  padding: 7px 0 7px 18px;
  font-size: .88rem; line-height: 1.6; color: var(--ink-soft);
}
.sub-disclosure li::before {
  content: ''; position: absolute; left: 0; top: 16px;
  width: 7px; height: 1px; background: var(--ink-faint);
}
.sub-disclosure strong { color: var(--ink); font-weight: 600; }
.sub-disclosure a { color: var(--accent); text-decoration: underline; }

.sub-panel {
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-lg);
  padding: clamp(26px, 3vw, 40px);
  box-shadow: var(--shadow-lg);
  position: sticky; top: 90px;
}
@media (max-width: 899px) { .sub-panel { position: static; } }

.sub-trust { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.sub-trust li { display: flex; gap: 12px; align-items: flex-start; font-size: .88rem; color: var(--ink-soft); line-height: 1.55; }
.sub-trust .k-icon { width: 19px; height: 19px; color: var(--ink-mute); margin-top: 1px; }

/* ════════════════════════════════════════════════════════════════════════
   KORVA v3 — PARENT DASHBOARD
   Data as narrative: one headline metric, then the parts that make it up,
   then the skill map. Sidebar on desktop, single column on mobile.
   ════════════════════════════════════════════════════════════════════════ */

.dash-head {
  display: flex; flex-wrap: wrap; gap: 20px;
  align-items: flex-end; justify-content: space-between;
  padding-bottom: 26px; margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.dash-head__status { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Banners */
.dash-banner {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  padding: 18px 22px; margin-bottom: 20px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-mute);
}
.dash-banner strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: 3px; }
.dash-banner p { margin: 0; font-size: .92rem; color: var(--ink-soft); max-width: var(--measure); }
.dash-banner--warn { border-left-color: var(--gold); background: var(--gold-50); }
.dash-banner--stop { border-left-color: var(--coral); background: var(--coral-50); }
.dash-banner--note { border-left-color: var(--accent); background: var(--accent-soft); }

.dash-empty { text-align: center; padding: clamp(40px, 6vw, 80px); }
.dash-empty .k-measure { margin-inline: auto; }

/* Sidebar */
.dash-aside { display: flex; flex-direction: column; }
.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-xs);
  color: var(--ink); transition: background .15s;
}
.dash-nav__item:hover { background: var(--bg-soft); color: var(--ink); }
.dash-nav__avatar {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-family: 'Fraunces', Georgia, serif; font-weight: 600; font-size: 1rem;
}
.dash-nav__meta { display: flex; flex-direction: column; min-width: 0; }
.dash-nav__name { font-weight: 500; font-size: .97rem; }
.dash-nav__sub { font-size: .8rem; color: var(--ink-mute); }

.dash-aside__links { display: flex; flex-direction: column; gap: 14px; }
.dash-link { font-size: .92rem; color: var(--ink-soft); }
.dash-link:hover { color: var(--accent); }
.dash-link--danger { color: var(--coral); }
.dash-link--danger:hover { color: #8C3A26; text-decoration: underline; }
.dash-link--inline { font-size: .87rem; }

/* Main column */
.dash-main { display: flex; flex-direction: column; gap: clamp(36px, 5vw, 72px); min-width: 0; }
.dash-child { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 90px; }
.dash-child__head {
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: flex-end; justify-content: space-between;
}
.dash-child__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-child__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* Metric row — auto-fit so it gains columns on wider screens. */
.dash-metrics {
  display: grid; gap: clamp(14px, 1.4vw, 20px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: stretch;
}
/* The test-ready card is the headline: give it more room where there is room. */
@media (min-width: 900px) {
  .dash-metrics { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 641px) and (max-width: 899px) {
  .dash-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-trs { grid-column: 1 / -1; }
}

.dash-trs {
  background: #211E1B;
  border-radius: var(--r-md);
  padding: clamp(22px, 2.2vw, 32px);
  color: #E8E1D7;
  display: flex; flex-direction: column;
  min-width: 0;
}
.dash-trs .k-eyebrow { color: #8B8378; }
.dash-trs__score {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(2.6rem, 1.8rem + 2.6vw, 4rem);
  font-weight: 600; line-height: 1; color: #FDFBF7;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.dash-trs__score span { font-size: .32em; color: #8B8378; margin-left: 4px; }
.dash-trs__score--pending { color: #55504A; }
.dash-trs .k-hint { color: #8B8378; margin-top: 6px; }
.dash-trs__parts { display: flex; flex-direction: column; gap: 14px; margin-top: auto; padding-top: 24px; }
.dash-trs__part-label { font-size: .78rem; color: #A79E92; margin-bottom: 6px; }
.dash-trs__part-value { font-size: .78rem; color: #8B8378; margin-top: 5px; font-variant-numeric: tabular-nums; }
.dash-trs .k-meter { background: #3A3530; height: 5px; }

.dash-stat-card { display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; }

/* Skill mastery — rows, not a heat grid. Legible at a glance. */
.dash-mastery { min-width: 0; }
.dash-skills {
  display: grid; gap: 6px 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.dash-skill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 54px;
  align-items: center; gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.dash-skill__label {
  font-size: .92rem; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-skill__bar { height: 5px; background: var(--bg-soft); border-radius: var(--r-pill); overflow: hidden; }
.dash-skill__bar span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--ink-faint); }
.dash-skill__value { font-size: .82rem; color: var(--ink-mute); text-align: right; font-variant-numeric: tabular-nums; }
/* Mastery bands — muted, never traffic-light. */
.dash-skill[data-level="1"] .dash-skill__bar span { background: var(--coral); }
.dash-skill[data-level="2"] .dash-skill__bar span { background: #C98A4B; }
.dash-skill[data-level="3"] .dash-skill__bar span { background: var(--gold); }
.dash-skill[data-level="4"] .dash-skill__bar span { background: #6E9B6B; }
.dash-skill[data-level="5"] .dash-skill__bar span { background: var(--mint); }
.dash-skill[data-level="0"] .dash-skill__bar span { background: transparent; }

@media (max-width: 640px) {
  .dash-head { align-items: flex-start; }
  .dash-skill { grid-template-columns: minmax(0, 1fr) 70px 46px; gap: 10px; }
  .dash-child__actions .k-btn { width: 100%; }
}

/* ════════════════════════════════════════════════════════════════════════
   KORVA v3 — PRACTICE SURFACES
   The markup and class names are deliberately unchanged: the page JS binds to
   .option / .part-card / .feedback-card / .hint-bubble by name. Everything
   here is a restyle of those existing hooks, so behaviour is untouched.
   ════════════════════════════════════════════════════════════════════════ */

/* Practice nav is quieter than the marketing nav. */
.monitored-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: var(--bg-soft); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 500; color: var(--ink-soft);
}
.monitored-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }

/* Question header strip */
.q-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: clamp(18px, 2vw, 28px);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.q-header__spine { display: none; }
.q-header__section {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: .74rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.q-header__progress { font-size: .88rem; color: var(--ink-mute); }
.q-header__timer {
  margin-left: auto; font-variant-numeric: tabular-nums;
  font-size: .88rem; color: var(--ink-mute);
}

/* Toolbar chips */
.q-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: clamp(16px, 2vw, 26px); }
.chip, .chip-lilac, .chip-mint {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: var(--r-pill);
  background: var(--bg-soft); color: var(--ink-soft);
  font-size: .78rem; font-weight: 500;
  border: 1px solid var(--line-soft);
}
.diff-pill {
  padding: 6px 13px; border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 500;
  background: var(--bg-soft); color: var(--ink-soft); border: 1px solid var(--line-soft);
}

/* Two-column stimulus/questions split — fills the viewport. */
.q-split {
  display: grid; grid-template-columns: 1fr;
  gap: clamp(20px, 2.4vw, 40px); align-items: start; width: 100%;
}
@media (min-width: 1100px) {
  .q-split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
  .q-passage-shell { position: sticky; top: 84px; }
}
@media (min-width: 1600px) { .q-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }

.q-passage-shell {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden; min-width: 0;
}
.q-passage-shell__title {
  padding: 16px 22px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem; font-weight: 600; color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
}
.q-passage-scroll { max-height: min(72vh, 780px); overflow-y: auto; }
.q-passage {
  padding: clamp(18px, 1.8vw, 28px);
  font-size: 1rem; line-height: 1.8; color: var(--ink-soft);
  background: transparent;
}
.q-passage p, .passage-para { margin-bottom: 15px; }

/* Part cards */
.parts { display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 22px); min-width: 0; }
.part-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: clamp(20px, 2vw, 30px);
  transition: border-color .2s;
}
.part-card--answered { border-color: var(--line); background: var(--surface-elev); }
.part-card__eyebrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.part-card__label {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: .72rem; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent);
}
.part-card__skill {
  font-size: .74rem; color: var(--ink-mute);
  background: var(--bg-soft); padding: 4px 10px; border-radius: var(--r-pill);
}
.part-card__status { margin-left: auto; font-size: .8rem; font-weight: 500; }
.part-card__status.is-correct { color: var(--mint); }
.part-card__status.is-incorrect { color: var(--coral); }

.q-question {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.28rem);
  font-weight: 600; line-height: 1.45; color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

/* Options — restrained, generous target area. */
.options { display: flex; flex-direction: column; gap: 9px; }
.option {
  display: flex; align-items: flex-start; gap: 14px;
  width: 100%; text-align: left;
  padding: 14px 17px;
  background: var(--surface-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: .99rem; line-height: 1.5; color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option:hover:not(.disabled) { border-color: var(--accent); background: var(--accent-soft); }
.option.disabled { cursor: default; }
.option-letter {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center; border-radius: 7px;
  background: var(--bg-soft); color: var(--ink-mute);
  font-family: 'Lexend', sans-serif; font-size: .78rem; font-weight: 600;
  transition: background .15s, color .15s;
}
.option:hover:not(.disabled) .option-letter { background: var(--accent); color: #fff; }
.option.selected { border-color: var(--ink-mute); }
.option.correct { border-color: var(--mint); background: var(--mint-50); }
.option.correct .option-letter { background: var(--mint); color: #fff; }
.option.incorrect { border-color: var(--coral); background: var(--coral-50); }
.option.incorrect .option-letter { background: var(--coral); color: #fff; }

/* Tools + hint */
.part-card__tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hint-btn {
  padding: 9px 16px; border-radius: var(--r-xs);
  background: transparent; border: 1px solid var(--line);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: .85rem; font-weight: 500; color: var(--ink-soft);
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.hint-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hint-btn--ghost { border-color: transparent; color: var(--ink-faint); }
.hint-btn--ghost:hover { background: transparent; border-color: transparent; color: var(--ink-mute); }
.hint-btn:disabled { opacity: .6; cursor: default; }

.hint-bubble, .part-hint__loading {
  margin-top: 15px; padding: 15px 18px;
  background: var(--bg-soft);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-xs);
  font-size: .93rem; line-height: 1.65; color: var(--ink-soft);
}
.hint-bubble-body { margin: 0; }

/* Feedback */
.feedback-card {
  margin-top: 16px; padding: 18px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-elev);
  display: flex; gap: 14px;
}
.feedback-card.success { border-color: #C3D8C8; background: var(--mint-50); }
.feedback-card.attempt { border-color: var(--line); background: var(--bg-soft); }
.feedback-heading {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.02rem; font-weight: 600; color: var(--ink); margin-bottom: 6px;
}
.feedback-text { font-size: .93rem; line-height: 1.7; color: var(--ink-soft); margin: 0; }

.next-row {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-top: clamp(24px, 3vw, 40px);
  padding-top: clamp(20px, 2.5vw, 32px);
  border-top: 1px solid var(--line);
}
.next-row.hidden, .hidden { display: none; }

/* ── Writing prompt panel ─────────────────────────────────────────────── */

.wr-prompt {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--sec-writing);
  border-radius: var(--r-md);
  padding: clamp(22px, 2.2vw, 32px);
  margin-bottom: 20px;
  max-width: var(--measure-wide);
}
.wr-prompt--image { border-left-color: var(--terracotta); text-align: left; }
.wr-prompt__text {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.45; color: var(--ink);
  letter-spacing: -0.015em;
  white-space: pre-line;
  margin: 14px 0 0;
}
.wr-prompt__text--italic { font-style: italic; }
.wr-prompt__tip {
  margin-top: 18px; padding-top: 15px;
  border-top: 1px solid var(--line-soft);
  font-size: .92rem; line-height: 1.65; color: var(--ink-soft);
}
.wr-prompt__tip-label {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: .7rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-mute);
  margin-right: 8px;
}

/* Writing form fills the column but keeps a sane writing measure. */
#writing-form { max-width: var(--measure-wide); }
.textarea {
  width: 100%; padding: 18px 20px;
  background: var(--surface-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink); line-height: 1.75;
  transition: border-color .15s, box-shadow .15s;
}
.textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#feedback { max-width: var(--measure-wide); }

/* ── Abstract stage ───────────────────────────────────────────────────── */

.abstract-stage, .q-figure {
  background: var(--figure-bg);
  border: 1px solid var(--figure-border);
  border-radius: var(--r-md);
  padding: clamp(18px, 2vw, 30px);
}
.abstract-options .option, .abstract-options button { justify-content: center; }

@media (max-width: 1099px) {
  .q-passage-shell { position: static; }
  .q-passage-scroll { max-height: none; }
}
@media (max-width: 640px) {
  .q-header { gap: 10px; padding: 12px 15px; }
  .q-header__timer { margin-left: 0; }
  .part-card { padding: 18px 16px; }
  .option { padding: 13px 14px; font-size: .95rem; }
  .next-row .btn, .next-row .k-btn { width: 100%; }
}

/* ── Practice nav at narrow widths ────────────────────────────────────────
   The practice nav is a flat row (brand · monitored pill · switch section)
   with no burger, so at 375px the three items overflowed by ~29px. Allowing
   the row to wrap is preferable to hiding the "Parent monitored" trust
   signal, which is the one thing on that bar a parent looks for. */
@media (max-width: 700px) {
  .nav-inner { flex-wrap: wrap; row-gap: 8px; }
  .nav-inner .monitored-pill { font-size: .72rem; padding: 5px 11px; }
  .nav-inner .btn-sm { padding: 7px 13px; font-size: .8rem; margin-left: 0 !important; }
}
@media (max-width: 420px) {
  .nav-inner .monitored-pill { margin-left: 0 !important; order: 3; }
  .nav-inner .btn-sm { order: 2; margin-left: auto !important; }
}

/* ── Writing split panel ──────────────────────────────────────────────────
   Same shape as reading: stimulus left, response right. The prompt and the
   three ASET criteria stay visible while the child writes — a prompt scrolled
   off the top is a prompt they stop re-reading. */
.wr-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 2.4vw, 40px);
  align-items: start;
  width: 100%;
}
@media (min-width: 1000px) {
  .wr-split { grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr); }
  .wr-aside { position: sticky; top: 84px; }
}
.wr-aside, .wr-main { min-width: 0; }
.wr-aside .wr-prompt { max-width: none; margin-bottom: 18px; }

.wr-rubric {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: clamp(18px, 1.8vw, 24px);
}
.wr-rubric__list { list-style: none; padding: 0; margin: 0; }
.wr-rubric__list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 3px;
}
.wr-rubric__list li:last-child { border-bottom: 0; }
.wr-rubric__name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1rem; font-weight: 600; color: var(--ink);
}
.wr-rubric__hint { font-size: .87rem; line-height: 1.5; color: var(--ink-mute); }
.wr-rubric__note {
  margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: .84rem; color: var(--ink-faint);
}

.wr-hint-row { margin-top: 16px; }
.wr-main #writing-form { max-width: none; }
.wr-textarea { min-height: clamp(320px, 46vh, 560px); font-size: 1rem; line-height: 1.75; }
.wr-actions { margin-top: 20px; display: flex; gap: 12px; }
.wr-actions .btn { flex: 1; }
.wr-main #feedback { max-width: none; }

@media (max-width: 999px) {
  .wr-aside { position: static; }
  .wr-textarea { min-height: 300px; }
}
@media (max-width: 640px) {
  .wr-actions .btn { width: 100%; }
}

/* Quant scene illustration — decoration that sets the scene for a word problem.
   Capped so it frames the text rather than dominating it. */
.q-illus {
  margin: 0 0 18px;
  display: flex;
  justify-content: center;
}
.q-illus img {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: var(--r-sm);
}
@media (max-width: 640px) { .q-illus img { max-width: 200px; } }

/* ════════════════════════════════════════════════════════════════════════════
   MULTI-PART QUESTIONS — one shared stimulus, N progressive parts.

   Deliberately thin: the part cards, options, feedback cards and hint bubbles
   are the EXISTING .part-card / .option / .feedback-card / .hint-bubble
   components, so everything below is only what progressive reveal adds — the
   step bar, the carry-forward line, and the final review panel. Every colour is
   an existing token, so the palette overhaul retokenises this for free.
   ════════════════════════════════════════════════════════════════════════════ */

/* Section spine for abstract, to match --reading / --quant already defined. */
.q-header--abstract .q-header__spine { background: var(--sec-abstract); }
.q-header--abstract .q-header__section { color: var(--sec-abstract); }

/* The right-hand column when a shared context is present: parts + review stack
   as ONE grid child so .q-split--quant-pack stays a clean two-column grid. */
.mp-column { min-width: 0; display: flex; flex-direction: column; gap: var(--s-5); }

/* ── Step bar (1/4, 2/4 …) ─────────────────────────────────────────────── */
.mp-progress {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 var(--s-5);
  padding: 0;
}
.mp-progress__step {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
}
.mp-progress__step:last-child { flex: 0 0 auto; }
.mp-progress__dot {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-faint);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 700;
  text-transform: uppercase;
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out),
              color .18s var(--ease-out);
}
.mp-progress__rail {
  flex: 1 1 auto;
  min-width: 8px;
  height: 2px;
  background: var(--line);
  margin: 0 var(--s-2);
  border-radius: var(--r-pill);
}
.mp-progress__step:last-child .mp-progress__rail { display: none; }

.mp-progress__step.is-current .mp-progress__dot {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.mp-progress__step.is-correct .mp-progress__dot {
  border-color: var(--mint);
  background: var(--mint);
  color: #fff;
}
/* Answered steps are FILLED (mint / coral); the current step is an accent RING.
   Without the fill, is-incorrect and is-current read as the same orange circle. */
.mp-progress__step.is-incorrect .mp-progress__dot {
  border-color: var(--coral);
  background: var(--coral);
  color: #fff;
}
.mp-progress__step.is-correct .mp-progress__rail,
.mp-progress__step.is-incorrect .mp-progress__rail { background: var(--ink-faint); }
.mp-progress__step.is-locked .mp-progress__dot { opacity: 0.55; }

/* ── Carry-forward line: the result the student just established ───────── */
.mp-carry {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--bg-soft);
  border-left: 3px solid var(--ink-faint);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.mp-carry__tag {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-mute);
}

/* ── Final review / solution walkthrough ──────────────────────────────── */
.mp-review {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s-6);
}
.mp-review__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-5);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--line-soft);
}
.mp-review__score {
  flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 108px;
  padding: var(--s-4) var(--s-5);
  background: var(--bg-soft);
  border-radius: var(--r-md);
}
.mp-review__score-num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 38px; font-weight: 700; line-height: 1; color: var(--ink);
}
.mp-review__score-of { font-size: 20px; color: var(--ink-mute); }
.mp-review__score-label {
  margin-top: 4px;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute);
}
.mp-review__blurb { flex: 1 1 220px; min-width: 0; }
.mp-review__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.mp-review__xp {
  margin-top: 6px;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13px; font-weight: 600; color: var(--accent);
}

.mp-review__list { list-style: none; margin: 0; padding: 0; }
.mp-review__row {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line-soft);
}
.mp-review__row:last-child { border-bottom: none; padding-bottom: 0; }
.mp-review__row-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-3);
  margin-bottom: var(--s-2);
}
.mp-review__row-part {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute);
}
.mp-review__row-verdict {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 600; color: var(--ink-faint);
}
.mp-review__row.is-correct .mp-review__row-verdict { color: var(--mint); }
.mp-review__row.is-incorrect .mp-review__row-verdict { color: var(--coral); }
.mp-review__row-q { font-size: 15.5px; line-height: 1.55; color: var(--ink); }
.mp-review__row-a {
  margin-top: var(--s-2);
  font-size: 15px; line-height: 1.5; color: var(--ink-soft);
}
.mp-review__row-a strong { color: var(--mint); }
.mp-review__row-exp {
  margin-top: var(--s-2);
  font-size: 14.5px; line-height: 1.6; color: var(--ink-mute);
}

/* ── Determinate progress bar, above the stepper ───────────────────────────
   The stepper says WHICH parts landed; this says how much is left. Both are
   repainted from the same `steps` payload by paintSteps(). */
.mp-progress-wrap { margin: 0 0 var(--s-5); }
.mp-progress-bar__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-3); margin-bottom: 7px;
}
.mp-progress-bar__label {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute);
}
.mp-progress-bar__count {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 700; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.mp-progress-bar {
  height: 7px; border-radius: var(--r-pill);
  background: var(--bg-soft); overflow: hidden;
  margin-bottom: var(--s-4);
}
.mp-progress-bar__fill {
  display: block; height: 100%; min-width: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  transition: width .35s var(--ease-out);
}
.mp-progress-wrap .mp-progress { margin-bottom: 0; }

/* ── Figure strips (the shared stimulus of an abstract chain) ─────────────
   Scrolls INSIDE itself rather than pushing the page wide — a five-cell strip
   at 375px is wider than the viewport and must not take the body with it. */
.mp-figrow {
  display: flex; align-items: flex-end; gap: var(--s-3);
  margin: var(--s-3) 0;
  padding-bottom: var(--s-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mp-figrow__cell { flex: 0 0 auto; margin: 0; text-align: center; }
.mp-fig {
  display: block;
  /* Sized so a FIVE-cell strip (four figures plus the "?") still fits a 375px
     viewport without needing the scroll: 5 x 48 + 4 x gap clears the shell's
     inner width. The scroll below is the safety net for a six-cell strip, not
     the expected reading experience. */
  width: clamp(48px, 14vw, 84px); height: auto; aspect-ratio: 1 / 1;
}
.mp-figrow__cap {
  margin-top: 5px;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 11px; font-weight: 600; color: var(--ink-faint);
}
.mp-figrow__q {
  width: clamp(48px, 14vw, 84px); aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  border: 2.5px dashed var(--line); border-radius: 7px;
  background: var(--surface-elev);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 30px; color: var(--ink-faint);
}
.mp-part-figure { margin-bottom: var(--s-4); }

/* ── Figure OPTIONS ───────────────────────────────────────────────────────
   The button is still `.option` — same class, same data-letter, same JS. Only
   its layout changes: a 2-column tile grid instead of a text row. Because
   `.option.correct` / `.option.incorrect` are two-class selectors they still
   outrank these single-class rules, so grading paints figure options with no
   extra CSS at all. */
.options--figure {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}
.option--figure {
  flex-direction: column; align-items: center; gap: 8px;
  padding: var(--s-3);
  text-align: center;
}
.option--figure .option-letter { width: 24px; height: 24px; font-size: .74rem; }
.option-figure { display: block; width: 100%; }
.option-figure svg { display: block; width: 100%; max-width: 108px; height: auto; margin: 0 auto; }
@media (min-width: 900px) {
  /* Four across once the column is wide enough to keep the figures comparable
     side by side — which is how the real test presents them. */
  .q-page:not(.q-page--split) .options--figure { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ── The chain panel: how each part's result fed the next ─────────────────── */
.mp-chain {
  margin-top: var(--s-5);
  padding: var(--s-5);
  background: var(--bg-soft);
  border-radius: var(--r-md);
}
.mp-chain__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px; font-weight: 600; color: var(--ink);
  margin-bottom: var(--s-4);
}
.mp-chain__list { list-style: none; margin: 0; padding: 0; }
.mp-chain__link {
  position: relative;
  display: flex; gap: var(--s-4);
  padding-bottom: var(--s-4);
}
.mp-chain__link:last-child { padding-bottom: 0; }
/* The connector runs from each node down to the next, which is what makes the
   panel read as a chain rather than as another list. */
.mp-chain__link:not(.is-last)::before {
  content: '';
  position: absolute;
  left: 13px; top: 30px; bottom: 4px;
  width: 2px; border-radius: 1px;
  background: var(--line);
}
.mp-chain__node {
  flex: none; z-index: 1;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 700; color: var(--ink-mute);
  text-transform: uppercase;
}
.mp-chain__link.is-correct .mp-chain__node {
  border-color: var(--mint); background: var(--mint); color: #fff;
}
.mp-chain__link.is-incorrect .mp-chain__node {
  border-color: var(--coral); background: var(--coral); color: #fff;
}
.mp-chain__body { min-width: 0; padding-top: 3px; }
.mp-chain__establishes { font-size: 15px; line-height: 1.5; color: var(--ink); }
.mp-chain__establishes--plain { color: var(--ink-soft); }
.mp-chain__feeds {
  margin-top: 3px;
  font-size: 13.5px; line-height: 1.5; color: var(--ink-mute);
}
.mp-chain__feeds--end { color: var(--ink-faint); font-style: italic; }

.mp-review__list-title {
  margin-top: var(--s-5);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px; font-weight: 600; color: var(--ink);
}

/* Figure answers in the review: the answer, and the wrong pick beside it. */
.mp-review__figs { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-3); }
.mp-review__fig {
  margin: 0; padding: var(--s-3);
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-elev);
  text-align: center;
}
.mp-review__fig svg { display: block; width: 76px; height: auto; margin: 0 auto; }
.mp-review__fig figcaption {
  margin-top: 6px;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 11.5px; font-weight: 600; color: var(--ink-mute);
}
.mp-review__fig.is-answer { border-color: var(--mint); }
.mp-review__fig.is-answer figcaption { color: var(--mint); }
.mp-review__fig.is-yours { border-color: var(--coral); }
.mp-review__fig.is-yours figcaption { color: var(--coral); }

@media (max-width: 560px) {
  .mp-review { padding: var(--s-4); }
  .mp-review__head { gap: var(--s-4); }
  .mp-review__score { min-width: 88px; padding: var(--s-3) var(--s-4); }
  .mp-review__score-num { font-size: 30px; }
  .mp-review__title { font-size: 19px; }
  .mp-progress__dot { width: 26px; height: 26px; font-size: 11.5px; }
  .mp-progress__rail { margin: 0 var(--s-1); min-width: 4px; }
  .mp-chain { padding: var(--s-4); }
  .mp-chain__link { gap: var(--s-3); }
  .mp-chain__link:not(.is-last)::before { left: 12px; }
  .mp-chain__node { width: 26px; height: 26px; font-size: 11.5px; }
  .mp-figrow { gap: var(--s-2); }
}
@media (prefers-reduced-motion: reduce) {
  .mp-progress__dot { transition: none; }
}

/* Zero-specificity fallback for a difficulty pill whose tier has no palette rule
   yet — the tier vocabulary is owned elsewhere and is being extended, and an
   unknown tier must not render as bare unstyled text. `:where()` contributes no
   specificity, so every real .diff-<tier> rule still wins. */
:where(.diff-pill.diff-fallback) { background: var(--bg-soft); color: var(--ink-soft); }

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION HUBS  —  /section/<section_id>, its test intro, results and mistakes.

   Tokens only: --accent / --ink* / --surface / --line / --bg-soft / --mint /
   --gold / --coral / --sec-* — nothing hardcoded, so a retokenise reskins this
   for free. Every grid is auto-fit with a min track small enough to survive a
   375px viewport without horizontal overflow.
   ═══════════════════════════════════════════════════════════════════════════ */

.sec-hub, .sec-results { padding-bottom: 48px; }
.sec-hub--reading  { --sec-accent: var(--sec-reading);  --sec-accent-soft: var(--sec-reading-soft); }
.sec-hub--quant    { --sec-accent: var(--sec-quant);    --sec-accent-soft: var(--sec-quant-soft); }
.sec-hub--abstract { --sec-accent: var(--sec-abstract); --sec-accent-soft: var(--sec-abstract-soft); }
.sec-hub--writing  { --sec-accent: var(--sec-writing);  --sec-accent-soft: var(--sec-writing-soft); }

/* --- Hero --- */
.sec-hero {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  padding: 22px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--sec-accent, var(--accent));
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.sec-hero__mark {
  width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center;
  font-size: 26px; border-radius: var(--r-md);
  background: var(--sec-accent-soft, var(--bg-soft));
}
.sec-hero__body { flex: 1 1 220px; min-width: 0; }
.sec-hero__title { font-family: 'Fraunces', serif; font-size: clamp(22px, 5vw, 30px); margin: 0; color: var(--ink); }
.sec-hero__blurb { margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-soft); }
.sec-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sec-hero__score { flex: 0 0 auto; text-align: right; margin-left: auto; }
.sec-score__num { font-family: 'Fraunces', serif; font-weight: 700; font-size: 34px; line-height: 1; color: var(--sec-accent, var(--accent)); }
.sec-score__num span { font-size: 18px; }
.sec-score__num--empty { color: var(--ink-faint); }
.sec-score__cap { font-size: 11.5px; color: var(--ink-mute); margin-top: 4px; }

/* --- Truth notes --- */
.sec-note {
  padding: 12px 16px; margin-bottom: 16px; border-radius: var(--r-sm);
  font-size: 13.5px; line-height: 1.5;
  background: var(--bg-soft); color: var(--ink-soft); border: 1px solid var(--line);
}
.sec-note strong { color: var(--ink); }
.sec-note--warn { background: var(--gold-50); border-color: var(--gold); color: var(--ink-soft); }
.sec-note--good { background: var(--mint-50); border-color: var(--mint); }
.sec-note--soft { background: transparent; border-style: dashed; color: var(--ink-mute); }

/* --- Primary actions --- */
.sec-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 26px; }
.sec-action {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.sec-action:hover { border-color: var(--sec-accent, var(--accent)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.sec-action--primary { background: var(--sec-accent-soft, var(--bg-soft)); border-color: var(--sec-accent, var(--accent)); }
.sec-action__icon {
  width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
  border-radius: 12px; background: var(--surface); font-size: 17px; color: var(--sec-accent, var(--accent));
}
.sec-action__body { display: flex; flex-direction: column; min-width: 0; }
.sec-action__title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px; }
.sec-action__meta { font-size: 12.5px; color: var(--ink-mute); margin-top: 2px; }

/* --- Blocks --- */
.sec-block { margin-bottom: 28px; }
.sec-block__head { margin-bottom: 12px; }
.sec-block__title { font-family: 'Fraunces', serif; font-size: 18px; margin: 0; color: var(--ink); }
.sec-block__cta { margin-top: 12px; }

/* --- Test cards --- */
.sec-test-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.sec-test-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 18px 16px; text-decoration: none;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.sec-test-card:hover { border-color: var(--sec-accent, var(--accent)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.sec-test-card__len { font-family: 'Fraunces', serif; font-weight: 700; font-size: 30px; line-height: 1; color: var(--sec-accent, var(--accent)); }
.sec-test-card__unit { font-size: 13px; color: var(--ink-soft); }
.sec-test-card__time { font-size: 11.5px; color: var(--ink-mute); margin-top: 6px; }

/* --- Skill-focused mini test --- */
.sec-focus {
  display: block; padding: 18px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .15s, transform .15s;
}
.sec-focus:hover { border-color: var(--sec-accent, var(--accent)); transform: translateY(-2px); }
.sec-focus__head { display: flex; align-items: flex-start; gap: 14px; }
.sec-focus__icon { font-size: 22px; line-height: 1.2; }
.sec-focus__title { display: block; font-family: 'Fraunces', serif; font-weight: 600; font-size: 16.5px; }
.sec-focus__meta { display: block; font-size: 12.5px; color: var(--ink-mute); margin-top: 3px; line-height: 1.45; }
.sec-focus__skills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sec-focus__skill {
  font-size: 12px; padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--sec-accent-soft, var(--bg-soft)); color: var(--ink-soft);
}
.sec-focus__skill em { font-style: normal; font-weight: 700; color: var(--coral); }

/* --- Skill breakdown --- */
.sec-skills { display: flex; flex-direction: column; gap: 2px; }
.sec-skill {
  display: grid; align-items: center; gap: 4px 10px;
  grid-template-columns: minmax(0, 1fr) 46px;
  grid-template-areas: "name num" "bar meta";
  padding: 10px 12px; border-radius: var(--r-xs);
}
.sec-skill:nth-child(odd) { background: var(--bg-soft); }
.sec-skill__name { grid-area: name; font-size: 13.5px; font-weight: 600; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.sec-skill__bar { grid-area: bar; height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.sec-skill__fill { height: 100%; border-radius: 999px; background: var(--ink-faint); }
.sec-skill__fill.is-strong { background: var(--mint); }
.sec-skill__fill.is-mid { background: var(--gold); }
.sec-skill__fill.is-weak { background: var(--coral); }
.sec-skill__fill.is-neutral { background: var(--sec-accent, var(--accent)); }
.sec-skill__num { grid-area: num; text-align: right; font-weight: 700; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sec-skill__meta { grid-area: meta; text-align: right; font-size: 11.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
@media (min-width: 620px) {
  .sec-skill {
    grid-template-columns: minmax(120px, 1.1fr) minmax(0, 2fr) 46px 52px;
    grid-template-areas: "name bar num meta";
  }
}
.sec-details { margin-top: 14px; }
.sec-details summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.sec-chiprow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* --- Mistakes --- */
.sec-mistakes { display: flex; flex-direction: column; gap: 10px; }
.sec-mistake {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--coral);
  border-radius: var(--r-sm);
}
.sec-mistake__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sec-mistake__skill {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-mute);
}
.sec-mistake__text { font-size: 14px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.sec-mistake__ans { font-size: 12.5px; color: var(--ink-mute); }
.sec-mistake--full { gap: 10px; }
.sec-retry-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding: 16px 18px; margin-bottom: 18px;
  background: var(--sec-accent-soft, var(--bg-soft));
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.sec-retry-bar__title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px; }

/* --- Empty states --- */
.sec-empty {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px; background: var(--bg-soft);
  border: 1px dashed var(--line); border-radius: var(--r-md);
}
.sec-empty__icon { font-size: 24px; line-height: 1.2; }
.sec-empty__title { font-family: 'Fraunces', serif; font-weight: 600; font-size: 15.5px; color: var(--ink); }
.sec-empty__body { font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); margin-top: 3px; }

/* --- This week --- */
.sec-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 10px; }
.sec-week__cell {
  padding: 14px 10px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.sec-week__num { font-family: 'Fraunces', serif; font-weight: 700; font-size: 22px; color: var(--ink); }
.sec-week__cap { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

/* --- Test intro --- */
.sec-intro { padding-top: 12px; padding-bottom: 48px; }
.sec-intro__card {
  padding: 26px 22px; background: var(--surface);
  border: 1px solid var(--line); border-top: 5px solid var(--sec-accent, var(--accent));
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.sec-intro__eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-mute);
}
.sec-intro__title { font-family: 'Fraunces', serif; font-size: clamp(24px, 6vw, 32px); margin: 6px 0 18px; }
.sec-intro__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 10px; margin-bottom: 20px; }
.sec-intro__fact { padding: 14px 8px; text-align: center; background: var(--bg-soft); border-radius: var(--r-sm); }
.sec-intro__fact-num { font-family: 'Fraunces', serif; font-weight: 700; font-size: 26px; line-height: 1.1; color: var(--sec-accent, var(--accent)); }
.sec-intro__fact-cap { font-size: 11.5px; color: var(--ink-mute); margin-top: 4px; }
.sec-intro__list { margin: 0 0 20px; padding-left: 20px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.65; }
.sec-intro__list li { margin-bottom: 4px; }
.sec-intro__form { display: flex; flex-direction: column; gap: 16px; }
.sec-intro__back { display: block; text-align: center; margin-top: 14px; font-size: 13px; color: var(--ink-mute); }

/* --- Timer toggle --- */
.sec-toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.sec-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.sec-toggle__track {
  flex: 0 0 46px; width: 46px; height: 27px; border-radius: 999px;
  background: var(--line); position: relative; transition: background .15s; margin-top: 2px;
}
.sec-toggle__knob {
  position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: var(--surface-elev);
  box-shadow: var(--shadow-xs); transition: transform .15s;
}
.sec-toggle input:checked + .sec-toggle__track { background: var(--sec-accent, var(--accent)); }
.sec-toggle input:checked + .sec-toggle__track .sec-toggle__knob { transform: translateX(19px); }
.sec-toggle input:focus-visible + .sec-toggle__track { outline: 2px solid var(--ink); outline-offset: 2px; }
.sec-toggle__label { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink); }

/* --- Results --- */
.sec-results__head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-results__ring {
  --size: 92px; --pct: 0;
  width: var(--size); height: var(--size); flex: 0 0 var(--size); display: grid; place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--sec-accent, var(--accent)) calc(var(--pct) * 1%), var(--line) 0);
}
.sec-results__ring-text {
  width: calc(100% - 14px); height: calc(100% - 14px); border-radius: 50%;
  background: var(--bg); display: grid; place-items: center;
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 20px; color: var(--ink);
}
.sec-results__ring-text span { font-size: 13px; color: var(--ink-mute); }
.sec-results__title { font-family: 'Fraunces', serif; font-size: clamp(22px, 5vw, 28px); margin: 0; }
.sec-results__sub { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.sec-results__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.sec-review { display: flex; flex-direction: column; gap: 8px; }
.sec-review__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.sec-review__item.is-correct { border-left: 3px solid var(--mint); }
.sec-review__item.is-wrong { border-left: 3px solid var(--coral); }
.sec-review__item.is-skipped { border-left: 3px solid var(--ink-faint); }
.sec-review__item > summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; cursor: pointer; font-size: 13.5px; color: var(--ink);
}
.sec-review__n { font-weight: 700; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.sec-review__mark { font-weight: 700; }
.is-correct .sec-review__mark { color: var(--mint); }
.is-wrong .sec-review__mark { color: var(--coral); }
.sec-review__q { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.sec-review__skill { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-mute); }
.sec-review__body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.sec-review__opts { display: flex; flex-direction: column; gap: 6px; }
.sec-review__opt {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--r-xs);
  font-size: 13.5px; color: var(--ink-soft); overflow-wrap: anywhere;
}
.sec-review__opt.is-answer { border-color: var(--mint); background: var(--mint-50); color: var(--ink); }
.sec-review__opt.is-yours { border-color: var(--coral); background: var(--coral-50); color: var(--ink); }
.sec-review__why { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }

/* Nothing in this layer may push the page sideways on a 375px phone. */
.sec-hub, .sec-results, .sec-intro { overflow-x: clip; }

/* ════════════════════════════════════════════════════════════════════════════
   KORVA NAV LAYER — persistent top nav, breadcrumbs, mobile bottom bar
   ----------------------------------------------------------------------------
   Appended LAST on purpose. Two rules of engagement in this file:

   1. Media queries add NO specificity. A plain rule that appears later in the
      file beats a rule inside an earlier @media block — that is exactly how the
      old mobile menu ended up permanently open. So: every plain rule in this
      layer comes first, and EVERY @media block comes after all of them, at the
      very bottom of the file. Nothing may be appended after them.
   2. Colours come from the existing tokens (--accent, --ink*, --surface, --line,
      --sec-*). No literal hexes, so a palette swap reskins this for free.
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  --knav-bottom-h: 62px;   /* keep in sync with .knav-bottom height */
}

/* ── Top nav ──────────────────────────────────────────────────────────────── */

.knav { position: sticky; top: 0; z-index: 120; backdrop-filter: saturate(1.4) blur(8px); }
.knav-inner { position: relative; gap: 12px; flex-wrap: nowrap; }
.knav-brand { margin-right: 0; flex-shrink: 0; }
.knav-brand--inert { cursor: default; }

.knav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  /* Safety net above the burger breakpoint: if a future link pushes the row past
     the viewport it wraps to a second line rather than scrolling the page
     sideways. Overflow-x is the one failure this layer must never produce. */
  flex-wrap: wrap;
}
.knav-group { display: flex; align-items: center; gap: 4px; min-width: 0; }
.knav-spacer { flex: 1 1 auto; }

.knav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  border-radius: var(--r-xs);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13.5px; font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.knav-link:hover { color: var(--ink); background: var(--bg-soft); }
.knav-link__ico { font-size: 13px; line-height: 1; }
.knav-link.is-active {
  color: var(--ink);
  font-weight: 600;
  background: var(--surface);
  border-color: var(--line);
}
.knav-link--quiet { color: var(--ink-mute); font-size: 12.5px; padding: 6px 8px; }
.knav-link--quiet:hover { color: var(--ink-soft); }
.knav-link--cta {
  background: var(--accent); color: #fff; font-weight: 600;
  border-color: var(--accent);
}
.knav-link--cta:hover { background: var(--accent-hover); color: #fff; border-color: var(--accent-hover); }

/* Section shortcuts carry their section colour on the active state only, so the
   bar reads as one object until you are actually inside a section. */
.knav-sec--reading.is-active  { border-color: var(--sec-reading);  color: var(--sec-reading); }
.knav-sec--quant.is-active    { border-color: var(--sec-quant);    color: var(--sec-quant); }
.knav-sec--abstract.is-active { border-color: var(--sec-abstract); color: var(--sec-abstract); }
.knav-sec--writing.is-active  { border-color: var(--sec-writing);  color: var(--sec-writing); }

/* Weekly Challenge / Weekly Mock do not exist yet. Rendered inert and visibly
   unavailable — never as something tappable, never with a number. */
.knav-soon {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 9px;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  cursor: default;
  border: 1px dashed var(--line);
  border-radius: var(--r-xs);
}
.knav-soon em {
  font-style: normal; font-size: 9.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-mute); background: var(--bg-soft);
  padding: 2px 5px; border-radius: var(--r-pill);
}

/* Current-child selector + account disclosure. <details>/<summary>, so it opens
   without JS and closes on Escape for free. */
.knav-more { position: relative; flex-shrink: 0; }
.knav-who {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
.knav-who::-webkit-details-marker { display: none; }
.knav-who::after { content: '▾'; color: var(--ink-faint); font-size: 10px; }
.knav-more[open] .knav-who { border-color: var(--accent); color: var(--ink); }
.knav-who__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint); flex-shrink: 0;
}
.knav-more__panel {
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 190px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 220;
}
.knav-more__cap {
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-faint);
  padding: 4px 8px 6px;
}
.knav-more__panel .knav-link { width: 100%; }

/* Test mode: no shortcuts at all, one deliberate exit. */
.knav--test { background: var(--surface); }
.knav-testtag {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: auto;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-mute); white-space: nowrap;
}
.knav-testtag__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.knav-exit {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.knav-exit:hover { border-color: var(--accent); color: var(--accent); }

/* ── Breadcrumbs ──────────────────────────────────────────────────────────── */

.kcrumbs { margin: 0 0 14px; }
.kcrumbs__list {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 2px 4px;
  list-style: none; margin: 0; padding: 0;
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 12.5px;
}
.kcrumbs__item { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.kcrumbs__link {
  color: var(--ink-mute);
  text-decoration: none;
  padding: 3px 5px;
  border-radius: 6px;
}
.kcrumbs__link:hover { color: var(--accent); background: var(--bg-soft); text-decoration: underline; }
.kcrumbs__here { color: var(--ink-soft); font-weight: 600; padding: 3px 5px; overflow-wrap: anywhere; }
.kcrumbs__sep { color: var(--ink-faint); }

/* ── Explicit back control ────────────────────────────────────────────────── */

.kback {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 16px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: 'Lexend', system-ui, sans-serif;
  font-size: 13.5px; font-weight: 600;
  text-decoration: none;
  transition: border-color .15s, color .15s, transform .15s;
}
.kback:hover { border-color: var(--accent); color: var(--accent); transform: translateX(-2px); }

/* ── Mobile bottom bar ────────────────────────────────────────────────────── */
/* Hidden by default and REVEALED by a media query, never the other way round:
   if the media query is ever dropped the bar disappears rather than covering
   the submit button on every desktop page. */

.knav-bottom { display: none; }

/* ════════════════════════════════════════════════════════════════════════════
   MEDIA QUERIES — must remain the LAST thing in this file.
   ════════════════════════════════════════════════════════════════════════════ */

/* Top nav collapses to a burger.

   TWO breakpoints, because the two navs are not the same size. The parent nav is
   four links and survives to 860px. The child nav carries Home + four sections +
   two weekly tags + the child chip + Done and measured ~1090px laid out flat, so
   it collapses at 1200px — 1024px would otherwise have pushed the page sideways.

   Each block repeats BOTH the collapse rule and the .is-open reveal at its own
   selector depth. The reveal must out-specify every collapse rule that can apply
   at the same width, and media queries contribute no specificity of their own —
   which is precisely how a previous redesign ended up with a mobile menu that
   could never be closed. */
@media (max-width: 860px) {
  .knav .knav-burger { display: flex; margin-left: auto; }
  .knav .knav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: var(--gutter); right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: 210;
    max-height: 72vh;
    overflow-y: auto;
  }
  .knav .knav-menu.is-open { display: flex; }
}
@media (max-width: 1200px) {
  .knav--kid .knav-burger { display: flex; margin-left: auto; }
  .knav--kid .knav-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: var(--gutter); right: var(--gutter);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    z-index: 210;
    max-height: 72vh;
    overflow-y: auto;
  }
  .knav--kid .knav-menu.is-open { display: flex; }
}
/* Panel-shaped layout for the collapsed menu. Safe to apply at both breakpoints
   because it only takes effect once the menu is a column. */
@media (max-width: 1200px) {
  .knav-menu { flex-wrap: nowrap; }
  .knav-group { flex-direction: column; align-items: stretch; gap: 2px; }
  /* `.knav-group--soon` was removed here in Session 6. It was a misnomer — a
     mobile layout separator, never a "coming soon" state — and the markup in
     _kid_nav.html now says `.knav-group--weekly`, whose rule lives in app.css.
     This selector matched nothing after the rename; the two agents that split
     the change could each only reach one half of it. */
  .knav-link { width: 100%; padding: 11px 12px; font-size: 14.5px; }
  .knav-link--quiet { font-size: 13.5px; padding: 10px 12px; }
  .knav-soon { width: 100%; justify-content: space-between; }
  .knav-spacer { display: none; }
  .knav-more { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
  .knav-who { width: 100%; justify-content: flex-start; }
  .knav-who::after { margin-left: auto; }
  /* Inside the collapsed panel the disclosure sits in flow — a floating popover
     inside a scrolling panel is unreachable on a phone. */
  .knav-more__panel {
    position: static;
    min-width: 0;
    border: 0; box-shadow: none; background: transparent;
    padding: 4px 0 0;
  }
}

/* Bottom bar. Below this width the burger alone is not enough — a child mid
   question should not have to open a menu to get out. */
@media (max-width: 820px) {
  .knav-bottom {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 130;
    height: var(--knav-bottom-h);
    align-items: stretch;
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(90, 70, 50, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .knav-bottom__item {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    text-decoration: none;
    color: var(--ink-mute);
    font-family: 'Lexend', system-ui, sans-serif;
    font-size: 10.5px; font-weight: 600;
    letter-spacing: .01em;
    padding: 6px 4px;
    overflow: hidden;
  }
  .knav-bottom__item > span:last-child {
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .knav-bottom__ico { font-size: 17px; line-height: 1; }
  .knav-bottom__item.is-active { color: var(--accent); }
  .knav-bottom__item--end { color: var(--ink-soft); }
  .knav-bottom__count {
    font-style: normal; font-weight: 700;
    background: var(--accent); color: #fff;
    border-radius: var(--r-pill);
    padding: 0 5px; margin-left: 2px; font-size: 9.5px;
  }
  .knav-bottom--test { justify-content: space-between; align-items: center; padding: 0 14px; }
  .knav-bottom__note {
    font-family: 'Lexend', system-ui, sans-serif;
    font-size: 12.5px; font-weight: 600; color: var(--ink-mute);
  }
  .knav-bottom__exit {
    padding: 9px 16px;
    border-radius: var(--r-pill);
    border: 1px solid var(--line);
    background: var(--bg-soft);
    color: var(--ink-soft);
    font-family: 'Lexend', system-ui, sans-serif;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
  }

  /* The bar is fixed, so it would otherwise sit on top of whatever the page ends
     with — the last answer option, or the writing "Get feedback" button. Reserve
     its height, and lift the other fixed furniture above it. */
  body.has-knav-bottom { padding-bottom: calc(var(--knav-bottom-h) + 12px); }
  #fo-chat-trigger { bottom: calc(var(--knav-bottom-h) + 14px) !important; }
  .fab { bottom: calc(var(--knav-bottom-h) + 14px); }
  .toast { bottom: calc(var(--knav-bottom-h) + 18px); }
  .test-exit-card, .test-time-up-card { margin-bottom: var(--knav-bottom-h); }
}
