/* ── Sir Isaac Newton Education Center design system ────────────────────────────────────────────────
   Self-contained (no CDNs/webfonts — strict CSP). Deep-navy + electric-blue
   palette with a recurring sine-wave motif. */

:root {
  --ink:        #0b1b33;   /* deep navy — headings, nav */
  --ink-soft:   #33415c;   /* body text */
  --ink-faint:  #64748b;   /* secondary text */
  --paper:      #ffffff;
  --paper-alt:  #f4f7fc;   /* alternating sections */
  --line:       #e2e8f2;
  --blue:       #2563eb;   /* primary action */
  --blue-deep:  #1d4ed8;
  --cyan:       #06b6d4;   /* gradient partner */
  --gold:       #f59e0b;   /* accents / badges */
  --green:      #16a34a;
  --red:        #dc2626;
  --radius:     14px;
  --shadow:     0 1px 2px rgba(11,27,51,.06), 0 8px 24px rgba(11,27,51,.07);
  --shadow-lg:  0 2px 4px rgba(11,27,51,.08), 0 16px 48px rgba(11,27,51,.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* The [hidden] attribute must always win — otherwise same-specificity rules
   like `.btn { display: inline-flex }` (declared later in the cascade) show
   a "hidden" button anyway. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--ink-soft);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }

h1, h2, h3 { color: var(--ink); line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 800; }
h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* One keyboard focus ring for the whole site. :focus-visible keeps it off
   mouse clicks, so it never reads as a stray outline. */
:focus-visible {
  outline: 3px solid rgba(37,99,235,.55);
  outline-offset: 2px; border-radius: 4px;
}
.cta-band :focus-visible, .footer :focus-visible { outline-color: rgba(125,211,252,.8); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; }

/* ── Demo banner ─────────────────────────────────────────────────────────── */
.demo-banner {
  background: var(--gold); color: #442c00; text-align: center;
  font-size: 13px; font-weight: 600; padding: 6px 16px;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  /* min-height, not height: a wrapped two-line brand name must be able to
     grow the bar rather than spill out of it. */
  min-height: 64px; position: relative;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em;
}
.nav-brand:hover { text-decoration: none; }
/* The mark is a self-coloured SVG loaded through <img>, so it keeps its own
   gradient on any background the lockup sits on. */
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; display: block; border-radius: 9px; }
.nav-brand .brand-mark { transition: transform .18s ease; }
.nav-brand:hover .brand-mark { transform: rotate(-4deg) scale(1.04); }
/* The brand name is five words. It cannot sit on one line beside the mark at
   phone width, so it wraps in a controlled way (balanced, tight leading, capped
   width) instead of overflowing the header or forcing a horizontal scrollbar.
   The old two-word name used white-space: nowrap, which would clip this one. */
.brand-name {
  line-height: 1.12;
  max-width: 16ch;
  text-wrap: balance;
}
@media (max-width: 700px) {
  /* Wide enough that the name breaks to two lines beside the mark, not four.
     Too narrow a cap here is what turns a five-word name into a tall header. */
  .nav-brand { font-size: 15px; gap: 7px; }
  .brand-name { max-width: 19ch; }
}
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a {
  color: var(--ink-soft); font-size: 14.5px; font-weight: 600;
  padding: 8px 2px; white-space: nowrap;
}
.nav-links a:hover { color: var(--blue); text-decoration: none; }
/* `.nav-links a` outranks `.btn-primary`, which left the nav CTA rendering
   dark-on-blue. Restate the button colours for links inside the nav. */
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #fff; }
.nav-links a.btn-outline, .nav-links a.btn-outline:hover { color: var(--blue); }
.nav-links a.btn-light, .nav-links a.btn-light:hover { color: var(--ink); }
.inline-form { display: inline; }
.nav-cta-wrap { margin-left: 4px; }
.nav-cta { flex-shrink: 0; }

.nav-toggle-check { display: none; }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; padding: 8px; border-radius: 8px; cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--paper-alt); }
.nav-toggle span {
  display: block; width: 100%; height: 2px; border-radius: 2px;
  background: var(--ink); transition: transform .18s ease, opacity .18s ease;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font); font-size: 14.5px; font-weight: 700;
  padding: 10px 20px; border-radius: 10px; border: 2px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease,
  background .12s ease; text-decoration: none !important; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(37,99,235,.45); }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: rgba(37,99,235,.06); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-faint); }
.btn-light { background: #fff; color: var(--ink); }
.btn-sm { font-size: 13px; padding: 7px 14px; border-radius: 8px; }
.btn-lg { font-size: 16px; padding: 13px 26px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; text-align: center;
  background:
    radial-gradient(1000px 500px at 85% -10%, rgba(6,182,212,.16), transparent 60%),
    radial-gradient(900px 500px at 10% -20%, rgba(37,99,235,.18), transparent 60%),
    var(--paper);
  padding: 96px 0 140px;
}
.hero-inner { position: relative; z-index: 1; max-width: 780px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; color: var(--blue);
  background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.2);
  padding: 5px 14px; border-radius: 999px; margin-bottom: 20px;
}
.grad-text {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 18px; color: var(--ink-faint); max-width: 620px; margin: 18px auto 0; }
/* A status note in the hero — used on the programme pages while the practice
   platform is still in build (SITE_MODE=placeholder). Reads as an aside, not
   an error: bordered rather than tinted, so it sits under the sub-heading
   without competing with the CTA below it. */
.hero-note {
  font-size: 15px; color: var(--ink-faint); max-width: 620px;
  margin: 18px auto 0; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  text-align: left;
}
.hero-copy .hero-note { margin-left: 0; margin-right: 0; max-width: 34rem; }
/* The direct-email line beside the contact form. Sits under the intro copy as
   a quieter alternative to the form, not a competing call to action. */
.contact-direct { margin-top: 14px; font-size: 15px; color: var(--ink-faint); }
.contact-direct a { font-weight: 600; overflow-wrap: anywhere; }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.hero-wave {
  position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 90px;
  color: var(--paper-alt);
}

