/* ============================================================
   irikos — utilitarian / app-like reskin.
   Charcoal pill nav, teal pill buttons w/ circular icon badge,
   white cards on light gray, plain sans, colored status dots.
   Light + dark. No serif, no editorial flourish.
   ============================================================ */

:root {
  /* Palette — light */
  --bg:        #efeeec;
  --bg-2:      #e7e5e1;
  --bg-3:      #ddd9d2;
  --ink:       #232825;
  --ink-2:     #4a4f4b;
  --ink-3:     #797e78;
  --ink-4:     #a6a9a2;
  --rule:      #e3e1dc;
  --rule-2:    #d6d3cc;
  --card:      #ffffff;

  /* Nav (charcoal bar) */
  --nav:           #4c4c4c;
  --nav-inset:     #3c3c3c;
  --nav-tab:       #cdcdcd;
  --nav-tab-hover: #ffffff;
  --nav-active-bg: #ffffff;
  --nav-active-ink:#2a2a2a;
  --nav-brand-2:   #16b8a6;

  /* Teal accent */
  --accent:      #13a292;
  --accent-ink:  color-mix(in oklab, var(--accent) 80%, #000);
  --accent-deep: color-mix(in oklab, var(--accent) 64%, #000);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, var(--bg));
  --accent-tint: color-mix(in oklab, var(--accent) 8%, var(--card));

  /* Status */
  --ok:   #2faa44;
  --warn: #efb70b;
  --no:   #e1593a;
  --ok-soft:   color-mix(in oklab, var(--ok) 16%, var(--bg));
  --no-soft:   color-mix(in oklab, var(--no) 14%, var(--bg));
  --warn-soft: color-mix(in oklab, var(--warn) 18%, var(--bg));
  --ok-tint:   color-mix(in oklab, var(--ok) 12%, var(--card));

  --shadow-card: 0 1px 2px rgba(30,30,28,0.05);
  --shadow-pop:  0 2px 4px rgba(30,30,28,0.05), 0 18px 40px -28px rgba(30,30,28,0.22);
  --shadow-nav:  0 4px 14px -6px rgba(30,30,28,0.28);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", system-ui, -apple-system, sans-serif;
  /* mono + serif intentionally collapse to sans — "less fancy" */
  --mono: var(--sans);
  --serif: var(--sans);

  --action-bar-h: 72px;
}

:root[data-theme="dark"] {
  --bg:        #141615;
  --bg-2:      #1d201e;
  --bg-3:      #262a28;
  --ink:       #eceee9;
  --ink-2:     #c2c6c0;
  --ink-3:     #888d87;
  --ink-4:     #5d615b;
  --rule:      #2a2e2b;
  --rule-2:    #353a36;
  --card:      #1c1f1d;

  --nav:           #232625;
  --nav-inset:     #161817;
  --nav-tab:       #939892;
  --nav-tab-hover: #ffffff;
  --nav-active-bg: #f1f1ee;
  --nav-active-ink:#222420;

  --accent-soft: color-mix(in oklab, var(--accent) 20%, var(--bg-2));
  --accent-tint: color-mix(in oklab, var(--accent) 13%, var(--card));
  --ok-soft:   color-mix(in oklab, var(--ok) 22%, var(--bg-2));
  --no-soft:   color-mix(in oklab, var(--no) 20%, var(--bg-2));
  --warn-soft: color-mix(in oklab, var(--warn) 22%, var(--bg-2));
  --ok-tint:   color-mix(in oklab, var(--ok) 16%, var(--card));
  --shadow-card: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-pop:  0 2px 4px rgba(0,0,0,0.3), 0 18px 40px -26px rgba(0,0,0,0.6);
  --shadow-nav:  0 6px 18px -6px rgba(0,0,0,0.55);
}

:root[data-motion="reduced"] *,
:root[data-motion="reduced"] *::before,
:root[data-motion="reduced"] *::after {
  transition-duration: 0ms !important;
  animation-duration: 0ms !important;
}

/* Also honor the OS-level setting, not just the in-app toggle. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }            /* no iOS text auto-inflation */
html, body { margin: 0; padding: 0; overflow-x: hidden; }  /* kill sideways scroll */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
/* No 300ms tap delay / no double-tap zoom on interactive controls. */
button, a, .mc-option, .segmented-btn { touch-action: manipulation; }
input { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
kbd {
  font-family: var(--mono); font-size: 0.78em;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.28);
  padding: 0 5px; border-radius: 4px;
}
.serif-italic { font-style: normal; font-weight: 700; }

/* dvh tracks Safari's collapsing toolbar so these never under-/over-shoot. */
.app-root { min-height: 100vh; min-height: 100dvh; }
.page { min-height: 100vh; min-height: 100dvh; }

/* Touch targets ≥ 44px on phones (desktop untouched). */
@media (max-width: 720px) {
  .text-link, .topnav-tab, .segmented-btn {
    min-height: 44px; display: inline-flex; align-items: center;
  }
  /* Keep the toggle's visual size; expand only its tappable area. */
  .switch { position: relative; }
  .switch::after { content: ""; position: absolute; inset: -9px; }
}

/* =====================================================================
   TOP NAV — charcoal pill bar
   ===================================================================== */
.topnav-wrap {
  position: sticky; top: 0; z-index: 40;
  padding: 16px 24px 6px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
@media (max-width: 720px) { .topnav-wrap { padding: max(12px, env(safe-area-inset-top)) 12px 4px; } }

.topnav {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--nav);
  border-radius: 999px;
  padding: 9px 10px 9px 9px;
  box-shadow: var(--shadow-nav);
}

.topnav-brand {
  display: flex; align-items: baseline; gap: 0;
  background: var(--nav-inset);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: 0.04em;
  white-space: nowrap;
  transition: filter 140ms ease;
}
.topnav-brand:hover { filter: brightness(1.12); }
.tn-brand-main { color: #fff; }
.tn-brand-accent { color: var(--nav-brand-2); font-weight: 700; }
.tn-brand-tag { color: #9b9b9b; font-weight: 600; font-size: 12px; letter-spacing: 0.08em; }

.topnav-tabs {
  display: flex; align-items: center; gap: 2px;
  margin-left: auto;
}
.topnav-tab {
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--nav-tab);
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
  transition: color 130ms ease;   /* not background — avoids a sticky-bar stale-paint on the active pill */
  min-height: 38px;
}
.topnav-tab:hover { color: var(--nav-tab-hover); }
.topnav-tab.is-active {
  background: var(--nav-active-bg);
  color: var(--nav-active-ink);
  font-weight: 600;
}
.topnav-avatar {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--nav-inset);
  color: #d6d6d6;
  display: grid; place-items: center;
  margin-left: 4px;
  transition: filter 140ms ease;
}
.topnav-avatar:hover { filter: brightness(1.15); }
/* Signed-in: show the @handle instead of a generic avatar glyph. */
.topnav-avatar.is-handle { width: auto; min-width: 40px; height: 36px; border-radius: 999px; padding: 0 14px; }
.tn-handle { font-size: 13px; font-weight: 700; letter-spacing: 0.01em; color: #e6e6e6; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .topnav { gap: 6px; padding: 7px; overflow-x: auto; scrollbar-width: none; border-radius: 22px; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav-brand { padding: 8px 12px; font-size: 13px; }
  .topnav-tabs { margin-left: 6px; }
  .topnav-tab { padding: 8px 12px; font-size: 13px; }
  .topnav-avatar { width: 34px; height: 34px; }
}

/* =====================================================================
   SIDE NAV — desktop left rail (Direction A). Replaces the top pill nav
   > 760px so screens can use the page width; hidden on phones.
   ===================================================================== */
.sidenav { display: none; }
@media (min-width: 761px) {
  .app-root[data-shell="main"] { padding-left: var(--sidenav-w, 236px); }
  .sidenav {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
    width: var(--sidenav-w, 236px);
    display: flex; flex-direction: column;
    padding: 20px 16px 16px;
    background: var(--card);
    border-right: 1px solid var(--rule);
  }
  .sidenav-brand {
    display: inline-flex; align-items: baseline; gap: 0; align-self: flex-start;
    background: var(--nav); color: #fff;
    padding: 9px 16px; border-radius: 999px;
    font-weight: 700; font-size: 15px; letter-spacing: 0.04em;
    transition: filter 140ms ease; margin-bottom: 22px;
  }
  .sidenav-brand:hover { filter: brightness(1.12); }
  .sidenav-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
    color: var(--ink-3); padding: 0 10px; margin-bottom: 8px;
  }
  .sidenav-items { display: flex; flex-direction: column; gap: 2px; }
  .sidenav-item {
    display: flex; align-items: center; gap: 13px; width: 100%;
    padding: 10px 12px; border-radius: 12px;
    color: var(--ink-2); font-size: 15px; font-weight: 500; text-align: left;
    transition: background 120ms ease, color 120ms ease;
  }
  .sidenav-item:hover { background: color-mix(in oklab, var(--ink) 5%, transparent); color: var(--ink); }
  .sidenav-item.is-active {
    background: color-mix(in oklab, var(--ok) 13%, var(--card));
    color: color-mix(in oklab, var(--ok) 72%, var(--ink)); font-weight: 600;
  }
  .sidenav-ic { width: 22px; height: 22px; display: grid; place-items: center; flex-shrink: 0; }
  .sidenav-ic svg { width: 20px; height: 20px; }
  .sidenav-item-label { flex: 1; }
  .sidenav-badge {
    background: color-mix(in oklab, var(--no) 16%, transparent); color: var(--no);
    font-size: 12px; font-weight: 700; line-height: 1;
    padding: 4px 8px; border-radius: 999px;
  }
  .sidenav-account {
    display: flex; align-items: center; gap: 11px; width: 100%;
    margin-top: auto; padding: 11px 10px; border-radius: 14px;
    border-top: 1px solid var(--rule); border-radius: 0;
    transition: background 120ms ease;
  }
  .sidenav-account:hover { background: color-mix(in oklab, var(--ink) 4%, transparent); }
  .sidenav-avatar {
    width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
    background: var(--nav); color: #fff; display: grid; place-items: center;
    font-size: 15px; font-weight: 700;
  }
  .sidenav-account-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; text-align: left; }
  .sidenav-handle { font-size: 14px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidenav-role { font-size: 12px; color: var(--ink-3); }
  .sidenav-signout { color: var(--ink-3); flex-shrink: 0; display: grid; place-items: center; }
  .sidenav-account:hover .sidenav-signout { color: var(--ink-2); }
}

/* =====================================================================
   BOTTOM TAB BAR — phones only. Replaces the top pill nav < 760px with a
   thumb-reachable bar; both are rendered, CSS shows the right one.
   ===================================================================== */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .topnav-wrap { display: none; }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: flex; align-items: stretch;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in oklab, var(--card) 86%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    box-shadow: 0 -1px 0 var(--rule), 0 -8px 24px -16px rgba(30,30,28,0.18);
  }
  .bn-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 8px 2px; min-height: 52px; border-radius: 12px;
    color: var(--ink-4); background: none; border: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: color 130ms ease, transform 120ms cubic-bezier(0.22,1,0.36,1);
  }
  .bn-tab:active { transform: scale(0.94); }
  .bn-tab.is-active { color: var(--accent-ink); }
  .bn-tab svg { width: 24px; height: 24px; transition: transform 220ms cubic-bezier(0.34,1.4,0.5,1); }
  .bn-tab.is-active svg { transform: translateY(-1px) scale(1.06); }
  .bn-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; }

  /* reserve space so screen content clears the fixed bar */
  .home-shell,
  .review-shell, .stats-shell, .categories-shell, .settings-shell, .mistakes-shell,
  .class-shell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