/* Graph-paper wash behind the hero. Purely decorative, and faint enough that
   text contrast is unaffected. */
.hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(37,99,235,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 50% 0%, #000 35%, transparent 78%);
}

/* ── Split hero (marketing home) ─────────────────────────────────────────── */
.hero-split { text-align: left; padding: 84px 0 150px; }
.hero-split-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 56px; align-items: center;
}
.hero-copy .hero-sub { margin-left: 0; margin-right: 0; max-width: 34rem; }
.hero-copy .hero-cta { justify-content: flex-start; }
.hero-copy h1 { max-width: 15ch; }

.hero-trust {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 32px;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.hero-trust li {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.hero-trust .icon { width: 19px; height: 19px; color: var(--blue); }
.hero-inner .hero-trust { justify-content: center; margin-top: 34px; }

/* The hero visual: a plotted sine curve, which is what the practice is named
   after. Decorative, so it is hidden from assistive tech. */
.hero-visual { position: relative; }
.plot-card {
  margin: 0; background: var(--paper); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px 20px 16px; box-shadow: var(--shadow-lg);
  transform: rotate(-1.2deg);
}
.plot-card svg { display: block; width: 100%; height: auto; }
.plot-card figcaption {
  margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px;
  max-width: 62%;   /* keeps the caption clear of the overlapping chip */
}
@media (max-width: 900px) { .plot-card figcaption { max-width: none; } }
.plot-card figcaption b { color: var(--ink); font-weight: 800; }
.plot-chip {
  position: absolute; right: -10px; bottom: -30px;
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 16px; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 700;
  color: var(--ink);
}
.plot-chip .icon { width: 20px; height: 20px; color: var(--green); }
.plot-chip small { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-faint); }

@media (max-width: 900px) {
  .hero-split { text-align: center; padding-top: 64px; }
  .hero-split-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-copy h1 { max-width: none; }
  .hero-copy .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-copy .hero-cta { justify-content: center; }
  .hero-trust { justify-content: center; }
  .hero-visual { max-width: 460px; margin: 0 auto; }
  .plot-chip { right: 0; }
}

/* ── Step Up For Students ────────────────────────────────────────────────────
   Approved-provider signalling. `.step-up-wordmark` is the typographic
   fallback shown until the official badge file is dropped into
   static/img/logos/ — it is our own type treatment of the programme name, not
   an approximation of their artwork. See templates/marketing/_step_up.html. */
/* Sized by width: the supplied badge is a wide lockup (646x209) whose
   "MARKETPLACE PROVIDER" line goes unreadable if it is scaled to fit a height.
   Both sizes stay at or under half the source width, so it stays crisp on a
   2x display. The artwork has a white background rather than alpha, so every
   placement sits it on a white plate with clear space around it. */
.step-up-logo { display: block; height: auto; object-fit: contain; }
.step-up-logo-sm { width: 186px; max-width: 100%; }
.step-up-logo-lg { width: 300px; max-width: 100%; }
.step-up-plate {
  display: block; background: #fff; border-radius: 10px; padding: 10px 12px;
  border: 1px solid var(--line);
}

.step-up-wordmark { display: block; line-height: 1.2; }
.step-up-kicker {
  display: block; font-size: 10px; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--blue);
}
.step-up-name {
  display: block; font-weight: 800; color: var(--ink); letter-spacing: -0.015em;
}
.step-up-wordmark-sm .step-up-name { font-size: 15px; }
.step-up-wordmark-lg .step-up-kicker { font-size: 11.5px; margin-bottom: 4px; }
.step-up-wordmark-lg .step-up-name { font-size: clamp(20px, 2.4vw, 26px); }

/* Compact badge — hero and pricing pages. */
.step-up-badge {
  display: inline-flex; align-items: center; gap: 16px; margin-top: 28px;
  padding: 14px 20px; border-radius: 16px; text-align: left;
  background: linear-gradient(135deg, rgba(37,99,235,.07), rgba(6,182,212,.09));
  border: 1px solid rgba(37,99,235,.22); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none !important;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.step-up-badge:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
  border-color: rgba(37,99,235,.42);
}
.step-up-badge-text { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.step-up-badge-text small {
  display: block; margin-top: 3px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-faint);
}
/* The pricing pages sit under a left-aligned page head, not a centred hero. */
.step-up-badge-compact { margin-top: 22px; }

/* The full section. Centred and narrow rather than a full-width two-column
   slab: the badge is a wide lockup, and pinning it in a side rail left it
   marooned in a tall empty column. Stacking it above the copy lets it lead,
   and caps the line length at something readable. */
.step-up-section { padding-top: 8px; }
.step-up-inner { max-width: 680px; }
.step-up-card {
  display: grid; gap: 22px; justify-items: center; text-align: center;
  padding: 34px 32px;
  position: relative; overflow: hidden;
  border-color: rgba(37,99,235,.22);
  background:
    radial-gradient(520px 280px at 100% 0%, rgba(6,182,212,.10), transparent 62%),
    linear-gradient(135deg, rgba(37,99,235,.06), rgba(6,182,212,.05));
  box-shadow: var(--shadow-lg);
}
/* White plate: the artwork has a white background rather than alpha, so this
   makes that read as deliberate clear space instead of a seam on the tint. */
.step-up-mark .step-up-plate { padding: 14px 20px; border: none; border-radius: 12px; }

.step-up-body h2 { margin-bottom: 10px; }
.step-up-lead { color: var(--ink-soft); font-size: 16.5px; margin: 0 auto; }

.step-up-programs {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px 24px; margin-top: 18px;
}
.step-up-programs li {
  display: flex; align-items: center; gap: 9px;
  font-size: 14.5px; font-weight: 700; color: var(--ink);
}
.step-up-programs .icon { width: 19px; height: 19px; color: var(--green); }

.step-up-cta {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(37,99,235,.16);
}
.step-up-note { font-size: 13.5px; color: var(--ink-faint); max-width: 34rem; }