/* Signature: teal pill + white circular icon badge (the .cta-arrow) */
.cta-primary {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--accent); color: #fff;
  padding: 8px 10px 8px 22px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  min-height: 50px;
  transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 1px 2px rgba(10,90,80,0.18);
}
.cta-primary:hover { background: var(--accent-ink); transform: translateY(-1px); }
.cta-primary:active { transform: translateY(0); }
.cta-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.cta-arrow {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  background: #fff; color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700; line-height: 1;
  transition: transform 160ms ease;
}
.cta-primary:hover .cta-arrow { transform: translateX(2px); }

/* Neutral pill (secondary) */
.cta-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--rule-2);
  font-size: 14px; font-weight: 500;
  min-height: 48px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.cta-secondary:hover { background: var(--bg-2); color: var(--ink); border-color: var(--ink-4); }

/* Outline ghost (back / small) */
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--rule-2);
  background: var(--card);
  min-height: 42px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.ghost-btn:hover { background: var(--bg-2); color: var(--ink); border-color: var(--ink-4); }
.ghost-arrow { font-weight: 700; }

.text-link {
  font-size: 13px; font-weight: 500; color: var(--accent-ink);
  background: transparent;
}
.text-link:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }
.text-link.danger { color: var(--no); }
.text-link.danger:hover { color: var(--no); }

/* =====================================================================
   HOME
   ===================================================================== */
.home-shell { max-width: 1120px; margin: 0 auto; padding: 12px 24px 64px; }
@media (max-width: 720px) { .home-shell { padding: 8px 16px 60px; } }

.home-hero { padding: 26px 0 26px; }
.hero-eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 5px 12px; border-radius: 999px;
  margin-bottom: 20px;
}
.hero-title {
  font-weight: 700;
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 16px 0;
  text-wrap: pretty;
  max-width: 20ch;
}
.hero-sub { max-width: 56ch; color: var(--ink-3); font-size: 16px; margin: 0 0 28px 0; }
.hero-cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.hero-meta-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 32px;
}
@media (max-width: 720px) { .hero-meta-row { grid-template-columns: repeat(2, 1fr); } }
.meta-tile {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.meta-tile-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.meta-tile-value { font-weight: 700; font-size: 30px; letter-spacing: -0.02em; line-height: 1.05; }
.meta-tile-sub { font-size: 12px; color: var(--ink-3); }

/* Day-streak tile → gateway to the streak-pet screen (desktop dashboard) */
.streak-tile {
  flex-direction: row; align-items: center; justify-content: space-between;
  gap: 8px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color 140ms ease, transform 120ms ease, box-shadow 160ms ease;
}
.streak-tile:hover { border-color: var(--ink-4); }
.streak-tile:active { transform: scale(0.99); }
.streak-tile .streak-tile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.streak-tile .meta-tile-sub { color: var(--accent); font-weight: 600; white-space: nowrap; }
.streak-tile-pet { flex: 0 0 auto; display: grid; place-items: center; margin-right: -2px; }

/* ===================================================================
   Editorial desktop Home (Desktop Home - Editorial.html). Container-light:
   bare stats, hairlines, only two faint "earned" containers. Uses app tokens
   so it adapts to light/dark (its dark palette is the app's dark palette).
   =================================================================== */
.ed-home { max-width: 1080px; margin: 0 auto; padding: 40px 8px 56px; }
.ed-home .num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ed-eyebrow { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.ed-eyebrow-accent { color: var(--accent); }
.ed-heading { font-size: 20px; font-weight: 600; color: var(--ink); margin: 0; letter-spacing: -0.015em; }
.ed-heading-row { display: flex; align-items: center; gap: 9px; }
.ed-warn-tri { width: 17px; height: 17px; flex: 0 0 auto; color: var(--no); }
.ed-head-rule { border: 0; border-top: 1px solid var(--rule-2); margin: 14px 0 0; }

/* ROW 1 — countdown (type event) + start (earned container) */
.ed-row-top { display: grid; grid-template-columns: 1.42fr 1fr; gap: 44px; align-items: stretch; }
.ed-countdown { display: flex; flex-direction: column; justify-content: center; }
.ed-count-sub { font-size: 16px; color: var(--ink-3); margin: 14px 0 0; max-width: 42ch; line-height: 1.5; }
.ed-countdown .ege-countdown { text-align: left; margin: 0; }
.ed-countdown .ege-cd-label { font-size: 14px; color: var(--ink-3); text-transform: none; letter-spacing: 0; font-weight: 500; margin-bottom: 0; }
.ed-countdown .ege-cd-units { display: flex; align-items: flex-start; justify-content: flex-start; gap: 20px; margin: 18px 0 0; }
.ed-countdown .ege-cd-unit { min-width: 0; }
.ed-countdown .ege-cd-sep { font-size: 46px; font-weight: 300; color: var(--ink-4); line-height: 1; margin-top: 4px; align-self: flex-start; }
.ed-countdown .ege-cd-unit { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ed-countdown .ege-cd-unit .n { font-size: clamp(48px, 5.4vw, 64px); font-weight: 500; line-height: 0.9; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.ed-countdown .ege-cd-unit .u { font-size: 12px; color: var(--ink-4); text-transform: none; letter-spacing: 0; font-weight: 400; }

.ed-start { background: var(--bg-2); border: 1px solid var(--rule); border-radius: 12px; padding: 26px 28px; display: flex; flex-direction: column; }
.ed-start-title { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 8px 0 0; color: var(--ink); }
.ed-start-spacer { flex: 1; min-height: 22px; }
.ed-start-row { display: flex; gap: 12px; align-items: stretch; }
.ed-seg { flex: 1; }
.ed-cta { min-height: 54px; }
.ed-resume { display: inline-block; font-size: 14px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); margin-top: 14px; cursor: pointer; background: none; border: 0; font-family: inherit; padding: 0; text-align: left; }
.ed-resume-empty { cursor: default; text-decoration: none; color: var(--ink-4); }

/* ROW 2 — stats (no containers) */
.ed-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--rule-2); }
.ed-stat { display: flex; flex-direction: column; gap: 7px; }
.ed-stat-num { font-size: 40px; font-weight: 500; line-height: 1; color: var(--ink); }
.ed-stat-label { font-size: 12px; color: var(--ink-3); }
.ed-stat-sub { font-size: 12px; color: var(--ink-4); }

/* ROW 3 — mastery + (weakest container / mistakes line) */
.ed-row-mid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 44px; margin-top: 48px; align-items: start; }
.ed-mrows { margin-top: 14px; }
.ed-mrow { display: grid; grid-template-columns: 1fr 120px 44px; align-items: center; gap: 18px; padding: 14px 0; border-top: 1px solid var(--rule); }
.ed-mrow:first-child { border-top: 0; }
.ed-mrow-nm { font-size: 14px; font-weight: 500; color: var(--ink); }
.ed-mrow-bar { height: 4px; border-radius: 999px; background: var(--rule-2); overflow: hidden; }
.ed-mrow-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.ed-mrow-pct { font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: right; }
.ed-mastery-empty { font-size: 14px; color: var(--ink-3); margin-top: 16px; line-height: 1.5; }

.ed-right { display: flex; flex-direction: column; gap: 36px; }
.ed-weakest { background: var(--bg-2); border-left: 2px solid var(--accent); border-radius: 0 12px 12px 0; padding: 22px 26px; }
.ed-wtitle { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin: 9px 0 0; color: var(--ink); }
.ed-wtitle .ed-em { color: var(--accent); }
.ed-wsub { font-size: 14px; color: var(--ink-3); margin: 6px 0 16px; }

.ed-tlink { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; font-family: inherit; padding: 0; cursor: pointer; color: var(--accent); font-size: 14px; font-weight: 600; }
.ed-tlink .ed-arr { font-size: 15px; transition: transform 130ms; }
.ed-tlink:hover .ed-arr { transform: translateX(3px); }
.ed-tlink-no { color: var(--no); }

.ed-mline { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 16px; }
.ed-mtext { font-size: 16px; color: var(--ink-2); }
.ed-mtext b { color: var(--ink); font-weight: 600; }

/* ROW 4 — streak strip (compact footnote) */
.ed-streak { display: flex; align-items: center; gap: 16px; width: 100%; margin-top: 44px; padding: 18px 0 0; border-top: 1px solid var(--rule-2); background: none; border-left: 0; border-right: 0; border-bottom: 0; font-family: inherit; color: inherit; text-align: left; cursor: pointer; }
.ed-streak-pet { flex: 0 0 auto; }
.ed-streak-info { display: flex; flex-direction: column; gap: 2px; }
.ed-streak-line { font-size: 16px; color: var(--ink); }
.ed-streak-line b { font-weight: 600; }
.ed-streak-meta { font-size: 12px; color: var(--ink-4); }
.ed-streak-week { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.ed-wd { width: 11px; height: 11px; border-radius: 50%; background: var(--rule-2); }
.ed-wd.on { background: var(--accent); }
.ed-wd.today { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 26%, transparent); }
.ed-streak-go { font-size: 22px; color: var(--ink-4); margin-left: 6px; }

@media (max-width: 1040px) {
  .ed-row-top, .ed-row-mid { grid-template-columns: 1fr; gap: 32px; }
  .ed-stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

.home-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
@media (max-width: 820px) { .home-cards { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.card-eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3);
}

.streak-card {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center;
  background: var(--ok-tint);
  border-color: color-mix(in oklab, var(--ok) 28%, var(--rule));
}
@media (max-width: 560px) { .streak-card { grid-template-columns: 1fr; gap: 16px; } }
.streak-card .card-eyebrow { color: color-mix(in oklab, var(--ok) 55%, var(--ink-3)); }
.streak-body { display: flex; flex-direction: column; gap: 6px; }
.streak-title { font-weight: 700; font-size: 21px; line-height: 1.28; letter-spacing: -0.01em; margin: 6px 0 0; text-wrap: pretty; }
.streak-sub { font-size: 13px; color: var(--ink-3); }
.streak-cta { justify-self: end; }
@media (max-width: 560px) { .streak-cta { justify-self: stretch; } }

.resume-card { display: flex; flex-direction: column; gap: 12px; }
.resume-body { padding: 6px 0 2px; }
.resume-line { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.resume-line b { color: var(--ink); font-weight: 700; }
.resume-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.resume-cta { display: flex; gap: 8px; margin-top: 4px; }

.cat-list { list-style: none; padding: 0; margin: 10px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.cat-list.large { gap: 8px; }
.cat-row {
  display: grid; grid-template-columns: auto 1fr 80px 44px 40px; align-items: center; gap: 12px;
  padding: 7px 0;
}
.cat-list:not(.large) .cat-row { grid-template-columns: auto 1fr 80px 44px; }
@media (max-width: 480px) {
  .cat-row { grid-template-columns: auto 1fr 44px !important; }
  .cat-bar, .cat-count { display: none; }
}
.status-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
  background: var(--ink-4);
}
.status-dot[data-level="ok"]   { background: var(--ok); }
.status-dot[data-level="warn"] { background: var(--warn); }
.status-dot[data-level="no"]   { background: var(--no); }
.status-dot[data-level="none"] { background: var(--rule-2); }
.cat-name { font-size: 14px; color: var(--ink-2); }
.cat-bar { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.cat-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 280ms ease; }
.cat-pct { font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: right; }
.cat-count { font-size: 11px; color: var(--ink-4); text-align: right; }
.card-action { display: inline-block; margin-top: 8px; }

.home-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 4px 0; font-size: 12px; color: var(--ink-3);
}

/* =====================================================================
   PRACTICE
   ===================================================================== */
.practice-shell { max-width: 1080px; margin: 0 auto; padding: 22px 24px 80px; min-height: 100vh; min-height: 100dvh; }
@media (max-width: 720px) { .practice-shell { padding: 14px 16px calc(var(--action-bar-h) + 24px); } }

.practice-header {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding-bottom: 22px;
}
.practice-progress { display: flex; align-items: center; gap: 12px; min-width: 0; }
.progress-track { flex: 1; height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 360ms cubic-bezier(.2,.7,.2,1); }
:root[data-motion="reduced"] .progress-fill { transition: none; }
.progress-label { font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }

.practice-stage { display: grid; grid-template-columns: 210px 1fr; gap: 28px; align-items: start; }
:root[data-rail="off"] .practice-stage { grid-template-columns: 1fr; }
:root[data-rail="off"] .stat-rail { display: none; }

@media (max-width: 880px) {
  /* Task-first: stack as a single column and demote the four stats to ONE thin
     divided strip ABOVE the question (not four cards on top of the task).
     Selectors are prefixed with .practice-stage so they out-specify the base
     .stat-rail / .stat-chip rules, which are defined LATER in this file. */
  .practice-stage { display: flex; flex-direction: column; gap: 0; }
  .practice-stage .stat-rail {
    position: static; order: -1;
    display: flex; flex-direction: row; flex-wrap: nowrap;
    gap: 0; margin: 0 0 14px; padding: 0; overflow: hidden; top: auto;
    background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  }
  .practice-stage .stat-rail::-webkit-scrollbar { display: none; }
  .practice-stage .stat-rail .stat-chip {
    flex: 1; min-width: 0; padding: 9px 4px; background: none;
    display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center;
    border: 0; border-right: 1px solid var(--rule); border-radius: 0;
  }
  .practice-stage .stat-rail .stat-chip:last-child { border-right: 0; }
  .practice-stage .stat-rail .stat-chip.is-accent { background: var(--accent-soft); }
  .practice-stage .stat-chip-value { font-size: 18px; }
  .practice-stage .stat-chip-value.is-mono { font-size: 15px; }
  .practice-stage .stat-chip-label { font-size: 9.5px; letter-spacing: 0.06em; }
  .practice-stage .stat-chip-sub,
  .practice-stage .rail-divider, .practice-stage .rail-meta { display: none; }
}
@media (max-width: 420px) {
  .practice-stage .stat-chip-value { font-size: 16px; }
}

.stat-rail { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 20px; }
.stat-chip {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-md);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.stat-chip.is-accent { border-color: color-mix(in oklab, var(--accent) 40%, var(--rule)); background: var(--accent-tint); }
.stat-chip-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.stat-chip-value { font-weight: 700; font-size: 24px; letter-spacing: -0.01em; line-height: 1; }
.stat-chip-value.is-mono { font-size: 18px; }
.stat-chip-sub { font-size: 11px; color: var(--ink-3); }
.rail-divider { height: 1px; background: var(--rule); margin: 4px 0; }
.rail-meta { display: flex; flex-direction: column; gap: 8px; padding: 0 2px; }
.rail-meta-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.rail-meta-row b { color: var(--ink-2); font-weight: 600; }
.rail-source { text-align: right; flex: 1; }

.qcard {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-xl);
  padding: 36px 40px; box-shadow: var(--shadow-pop);
  transition: border-color 200ms ease;
}
[data-density="compact"] .qcard { padding: 26px 30px; }
@media (max-width: 720px) { .qcard { padding: 22px 18px; border-radius: var(--radius-lg); } }
.qcard[data-feedback="ok"] { border-color: color-mix(in oklab, var(--ok) 50%, var(--rule)); }
.qcard[data-feedback="no"] { border-color: color-mix(in oklab, var(--no) 50%, var(--rule)); }