@media (max-width: 620px) {
  .step-up-card { padding: 26px 20px; }
  .step-up-logo-lg { width: 100%; max-width: 260px; }
}
@media (max-width: 560px) {
  .step-up-badge { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .step-up-badge, .step-up-badge:hover { transition: none; transform: none; }
}

/* ── Sections & cards ────────────────────────────────────────────────────── */
.section { padding: 72px 0; }
.section-alt { background: var(--paper-alt); }
.section-title { text-align: center; margin-bottom: 44px; }
.section-head { text-align: center; max-width: 44rem; margin: 0 auto 44px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 { margin-bottom: 10px; }
.section-head p { color: var(--ink-faint); font-size: 16.5px; }
.section-sub { font-size: 20px; margin: 40px 0 16px; }
.page-head { padding-bottom: 12px; }
.page-head h1 { margin-top: 8px; }
/* .hero-sub centres itself; under a left-aligned page heading it should not. */
.page-head .hero-sub { margin-left: 0; margin-right: 0; }

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}

.feature-grid, .bank-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
  align-items: stretch;
}
.feature-grid > .card, .bank-grid > .card { height: 100%; }
/* Stroke icons from templates/_icons.html — one drawing style, inheriting
   `currentColor` so a tile can restate the colour without touching the SVG. */
.icon { width: 24px; height: 24px; flex-shrink: 0; display: block; }

.feature-icon {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(37,99,235,.13), rgba(6,182,212,.13));
  border: 1px solid rgba(37,99,235,.14);
  color: var(--blue-deep);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature-icon .icon { width: 26px; height: 26px; }
.feature { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,.28); }
.feature:hover .feature-icon {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(37,99,235,.22);
}
.feature p { font-size: 14.5px; color: var(--ink-faint); margin-top: 6px; }

/* Reduced-motion users get the colour changes without the movement. */
@media (prefers-reduced-motion: reduce) {
  .feature, .feature-icon, .feature:hover, .feature:hover .feature-icon,
  .nav-brand .brand-mark, .nav-brand:hover .brand-mark { transition: none; transform: none; }
  html { scroll-behavior: auto; }
}

.steps {
  list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px; counter-reset: step; position: relative; align-items: stretch;
}
/* A hairline that threads the numbered badges together, so the three cards read
   as one sequence rather than three unrelated boxes. Desktop only — once the
   cards stack, the line would point nowhere. */
.steps::before {
  content: ''; position: absolute; top: 2px; left: 12%; right: 12%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,.35), rgba(6,182,212,.35), transparent);
}
@media (max-width: 760px) { .steps::before { display: none; } }
.step { position: relative; padding-top: 34px; height: 100%; }
.step-num {
  position: absolute; top: -18px; left: 22px;
  width: 40px; height: 40px; border-radius: 999px; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff; font-weight: 800; box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.step p { font-size: 14.5px; color: var(--ink-faint); margin-top: 6px; }

.callout {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  flex-wrap: wrap; margin-bottom: 24px; padding: 34px 36px;
  position: relative; overflow: hidden; border-color: rgba(37,99,235,.18);
  background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(6,182,212,.08));
}
/* The mark, oversized and faded, as a watermark. */
.callout-mark {
  position: absolute; right: -26px; bottom: -56px; width: 220px; height: 220px;
  opacity: .09; pointer-events: none; transform: rotate(-8deg);
}
/* Lift the real content above the watermark without disturbing the watermark's
   own absolute positioning. */
.callout > :not(.callout-mark) { position: relative; z-index: 1; }
.callout-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue);
}
.callout-eyebrow .icon { width: 17px; height: 17px; }
.callout p { color: var(--ink-faint); margin-top: 6px; max-width: 560px; }

.cta-band {
  text-align: center; padding: 80px 24px; position: relative; overflow: hidden;
  background:
    radial-gradient(800px 400px at 50% 120%, rgba(6,182,212,.25), transparent 60%),
    radial-gradient(700px 380px at 8% -20%, rgba(37,99,235,.28), transparent 60%),
    var(--ink);
}
.cta-band::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(125,211,252,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125,211,252,.16) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(90% 80% at 50% 0%, #000, transparent 75%);
          mask-image: radial-gradient(90% 80% at 50% 0%, #000, transparent 75%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #a9b8d4; margin: 10px 0 26px; }

.contact-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  text-align: left; max-width: 940px;
}
.contact-intro h2 { margin-bottom: 4px; }
.contact-alt-link { color: #fff; text-decoration: underline; }
.contact-form { padding: 28px; text-align: left; }
.contact-form .field:last-of-type { margin-bottom: 20px; }
/* Honeypot: visually hidden (not display:none, so it still "renders" for
   simple bots) but unreachable and invisible to real visitors. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 760px) {
  .contact-layout { grid-template-columns: 1fr; text-align: center; }
  .contact-form { text-align: left; }
}

/* ── Pricing ─────────────────────────────────────────────────────────────── */
/* Tracks are capped rather than 1fr: a tier whose Stripe price ID is unset
   renders no card, and an uncapped grid would stretch whatever is left into
   one full-width slab. Centred so a short row still sits under the heading. */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 330px));
  gap: 22px; align-items: stretch; justify-content: center;
}
.pricing-grid > .card { height: 100%; }
.price-card { display: flex; flex-direction: column; gap: 16px; position: relative; }
.price-featured { border: 2px solid var(--blue); box-shadow: var(--shadow-lg); }
.price-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--blue), var(--cyan)); color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 999px;
}
.price { font-size: 42px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }
.price span { font-size: 15px; font-weight: 600; color: var(--ink-faint); letter-spacing: 0; }
.check-list { list-style: none; display: grid; gap: 9px; }
.check-list li { padding-left: 26px; position: relative; font-size: 14.5px; }
.check-list li::before {
  content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 800;
}
.excl-list { list-style: none; display: grid; gap: 9px; }
.excl-list li { padding-left: 26px; position: relative; font-size: 14.5px; color: var(--ink-faint); }
.excl-list li::before { content: '—'; position: absolute; left: 0; font-weight: 800; }
.fine-print { font-size: 12.5px; color: var(--ink-faint); }