.qcard-eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3); margin-bottom: 20px;
}
.dot-sep { color: var(--ink-4); }
.eyebrow-source { color: var(--ink-3); }
.task-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-2);
}
.task-tag[data-task="word-formation"]  { background: var(--accent-soft); color: var(--accent-ink); }
.task-tag[data-task="grammar"]         { background: color-mix(in oklab, #3b82c4 16%, var(--bg-2)); color: color-mix(in oklab, #3b82c4 70%, var(--ink)); }
.task-tag[data-task="multiple-choice"] { background: var(--warn-soft); color: color-mix(in oklab, var(--warn) 60%, var(--ink)); }
.task-tag[data-task="irregular"]       { background: color-mix(in oklab, #a05bb0 16%, var(--bg-2)); color: color-mix(in oklab, #a05bb0 66%, var(--ink)); }
.base-chip {
  margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--ink); color: var(--card);
  padding: 4px 10px; border-radius: 999px;
}

.qprompt {
  font-weight: 600;
  font-size: clamp(24px, 3.2vw, 36px);
  letter-spacing: -0.015em; line-height: 1.3;
  margin: 0 0 26px; text-wrap: pretty;
}
@media (max-width: 760px) { .qprompt { font-size: clamp(26px, 7.4vw, 34px); line-height: 1.26; margin-bottom: 24px; } }
.qprompt .blank {
  display: inline-block; min-width: 4em;
  border-bottom: 2.5px solid var(--accent);
  padding: 0 0.18em; margin: 0 0.08em; vertical-align: baseline;
  line-height: 1; text-align: center; color: var(--accent-ink);
  font-weight: 700; border-radius: 2px;
  transition: background 200ms ease, border-color 200ms ease;
}
.qprompt .blank.is-filled { background: var(--accent-soft); padding: 0 0.4em; min-width: 0; border-radius: 6px; }
.qprompt .blank.is-wrong-fill { background: var(--no-soft); border-bottom-color: var(--no); color: color-mix(in oklab, var(--no) 72%, var(--ink)); }
:root[data-motion="reduced"] .qprompt .blank { transition: none; }

.answer-form { margin-top: 4px; }
.answer-input {
  width: 100%; font-weight: 600;
  font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -0.01em;
  padding: 12px 14px; background: var(--bg-2);
  border: 1.5px solid var(--rule-2); border-radius: var(--radius-md);
  color: var(--ink); transition: border-color 160ms ease, background 160ms ease;
  min-height: 56px;
}
.answer-input::placeholder { color: var(--ink-4); font-weight: 400; }
.answer-input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.answer-input:disabled { color: var(--ink-2); }

.mc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
@media (max-width: 720px) { .mc-options { grid-template-columns: 1fr; gap: 8px; } }
@media (max-width: 880px) and (orientation: landscape) { .mc-options { grid-template-columns: 1fr 1fr; } }
.mc-option {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 15px 18px; background: var(--bg-2);
  border: 1.5px solid var(--rule-2); border-radius: var(--radius-md);
  font-weight: 600; font-size: 19px; letter-spacing: -0.005em; color: var(--ink);
  min-height: 60px; position: relative;
  transition: background 140ms ease, border-color 140ms ease, transform 120ms ease, opacity 200ms ease;
}
.mc-option:hover:not(:disabled) { background: var(--card); border-color: var(--ink-4); }
.mc-option:active:not(:disabled) { transform: scale(0.995); }
.mc-index {
  font-size: 12px; font-weight: 700; color: var(--ink-3);
  width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--rule-2); border-radius: 6px; flex-shrink: 0;
}
@media (max-width: 720px) { .mc-index { display: none; } .mc-option { font-size: 18px; } }
.mc-text { flex: 1; }
.mc-mark { font-size: 15px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; color: #fff; }
.mc-option.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.mc-option.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.mc-option.is-correct .mc-mark { background: var(--ok); }
.mc-option.is-wrong { border-color: var(--no); background: var(--no-soft); }
.mc-option.is-wrong .mc-mark { background: var(--no); }
.mc-option.is-wrong .mc-text { text-decoration: line-through; text-decoration-color: var(--no); }
.mc-option.is-faded { opacity: 0.4; }

.feedback-bar {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 18px;
  margin-top: 22px; padding: 14px 18px; border-radius: var(--radius-md);
  background: var(--bg-2);
  opacity: 0; transform: translateY(4px); pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, background 220ms ease;
  min-height: 60px;
}
:root[data-motion="reduced"] .feedback-bar { transition: none; }
.feedback-bar.is-shown { opacity: 1; transform: translateY(0); pointer-events: auto; }
.feedback-bar.is-ok { background: var(--ok-soft); }
.feedback-bar.is-no { background: var(--no-soft); }
.feedback-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.feedback-line { font-size: 14px; color: var(--ink-2); }
.feedback-line b { color: var(--ink); font-weight: 700; }
.feedback-answer { font-weight: 700; font-size: clamp(19px, 2.4vw, 24px); line-height: 1.25; color: var(--ink); margin-top: 2px; text-wrap: pretty; }
.feedback-gain {
  font-weight: 700; font-size: 22px; color: var(--ok);
  justify-self: end; white-space: nowrap; padding-left: 14px;
  border-left: 1px solid color-mix(in oklab, var(--ok) 30%, transparent);
}

.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 0; }
.action-summary { font-size: 13px; color: var(--ink-3); }
.link-btn { font-size: 14px; font-weight: 500; color: var(--ink-3); padding: 12px 4px; min-height: 44px; }
.link-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.primary-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--accent); color: #fff;
  padding: 8px 10px 8px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 600; min-height: 50px;
  transition: background 140ms ease, transform 140ms ease;
}
.primary-btn:hover { background: var(--accent-ink); }
.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.kbd-hint {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%;
  background: #fff; color: var(--accent-ink);
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}

@media (max-width: 720px) {
  .action-bar {
    position: fixed; inset: auto 0 0 0; height: var(--action-bar-h); margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--rule);
    box-shadow: 0 -8px 24px -12px rgba(0,0,0,0.14); z-index: 50;
  }
  .primary-btn { min-height: 52px; }
}

/* =====================================================================
   RESULTS
   ===================================================================== */
.results-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 40px 20px; }
.results-card {
  width: 100%; max-width: 640px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--radius-xl);
  padding: 44px 40px; box-shadow: var(--shadow-pop); text-align: center;
}
@media (max-width: 560px) { .results-card { padding: 30px 22px; } }
.results-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-ink); margin-bottom: 14px; }
.results-headline { font-weight: 700; font-size: clamp(30px, 4.4vw, 44px); letter-spacing: -0.02em; margin: 0 0 24px; line-height: 1.06; }

.result-donut { display: grid; place-items: center; margin: 0 auto 28px; position: relative; width: 184px; height: 184px; }
.result-donut svg { transform: rotate(-90deg); }
.result-donut-center { position: absolute; inset: 0; display: grid; place-items: center; }
.result-donut-pct { font-weight: 700; font-size: 38px; letter-spacing: -0.02em; line-height: 1; }
.result-donut-lbl { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.result-legend { display: flex; gap: 18px; justify-content: center; margin: -8px 0 24px; font-size: 13px; color: var(--ink-2); }
.result-legend span { display: inline-flex; align-items: center; gap: 7px; }
.result-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.results-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 20px;
  padding: 24px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  text-align: left;
}
@media (max-width: 560px) { .results-grid { grid-template-columns: repeat(2, 1fr); } }
.result-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.result-stat-value { font-weight: 700; font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; margin-top: 4px; }
.result-stat-value.is-mono { font-size: 22px; }
.results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding-top: 24px; }

/* =====================================================================
   SUB-PAGES
   ===================================================================== */
.review-shell, .stats-shell, .categories-shell, .settings-shell, .mistakes-shell {
  max-width: 1120px; margin: 0 auto; padding: 14px 24px 80px;
}
@media (max-width: 720px) { .review-shell, .stats-shell, .categories-shell, .settings-shell, .mistakes-shell { padding: 10px 16px 60px; } }

.sub-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 2px 22px; }
.sub-title { font-weight: 700; font-size: 26px; letter-spacing: -0.02em; }
.sub-lead { color: var(--ink-3); font-size: 14px; margin: -8px 0 22px; max-width: 64ch; }

/* Review */
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 20px 24px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 26px; align-items: start;
}
@media (max-width: 640px) { .review-card { grid-template-columns: 1fr; gap: 14px; } }
.review-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin-bottom: 10px; }
.review-base { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: var(--card); }
.review-prompt h2 { font-weight: 600; font-size: 19px; letter-spacing: -0.01em; margin: 0; line-height: 1.4; }
.review-answers { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.review-line { display: flex; align-items: center; gap: 10px; }
.review-tag { font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.04em; }
.review-tag.is-ok { background: var(--ok-soft); color: color-mix(in oklab, var(--ok) 62%, var(--ink)); }
.review-tag.is-no { background: var(--no-soft); color: color-mix(in oklab, var(--no) 62%, var(--ink)); }
.review-text { font-weight: 600; }
.review-text.strike { text-decoration: line-through; text-decoration-color: var(--no); color: var(--ink-3); font-weight: 500; }
.review-alts { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 980px) { .stats-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 540px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.big-stat {
  background: var(--ok-tint); border: 1px solid color-mix(in oklab, var(--ok) 24%, var(--rule));
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.big-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: color-mix(in oklab, var(--ok) 45%, var(--ink-3)); }
.big-stat-value { font-weight: 700; font-size: 30px; letter-spacing: -0.02em; line-height: 1; margin-top: 8px; }
.big-stat-sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.stats-card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 14px; }
.stats-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-title { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; margin: 4px 0 0; }
.legend { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--ink-3); }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; background: var(--accent); display: inline-block; margin-right: 4px; }
.legend-dot.is-line { background: var(--ink-2); border-radius: 50%; }

.chart { display: grid; gap: 6px; height: 160px; align-items: end; padding: 8px 0 4px; }
.chart-col { display: flex; flex-direction: column; align-items: stretch; height: 100%; min-width: 0; }
.chart-stack { position: relative; flex: 1; }
.chart-bar { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); opacity: 0.9; border-radius: 4px 4px 0 0; transition: height 280ms ease; }
.chart-acc { position: absolute; left: -2px; right: -2px; height: 2px; background: var(--ink-2); border-radius: 1px; }
.chart-label { font-size: 9px; color: var(--ink-4); text-align: center; margin-top: 6px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 820px) { .stats-grid { grid-template-columns: 1fr; } }

.weak-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.weak-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--rule); }
.weak-row:first-child { border-top: 0; padding-top: 0; }
.weak-en { font-size: 13px; color: var(--ink); line-height: 1.35; max-width: 38ch; }
.weak-es { font-weight: 700; font-size: 14px; color: var(--accent-ink); margin-top: 2px; }
.weak-meta { text-align: right; flex-shrink: 0; }
.weak-acc { font-weight: 700; font-size: 14px; color: var(--no); }
.weak-seen { font-size: 11px; color: var(--ink-4); }

.session-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.session-row { display: grid; grid-template-columns: 1.5fr 0.85fr 0.85fr 1.1fr 0.9fr auto; gap: 12px; padding: 12px 8px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); align-items: center; }
.session-row:first-child { border-top: 0; }
.session-row b { color: var(--ink); font-weight: 700; }
.session-stat.mono { color: var(--ink-3); }
.session-date { color: var(--ink-3); font-size: 12px; }
@media (max-width: 720px) { .session-row { grid-template-columns: 1fr 1fr; gap: 6px 12px; } }

.muted { color: var(--ink-3); font-size: 14px; }

/* Tests / categories */
.family-section { margin-bottom: 30px; }
.family-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.family-title { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; margin: 0; }
.family-blurb { font-size: 13px; color: var(--ink-3); }

.cat-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.cat-card {
  text-align: left; padding: 18px 20px; background: var(--card);
  border: 1px solid var(--rule); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
  min-height: 118px;
}
.cat-card:hover { border-color: var(--ink-4); transform: translateY(-1px); }
.cat-card.is-on { border-color: color-mix(in oklab, var(--accent) 50%, var(--rule)); background: var(--accent-tint); }
.cat-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cat-card-title { font-weight: 700; font-size: 17px; letter-spacing: -0.005em; line-height: 1.3; }
.cat-card-blurb { font-size: 12px; color: var(--ink-3); }
.cat-card-foot { font-size: 11px; color: var(--ink-4); display: flex; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.cat-card-mastery { color: var(--accent-ink); font-weight: 600; }

/* ---- Direction-A Tests enrichments (status dot + mastery bar) ---- */
.cats-grouped { max-width: 1000px; margin: 0 auto; }
@media (min-width: 761px) { .cats-grouped .cat-card-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }
.cats-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.cats-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.cat-card-titlewrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cat-card-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-4); flex-shrink: 0; }
.cat-card-dot[data-level="ok"] { background: var(--ok); }
.cat-card-dot[data-level="warn"] { background: var(--warn); }
.cat-card-dot[data-level="no"] { background: var(--no); }
.cat-card .cat-card-bar { margin-top: auto; padding-top: 14px; }
.cat-card .cat-card-foot { margin-top: 10px; padding-top: 0; }
.cat-card-track { display: block; height: 7px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 8%, transparent); overflow: hidden; }
.cat-card-fill { display: block; height: 100%; border-radius: 999px; background: var(--ink-4); transition: width 320ms ease; }
.cat-card-fill[data-level="ok"] { background: var(--ok); }
.cat-card-fill[data-level="warn"] { background: var(--warn); }
.cat-card-fill[data-level="no"] { background: var(--no); }
.cat-card-mastery[data-level="ok"] { color: var(--ok); }
.cat-card-mastery[data-level="warn"] { color: var(--warn); }
.cat-card-mastery[data-level="no"] { color: var(--no); }
.cat-card-mastery.is-muted { color: var(--ink-4); font-weight: 500; }
.cats-footnote { font-size: 12px; color: var(--ink-4); margin-top: 16px; max-width: 70ch; }