/* ── Forms & auth ────────────────────────────────────────────────────────── */
.auth-page main { background: var(--paper-alt); }
.auth-wrap { min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px; }
.auth-mark {
  display: block; width: 52px; height: 52px; border-radius: 14px;
  margin: 0 0 18px; box-shadow: 0 6px 18px rgba(11,27,51,.18);
}
.auth-title { font-size: 26px; margin-bottom: 6px; }
.auth-sub { color: var(--ink-faint); font-size: 14.5px; margin-bottom: 24px; }
.auth-meta { text-align: right; margin-top: 12px; font-size: 13px; }
.auth-switch { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; text-align: center; font-size: 14px; }
.center { text-align: center; }
.big-check {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: rgba(22,163,74,.12); color: var(--green); font-weight: 800;
}

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.field .hint, .hint { font-weight: 500; color: var(--ink-faint); font-size: 12.5px; }
.field input, .field textarea, .grant-form input, .search-form input {
  width: 100%; font-family: var(--font); font-size: 15px;
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  color: var(--ink); background: #fff; transition: border-color .12s, box-shadow .12s;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field textarea:focus, .grant-form input:focus, .search-form input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 12.5px; font-weight: 700;
  color: var(--blue); cursor: pointer; padding: 6px 8px;
}
.password-toggle:hover { text-decoration: underline; }
.hint-ok   { color: var(--green); }
.hint-warn { color: var(--ink-faint); }

/* ── Alerts & badges ─────────────────────────────────────────────────────── */
.flash-stack { padding-top: 20px; display: grid; gap: 10px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 12px;
  border-radius: 999px; letter-spacing: .02em;
}
.badge-success { background: rgba(22,163,74,.12); color: var(--green); }
.badge-info    { background: rgba(37,99,235,.1); color: var(--blue-deep); }
.badge-muted   { background: #eef1f6; color: var(--ink-faint); }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head .badge { vertical-align: middle; }
.bank-card { display: flex; flex-direction: column; gap: 8px; }
.bank-card p { font-size: 14px; color: var(--ink-faint); flex: 1; }
.bank-section {
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cyan);
}
.bank-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.bank-count { font-size: 13px; color: var(--ink-faint); }
.empty-state { text-align: center; color: var(--ink-faint); padding: 40px; }

.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
tr:last-child td { border-bottom: none; }
.admin-message-body { max-width: 420px; white-space: pre-wrap; }

/* ── Quiz ────────────────────────────────────────────────────────────────── */
.question-card { margin-top: 22px; border: 1px solid var(--line); }
fieldset.question-card { min-width: 0; }
.q-num {
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue); padding: 0 6px;
}
.q-prompt { font-size: 16.5px; color: var(--ink); margin: 10px 0 16px; white-space: pre-wrap; }
.q-passage {
  font-size: 15px; color: var(--ink-soft); margin: 12px 0 4px; padding: 14px 16px;
  background: var(--paper-alt); border-left: 3px solid var(--cyan);
  border-radius: 0 10px 10px 0; white-space: pre-wrap;
}
.explanation-miss { border-left: 3px solid var(--gold); }
.fib-field label { font-size: 14px; font-weight: 700; color: var(--ink); }
.fib-field input {
  display: block; margin-top: 6px; width: 100%; max-width: 260px;
  font-family: var(--font); font-size: 15px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink);
}
.fib-field input:focus { outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.fib-review { display: grid; gap: 4px; font-size: 15px; margin-top: 4px; }
.q-choices { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer;
  transition: border-color .12s, background .12s; position: relative;
}
.choice:hover { border-color: var(--blue); background: rgba(37,99,235,.04); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-letter {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--ink-soft);
  background: var(--paper-alt); border: 1.5px solid var(--line);
}
.choice:has(input:checked) { border-color: var(--blue); background: rgba(37,99,235,.07); }
.choice:has(input:checked) .choice-letter { background: var(--blue); border-color: var(--blue); color: #fff; }
.choice-text { padding-top: 3px; }
.submit-row { margin-top: 28px; text-align: center; }

/* results review */
.choice-static { cursor: default; }
.choice-static:hover { border-color: var(--line); background: transparent; }
.review-right  { border-left: 4px solid var(--green); }
.review-wrong  { border-left: 4px solid var(--red); }
.choice-correct { border-color: var(--green); background: rgba(22,163,74,.06); }
.choice-correct .choice-letter { background: var(--green); border-color: var(--green); color: #fff; }
.choice-picked-wrong { border-color: var(--red); background: rgba(220,38,38,.05); }
.choice-picked-wrong .choice-letter { background: var(--red); border-color: var(--red); color: #fff; }
.choice-tag { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-faint); padding-top: 5px; }
.explanation {
  margin-top: 16px; padding: 14px 16px; border-radius: 10px; font-size: 14.5px;
  background: var(--paper-alt); border: 1px solid var(--line);
}
.score-card { text-align: center; padding: 34px; margin-bottom: 8px; }
.score-big { font-size: 56px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }
.score-big span { font-size: 26px; color: var(--ink-faint); }
.score-label { color: var(--ink-faint); font-size: 14px; }

/* ── Practice modes (dashboard front doors) ──────────────────────────────── */
.mode-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px; margin: 8px 0 36px;
}
.mode-card {
  display: flex; align-items: center; gap: 16px; text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,.4); }
.mode-card h3 { color: var(--ink); }
.mode-card p { font-size: 13.5px; color: var(--ink-faint); margin-top: 3px; }
.mode-icon {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(6,182,212,.14));
}
.mode-card-accent { border-color: rgba(37,99,235,.35); background:
  linear-gradient(135deg, rgba(37,99,235,.04), rgba(6,182,212,.05)); }