/* Settings */
.settings-list { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-top: 1px solid var(--rule); }
.setting-row:first-child { border-top: 0; }
.setting-text { min-width: 0; }
.setting-label { font-size: 15px; font-weight: 600; color: var(--ink); }
.setting-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.setting-control { flex-shrink: 0; }

/* ---- Direction-A grouped Settings (desktop) ---- */
.settings-grouped { max-width: 1000px; margin: 0 auto; }
.set-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.set-autosave { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.set-autosave-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.set-account { display: flex; align-items: center; gap: 16px; padding: 20px 24px; margin-bottom: 18px; }
.set-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--nav); color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 700; flex-shrink: 0; }
.set-account-text { flex: 1; min-width: 0; }
.set-account-name { font-size: 17px; font-weight: 700; }
.set-account-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.set-account-sub strong { color: var(--ink-2); font-weight: 700; }
.set-signout { flex-shrink: 0; }
.set-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.set-groups-col { display: flex; flex-direction: column; gap: 18px; }
.set-group { padding: 14px 22px 6px; }
.set-group-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 12px; }
.set-group .setting-row { padding-left: 0; padding-right: 0; }
.set-group .setting-nav { padding-left: 0; padding-right: 0; }
@media (max-width: 760px) {
  .settings-grouped { max-width: 100%; }
  .set-groups { grid-template-columns: 1fr; gap: 14px; }
  .set-account { padding: 16px 18px; }
  .set-signout { padding: 8px 12px; }
}

.switch {
  width: 46px; height: 26px; padding: 2px; background: var(--bg-3); border-radius: 999px;
  display: inline-flex; align-items: center; transition: background 200ms ease; cursor: pointer; border: 0;
}
.switch > span { width: 22px; height: 22px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 200ms ease; }
.switch.is-on { background: var(--accent); }
.switch.is-on > span { transform: translateX(20px); }

.segmented { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: 999px; border: 1px solid var(--rule); }
.segmented-btn { padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-3); min-height: 36px; transition: background 140ms ease, color 140ms ease; }
.segmented-btn.is-on { background: var(--accent); color: #fff; font-weight: 600; }

/* ===================================================================
   Mistakes / Review redesign — compact card (header + count + Review CTA),
   most-missed preview rows, then a Join-a-live-game entry.
   =================================================================== */
.mk-eyebrow { font-size: 13px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 14px; }
.mk-seg { margin-bottom: 14px; }
.mk-card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.mk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mk-head-l { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mk-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--no); flex: 0 0 auto; }
.mk-title { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.mk-count {
  display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 7px;
  border-radius: 999px; background: color-mix(in oklab, var(--no) 20%, transparent);
  color: var(--no); font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.mk-review {
  display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; cursor: pointer;
  padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 14.5px; font-weight: 700; transition: transform 120ms ease, filter 140ms ease;
}
.mk-review:hover { filter: brightness(1.05); }
.mk-review:active { transform: scale(0.97); }
.mk-review-arrow { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: rgba(255,255,255,0.22); font-size: 15px; }
.mk-sub { margin: 9px 0 2px; font-size: 13px; color: var(--ink-3); }
.mk-list { list-style: none; margin: 6px 0 0; padding: 0; }
.mk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--rule); }
.mk-row:first-child { border-top: none; }
.mk-row-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mk-base {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--rule-2);
  padding: 3px 8px; border-radius: 7px; white-space: nowrap; flex: 0 0 auto;
}
.mk-arrow { color: var(--ink-4); flex: 0 0 auto; }
.mk-ans { font-size: 15px; font-weight: 700; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-miss { font-size: 13px; font-weight: 700; color: var(--no); white-space: nowrap; flex: 0 0 auto; }
.mk-more { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.mk-more:hover { color: var(--ink-2); }
.mk-empty { text-align: center; padding: 30px 18px; }
.mk-live { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer; transition: border-color 140ms ease, transform 120ms ease; }
.mk-live:hover { border-color: var(--ink-4); }
.mk-live:active { transform: scale(0.995); }
.mk-live-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.mk-live-ic svg { width: 22px; height: 22px; }
.mk-live-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mk-live-text b { font-size: 15px; font-weight: 700; color: var(--ink); }
.mk-live-text > span { font-size: 13px; color: var(--ink-3); }
.mk-live-go { font-size: 22px; color: var(--ink-4); flex: 0 0 auto; }

/* Density */
[data-density="compact"] { --radius-xl: 14px; }
[data-density="compact"] .home-shell { padding: 12px 24px 60px; }
[data-density="compact"] .hero-title { font-size: clamp(28px, 4.6vw, 46px); }
[data-density="compact"] .qprompt { font-size: clamp(22px, 3.6vw, 30px); }
[data-density="compact"] .meta-tile-value { font-size: 26px; }
[data-density="compact"] .big-stat-value { font-size: 26px; }
[data-density="compact"] .stat-chip { padding: 10px 12px; }

/* ============================================================
   AUTH SCREEN — sign-in / create-account card (teal reskin)
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-pop);
  padding: 30px 26px 22px;
}
.auth-brand { text-align: center; margin: 4px 0 22px; }
.auth-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.02em;
}
.auth-wordmark .tn-brand-main { color: var(--ink); }
.auth-wordmark .tn-brand-accent { color: var(--accent); }
.auth-tagline { margin-top: 8px; color: var(--ink-3); font-size: 13px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg-2);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab.is-on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-card); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px;            /* keep >=16px to avoid iOS zoom-on-focus */
  color: var(--ink);
  background: var(--bg-2);
  border: 1.5px solid var(--rule-2);
  border-radius: var(--radius-md);
  transition: border-color .15s, background .15s;
}
.auth-input::placeholder { color: var(--ink-4); }
.auth-input:focus { outline: none; border-color: var(--accent); background: var(--card); }

.auth-err {
  font-size: 13px;
  color: var(--no);
  background: var(--no-soft);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  line-height: 1.4;
}
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }

.auth-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-note { font-size: 12px; color: var(--ink-4); line-height: 1.45; }

/* ============================================================
   STATS MASTERY — grouped by task type (3 families)
   ============================================================ */
.mastery-group + .mastery-group { margin-top: 18px; }
.mastery-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}
.mastery-group-name { flex: 1; font-weight: 700; font-size: 14px; color: var(--ink); }
.mastery-group-pct { font-weight: 700; font-size: 13px; color: var(--ink-2); }

/* ============================================================
   HOME — centered launcher (variation B)
   ============================================================ */
.vb-home { max-width: 940px; }
.vb-launch { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 0 36px; }
.vb-title { max-width: 17ch; }
.vb-sub { max-width: 52ch; margin-bottom: 26px; }
.vb-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.segmented.big { border-radius: 999px; }
.segmented.big .segmented-btn { padding: 13px 24px; font-size: 15px; min-height: 48px; }
.cta-primary.lg { padding: 11px 11px 11px 28px; font-size: 16px; min-height: 58px; }
.cta-primary.lg .cta-arrow { width: 38px; height: 38px; font-size: 18px; }
.vb-resume {
  margin-top: 20px; font-size: 13px; color: var(--ink-3);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2);
}
.vb-resume:hover { color: var(--ink); text-decoration-color: var(--ink-3); }
.vb-home .hero-meta-row { margin-top: 8px; }
.vb-cards { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }

/* ---- Direction-A dashboard (desktop only) ---- */
.vb-dashboard { max-width: 1080px; }
.vb-dashboard .vb-top {
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 20px; align-items: stretch;
  margin: 8px 0 18px;
}
.vb-countdown-card, .vb-launch-card { padding: 26px 28px; display: flex; flex-direction: column; }
.vb-countdown-card { justify-content: center; }
.vb-countdown-card .ege-countdown { text-align: left; align-items: flex-start; }
.vb-cd-tagline { margin-top: 16px; font-size: 14px; color: var(--ink-3); max-width: 34ch; }
.vb-launch-card .card-eyebrow { margin-bottom: 6px; }
.vb-launch-headline { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 18px; }
.vb-launch-card .vb-controls { justify-content: flex-start; margin-top: auto; }
.vb-launch-card .vb-resume { align-self: flex-start; }

.vb-dashboard .vb-bottom {
  display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 20px; align-items: start;
  margin-top: 18px;
}
.vb-dashboard .vb-bottom-col { display: flex; flex-direction: column; gap: 16px; }
.vb-mastery-card { padding: 22px 24px; }
.vb-mastery-card .card-eyebrow { margin-bottom: 16px; }
.vb-mastery-list { display: flex; flex-direction: column; gap: 15px; }
.vb-mastery-row { display: grid; grid-template-columns: 10px minmax(96px,auto) 1fr 42px; align-items: center; gap: 13px; }
.vb-mastery-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.vb-mastery-label { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.vb-mastery-track { height: 8px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 8%, transparent); overflow: hidden; }
.vb-mastery-fill { display: block; height: 100%; border-radius: 999px; background: var(--ink-3); transition: width 320ms ease; }
.vb-mastery-pct { font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: right; }
.vb-mastery-dot[data-level="ok"], .vb-mastery-fill[data-level="ok"] { background: var(--ok); }
.vb-mastery-dot[data-level="warn"], .vb-mastery-fill[data-level="warn"] { background: var(--warn); }
.vb-mastery-dot[data-level="no"], .vb-mastery-fill[data-level="no"] { background: var(--no); }
.vb-mastery-empty { font-size: 14px; color: var(--ink-3); }
/* On the dashboard the streak/mistakes cards stack in the right column. */
.vb-dashboard .streak-card, .vb-dashboard .mistakes-card { grid-template-columns: 1fr; gap: 16px; }

/* Mistakes card on Home */
.mistakes-card {
  display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center;
  background: var(--no-soft); border-color: color-mix(in oklab, var(--no) 26%, var(--rule));
}
@media (max-width: 560px) { .mistakes-card { grid-template-columns: 1fr; gap: 16px; } }
.mistakes-card .card-eyebrow { color: color-mix(in oklab, var(--no) 52%, var(--ink-3)); }
.mistakes-title { font-weight: 700; font-size: 21px; letter-spacing: -0.01em; margin: 6px 0 0; line-height: 1.28; }
.mistakes-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; max-width: 48ch; }
.mistakes-cta:disabled { opacity: 0.4; }
@media (max-width: 560px) { .mistakes-cta { justify-self: stretch; } }

/* ============================================================
   MISTAKES screen
   ============================================================ */
.mistakes-count-row { margin-bottom: 14px; }
.mistakes-count { font-size: 13px; color: var(--ink-3); }
.mistakes-count b { color: var(--ink); font-weight: 700; }
.mistake-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mistake-row {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 18px 22px; display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center;
}
.mistake-row { border-left: 3px solid color-mix(in oklab, var(--no) 55%, var(--rule)); }
.mistake-main { min-width: 0; }
.mistake-eyebrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.mistake-base { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--card); }
.mistake-sentence { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink); letter-spacing: -0.005em; text-wrap: pretty; }
.mistake-answer { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.mistake-answer b { color: var(--accent-ink); font-weight: 700; }
.mistake-alts { color: var(--ink-4); }
.mistake-meta { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.mistake-miss { font-weight: 700; font-size: 20px; color: var(--no); line-height: 1; }
.mistake-misslabel { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-4); }
.mistake-acc { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
@media (max-width: 560px) {
  .mistake-row { grid-template-columns: 1fr auto; gap: 14px; padding: 16px 18px; }
  .mistake-sentence { font-size: 15px; }
}
.mistakes-empty {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 48px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.mistakes-empty-mark {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok); font-size: 24px; font-weight: 700; margin-bottom: 6px;
}
.mistakes-empty-title { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.mistakes-empty .muted { max-width: 44ch; }

/* =====================================================================
   MOTION — soft, spring-based "feel" layer (mobile). Entrances animate
   TRANSFORM ONLY so content is always visible even if the timeline is
   throttled (backgrounded PWA tab). Honors the Reduce-motion toggle
   (data-motion="reduced") and the OS prefers-reduced-motion setting.
   ===================================================================== */
:root { --spring: cubic-bezier(0.34, 1.4, 0.5, 1); --ease: cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes m-tick   { 0% { transform: scale(1); } 45% { transform: scale(0.95); } 100% { transform: scale(1); } }
@keyframes m-bump   { 0% { transform: scale(1); } 38% { transform: scale(1.26); } 100% { transform: scale(1); } }
@keyframes m-task-in { from { transform: translateY(14px); } to { transform: none; } }
@keyframes m-opt-in  { from { transform: translateY(12px); } to { transform: none; } }
@keyframes m-fb-in   { from { transform: translateY(12px); } to { transform: none; } }

/* visual "tick" — the iOS-safe haptic surrogate fired by tapFeedback() */
.is-ticking { animation: m-tick 160ms var(--ease); }
/* live value bump (driven by <Pop>) */
.is-bump { display: inline-block; animation: m-bump 360ms var(--spring); }

/* per-question entrance + MC stagger + feedback spring (mobile only) */
@media (max-width: 880px) {
  .qcard    { animation: m-task-in 340ms var(--spring); }
  .feedback { animation: m-fb-in 300ms var(--spring); }
  .mc-option { animation: m-opt-in 300ms var(--ease); animation-fill-mode: backwards; }
  .mc-option:nth-child(1) { animation-delay: 30ms; }
  .mc-option:nth-child(2) { animation-delay: 70ms; }
  .mc-option:nth-child(3) { animation-delay: 110ms; }
  .mc-option:nth-child(4) { animation-delay: 150ms; }
}

/* tappable press dip (additive; desktop unaffected since these are touch UI) */
.bn-tab:active, .segmented-btn:active { transform: scale(0.95); }

/* settings: tappable navigation row (Classroom) */
.setting-nav { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.setting-chevron { font-size: 20px; color: var(--ink-3); font-weight: 600; flex-shrink: 0; }

/* Reduce-motion: zero durations. Entrances are transform-only with no
   fill:forwards, so they rest at their visible (transform:none) state. */
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important;
}

/* =====================================================================
   LIVE QUIZ — entry points on Home + the TopNav "Live" dot.
   The 2×2 shape glyph reuses the live shape colours.
   ===================================================================== */
.vb-live-glyph { display: inline-grid; grid-template-columns: repeat(2, 1fr); gap: 2px; --q-shape-0:#19b39f; --q-shape-1:#5aa6e6; --q-shape-2:#e6b24c; --q-shape-3:#a98fe0; }
.vb-live-glyph .lv-shape-tri { color: var(--q-shape-0); }
.vb-live-glyph .lv-shape-dia { color: var(--q-shape-1); }
.vb-live-glyph .lv-shape-cir { color: var(--q-shape-2); }
.vb-live-glyph .lv-shape-sqr { color: var(--q-shape-3); }
.vb-live-btn { display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; }
.tn-live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--no); margin-right: 6px; vertical-align: middle; }

.vb-host-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer;
  background: var(--accent-tint); border: 1px solid color-mix(in oklab, var(--accent) 28%, var(--rule));
  border-radius: var(--radius-lg); padding: 18px 20px; transition: transform 120ms ease, box-shadow 160ms ease;
}
.vb-host-card:active { transform: scale(0.99); }
.vb-host-l { flex: 1; }
.vb-host-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); }
.vb-host-title { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; margin: 6px 0 4px; }
.vb-host-sub { font-size: 13.5px; color: var(--ink-3); line-height: 1.4; }
.vb-host-go { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 18px; font-weight: 700; }

/* Live entry: the on-page button is MOBILE-ONLY (the join entry on phones).
   On desktop the only Live entry is the top-bar "Live" tab. */
.vb-controls .vb-live-btn { display: none; }
@media (max-width: 760px) { .vb-controls .vb-live-btn { display: inline-flex; } }