.mode-count {
  margin-left: auto; flex-shrink: 0; font-size: 12px; font-weight: 700;
  color: var(--ink-faint); background: var(--paper-alt); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

.crumb { font-weight: 700; }

/* ── Quizzes browse: section / category chooser ──────────────────────────── */
.choose-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; margin: 24px 0 8px;
}
.choose-card {
  display: flex; align-items: center; gap: 16px; text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.choose-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,.4); }
.choose-icon {
  flex-shrink: 0; width: 50px; height: 50px; border-radius: 14px; font-size: 25px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(6,182,212,.14));
}
.choose-body { flex: 1; }
.choose-body h3 { color: var(--ink); }
.choose-body p { font-size: 13.5px; color: var(--ink-faint); margin-top: 2px; }
.choose-go { flex-shrink: 0; font-size: 20px; font-weight: 800; color: var(--blue); }

/* category chooser grouped by SAT domain */
.cat-domain { margin-top: 26px; }
.cat-domain-title { font-size: 13px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; }
.cat-domain .choose-grid { margin-top: 12px; }
.choose-empty { cursor: default; box-shadow: none; background: var(--paper-alt);
  border-style: dashed; opacity: .75; }
.choose-empty:hover { transform: none; box-shadow: none; border-color: var(--line); }
.choose-empty .choose-body h3 { color: var(--ink-faint); }

/* ── Drills landing ──────────────────────────────────────────────────────── */
.drill-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; margin: 28px 0 32px;
}
.drill-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.drill-live { cursor: pointer; }
.drill-live:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,.45); }
.drill-locked { opacity: .82; }
.drill-top { display: flex; align-items: center; justify-content: space-between; }
.drill-icon {
  width: 50px; height: 50px; border-radius: 14px; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(6,182,212,.14));
}
.drill-status { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; }
.drill-status-live { background: rgba(22,163,74,.12); color: var(--green); }
.drill-status-soon { background: #eef1f6; color: var(--ink-faint); }
.drill-card h3 { color: var(--ink); margin-top: 4px; }
.drill-tagline { font-size: 13px; font-weight: 700; color: var(--blue); }
.drill-desc { font-size: 14px; color: var(--ink-faint); flex: 1; }
.drill-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px;
  padding-top: 12px; border-top: 1px solid var(--line); }
.drill-tag { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cyan); }
.drill-go { font-size: 14px; font-weight: 700; color: var(--blue); }
.drill-go-muted { color: var(--ink-faint); }
.drill-note { background: linear-gradient(135deg, rgba(37,99,235,.04), rgba(6,182,212,.05)); }
.drill-note p { font-size: 14px; color: var(--ink-faint); margin-top: 6px; }

/* ── Drill hub: study tile + level map ───────────────────────────────────── */
.study-tile { display: flex; align-items: center; gap: 16px; margin: 4px 0 8px;
  text-decoration: none !important; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  background: linear-gradient(135deg, rgba(37,99,235,.05), rgba(6,182,212,.06)); }
.study-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,.4); }
.study-tile-icon { flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px; font-size: 26px;
  display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); }
.study-tile-body { flex: 1; }
.study-tile-body h3 { color: var(--ink); }
.study-tile-body p { font-size: 13.5px; color: var(--ink-faint); margin-top: 3px; }
.study-tile-go { flex-shrink: 0; font-weight: 700; color: var(--blue); }

.level-map { display: grid; gap: 12px; }
.level-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
  box-shadow: var(--shadow); text-decoration: none !important; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.level-open:hover, .level-passed:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,.4); }