/* ===== EGE countdown (home hero) ===== */
.ege-countdown { text-align: center; margin: 2px 0 16px; }
.ege-cd-label { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-ink); margin-bottom: 12px; }
.ege-cd-units { display: inline-flex; align-items: flex-start; gap: 8px; justify-content: center; }
.ege-cd-unit { display: flex; flex-direction: column; align-items: center; min-width: 62px; }
.ege-cd-unit .n { font-size: clamp(40px, 9vw, 70px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ege-cd-unit .u { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); margin-top: 7px; }
.ege-cd-sep { font-size: clamp(30px, 6.5vw, 52px); font-weight: 300; color: var(--ink-4); line-height: 1; margin-top: 2px; }
.ege-cd-now { font-size: clamp(26px, 6vw, 42px); font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 420px) { .ege-cd-unit { min-width: 50px; } .ege-cd-units { gap: 4px; } }

/* StreakCard CTA matches the Mistakes card: right-aligned + vertically centered
   on the same level as the text (handled by .streak-card's `align-items:center`
   grid + .streak-cta `justify-self:end`; stretches on mobile like Mistakes). */

/* tappable stat boxes (tap to read what the metric means) */
.big-stat.is-tappable { cursor: pointer; width: 100%; display: block; text-align: left; font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; transition: background 120ms ease; }
.big-stat.is-tappable:hover { background: color-mix(in oklab, var(--ok) 10%, var(--ok-tint)); }
.big-stat-i { float: right; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid currentColor; font-size: 10px; font-weight: 700; opacity: 0.5; line-height: 1; }
.big-stat-info { font-size: 12.5px; line-height: 1.42; color: var(--ink-2); margin-top: 9px; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* PWA: when installed (standalone) the bottom nav can sit lower — no browser
   toolbar to clear — so trim the extra bottom gap the browser build needs. */
@media (max-width: 760px) {
  :root[data-standalone="true"] .bottom-nav { padding-bottom: calc(2px + env(safe-area-inset-bottom)); }
  :root[data-standalone="true"] .bn-tab { padding-top: 4px; }
}

/* add-to-home-screen banner (browser only) */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--rule-2); box-shadow: var(--shadow-pop); max-width: 460px; margin: 0 auto; }
.install-glyph { flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-tint); }
.install-text { flex: 1; min-width: 0; }
.install-title { font-weight: 700; font-size: 14px; }
.install-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.install-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.cta-primary.sm { padding: 8px 14px; min-height: 0; font-size: 13px; }
.install-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); font-size: 18px; }
.install-x:hover { background: var(--bg-2); color: var(--ink); }

/* PWA: lower the installed-app bottom nav a touch more (down to the safe-area
   floor — can't go under the home indicator). */
@media (max-width: 760px) {
  :root[data-standalone="true"] .bottom-nav { padding-bottom: env(safe-area-inset-bottom); padding-top: 2px; }
  :root[data-standalone="true"] .bn-tab { padding-top: 2px; }
}

/* tests coverage bar (how many of this exam's questions you've tried) */
.coverage-bar { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 14px 18px; margin-bottom: 18px; }
.coverage-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.coverage-n { font-size: 14px; color: var(--ink-2); }
.coverage-n b { color: var(--ink); font-weight: 700; }
.coverage-pct { font-size: 14px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.coverage-track { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.coverage-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 300ms ease; }

/* report-a-problem (under each practice question) */
.report-control { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.report-link { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.report-link:hover { color: var(--ink); }
.report-thanks { font-size: 13px; color: var(--ok); font-weight: 600; }
.report-panel { display: flex; flex-direction: column; gap: 10px; }
.report-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.report-reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.report-chip { font-size: 13px; padding: 7px 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--rule); color: var(--ink-2); }
.report-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.report-note { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--rule-2); background: var(--card); font-size: 14px; color: var(--ink); }
.report-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.report-cancel { font-size: 13px; color: var(--ink-3); padding: 8px 12px; }
.report-cancel:hover { color: var(--ink); }
.report-send { font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px; background: var(--accent); color: #fff; }
.report-send:disabled { opacity: 0.45; }

/* ===== Session review modal (review every question of a past test) ===== */
.session-row.is-tappable { cursor: pointer; transition: background 120ms ease; border-radius: 8px; }
.session-row.is-tappable:hover { background: var(--bg-2); }
.session-review { color: var(--accent-ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
.rv-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(20,22,21,0.5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .rv-scrim { align-items: center; padding: 24px; } }
.rv-modal { background: var(--card); width: 100%; max-width: 640px; max-height: 90dvh; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-pop); }
@media (min-width: 640px) { .rv-modal { border-radius: 20px; max-height: calc(100dvh - 48px); } }
.rv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--rule); flex: 0 0 auto; }
.rv-title { font-weight: 700; font-size: 17px; }
.rv-sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.rv-x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); font-size: 14px; flex: 0 0 auto; }
.rv-body { overflow-y: auto; padding: 14px 22px 22px; display: flex; flex-direction: column; gap: 12px; }
.rv-q { border: 1px solid var(--rule); border-radius: 14px; padding: 14px 16px; }
.rv-q.is-no { border-color: color-mix(in oklab, var(--no) 35%, var(--rule)); background: var(--no-soft); }
.rv-q.is-ok { border-color: color-mix(in oklab, var(--ok) 28%, var(--rule)); }
.rv-q-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rv-mk { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; }
.rv-mk.ok { background: var(--ok); }
.rv-mk.no { background: var(--no); }
.rv-q-cue { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; background: var(--ink); color: var(--card); padding: 3px 9px; border-radius: 999px; }
.rv-q-fam { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.rv-q-sentence { font-size: 15px; line-height: 1.4; font-weight: 500; }
.rv-q-answers { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; }
.rv-q-correct b { color: var(--ok); }
.rv-q-your { color: var(--no); }

/* ===== OGE passage task (fill the whole text, then check together) ===== */
.passage { display: flex; flex-direction: column; }
.passage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.passage-sub { font-size: 12px; color: var(--ink-4); font-weight: 600; }
.passage-instr { font-size: 13px; color: var(--ink-3); line-height: 1.5; margin: 12px 0 0; }
.passage-instr b { color: var(--ink-2); font-weight: 700; }
/* Calm reading rhythm; the inline gap is a 2-row stack, so the line box must be
   tall enough that cues never bleed into the line above. */
.passage-text { font-size: clamp(16px, 2vw, 19px); line-height: 2.7; margin: 22px 0 6px; text-wrap: pretty; }
.passage-gap { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 4px; }
.passage-cue { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; margin-bottom: 3px; white-space: nowrap; }
.passage-num { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: color-mix(in oklab, var(--accent) 20%, transparent); color: var(--accent-ink); font-size: 9px; font-weight: 800; }
.passage-cueword { color: var(--ink-3); }
.passage-mark { font-size: 11px; font-weight: 900; }
.passage-mark.is-ok { color: var(--ok); }
.passage-mark.is-no { color: var(--no); }
.passage-input { font: inherit; font-size: 0.82em; text-align: center; padding: 3px 10px; border: 1px solid var(--rule); border-bottom: 2px solid var(--ink-4); background: var(--bg-2); border-radius: 8px; min-width: 72px; color: var(--ink); transition: background 120ms ease, border-color 120ms ease; }
.passage-input:focus { outline: none; border-color: var(--accent); background: var(--accent-tint); }
.passage-gap.is-filled .passage-input { background: var(--accent-tint); border-color: color-mix(in oklab, var(--accent) 45%, var(--rule)); border-bottom-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.passage-gap.is-ok .passage-input { border-color: color-mix(in oklab, var(--ok) 45%, var(--rule)); border-bottom-color: var(--ok); background: var(--ok-soft); color: color-mix(in oklab, var(--ok) 62%, var(--ink)); font-weight: 600; }
.passage-gap.is-no .passage-input { border-color: color-mix(in oklab, var(--no) 40%, var(--rule)); border-bottom-color: var(--no); background: var(--no-soft); color: color-mix(in oklab, var(--no) 62%, var(--ink)); text-decoration: line-through; }
.passage-correct { font-size: 11px; font-weight: 700; color: var(--ok); margin-top: 3px; white-space: nowrap; }
.passage-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 22px; }
.passage-action-btns { display: flex; align-items: center; gap: 16px; }
.passage-idk { color: var(--ink-3); font-size: 14px; white-space: nowrap; }
.passage-idk:hover { color: var(--ink); }
@media (max-width: 560px) { .passage-action-btns { gap: 10px; } .passage-idk { font-size: 13px; } }
.passage-counter { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.passage-counter.is-perfect { color: var(--ok); }
.passage-tick { margin-left: 8px; font-weight: 900; }
.passage-actions .primary-btn { position: static; box-shadow: none; flex-shrink: 0; }