.level-locked { opacity: .6; box-shadow: none; background: var(--paper-alt); }
.level-badge { flex-shrink: 0; width: 44px; height: 44px; border-radius: 999px; font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan)); }
.level-passed .level-badge { background: linear-gradient(135deg, var(--green), #22c55e); }
.level-locked .level-badge { background: #cbd5e1; color: #fff; }
.level-body { flex: 1; }
.level-name { font-weight: 800; color: var(--ink); font-size: 16px; }
.level-meta { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.level-go { flex-shrink: 0; font-weight: 700; color: var(--blue); font-size: 14px; }

/* ── Question-bank attempt quiz (paged, one question per screen) ──────────── */
.attempt-quiz-page .footer { display: none; }   /* keep the quiz to one screen */
.aq-foot { margin-top: 28px; }

/* ── Graded drill quiz (mobile-first, single question, no-scroll) ─────────── */
.drill-quiz-page .footer { display: none; }          /* keep the quiz to one screen */
.drill-quiz-shell { min-height: calc(100vh - 64px); display: flex; align-items: center;
  justify-content: center; padding: 20px 16px; }
.drill-quiz { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 18px; }
.dq-top { display: flex; align-items: center; gap: 12px; }
.dq-exit { flex-shrink: 0; width: 34px; height: 34px; border-radius: 999px; display: flex;
  align-items: center; justify-content: center; color: var(--ink-faint); background: var(--paper-alt);
  border: 1px solid var(--line); text-decoration: none !important; font-size: 15px; }
.dq-exit:hover { color: var(--ink); }
.dq-title { font-weight: 800; color: var(--ink); }
.dq-count { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink-faint); }
/* Sprint countdown. Tabular figures so the width doesn't jitter each second. */
.dq-clock { margin-left: auto; font-size: 15px; font-weight: 800; color: var(--ink);
  font-variant-numeric: tabular-nums; padding: 3px 10px; border-radius: 999px;
  background: var(--paper-alt); }
.dq-clock.is-low { color: #991b1b; background: rgba(220,38,38,.10); }
.dq-clock + .dq-count { margin-left: 0; }
.dq-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.dq-track span { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .25s ease; }
.dq-body { text-align: center; padding: 8px 0; }
.dq-meta { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 12px; }
.dq-stem-term { font-size: clamp(30px, 8vw, 44px); font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.dq-stem-sentence { font-size: clamp(18px, 5vw, 22px); line-height: 1.55; color: var(--ink);
  background: var(--paper-alt); border-left: 4px solid var(--blue); border-radius: 12px;
  padding: 16px 18px; text-align: left; }
.dq-choices { display: grid; gap: 10px; margin-top: 22px; }
.dq-choice { font-family: var(--font); font-size: 16px; font-weight: 700; text-align: left;
  line-height: 1.4;   /* error-ID labels are phrases, not single words — let them wrap */
  padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  color: var(--ink); cursor: pointer; transition: border-color .1s, background .1s, transform .06s; }
.dq-choice:hover { border-color: var(--blue); background: rgba(37,99,235,.04); }
.dq-choice:active { transform: translateY(1px); }
.dq-choice.is-chosen { border-color: var(--blue); background: rgba(37,99,235,.09);
  box-shadow: 0 0 0 2px rgba(37,99,235,.25); }
.dq-foot { display: flex; align-items: center; gap: 10px; }
.dq-foot-spacer { flex: 1; }

/* Drill results extras */
.score-time { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--ink-faint);
  font-variant-numeric: tabular-nums; }
.score-pass { border: 1px solid #bbf7d0; }
.score-fail { border: 1px solid #fecaca; }
.drill-results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0 8px; }
.ans-right { color: #166534; }
.ans-wrong { color: #991b1b; text-decoration: line-through; }

@media (max-width: 480px) {
  .level-card { padding: 14px; gap: 12px; }
  .drill-results-actions { flex-direction: column; }
  .drill-results-actions .btn { width: 100%; }
}

/* ── Vocabulary drill ────────────────────────────────────────────────────── */
.vocab-head { margin-bottom: 20px; }
.vocab-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 18px; }
.vocab-controls-spacer { flex: 1 1 auto; }

/* segmented control */
.vseg { display: inline-flex; background: var(--paper-alt); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; gap: 4px; }
.vseg-btn { font-family: var(--font); font-size: 14px; font-weight: 700; color: var(--ink-faint);
  background: transparent; border: none; cursor: pointer; padding: 8px 16px; border-radius: 9px;
  transition: background .12s, color .12s; }
.vseg-btn:hover { color: var(--ink); }
.vseg-btn.is-active { background: #fff; color: var(--blue-deep); box-shadow: var(--shadow); }
.vseg-sm .vseg-btn { padding: 7px 14px; font-size: 13px; }

/* progress */
.vocab-progress { margin-bottom: 22px; }
.vocab-progress-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.vocab-progress-bar span { display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 999px;
  transition: width .28s ease; }
.vocab-progress-meta { display: flex; justify-content: space-between; font-size: 12.5px;
  color: var(--ink-faint); margin-top: 7px; }

/* flashcard with 3D flip */
.flashcard { perspective: 1400px; margin: 0 auto 22px; max-width: 620px; cursor: pointer; outline: none; }
.flashcard:focus-visible .flashcard-inner { box-shadow: 0 0 0 3px rgba(37,99,235,.35); border-radius: 20px; }
.flashcard-inner { position: relative; width: 100%; min-height: 320px;
  transition: transform .5s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.flashcard-inner.is-flipped { transform: rotateY(180deg); }
.flashcard-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 40px 32px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.flashcard-front { background:
  radial-gradient(700px 320px at 50% -30%, rgba(6,182,212,.14), transparent 60%),
  linear-gradient(160deg, #fff, var(--paper-alt)); }
.flashcard-back { background: linear-gradient(160deg, #0f2444, var(--ink)); transform: rotateY(180deg); }
.flashcard-pos { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--blue); background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.2);
  padding: 4px 14px; border-radius: 999px; margin-bottom: 18px; }
.flashcard-word { font-size: clamp(32px, 6vw, 46px); font-weight: 800; color: var(--ink);
  letter-spacing: -0.02em; }
.flashcard-hint { margin-top: 22px; font-size: 12.5px; color: var(--ink-faint); }
.flashcard-word-sm { font-size: 15px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 14px; }
.flashcard-def { font-size: clamp(19px, 3vw, 24px); font-weight: 600; color: #fff; line-height: 1.4; max-width: 480px; }
.flashcard-example { margin-top: 18px; font-size: 15px; font-style: italic; color: #a9c2ea; max-width: 460px; }
.card-known .flashcard-front { border-color: var(--green); box-shadow: 0 0 0 2px rgba(22,163,74,.4), var(--shadow-lg); }
.card-review .flashcard-front { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245,158,11,.45), var(--shadow-lg); }

.flashcard-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 620px; margin: 0 auto; flex-wrap: wrap; }
.flashcard-mark { display: flex; gap: 8px; }
.markbtn-review { color: var(--gold); border-color: var(--gold); }
.markbtn-review:hover { background: rgba(245,158,11,.08); }
.vocab-keys { text-align: center; font-size: 12.5px; color: var(--ink-faint); margin-top: 18px; }
.vocab-keys kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  background: var(--paper-alt); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; color: var(--ink-soft); }

/* quiz mode */
.quiz-card { max-width: 640px; margin: 0 auto; }
.quiz-streak { font-size: 13px; font-weight: 700; color: var(--ink-faint); margin-bottom: 14px; }
.quiz-prompt-label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--blue); }
.quiz-prompt { font-size: clamp(18px, 3vw, 23px); font-weight: 600; color: var(--ink);
  margin: 8px 0 22px; line-height: 1.4; }
.quiz-choices { display: grid; gap: 10px; }
.quiz-choice { font-family: var(--font); font-size: 16px; font-weight: 700; text-align: left;
  padding: 15px 18px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s, transform .08s; }
.quiz-choice:hover:not(:disabled) { border-color: var(--blue); background: rgba(37,99,235,.04); }
.quiz-choice:active:not(:disabled) { transform: translateY(1px); }
.quiz-choice:disabled { cursor: default; }
.quiz-choice.is-correct { border-color: var(--green); background: rgba(22,163,74,.09); color: #065f46; }
.quiz-choice.is-wrong { border-color: var(--red); background: rgba(220,38,38,.07); color: #991b1b; }
.quiz-feedback { margin-top: 18px; padding: 14px 16px; border-radius: 12px; font-size: 14.5px; line-height: 1.5; }
.quiz-feedback.is-right { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.quiz-feedback.is-wrong { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.quiz-next-row { margin-top: 18px; text-align: right; min-height: 4px; }

.quiz-results { max-width: 640px; margin: 0 auto; text-align: center; }
.quiz-missed { margin: 22px 0; text-align: left; }
.quiz-missed h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint);
  margin-bottom: 10px; }
.quiz-missed ul { list-style: none; display: grid; gap: 8px; }
.quiz-missed li { font-size: 14.5px; padding: 10px 14px; background: var(--paper-alt);
  border-radius: 10px; border-left: 3px solid var(--gold); }
.quiz-perfect { font-size: 17px; font-weight: 700; color: var(--green); margin: 20px 0; }
.quiz-results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ── Roots drill ─────────────────────────────────────────────────────────── */
.vseg-count { font-size: 11px; opacity: .65; margin-left: 3px; }
.roots-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.roots-example-chip { font-size: 13.5px; font-weight: 600; color: #cfe0fb;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  padding: 5px 12px; border-radius: 999px; }
.roots-quiz-part { font-weight: 800; letter-spacing: -0.01em; color: var(--blue-deep);
  font-size: clamp(28px, 5vw, 40px); }

/* ── Grammar drill ───────────────────────────────────────────────────────── */
.grammar-filter { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 18px; }
.grammar-filter-label { font-size: 12px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-faint); flex-shrink: 0; }
.rule-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.rule-pill { font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink-soft); transition: border-color .12s, background .12s, color .12s; }
.rule-pill:hover { border-color: var(--blue); color: var(--blue); }
.rule-pill.is-active { border-color: var(--blue); background: var(--blue); color: #fff; }
.rule-pill-count { font-size: 11px; opacity: .7; margin-left: 3px; }

.grammar-topbar { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grammar-topbar .quiz-streak { margin-bottom: 0; }
.grammar-rule-tag { font-size: 11.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--cyan); background: rgba(6,182,212,.1);
  border: 1px solid rgba(6,182,212,.25); padding: 4px 12px; border-radius: 999px; }
.grammar-directions { font-size: 13px; color: var(--ink-faint); margin-bottom: 12px; }
.grammar-sentence { font-size: clamp(19px, 3vw, 24px); line-height: 1.6; color: var(--ink);
  padding: 18px 20px; margin: 0 0 22px; background: var(--paper-alt);
  border-radius: 12px; border-left: 4px solid var(--blue); }
.grammar-underline { text-decoration: none; background: rgba(37,99,235,.14);
  box-shadow: inset 0 -2px 0 var(--blue); padding: 1px 3px; border-radius: 3px; font-weight: 700; }
.grammar-nochange { font-variant: small-caps; letter-spacing: .04em; font-weight: 800; color: var(--ink-faint); }
.grammar-choice.is-correct .grammar-nochange,
.grammar-choice.is-wrong .grammar-nochange { color: inherit; }

.quiz-missed .gm-rule { display: inline-block; font-size: 10.5px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--cyan);
  margin-right: 8px; }
.quiz-missed .gm-why { display: block; font-size: 13px; color: var(--ink-faint); margin-top: 4px; }

/* ── Part 107 ────────────────────────────────────────────────────────────── */
.p107-free-note {
  text-align: center; font-size: 13px; color: var(--ink-faint);
  background: var(--paper-alt); border-radius: 10px; padding: 10px 16px; margin-bottom: 18px;
}
.p107-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; font-size: 12.5px; color: var(--ink-faint); }
.p107-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.p107-fulltest { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.p107-fulltest-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.p107-stat-chip { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.p107-module-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.p107-module-title { font-size: 16.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.p107-module-desc { font-size: 13px; color: var(--ink-faint); margin-bottom: 12px; }
.p107-topic-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.p107-topic-row { display: flex; align-items: center; gap: 6px; }
.p107-topic-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.p107-topic-pill:hover { border-color: var(--ink-faint); text-decoration: none; }
.p107-pill-easy   { border-color: #6ee7b7; background: #f0fdf4; color: #065f46; }
.p107-pill-medium { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.p107-pill-hard   { border-color: #fca5a5; background: #fff5f5; color: #991b1b; }
.p107-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.p107-dot-easy   { background: var(--green); }
.p107-dot-medium { background: var(--gold); }
.p107-dot-hard   { background: var(--red); }
.p107-lesson-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; background: rgba(37,99,235,.08);
  border: 1px solid rgba(37,99,235,.2); color: var(--blue); font-size: 13px;
  text-decoration: none; flex-shrink: 0;
}
.p107-lesson-btn:hover { background: rgba(37,99,235,.14); text-decoration: none; }
.p107-diff-badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.p107-diff-easy   { background: #d1fae5; color: #065f46; }
.p107-diff-medium { background: #fef3c7; color: #92400e; }
.p107-diff-hard   { background: #fee2e2; color: #991b1b; }
.p107-progress-bg { height: 6px; background: var(--line); border-radius: 3px; margin-bottom: 8px; }
.p107-progress-fg { height: 100%; background: var(--blue); border-radius: 3px; transition: width .3s ease; }
.p107-progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-faint); margin-bottom: 8px; }
.p107-breakdown { display: flex; gap: 16px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.p107-breakdown-pill { background: var(--paper-alt); border-radius: 8px; padding: 12px 20px; text-align: center; min-width: 90px; }
.p107-breakdown-pill .bv { font-size: 22px; font-weight: 700; color: var(--ink); }
.p107-breakdown-pill .bl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.p107-rule-pill { display: inline-block; background: #fef3c7; border: 1px solid #d97706; border-radius: 8px; padding: 8px 14px; font-size: 13px; color: #92400e; margin: 4px 4px 0 0; line-height: 1.6; }
.p107-example-block { background: #f8faff; border: 1px solid #dbeafe; border-radius: 10px; padding: 18px 22px; }
.p107-scenario-box { font-size: 15px; font-weight: 600; color: var(--ink); padding: 12px 16px; background: #eff6ff; border-radius: 8px; border-left: 4px solid var(--blue); margin-bottom: 14px; line-height: 1.55; }
.p107-answer-box { padding: 12px 16px; background: #f0fdf4; border: 2px solid var(--green); border-radius: 8px; font-size: 14px; font-weight: 600; color: #065f46; margin-top: 12px; }
.p107-mistake-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.p107-mistake-item:last-child { border-bottom: none; }
.p107-lesson-image { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.p107-lesson-caption { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; line-height: 1.5; }

/* ── Admin ───────────────────────────────────────────────────────────────── */
.admin-grant { margin: 20px 0 28px; }
.grant-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.grant-form input[type=email] { flex: 1 1 220px; }
.grant-form input[type=text] { flex: 2 1 280px; }
.search-form { display: flex; gap: 10px; margin-bottom: 14px; max-width: 420px; flex-wrap: wrap; }

/* ── Prose (privacy/terms) ───────────────────────────────────────────────── */
.prose { margin-top: 22px; }
.prose h2 { font-size: 19px; margin: 26px 0 8px; }
.prose p { margin-bottom: 10px; }

/* ── Dashboard: progress analytics ───────────────────────────────────────── */
/* Accuracy status colours — shared by meters, sparkline fills, and figures. */
.acc-strong { --acc: var(--green); }
.acc-mid    { --acc: var(--gold); }
.acc-weak   { --acc: var(--red); }

/* KPI tiles */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin: 8px 0 28px;
}
.stat-tile { padding: 20px 22px; }
.stat-ico {
  width: 42px; height: 42px; border-radius: 12px; font-size: 21px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(6,182,212,.14));
}
.stat-val { font-size: 30px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
.stat-unit { font-size: 15px; font-weight: 700; color: var(--ink-faint); margin-left: 3px; }
.stat-lbl { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }

/* Insight two-column layout */
.insight-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 18px; }
.insight-side { display: flex; flex-direction: column; gap: 18px; }
.insight-card { padding: 22px; }
.insight-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.insight-head .section-sub, .insight-head .mini-title { margin: 0; }
.insight-note { font-size: 12.5px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; }
.mini-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.empty-note { font-size: 14px; color: var(--ink-faint); }

/* Reusable meter (accuracy / progress bar) */
.meter { height: 8px; border-radius: 999px; background: var(--paper-alt); border: 1px solid var(--line); overflow: hidden; }
.meter-sm { height: 6px; }
.meter-fill { display: block; height: 100%; border-radius: 999px; background: var(--acc, var(--blue)); transition: width .3s ease; }

/* Focus-area list ("work on this next") */
.focus-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.focus-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.focus-name { font-weight: 700; color: var(--ink); font-size: 15px; }
.focus-sec { font-size: 11.5px; color: var(--ink-faint); margin-left: 8px; }
.focus-pct { font-size: 15px; font-weight: 800; color: var(--acc, var(--ink)); }
.focus-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.focus-count { font-size: 12.5px; color: var(--ink-faint); }
.focus-link { font-size: 13px; font-weight: 600; }

.strength-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.strength-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 700; }
.chip { font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--paper-alt); border: 1px solid var(--line); color: var(--ink-soft); }
.chip-strong { background: rgba(22,163,74,.08); border-color: rgba(22,163,74,.3); color: #15803d; }

/* Sparkline bar charts (activity + score trend) */
.spark-bars { display: flex; align-items: flex-end; gap: 5px; height: 96px; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.spark-track { flex: 1; width: 100%; display: flex; align-items: flex-end; border-radius: 5px 5px 0 0; }
.spark-fill { display: block; width: 100%; min-height: 3px; border-radius: 4px 4px 0 0; background: var(--acc, var(--blue)); transition: height .3s ease; }
.trend-bars { height: 72px; }
.spark-x { font-size: 10px; color: var(--ink-faint); }

/* Section split rows */
.sec-row { margin-top: 12px; }
.sec-row:first-of-type { margin-top: 0; }
.sec-top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.sec-pct { font-weight: 800; color: var(--acc, var(--ink)); }

/* Drill mastery */
.drill-mastery { margin-bottom: 18px; }
.dm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.dm-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none !important; transition: border-color .12s ease, transform .12s ease; }
.dm-item:hover { border-color: rgba(37,99,235,.4); transform: translateY(-1px); }
.dm-ico { font-size: 22px; flex-shrink: 0; }
.dm-body { flex: 1; min-width: 0; }
.dm-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dm-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.dm-count { font-size: 12.5px; font-weight: 700; color: var(--ink-faint); }

/* Recent-results accuracy cell */
.acc-cell { display: flex; align-items: center; gap: 10px; }
.acc-cell .meter { width: 90px; }
.acc-num { font-size: 13px; font-weight: 700; color: var(--acc, var(--ink)); min-width: 38px; }

@media (max-width: 860px) {
  .insight-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .col-acc { display: none; }
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); background: var(--paper-alt); padding: 36px 0; margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; color: var(--ink); }
.footer-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.footer-brand .brand-name { display: block; line-height: 1.25; }
.footer-tagline { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-faint); }
.footer-links { display: flex; gap: 12px 20px; font-size: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-faint); }
.footer-copy { font-size: 13px; color: var(--ink-faint); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border: 1px solid var(--line); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-lg);
    padding: 10px 14px 16px;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .22s ease, opacity .18s ease;
  }
  .nav-links a { padding: 12px 6px; border-bottom: 1px solid var(--line); }
  .nav-links a:last-of-type { border-bottom: none; }
  .nav-cta-wrap, .nav-cta { width: 100%; margin-left: 0; margin-top: 6px; }
  .nav-cta.btn { width: 100%; }
  .nav-toggle-check:checked ~ .nav-links {
    max-height: 480px; opacity: 1;
  }
  .nav-toggle-check:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle-check:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-toggle-check:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 640px) {
  .hero { padding: 64px 0 110px; }
  .section { padding: 48px 0; }
  .callout { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
