/* The 2-Week Pass Plan: engine styles.

   REDESIGN, 3 Oct 2026. Every social video now opens ON this app, so the
   question screen is the hero of the marketing and the whole inside has to
   read as premium in the first second of a reel. The look is the channel's
   own: night-time navy, brand gold, calm, with light used as depth.

   Rules this file keeps (the reasons are below, next to the rules):
     · Dark is the hero (the videos are dark); light must still look excellent.
     · System fonts, no web fonts, no external requests: it works in airplane mode.
     · Colour is never the only signal. Right and wrong always carry a glyph and
       a word; gold is an accent, it never carries meaning on its own.
     · WCAG AA text contrast in both themes. Tap targets 44px or more.
     · Motion is CSS only, 150 to 350ms, and off under prefers-reduced-motion.
     · app.js writes a few inline styles that read --card, --line, --radius,
       --ink, --gold, --gold-text, --right, --wrong, --focus and --cat-l, so
       those names must stay defined in both themes. */

/* ═══ TOKENS ════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  /* page and surfaces: a cool off-white page with white cards, so the cards
     have something to lift off */
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f4f7fa;        /* pressed, chips, input wells */
  --surface-3: #e9eef4;
  --card: var(--surface);      /* read by app.js (save-code boxes) */
  /* the glass of the top bar and dock: dense enough that the answer scrolling
     under it is colour, not a second line of text behind the count */
  --chrome: rgba(242, 245, 249, .9);
  --hairline: rgba(13, 27, 40, .09);
  --hairline-strong: rgba(13, 27, 40, .15);
  --line: #d6dee8;             /* tracks, rings, rules; read by app.js */

  /* ink: navy, never pure black */
  --ink: #0d1b28;
  --ink-2: #263849;
  --ink-soft: #4a5b6b;         /* 6.5:1 on --bg, 7.0:1 on white */

  /* Two golds, because one cannot do both jobs. Brand #ffd400 is a fill: it is
     1.4:1 on white, so it never carries small text in light mode. Gold TEXT is
     --gold-text, 5.3:1 on white and 4.9:1 on the page. Dark mode uses the
     bright brand gold for both, at 13:1 on the navy. */
  --gold: #ffd400;
  --gold-deep: #e8b700;
  --gold-text: #8a6600;
  /* gold for LARGE text only (24px+ bold, where AA asks 3:1): 3.6:1 on the
     page, and it reads as gold where #8a6600 reads as mustard at 44px */
  --gold-display: #a37a00;
  --gold-tint: rgba(255, 212, 0, .16);
  --gold-line: rgba(196, 150, 0, .45);
  --on-gold: #0a0f16;

  --right: #17743f;            /* 5.8:1 on white */
  --right-fill: #17743f;
  --right-line: #2f9a5c;
  --right-tint: rgba(23, 116, 63, .09);
  --right-glow: rgba(23, 116, 63, .30);
  --wrong: #b3261e;            /* 6.5:1 on white */
  --wrong-fill: #c0291f;
  --wrong-line: #d64a40;
  --wrong-tint: rgba(179, 38, 30, .08);
  --wrong-edge: rgba(214, 74, 64, .45);
  --on-fill: #ffffff;          /* a glyph on a right/wrong fill */

  --focus: #0a66c2;
  --why-tint: rgba(255, 212, 0, .13);
  --why-line: rgba(196, 150, 0, .32);
  --hw-line: #c79a00;

  /* the stage the road sign stands on */
  --stage-top: #edf2f7;
  --stage-bot: #dde5ee;
  --stage-glow: rgba(255, 255, 255, .85);

  --chip-veil: rgba(255, 255, 255, .87);   /* category chip: hue shows as dot + rim */
  --cat-l: 38%;                             /* read by app.js catColour() */

  --shadow-1: 0 1px 2px rgba(13, 27, 40, .05), 0 6px 16px -10px rgba(13, 27, 40, .22);
  --shadow-2: 0 2px 4px rgba(13, 27, 40, .04), 0 18px 40px -22px rgba(13, 27, 40, .35);

  --radius: 16px;              /* read by app.js */
  --r-lg: 20px;
  --r-xl: 24px;
  --tap: 48px;                 /* never smaller: WCAG 2.5.8 target size */
  --gutter: clamp(16px, 5vw, 22px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.4, .5, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a0f16;
    --surface: #10202e;
    --surface-2: #162a3c;
    --surface-3: #1b3247;
    --chrome: rgba(10, 15, 22, .87);
    --hairline: rgba(143, 160, 180, .15);
    --hairline-strong: rgba(143, 160, 180, .24);
    --line: #24394d;

    --ink: #eef4fb;
    --ink-2: #d3deea;
    --ink-soft: #8fa0b4;       /* 6.2:1 on the card navy */

    --gold: #ffd400;
    --gold-deep: #f0be00;
    --gold-text: #ffd400;
    --gold-display: #ffd400;
    --gold-tint: rgba(255, 212, 0, .10);
    --gold-line: rgba(255, 212, 0, .42);

    --right: #3ddc84;          /* 10.8:1 on the navy */
    --right-fill: #3ddc84;
    --right-line: #3ddc84;
    --right-tint: rgba(61, 220, 132, .11);
    --right-glow: rgba(61, 220, 132, .38);
    --wrong: #ff6b60;          /* brand red #e2231a is 4.4:1 here, short of AA for text */
    --wrong-fill: #ff6b60;
    --wrong-line: #ff5a4e;
    --wrong-tint: rgba(226, 35, 26, .15);
    --wrong-edge: rgba(255, 90, 78, .45);
    --on-fill: #0a0f16;

    --focus: #7cc0ff;
    --why-tint: rgba(255, 212, 0, .075);
    --why-line: rgba(255, 212, 0, .20);
    --hw-line: #ffd400;

    --stage-top: #12253a;
    --stage-bot: #0b1622;
    --stage-glow: rgba(150, 185, 225, .17);

    --chip-veil: rgba(13, 25, 38, .84);
    --cat-l: 62%;

    --shadow-1: inset 0 1px 0 rgba(255, 255, 255, .045), 0 10px 24px -16px rgba(0, 0, 0, .95);
    --shadow-2: inset 0 1px 0 rgba(255, 255, 255, .05), 0 24px 48px -24px rgba(0, 0, 0, .95);
  }
}

/* ═══ BASE ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Nothing on this page may scroll the phone sideways. */
body { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* iOS home-screen apps sit under the notch */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* The night sky. A fixed light from above, so the page has depth without a
   single extra request. Fixed and inset:0, so it can never widen the page. */
body::before {
  content: ''; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 55% at 50% -12%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 70%);
}
@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(110% 50% at 50% -10%, rgba(40, 84, 130, .38), rgba(40, 84, 130, 0) 72%),
      radial-gradient(80% 40% at 100% 0%, rgba(255, 212, 0, .045), rgba(255, 212, 0, 0) 70%);
  }
}

/* The status bar strip. The home-screen app asks iOS for a translucent status
   bar, which always draws WHITE text: on the light page the clock vanished.
   In Safari the inset is 0 and this is nothing. */
body::after {
  content: ''; position: fixed; left: 0; right: 0; top: 0; z-index: 70;
  height: env(safe-area-inset-top); background: #0a0f16; pointer-events: none;
}

.wrap {
  max-width: 640px; margin: 0 auto;
  padding: 18px var(--gutter) calc(124px + env(safe-area-inset-bottom));
}

/* ── type ────────────────────────────────────────────────────────────── */
h1 {
  font-size: 28px; line-height: 1.16; font-weight: 800; letter-spacing: -.7px;
  margin: 6px 0 6px; text-wrap: balance;
}
h2 { font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.35px; margin: 28px 0 12px; }
h3 { font-weight: 800; }
p { text-wrap: pretty; }
.sub { color: var(--ink-soft); margin: 0 0 22px; font-size: 15px; line-height: 1.5; }
.sub b { color: var(--ink-2); }
b, strong { font-weight: 700; }
code {
  display: inline-block; font: 600 15px/1.4 var(--mono); letter-spacing: .5px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px dashed var(--gold-line); color: var(--ink);
}

/* every screen arrives rather than snaps */
main > section:not(.hide) { animation: screen-in .26s var(--ease) backwards; }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }

/* ── focus: always visible, never colour alone ───────────────────────── */
:where(button, a, summary, textarea, input, label):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
/* Inside a card that clips its corners (the folded answers, the review
   list) a ring drawn outside the row is cut off, so it is drawn inside. */
details.folded > summary:focus-visible, .rvrow:focus-visible {
  outline-offset: -4px; border-radius: 18px;
}

/* ═══ BUTTONS ═══════════════════════════════════════════════════════════ */

button { font: inherit; color: inherit; }

.btn {
  position: relative;
  display: block; width: 100%; min-height: var(--tap);
  padding: 14px 18px; margin: 0 0 10px;
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
}
.btn:active:not([disabled]) { transform: scale(.985); }
.btn strong { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.2px; line-height: 1.3; }
.btn .meta { display: block; color: var(--ink-soft); font-size: 14px; margin-top: 3px; line-height: 1.35; }
.btn[disabled] { opacity: .4; cursor: default; box-shadow: none; }
@media (hover: hover) {
  .btn:not([disabled]):not(.btn-primary):hover { border-color: var(--gold-line); }
}

/* Gold that reads as metal rather than highlighter. Flat #ffd400 is a
   warning triangle; a gradient with a warm floor is a product. */
.btn-primary, .btn.btn-primary {
  text-align: center; color: var(--on-gold); font-weight: 800; letter-spacing: -.1px;
  border: 0;
  background: linear-gradient(180deg, #ffe45c 0%, #ffd400 46%, #f6c300 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(120, 80, 0, .14),
              0 12px 26px -12px rgba(255, 190, 0, .75);
}
.btn.btn-primary .meta { color: var(--on-gold); }
.btn.btn-primary:active:not([disabled]) { transform: translateY(1px) scale(.99); }

.btn.big { font-size: 18px; padding: 17px 18px; min-height: 58px; border-radius: 18px; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

/* A row in a list: a title, a line under it, and a chevron that says "in here". */
.btn:has(> strong):not(.btn-primary) { padding-right: 46px; }
.btn:has(> strong):not(.btn-primary)::after {
  content: ''; position: absolute; right: 20px; top: 50%;
  width: 9px; height: 9px; margin-top: -5px;
  border-top: 2px solid var(--ink-soft); border-right: 2px solid var(--ink-soft);
  transform: rotate(45deg); border-radius: 1px;
}

/* Icon tiles on the rows that open a place. The tile is the button's ::before
   and the glyph is a mask on the title's ::before, so it takes the theme's
   gold without a second copy of every icon. Pure decoration: aria never sees it. */
#home-more > .btn::before, #listen-list > .btn:not(.btn-primary)::before,
#watch-after > .btn[data-video]::before, #rq-why > .btn[data-why]::before,
#pick-list > .btn[data-drill]::before, #pick-list > .btn[data-go]::before {
  content: ''; position: absolute; left: 14px; top: 50%; margin-top: -21px;
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold-line);
}
#home-more > .btn, #listen-list > .btn:not(.btn-primary),
#watch-after > .btn[data-video], #rq-why > .btn[data-why],
#pick-list > .btn[data-drill], #pick-list > .btn[data-go] { padding-left: 72px; min-height: 70px; }
#home-more > .btn strong::before, #listen-list > .btn:not(.btn-primary) strong::before,
#watch-after > .btn[data-video] strong::before, #rq-why > .btn[data-why] strong::before,
#pick-list > .btn[data-drill] strong::before, #pick-list > .btn[data-go] strong::before {
  content: ''; position: absolute; left: 25px; top: 50%; margin-top: -10px;
  width: 20px; height: 20px; background: var(--gold-text);
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}

/* the glyphs: hand-drawn 24px strokes */
[data-go="pick-cat"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='2'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='2'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='2'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='2'/%3E%3C/svg%3E"); }
[data-drill="hard"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M13.5 2.5 4.5 13.5h7l-1 8 9-11h-7z'/%3E%3C/svg%3E"); }
[data-drill="wrong"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 12a8.5 8.5 0 1 0 2.6-6.1L3.5 8.5'/%3E%3Cpath d='M3.5 3.5v5h5'/%3E%3C/svg%3E"); }
[data-go="listen"], #listen-list > .btn { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 17v-5a8.5 8.5 0 0 1 17 0v5'/%3E%3Crect x='3.5' y='13.5' width='4.5' height='7' rx='2'/%3E%3Crect x='16' y='13.5' width='4.5' height='7' rx='2'/%3E%3C/svg%3E"); }
[data-go="prog"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 20.5v-6M12 20.5v-10M19 20.5V4'/%3E%3C/svg%3E"); }
[data-video] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.2v13.6c0 .8.9 1.3 1.6.9l10.4-6.8a1.1 1.1 0 0 0 0-1.8L9.6 4.3C8.9 3.9 8 4.4 8 5.2z'/%3E%3C/svg%3E"); }
[data-why] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 21.5h6V20H9zM12 2.5a7 7 0 0 0-4.3 12.5c.6.5.8 1.1.8 1.8v1.7h7v-1.7c0-.7.3-1.3.8-1.8A7 7 0 0 0 12 2.5z'/%3E%3C/svg%3E"); }

/* The six rows that had no glyph, and so painted a solid square (found on
   27 Oct). The fallback is for any row added later without one. */
:where(#home-more > .btn) { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 11v5.2M12 7.7v.1'/%3E%3C/svg%3E"); }
[data-go="dict"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.6C10 5.2 7.4 4.7 3.5 5v13.4c3.9-.3 6.5.2 8.5 1.6 2-1.4 4.6-1.9 8.5-1.6V5c-3.9-.3-6.5.2-8.5 1.6zM12 6.6V20'/%3E%3C/svg%3E"); }
[data-go="pick-mock"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.8 7.4l2 2 3.6-3.9M3.8 16.4l2 2 3.6-3.9M13 7.5h7.2M13 16.5h7.2'/%3E%3C/svg%3E"); }
[data-go="ready"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.6'/%3E%3Cpath d='M8.2 12.3l2.6 2.6 5-5.3'/%3E%3C/svg%3E"); }
[data-go="book"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4M8 14.5h3M8 17.3h6'/%3E%3C/svg%3E"); }
[data-go="testday"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.8' y='5.5' width='18.4' height='13' rx='3'/%3E%3Ccircle cx='8.6' cy='10.8' r='2'/%3E%3Cpath d='M5.9 15.6c.6-1.2 1.6-1.9 2.7-1.9s2.1.7 2.7 1.9M14.2 10h4M14.2 13.6h3'/%3E%3C/svg%3E"); }
[data-go="result"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 21V4.2'/%3E%3Cpath d='M5.5 4.5h11.3l-2.3 4.2 2.3 4.2H5.5'/%3E%3C/svg%3E"); }

/* ═══ THE ALWAYS-THERE TOP BAR ══════════════════════════════════════════ */
/* Fixed, because the way out must not require scrolling to find. Glass, so
   the question scrolls under it instead of being cut off by a slab. */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 35;
  padding-top: env(safe-area-inset-top);
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}
.tb-in {
  max-width: 640px; margin: 0 auto; padding: 4px calc(var(--gutter) - 6px) 0;
  /* three columns, so the count sits dead centre whatever is either side */
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
#tb-home {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 14px 0 12px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: 15px; font-weight: 700; letter-spacing: -.1px;
  transition: transform .15s var(--ease), background-color .2s;
}
#tb-home:active { transform: scale(.96); }
#tb-home:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
/* the arrow is drawn, not typed: the font's ‹ is a hairline at this size */
#tb-home span { font-size: 0; }
#tb-home span::before {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 3px;
  border-left: 2.4px solid currentColor; border-bottom: 2.4px solid currentColor;
  transform: rotate(45deg); border-radius: 1px;
}
#tb-mid {
  text-align: center; font-size: 15px; font-weight: 700; letter-spacing: -.1px;
  color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* app.js leaves .urgent on the element when a paper ends in its last five
   minutes, and nothing takes it off until the next paper: every count after
   that was red. The red is scoped to the paper itself, where it is true. */
body:has(#s-mock:not(.hide)) #tb-mid.urgent { color: var(--wrong); }
#tb-saved {
  justify-self: end; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
#tb-saved:empty { display: none; }
#tb-saved::before {
  content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--right); box-shadow: 0 0 0 3px var(--right-tint);
}
/* Inside Instagram it reads "Saved in this app only". On one line that took
   the mock clock's room at 375px and broke it into "56:59 / left". Two short
   lines fit inside the Home button's height, so the bar stays the same size. */
#tb-saved.warn {
  color: var(--wrong); font-weight: 700;
  max-width: 7em; text-align: right; line-height: 1.2;
}
/* the red words say it; the dot would cost the clock its room */
#tb-saved.warn::before { display: none; }

/* The progress rail: inset and rounded, with a lit leading edge, because a
   bar that fills is the one reward a drill gets on every single question. */
.tb-bar {
  position: relative; max-width: calc(640px - 2 * var(--gutter));
  width: calc(100% - 2 * var(--gutter)); height: 6px; margin: 6px auto 10px;
  border-radius: 999px; background: var(--line);
}
.tb-bar > i {
  position: relative; display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #f2b600, #ffd400 60%, #ffe566);
  box-shadow: 0 0 12px rgba(255, 212, 0, .45);
  transition: width .3s var(--ease);
}
.tb-bar > i::after {
  content: ''; position: absolute; right: -1px; top: 50%; width: 10px; height: 10px;
  margin-top: -5px; border-radius: 50%;
  background: #fff6b8; box-shadow: 0 0 0 2px rgba(255, 212, 0, .55), 0 0 12px 2px rgba(255, 212, 0, .7);
}
.tb-bar > i[style*="width: 0%"]::after, .tb-bar > i[style*="width:0%"]::after { display: none; }

/* the page has to clear the fixed bar */
body.has-topbar .wrap { padding-top: 84px; }
/* Screens with nothing to count (results, lists, Listen) hide the rail, which
   app.js does with an inline visibility:hidden. Fold its room away too, so
   the bar is a slim row there instead of a row with a hole under it. */
.tb-bar[style*="hidden"] { height: 0; margin-top: 0; margin-bottom: 4px; }
body.has-topbar:has(.tb-bar[style*="hidden"]) .wrap { padding-top: 72px; }

/* On a timed paper the middle of the bar is a clock: give it a face. */
body:has(#s-mock:not(.hide)) #tb-mid {
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline-strong);
  font-size: 14px;
}
body:has(#s-mock:not(.hide)) #tb-mid.urgent {
  background: var(--wrong-tint); box-shadow: inset 0 0 0 1px var(--wrong-line);
}

/* Narrow phones: a running paper, inside Instagram, is the widest the bar
   ever gets (Home, "Q12/50 · 56:59 left", "Saved in this app only"). It has
   to fit on one line at 360px, so everything tightens a notch. */
@media (max-width: 389px) {
  .tb-in { gap: 6px; padding-left: 10px; padding-right: 10px; }
  #tb-home { padding: 0 11px 0 9px; gap: 5px; font-size: 14px; }
  body:has(#s-mock:not(.hide)) #tb-mid { padding: 6px 9px; font-size: 13px; }
  #tb-saved.warn { font-size: 12px; }
}

/* ═══ STICKY ACTION DOCK ════════════════════════════════════════════════ */

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  border-top: 1px solid var(--hairline);
}
.dock:not(.hide) { animation: dock-in .3s var(--ease) backwards; }
@keyframes dock-in { from { transform: translateY(24px); opacity: 0; } }
.dock .wrapin { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.dock .btn { margin: 0; text-align: center; min-height: 54px; font-weight: 700; }
.dock .row .btn { padding-left: 10px; padding-right: 10px; }
/* The buttons that move you on say so with an arrow: Start, Carry on, Next
   question, See your score, Start the clock. Decoration only (empty alt). */
.dock [data-next]::after, .dock [data-mnext]::after, .dock .btn-primary[data-rgo]::after,
.dock [data-startmock]::after, .nextcard .btn-primary[data-step]::after,
#size-go .btn-primary::after, #watch-after .btn-primary[data-mod]::after {
  content: '\2192'; content: '\2192' / ''; display: inline-block; margin-left: 8px;
  font-weight: 800; transition: transform .2s var(--ease);
}
.btn-primary:active::after { transform: translateX(3px); }

/* A dock with two stacked buttons is taller than the page's spare room at the
   bottom: the last line of the pre-mock screen hid under "Not yet". */
body:has(#dock-in > .btn + .btn) .wrap { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
body:has(#dock.hide) .wrap { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

/* ═══ THE BOTTOM BAR ════════════════════════════════════════════════════
   Five places, one tap each, the way every app on their phone works (16 Oct
   2026). The same glass as the top bar and the dock. app.js shows it on the
   five tab screens only, so it never sits over a question, a lesson, a test
   or the dock's gold button. The place you are in is gold, as a word and as a
   soft gold pill behind its icon, so it is never colour alone. */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 5px calc(6px + env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom))
           calc(6px + env(safe-area-inset-left));
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  border-top: 1px solid var(--hairline);
}
.tabs-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 0; min-height: 56px; padding: 4px 2px 3px;
  border: 0; border-radius: 14px; background: none; cursor: pointer;
  color: var(--ink-soft); font-size: 12px; font-weight: 600; line-height: 1.15; letter-spacing: 0;
  transition: color .2s, transform .15s var(--ease);
}
.tab:active { transform: scale(.94); }
.tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.tabic {
  position: relative; display: block; width: 52px; height: 30px; border-radius: 999px;
  transition: background-color .2s, box-shadow .2s;
}
.tabic::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.tab.on { color: var(--gold-text); font-weight: 700; }
.tab.on .tabic { background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold-line); }
.tabs-brand { display: none; }   /* a computer's sidebar only: the end of this file */
@media (hover: hover) { .tab:not(.on):hover { color: var(--ink); } }
@media (max-width: 359px) { .tab { font-size: 11px; } .tabic { width: 44px; } }

/* The page clears the bar, so the last row is never under it. (The rule above
   for a hidden dock is as specific as a plain class, so this one is more so.) */
body.tabs-on:has(#tabbar:not(.hide)) .wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.tabs-on #gloss { bottom: calc(84px + env(safe-area-inset-bottom)); }
/* A phone on its side has little height: the icon goes beside its word. */
@media (orientation: landscape) and (max-height: 500px) {
  .tab { flex-direction: row; gap: 6px; min-height: 44px; padding: 2px 4px; }
  .tabic { width: 34px; height: 28px; }
  body.tabs-on:has(#tabbar:not(.hide)) .wrap { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}
/* Belt and braces for app.js: a dock on screen means no bar. */
body:has(#dock:not(.hide)) #tabbar { display: none; }
/* Typing in any box: the keyboard is the bottom of the screen now. */
body:has(:is(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]), textarea, select):focus) #tabbar { display: none; }

/* the icons: hand-drawn 24px strokes, like the rows' */
#tab-today { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 11.2 12 4l8.5 7.2'/%3E%3Cpath d='M5.8 9.5v10.7h4.4v-5.6h3.6v5.6h4.4V9.5'/%3E%3C/svg%3E"); }
#tab-lessons { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='2.8' y='4.8' width='18.4' height='14.4' rx='3.6'/%3E%3Cpath d='M10 9.2v5.6l4.8-2.8z' fill='%23000'/%3E%3C/svg%3E"); }
#tab-practice { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.8 7.4l2 2 3.6-3.9M3.8 16.4l2 2 3.6-3.9M13 7.5h7.2M13 16.5h7.2'/%3E%3C/svg%3E"); }
#tab-words { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.6C10 5.2 7.4 4.7 3.5 5v13.4c3.9-.3 6.5.2 8.5 1.6 2-1.4 4.6-1.9 8.5-1.6V5c-3.9-.3-6.5.2-8.5 1.6zM12 6.6V20'/%3E%3C/svg%3E"); }
#tab-progress { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 20.5v-6M12 20.5v-10M19 20.5V4'/%3E%3C/svg%3E"); }

/* The tab screens' lists: a heading at the very top sits close under the
   intro, and the Lessons videos carry the play glyph, not the headphones. */
#listen-list > h2:first-child { margin-top: 4px; }
#listen-list > .btn[data-video] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.2v13.6c0 .8.9 1.3 1.6.9l10.4-6.8a1.1 1.1 0 0 0 0-1.8L9.6 4.3C8.9 3.9 8 4.4 8 5.2z'/%3E%3C/svg%3E"); }

/* ═══ HOME ══════════════════════════════════════════════════════════════
   The first screen has to answer "is this worth £20" before it asks for
   anything, then make one card obviously the thing to press. */

.hero { position: relative; padding: 12px 0 24px; }
/* A soft gold light behind the headline. It stays inside the viewport: a
   negative left with a >100% width paints the same glow but widens the page's
   scroll area, which body{overflow-x:hidden} then hides rather than fixes. */
.hero::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  top: -110px; left: 0; width: 100%; height: 340px;
  background: radial-gradient(85% 60% at 30% 50%, rgba(255, 212, 0, .16), transparent 72%);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 800; letter-spacing: 2.2px;
  color: var(--gold-text); margin-bottom: 18px;
}
/* the channel's mark: the gold tick on navy, as on the app icon */
.brand::before {
  content: ''; flex: none; width: 28px; height: 28px; border-radius: 9px;
  background: #0a0f16 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5.5 12.6l4.1 4.1L18.6 7.4' fill='none' stroke='%23ffd400' stroke-width='3.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 212, 0, .35), 0 6px 16px -6px rgba(255, 190, 0, .55);
}
.heroline {
  font-size: 44px; line-height: 1; letter-spacing: -1.6px;
  font-weight: 800; margin: 0 0 14px; text-wrap: balance;
}
.heroline span { color: var(--gold-display); }
body.returning .heroline span { color: var(--gold-text); }
.heroby { color: var(--ink-soft); margin: 0 0 22px; font-size: 15px; line-height: 1.5; max-width: 30em; }

.stats { display: flex; gap: 10px; }
.stat {
  /* min-width:0 is load-bearing. A flex item defaults to min-width:auto, so a
     long stat label refuses to shrink, widens the page past the viewport, and
     every OTHER block then wraps at that wider width and gets clipped off the
     right edge of the phone. */
  flex: 1; min-width: 0;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 14px 8px 12px; text-align: center;
  box-shadow: var(--shadow-1);
}
.stat b {
  display: block; font-size: 22px; font-weight: 800; letter-spacing: -.6px; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block; font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.3;
  hyphens: auto; overflow-wrap: anywhere;
}

/* The storage note above Start. It is housekeeping, not teaching, so it is a
   quiet card with a phone on it rather than a second gold card competing with
   the Start card under it. The in-app warning keeps its red (below). */
#home-resume .why { margin-bottom: 14px; }
#home-resume .why p { font-size: 15px; line-height: 1.55; }
#home-resume .why:not([style*="--wrong"]) {
  background: var(--surface); border-color: var(--hairline-strong);
}
#home-resume .why:not([style*="--wrong"])::before { background: var(--ink-soft); opacity: .55; }
#home-resume .why:not([style*="--wrong"]) h3 { color: var(--ink-2); }
#home-resume .why:not([style*="--wrong"]) h3::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='6' y='2.5' width='12' height='19' rx='3'/%3E%3Cpath d='M10.5 18h3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='6' y='2.5' width='12' height='19' rx='3'/%3E%3Cpath d='M10.5 18h3'/%3E%3C/svg%3E");
}
#home-resume .why .btn[data-a2hs] {
  display: inline-block; width: auto; min-width: 104px; margin-top: 14px !important;
  padding: 10px 26px; min-height: 44px; text-align: center; font-weight: 700;
  border-radius: 999px;
}

/* ── one next thing ──────────────────────────────────────────────────── */
.nextcard {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 0 0 16px; padding: 22px 20px 20px;
  border-radius: var(--r-xl); border: 1.5px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(145deg, #ffe680 0%, #ffd400 38%, rgba(255, 212, 0, .25) 100%) border-box;
  box-shadow: 0 26px 50px -30px rgba(255, 190, 0, .6), var(--shadow-1);
}
.nextcard::before {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(90% 75% at 100% 0%, rgba(255, 212, 0, .15), transparent 60%);
}
.nextcard.done {
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(145deg, #8ff0b8, var(--right-line) 45%, rgba(61, 220, 132, .25)) border-box;
  box-shadow: 0 26px 50px -30px var(--right-glow), var(--shadow-1);
}
.nextcard.done::before { background: radial-gradient(90% 75% at 100% 0%, var(--right-tint), transparent 60%); }
.nextlab {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 800; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--gold-text); margin-bottom: 10px;
}
/* a live dot: this card is where you are */
.nextlab::before {
  content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(255, 212, 0, .2);
}
.nextcard.done .nextlab { color: var(--right); }
.nextcard.done .nextlab::before { background: var(--right); box-shadow: 0 0 0 4px var(--right-tint); }
.nexttitle {
  font-size: 30px; font-weight: 800; letter-spacing: -.9px;
  line-height: 1.08; margin-bottom: 6px; text-wrap: balance;
}
.nextwhat { font-size: 17px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.nextmins {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--ink-soft); margin-bottom: 18px;
}
.nextmins::before {
  content: ''; flex: none; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.nextcard .btn { margin: 0; }

/* ── the percentage, said out loud ───────────────────────────────────── */
#home-plan:not(:empty), .planbox {
  margin: 0 0 6px; padding: 16px 18px 18px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.prog100 { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.prog100 .pct {
  flex: none; font-size: 44px; font-weight: 800; letter-spacing: -2px;
  line-height: 1; color: var(--gold-display); font-variant-numeric: tabular-nums;
}
.prog100 .pct span { font-size: 20px; letter-spacing: 0; margin-left: 1px; }
.pcttext { min-width: 0; }
.pcttext strong { display: block; font-size: 17px; letter-spacing: -.2px; }
.pcttext span { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #f2b600, #ffd400 60%, #ffe566);
  transition: width .3s var(--ease);
}
.bar.big { position: relative; height: 12px; overflow: visible; }
.bar.big > i {
  position: relative; min-width: 12px;
  box-shadow: 0 0 14px rgba(255, 212, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .55);
}
/* a gloss line along the top of the fill */
.bar.big > i::after {
  content: ''; position: absolute; left: 6px; right: 6px; top: 2px; height: 3px;
  border-radius: 999px; background: rgba(255, 255, 255, .45);
}

/* ── the course, all of it, grouped ──────────────────────────────────── */
.outh {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 800; letter-spacing: 1.8px;
  text-transform: uppercase; color: var(--ink-soft);
  margin: 34px 4px 12px;
}
.outh::after { content: ''; flex: 1; height: 1px; background: var(--hairline-strong); }

/* each unit is one card; its steps are a path through it */
.unit {
  margin-bottom: 12px; padding: 4px 6px 6px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.unith {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 10px 8px 12px;
}
.unitname { font-size: 17px; font-weight: 800; letter-spacing: -.3px; line-height: 1.25; }
.unitn {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hairline); font-variant-numeric: tabular-nums;
}
.unit-done .unitname { color: var(--ink-2); }
.unit-done .unitn { color: var(--right); background: var(--right-tint); box-shadow: none; }
.unit-done .unitn::before { content: '\2713'; content: '\2713' / ''; font-weight: 900; }

.srow {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 60px; padding: 10px 12px; margin: 0;
  text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: transparent; border: 0; border-radius: 14px;
  transition: background-color .2s, transform .15s var(--ease);
}
.srow:active { transform: scale(.985); background: var(--surface-2); }
/* the path line, threaded through the marks */
.srow::before {
  content: ''; position: absolute; left: 25px; top: 0; bottom: 0; width: 2px;
  margin-left: -1px; background: var(--line);
}
.srow:first-of-type::before { top: 50%; }
.srow:last-child::before { bottom: 50%; }
.srow:first-of-type:last-child::before { display: none; }
.srow.ok::before { background: var(--right-line); }
.srow.ok:last-child::before { background: var(--right-line); }
.srow.now::before { background: linear-gradient(var(--right-line) 50%, var(--line) 50%); }
.srow.now:first-of-type::before { background: var(--line); }

.smark {
  position: relative; z-index: 1;
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; line-height: 1;
  background: var(--surface); color: var(--ink-soft);
  box-shadow: inset 0 0 0 2px var(--line);
}
.srow.ok .smark { background: var(--right-fill); color: var(--on-fill); box-shadow: none; }
.srow.ok .sname { color: var(--ink-soft); font-weight: 600; }
.srow.now {
  background: var(--gold-tint);
  box-shadow: inset 0 0 0 1.5px var(--gold-line);
}
.srow.now .smark {
  background: var(--gold); color: var(--on-gold); font-size: 10px; padding-left: 2px;
  box-shadow: 0 0 0 4px rgba(255, 212, 0, .22);
}
.sbody { flex: 1; min-width: 0; }
.sname { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.2px; line-height: 1.3; }
.smeta { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.snow {
  flex: none; font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  color: var(--on-gold); background: var(--gold);
  padding: 4px 9px; border-radius: 999px;
}

/* A returning learner has already decided it was worth £20. Give them the
   work, not the pitch. */
body.returning .hero { padding: 6px 0 14px; }
body.returning .brand { margin-bottom: 12px; }
body.returning .heroline { font-size: 22px; letter-spacing: -.5px; margin-bottom: 4px; line-height: 1.15; }
body.returning .heroline br { display: none; }
body.returning .heroby { display: none; }
body.returning .hero::before { display: none; }

/* ═══ THE QUESTION ══════════════════════════════════════════════════════
   The hero of every video: a count, a named topic, a question in big clear
   type, the sign on a lit stage, and four answers that each say which letter
   they are. */

/* ── category chip ───────────────────────────────────────────────────── */
/* Colour is orientation only. The name is always written, so nothing here
   depends on being able to tell the colours apart. app.js paints the chip in
   the topic's hue; a veil over it leaves that hue as a rim and a dot, so the
   name is read on a calm ground at full contrast in either theme. */
.catband { margin: 0 0 12px; min-height: 30px; }
.catpill {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; max-width: 100%;
  padding: 5px 13px 5px 27px; border-radius: 999px;
  color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: .1px; line-height: 1.35;
}
.catpill::before {
  content: ''; position: absolute; top: 1px; right: 1px; bottom: 1px; left: 1px; z-index: -1; border-radius: inherit;
  background: radial-gradient(circle at 13px 50%, transparent 4.2px, var(--chip-veil) 4.9px);
}

.qtext {
  font-size: clamp(19px, 5.65vw, 22px); line-height: 1.36; letter-spacing: -.35px; font-weight: 700;
  margin: 0 0 18px; text-wrap: pretty;
}

/* The sign on a stage. The <img> IS the stage: object-fit keeps the sign in
   the content box and the padding shows the lit ground around it, so there is
   no extra wrapper for app.js to know about. */
.qimg {
  display: block; width: 100%; height: clamp(150px, 25vh, 212px);
  object-fit: contain; padding: 18px; margin: 0 0 18px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(56% 74% at 50% 46%, var(--stage-glow), transparent 74%),
    linear-gradient(180deg, var(--stage-top), var(--stage-bot));
  box-shadow: inset 0 0 0 1px var(--hairline), inset 0 1px 0 rgba(255, 255, 255, .06),
              0 18px 36px -26px rgba(0, 0, 0, .55);
}

/* ── answer options ──────────────────────────────────────────────────── */
.opt {
  position: relative;
  display: flex; gap: 14px; align-items: center;
  width: 100%; min-height: 62px; padding: 12px 14px 12px 12px;
  margin: 0 0 10px; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline-strong); border-radius: 18px;
  box-shadow: var(--shadow-1);
  transition: transform .15s var(--ease), border-color .2s, background-color .25s,
              opacity .3s, box-shadow .3s;
}
.opt:active:not([disabled]) { transform: scale(.985); }
@media (hover: hover) {
  button.opt:not([disabled]):hover { border-color: var(--gold-line); }
}
.opt .key {
  flex: none; width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  font-size: 15px; font-weight: 800; line-height: 1;
  transition: background-color .25s, color .25s, box-shadow .25s;
}
.opt .txt { flex: 1; min-width: 0; font-size: 17px; line-height: 1.38; font-weight: 500; }
.opt .mark:empty { display: none; }
.opt .mark {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; line-height: 1;
}
.opt[disabled] { cursor: default; }

/* The four answers come in one after another, once per question. :where()
   keeps this weaker than the reveal below, or #d-opts would outrank
   .opt.is-right and the settle and the shake would never play. */
:where(#d-opts) .opt { animation: opt-in .32s var(--ease) backwards; }
:where(#d-opts) .opt:nth-child(2) { animation-delay: .04s; }
:where(#d-opts) .opt:nth-child(3) { animation-delay: .08s; }
:where(#d-opts) .opt:nth-child(4) { animation-delay: .12s; }
@keyframes opt-in { from { opacity: 0; transform: translateY(8px); } }

/* Right: it settles, glows green and gets a tick. */
.opt.is-right {
  border-color: var(--right-line);
  background: linear-gradient(var(--right-tint), var(--right-tint)), var(--surface);
  box-shadow: inset 0 0 0 1px var(--right-line), 0 12px 30px -14px var(--right-glow);
  animation: settle .34s var(--spring);
}
.opt.is-right .key { background: var(--right-fill); color: var(--on-fill); box-shadow: none; }
.opt.is-right .mark { background: var(--right-fill); color: var(--on-fill); animation: pop .34s .1s var(--spring) backwards; }
.opt.is-right::after {
  content: ''; position: absolute; top: -1px; right: -1px; bottom: -1px; left: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 var(--right-glow);
  animation: halo .35s ease-out .05s backwards;
}
@keyframes settle { 0% { transform: scale(.985); } 55% { transform: scale(1.015); } 100% { transform: none; } }
@keyframes pop { from { transform: scale(0); opacity: 0; } }
@keyframes halo { from { box-shadow: 0 0 0 0 var(--right-glow); } to { box-shadow: 0 0 0 12px rgba(61, 220, 132, 0); } }

/* Wrong: a short shake, red, and a cross. */
.opt.is-wrong {
  border-color: var(--wrong-line);
  background: linear-gradient(var(--wrong-tint), var(--wrong-tint)), var(--surface);
  box-shadow: inset 0 0 0 1px var(--wrong-line);
  animation: shake .34s ease-in-out;
}
.opt.is-wrong .key { background: var(--wrong-fill); color: var(--on-fill); box-shadow: none; }
.opt.is-wrong .mark { background: var(--wrong-fill); color: var(--on-fill); }
@keyframes shake {
  0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(2px); }
}
.opt.is-dim { opacity: .55; box-shadow: none; }

/* a chosen-but-not-yet-marked answer during a mock: no right/wrong colour,
   because a paper does not tell you anything until you hand it in */
.opt.is-picked {
  border-color: var(--gold-line);
  background: linear-gradient(var(--gold-tint), var(--gold-tint)), var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--gold), 0 12px 28px -16px rgba(255, 190, 0, .55);
}
.opt.is-picked .key { background: var(--gold); color: var(--on-gold); box-shadow: none; }
/* the ● becomes a radio dot */
.opt.is-picked .mark {
  font-size: 0; width: 24px; height: 24px; margin-right: 2px;
  background: radial-gradient(circle, var(--gold) 0 5px, transparent 5.5px);
  box-shadow: inset 0 0 0 2px var(--gold);
}

/* ── the teaching moment ─────────────────────────────────────────────── */
#d-fb > * { animation: rise .34s var(--ease) backwards; }
#d-fb > :nth-child(2) { animation-delay: .07s; }
#d-fb > :nth-child(3) { animation-delay: .14s; }
#d-fb > :nth-child(4) { animation-delay: .2s; }
#d-fb > :nth-child(n+5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.verdict { font-size: 20px; font-weight: 800; letter-spacing: -.3px; margin: 24px 0 12px; }
.verdict.right, .verdict.wrong { display: flex; align-items: center; gap: 10px; }
.verdict.right { color: var(--right); }
.verdict.wrong { color: var(--wrong); }
.verdict.right::before, .verdict.wrong::before {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: var(--on-fill);
}
.verdict.right::before { content: '\2713'; content: '\2713' / ''; background: var(--right-fill); box-shadow: 0 0 0 5px var(--right-tint); }
.verdict.wrong::before { content: '\2715'; content: '\2715' / ''; background: var(--wrong-fill); box-shadow: 0 0 0 5px var(--wrong-tint); }

/* The why. The whole difference from the £5.99 apps, so it is dressed as the
   moment the instructor leans over: warm gold, a teacher's mark, room to read. */
.why {
  position: relative; overflow: hidden;
  margin: 0 0 12px; padding: 16px 18px 17px 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--why-tint), transparent 70%), var(--surface);
  border: 1px solid var(--why-line);
  box-shadow: var(--shadow-1);
}
.why::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #ffe566, var(--gold) 40%, var(--gold-deep));
}
.why h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px; font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.4px; color: var(--gold-text);
}
.why h3::before {
  content: ''; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 21.5h6V20H9zM12 2.5a7 7 0 0 0-4.3 12.5c.6.5.8 1.1.8 1.8v1.7h7v-1.7c0-.7.3-1.3.8-1.8A7 7 0 0 0 12 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 21.5h6V20H9zM12 2.5a7 7 0 0 0-4.3 12.5c.6.5.8 1.1.8 1.8v1.7h7v-1.7c0-.7.3-1.3.8-1.8A7 7 0 0 0 12 2.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.why p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink); }
.why p + p { margin-top: 8px; }

/* The why-wrong and the in-app warning: app.js marks them with an inline red
   left border. They get the red card, and a cross instead of the bulb. */
.why[style*="--wrong"] {
  background: linear-gradient(160deg, var(--wrong-tint), transparent 70%), var(--surface);
  border-color: var(--wrong-edge);
  border-left-color: var(--wrong-line);
}
.why[style*="--wrong"]::before { background: var(--wrong-line); }
.why[style*="--wrong"] h3 { color: var(--wrong); }
.why[style*="--wrong"] h3::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 9l6 6M15 9l-6 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 9l6 6M15 9l-6 6'/%3E%3C/svg%3E");
}

/* the other answers, folded: an accordion that says it opens */
details.folded {
  margin: 0 0 12px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
details.folded > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 54px; padding: 12px 18px;
  font-size: 15px; font-weight: 700; color: var(--ink-2);
}
details.folded > summary::-webkit-details-marker { display: none; }
details.folded > summary::after {
  content: ''; flex: none; width: 9px; height: 9px; margin: -4px 4px 0 0;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg); transition: transform .25s var(--ease);
}
details.folded[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
details.folded .inner { padding: 4px 18px 14px; border-top: 1px solid var(--hairline); }
details.folded[open] .inner { animation: rise .26s var(--ease) backwards; }
details.folded .inner p { margin: 12px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
details.folded .inner b {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 24px; padding: 0 5px; margin-right: 6px; border-radius: 7px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline-strong);
  color: var(--ink); font-size: 13px; font-weight: 800; vertical-align: 1px;
}

.src { font-size: 13px; color: var(--ink-soft); margin: 14px 2px 0; line-height: 1.45; }

/* hard words look like a link: a gold word with a solid gold line under it,
   so nobody has to guess they can tap it. His call, 16 Oct 2026: the dotted
   line it had before was too quiet to read as "tap me". */
.hw {
  border: 0; padding: 0; margin: 0; background: none; font: inherit;
  color: var(--gold-text); cursor: pointer; border-radius: 4px;
  text-decoration: underline solid var(--hw-line);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.hw:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* the gloss bubble */
#gloss {
  /* Above the explanation sheet (60): a hard word tapped inside that sheet
     used to open underneath it, where nobody could see it. */
  position: fixed; left: var(--gutter); right: var(--gutter); z-index: 70;
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 600px; margin: 0 auto;
  padding: 16px 58px 17px 18px; border-radius: var(--r-lg);
  background: #0f1d2b; color: #eef4fb;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .65), inset 0 0 0 1px rgba(255, 212, 0, .28);
  font-size: 16px; line-height: 1.5;
  display: none;
}
#gloss.show { display: block; animation: sheet-up .3s var(--ease); }
#gloss b {
  display: block; margin-bottom: 2px;
  font-size: 19px; font-weight: 800; letter-spacing: -.2px; color: #ffd400;
}
#gloss-body br { display: none; }   /* the word is a block already */
/* when the dock is up, the bubble sits above it rather than over "Next" */
body:has(#dock:not(.hide)) #gloss { bottom: calc(92px + env(safe-area-inset-bottom)); }
#gloss .x {
  position: absolute; top: 8px; right: 8px;
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: #eef4fb; font-size: 22px; line-height: 1;
}
#gloss .x:focus-visible { outline: 3px solid #7cc0ff; outline-offset: 1px; }

/* ═══ CHOOSING ══════════════════════════════════════════════════════════ */

/* Options that look like options. The old size screen styled the first one
   as the primary button, so "10" read as GO and the other sizes read as
   nothing at all. An outline says choosable; the fill says chosen. */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }
.chip {
  position: relative;
  flex: 1 1 auto; min-width: 74px; min-height: var(--tap);
  padding: 10px 12px; border-radius: 999px;
  border: 0; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline-strong), var(--shadow-1);
  color: var(--ink); font: inherit; font-weight: 800; font-size: 17px;
  cursor: pointer; text-align: center;
  transition: transform .15s var(--ease), box-shadow .2s, background-color .2s;
}
.chip .chipsub {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink-soft); margin-top: 1px; letter-spacing: 0;
}
.chip.sel {
  background: linear-gradient(var(--gold-tint), var(--gold-tint)), var(--surface);
  box-shadow: inset 0 0 0 2px var(--gold), 0 12px 26px -14px rgba(255, 190, 0, .6);
}
.chip.sel .chipsub { color: var(--gold-text); }
.chip:active { transform: scale(.97); }

/* the session length: big tiles, one row */
#size-list { gap: 10px; margin: 6px 0 22px; }
#size-list .chip {
  min-height: 92px; border-radius: var(--r-lg);
  font-size: 28px; letter-spacing: -.8px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
#size-list .chip .chipsub { font-size: 13px; margin-top: 4px; }
/* four lengths (10, 25, 50, all) sit as a square, not three and a straggler */
#size-list:has(> .chip:nth-child(4)) { display: grid; grid-template-columns: 1fr 1fr; }
#size-list .chip.sel::after {
  content: '\2713'; content: '\2713' / '';
  position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--on-gold); font-size: 11px; font-weight: 900; letter-spacing: 0;
  animation: pop .25s var(--spring);
}
#size-go .btn { margin-top: 4px; }

/* review filters: a segmented control */
#rv-filters {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; margin: 6px 0 16px; border-radius: 18px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline);
}
#rv-filters .chip {
  min-width: 0; min-height: 52px; border-radius: 14px; padding: 7px 6px;
  background: transparent; box-shadow: none; font-size: 15px;
}
#rv-filters .chip .chipsub { font-variant-numeric: tabular-nums; }
#rv-filters .chip.sel { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--gold), var(--shadow-1); }

/* ═══ RESULTS ═══════════════════════════════════════════════════════════ */

.panel {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-xl); padding: 20px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow-1);
}
.panel h2 { margin: 0 0 6px; font-size: 20px; }
.panel .sub { margin: 0 0 16px; }
.panel .btn { margin-bottom: 10px; text-align: center; font-weight: 700; }
.panel .btn:last-child { margin-bottom: 0; }

#e-score {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 22px 20px; box-shadow: var(--shadow-2);
}
#e-score::before {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 90% at 100% 50%, rgba(255, 212, 0, .12), transparent 70%);
}
.scorerow { display: flex; align-items: center; gap: 16px; }
.scorefacts { flex: 1; min-width: 0; }
.scorefacts .lab {
  font-size: 11px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--ink-soft); margin-top: 12px;
}
.scorefacts .lab:first-child { margin-top: 0; }
.scorefacts .big {
  font-size: 46px; font-weight: 800; letter-spacing: -2px; line-height: 1.05;
  font-variant-numeric: tabular-nums;
  /* app.js colours this inline with var(--gold-text); at 46px the display
     gold is the right one, so the variable is re-pointed on this element */
  --gold-text: var(--gold-display);
}
.scorefacts .dim { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }

/* The ring. Drawn on, once, when the score lands. */
.ring { flex: none; width: 128px; height: 128px; overflow: visible; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.ring-on {
  fill: none; stroke: var(--gold); stroke: url(#ring-gold) var(--gold);
  stroke-width: 10; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 212, 0, .45));
  animation: ring-draw .35s var(--ease) .1s backwards;
}
@keyframes ring-draw { from { stroke-dasharray: 0 264; } }
/* at the pass mark the number turns green (app.js), and the ring follows it */
.scorerow:has(.big[style*="--right"]) .ring-on {
  stroke: url(#ring-green) var(--right-fill); filter: drop-shadow(0 0 6px var(--right-glow));
}
.ring-t { fill: var(--ink); font-size: 23px; font-weight: 800; letter-spacing: -.5px; font-family: var(--font); }

/* the big centred score (mocks, papers, progress) */
.score {
  position: relative; overflow: hidden; isolation: isolate;
  text-align: center; margin: 8px 0 18px; padding: 28px 16px 24px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-xl); box-shadow: var(--shadow-2);
}
.score::before {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 80% at 50% 0%, rgba(255, 212, 0, .14), transparent 70%);
}
.score .n {
  font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -3px;
  font-variant-numeric: tabular-nums;
}
.score .of { color: var(--ink-soft); font-size: 15px; font-weight: 600; margin-top: 10px; }

/* the paper verdict: a banner in its own colour (app.js sets the colour) */
.score + .verdict {
  margin: -4px 0 14px; padding: 14px 16px; border-radius: var(--r-lg);
  font-size: 19px; line-height: 1.3; text-wrap: balance;
  border: 1.5px solid currentColor; background: var(--surface);
}
.score + .verdict[style*="--right"] { background: linear-gradient(var(--right-tint), var(--right-tint)), var(--surface); }
.score + .verdict[style*="--gold-text"] { background: linear-gradient(var(--gold-tint), var(--gold-tint)), var(--surface); border-color: var(--gold-line); }
.score + .verdict[style*="--wrong"] { background: linear-gradient(var(--wrong-tint), var(--wrong-tint)), var(--surface); }

.list { list-style: none; padding: 0; margin: 0 0 18px; }
.list li {
  padding: 14px 16px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.list li .q { font-size: 16px; line-height: 1.4; }
.list li .a { font-size: 14px; color: var(--ink-soft); margin-top: 4px; line-height: 1.45; }
.list li .a b { color: var(--ink); }

#res-body > h1 { margin-bottom: 14px; }
#res-actions { margin-top: 22px; }
#res-actions .btn { text-align: center; font-weight: 700; }
#res-body .src { margin: 0 2px 16px; }

/* ═══ REVIEW ════════════════════════════════════════════════════════════ */

.rvlist {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden;
}
.rvlist > .sub { margin: 0; padding: 18px; }
.rvrow {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 64px; padding: 14px 14px 14px 16px; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--hairline);
  color: var(--ink); font: inherit; cursor: pointer;
  transition: background-color .2s;
}
.rvrow:last-child { border-bottom: 0; }
.rvrow:active { background: var(--surface-2); }
.rvmark {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: var(--on-fill);
}
.rvmark.ok { background: var(--right-fill); }
.rvmark.no { background: var(--wrong-fill); }
.rvq { flex: 1; min-width: 0; font-size: 15px; line-height: 1.4; }
.rvq b { font-weight: 800; font-variant-numeric: tabular-nums; }
.rvgo {
  flex: none; font-size: 0; width: 9px; height: 9px; margin-right: 4px;
  border-top: 2px solid var(--ink-soft); border-right: 2px solid var(--ink-soft);
  transform: rotate(45deg); border-radius: 1px;
}

#rq-why .src { margin: 0 2px 12px; }
#rq-why .btn[data-why] { margin-top: 6px; }

/* ═══ THE EXPLANATION SHEET ═════════════════════════════════════════════ */

body.sheet-open { overflow: hidden; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60;
  background: rgba(3, 7, 12, .58);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .22s ease-out;
}
.sheet.hide { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet-in {
  position: relative;
  width: 100%; max-width: 640px; max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .5), inset 0 1px 0 var(--hairline-strong);
  animation: sheet-up .34s var(--ease);
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
/* the grabber says "this is a sheet, it came up over the question" */
.sheet-in::before {
  content: ''; position: absolute; left: 50%; top: 8px; width: 38px; height: 5px;
  margin-left: -19px; border-radius: 999px; background: var(--hairline-strong);
}
.sheet-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 12px 8px var(--gutter); border-bottom: 1px solid var(--hairline);
}
.sheet-top h2 { margin: 0; font-size: 20px; }
.sheet-top .x {
  width: var(--tap); height: var(--tap); border: none; border-radius: 50%; cursor: pointer;
  background: var(--surface-2); color: var(--ink-soft); font-size: 26px; line-height: 1;
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.sheet-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px var(--gutter); flex: 1;
}
.sheet-body .verdict { display: none; }   /* the marks on the options already said it */
.sheet-foot {
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
}
.sheet-foot .btn { margin: 0; min-height: 54px; }

/* ═══ MOCKS ═════════════════════════════════════════════════════════════ */

#m-nav { margin-top: 14px; }
#m-nav .btn[data-mflag] {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center; font-weight: 700; color: var(--ink-2);
}
/* the paper at a glance: what is answered, what is parked, where you are */
.mnav {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px; margin: 16px 0 14px;
}
.mgo {
  min-width: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--surface); color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: transform .15s var(--ease);
}
.mgo:active { transform: scale(.94); }
.mgo.is-done { background: var(--surface-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.mgo.is-flag { background: var(--gold); color: var(--on-gold); box-shadow: none; }
.mgo.is-cur { box-shadow: inset 0 0 0 2px var(--ink), 0 0 0 3px var(--gold-tint); color: var(--ink); }
.mgo.is-flag.is-cur { box-shadow: inset 0 0 0 2px var(--on-gold), 0 0 0 3px var(--gold-tint); }

/* the pre-mock promise: a real checkbox, in gold */
#pre-body > h1 { margin-bottom: 10px; }
#pre-body label.btn { font-size: 16px; line-height: 1.45; padding: 16px 18px; margin-top: 18px; }
#pre-body input[type="checkbox"] { accent-color: var(--gold); }

/* ═══ PROGRESS AND THE SAVE CODE ════════════════════════════════════════ */

#prog-body .list li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; }
#prog-body .list li::before {
  content: ''; flex: none; width: 20px; height: 20px; border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line);
}
#prog-body .why code { margin-top: 2px; }

/* a quieter fold for things most people never need */
details.tuck { margin-top: 18px; }
details.tuck > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px; min-height: var(--tap);
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; color: var(--ink-2);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--hairline-strong);
}
details.tuck > summary::-webkit-details-marker { display: none; }
details.tuck > summary::after {
  content: ''; margin-left: auto; width: 9px; height: 9px; margin-top: -4px;
  border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg); transition: transform .25s var(--ease);
}
details.tuck[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
details.tuck[open] > summary { margin-bottom: 16px; }
details.tuck .sub { margin: 0 2px 12px; }
details.tuck textarea { display: block; margin: 0 0 12px; line-height: 1.45; resize: vertical; }
details.tuck textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
details.tuck .btn { text-align: center; font-weight: 700; }
#sc-msg:not(:empty) { font-weight: 600; color: var(--ink-2); }

/* ═══ LISTEN AND WATCH ══════════════════════════════════════════════════ */

#player { display: block; width: 100%; height: 54px; margin-bottom: 18px; border-radius: 999px; }
#listen-list > .btn-primary {
  padding: 18px 20px 18px 74px; min-height: 78px;
  border-radius: var(--r-lg); margin-bottom: 14px; text-align: left;
}
#listen-list > .btn-primary strong { font-size: 18px; }
/* the gold row is the one that plays: a navy disc with a play mark on it,
   or sound bars on the part that is playing now */
#listen-list > .btn-primary::before {
  content: ''; position: absolute; left: 16px; top: 50%; margin-top: -22px;
  width: 44px; height: 44px; border-radius: 50%;
  background: #0a0f16; box-shadow: 0 8px 18px -8px rgba(60, 40, 0, .55);
}
#listen-list > .btn-primary strong::before {
  content: ''; position: absolute; left: 30px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px; background: #ffd400;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
#listen-list > [data-chapter] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.2v13.6c0 .8.9 1.3 1.6.9l10.4-6.8a1.1 1.1 0 0 0 0-1.8L9.6 4.3C8.9 3.9 8 4.4 8 5.2z'/%3E%3C/svg%3E"); }
#listen-list > .btn-primary[data-listen] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.2v13.6c0 .8.9 1.3 1.6.9l10.4-6.8a1.1 1.1 0 0 0 0-1.8L9.6 4.3C8.9 3.9 8 4.4 8 5.2z'/%3E%3C/svg%3E"); }
#listen-list > .btn-primary[data-chapter] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='9' width='3.6' height='6' rx='1.8'/%3E%3Crect x='10.2' y='4' width='3.6' height='16' rx='1.8'/%3E%3Crect x='17.4' y='7' width='3.6' height='10' rx='1.8'/%3E%3C/svg%3E"); }

/* The lesson is a piece of film: a frame, a black surround, a shadow. */
#watch-player video {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain;
  border-radius: var(--r-lg) !important; background: #000;
  box-shadow: 0 0 0 1px var(--hairline-strong), 0 24px 50px -24px rgba(0, 0, 0, .75);
}
#watch-after .btn-primary { min-height: 56px; }

/* A phone on its side has about 390px of height, and the two bars took 150
   of it. Short screens get a smaller stage and a slimmer dock. */
@media (max-height: 500px) {
  .qimg { height: 132px; padding: 12px; }
  .dock { padding-top: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .dock .btn { min-height: 46px; padding-top: 10px; padding-bottom: 10px; }
}

/* ═══ THE RESTRUCTURE, 5 OCT 2026 ═══════════════════════════════════════

   Additions only. Nothing above this line was changed for the restructure,
   so the redesign stays checkable against its own screenshots. Every new
   element reuses the redesign's cards (.why, .nextcard, .list, .btn) and
   tokens; what follows is only what those did not already cover. */

/* the two quiet links under the first card */
.homelinks { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 18px; }
.linkbtn {
  appearance: none; background: none; border: 0; cursor: pointer;
  min-height: var(--tap); padding: 12px 4px; text-align: left;
  font: inherit; font-size: 15px; line-height: 1.4; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 3px;
}

/* "Day 3 done." above today's card. A tick and a word, never colour alone. */
.nextdone { font-size: 15px; font-weight: 700; color: var(--right); margin-bottom: 12px; }
.nextdone::before { content: '\2713\00a0'; content: '\2713\00a0' / ''; }

/* two answers stacked in the first card and the set-up card: both are
   answers to one question, so both are centred and the same weight */
.nextcard .btn + .btn { margin-top: 10px; }
.nextcard .btn:not(.btn-primary) { text-align: center; font-weight: 700; }
.homefact { margin: 2px 2px 18px; }

/* a labelled field: the test date, a score */
.field { display: block; margin: 14px 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.field input {
  display: block; width: 100%; min-height: 52px; margin-top: 8px; padding: 12px 14px;
  font: inherit; font-size: 17px; font-weight: 500; color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong); border-radius: var(--radius);
}

/* the hard words that sit inside the answers, listed under them */
.hwhint { display: block; font-size: 14px; font-weight: 400; color: var(--ink-soft); margin: 10px 0 0; }
.hwchips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 4px; }
.hwlab {
  flex-basis: 100%; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft);
}
.hw.hwchip {
  min-height: var(--tap); padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--hairline-strong);
  font-size: 15px; text-underline-offset: 4px;
}

/* the gloss bubble's door to the phone's own translator (the bubble is navy
   in both themes, so the link is the bubble's own gold) */
.glosslink {
  display: block; min-height: var(--tap); margin-top: 8px; padding: 11px 0 0;
  font-size: 15px; font-weight: 600; color: #ffd400; text-underline-offset: 3px;
}

/* the dictionary */
.dict {
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden;
}
.dictrow { padding: 14px 16px; border-top: 1px solid var(--hairline); }
.dictrow:first-child { border-top: 0; }
.dictrow b { display: block; font-size: 16px; color: var(--ink); }
.dictrow span { display: block; margin-top: 3px; font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.dictlink { display: block; min-height: var(--tap); padding: 12px 0 0; font-size: 14px; font-weight: 600;
            color: var(--gold-text); text-underline-offset: 3px; }

/* a link that is a button (GOV.UK, WhatsApp): same card, centred label */
a.btn { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; font-weight: 700; }
.why .btn { margin-bottom: 0; }

/* the tick box on a send card */
.tick {
  display: flex; align-items: flex-start; gap: 10px; min-height: var(--tap);
  margin: 12px 0 2px; font-size: 15px; line-height: 1.4; color: var(--ink-2);
}
.tick input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; }

/* "Am I ready?": a fact that is met carries a tick, a word and a green edge */
.list li.fact.is-ok { border-color: var(--right-line); }
.list li.fact.is-ok .q b { color: var(--right); }

/* ═══ UTILITIES ═════════════════════════════════════════════════════════ */

.hide { display: none !important; }

/* Still. Everything above that moves is decoration, and none of it may move
   for someone who has asked their phone for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important; animation: none !important; scroll-behavior: auto !important;
  }
}

/* ═══ THE FREE TASTER (/try/, app.js TRY) ═══════════════════════════════
   The offer after the first five. build.py writes the words; these are the
   only styles the course itself never uses. */
.tryoffer .nexttitle { font-size: 27px; }
.trylist { list-style: none; padding: 0; margin: 8px 0 14px; }
.trylist li { position: relative; padding-left: 32px; margin: 0 0 10px; font-weight: 700; line-height: 1.35; }
.trylist li::before {
  content: ''; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 6px;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%230a0f16' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.tryoffer .sub a { color: var(--gold-text); font-weight: 700; }
.tryseller { text-align: center; font-size: 14px; line-height: 1.4; color: var(--ink-soft); margin: 10px 0 0; }
.tryseller a { color: var(--ink-soft); }
.dock .tryseller { margin: 0; }
/* The score screen: one card with no panel round it, so the promise sits
   above the docked button with a browser's bars on screen. */
#e-score:has(+ #e-next .tryoffer) { background: none; border: 0; box-shadow: none; padding: 0; }
#e-score:has(+ #e-next .tryoffer)::before { display: none; }
#e-score:has(+ #e-next .tryoffer) .why { margin: 0; }
/* The dock under the offer is solid, so nothing reads through the seller line. */
#dock:has(.tryseller) { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Start and the buy button move you on, so they carry the app's arrow. */
.nextcard .btn-primary[data-tryfive]::after, a.btn-primary[href^="https://buy.stripe.com/"]::after {
  content: '\2192'; content: '\2192' / ''; display: inline-block; margin-left: 8px; font-weight: 800;
}
.tryoffer .sub:last-child { margin-bottom: 0; }
.trylist li { text-wrap: balance; }
/* In dark mode the gold belongs to the button; the way out is quieter. */
@media (prefers-color-scheme: dark) { .tryoffer .sub a { color: var(--ink-2); } }
/* The offer is its own gold card, so the panel it sits in steps back. */
#e-next:has(.tryoffer) { background: none; border: 0; box-shadow: none; padding: 0; }
/* Links in a sentence still get a 44px target for a thumb. */
.tryoffer .sub a, .tryseller a { display: inline-block; padding: 13px 2px; margin: -13px -2px; }
/* The dock holds the button and the seller line: the page clears both. */
body:has(#dock-in > .tryseller) .wrap { padding-bottom: calc(176px + env(safe-area-inset-bottom)); }

/* ═══ ON A COMPUTER: THE SIDEBAR (27 Oct 2026) ══════════════════════════
   His words: on a computer it is "not as good as the mobile version". A wide
   screen showed the phone's column in the middle of a lot of nothing, with
   the bar stretched along the bottom. From 1000px the bar is a sidebar down
   the left, the way a computer app is laid out, and the five places use the
   width: cards two to a row, the day's card beside the percentage. The same
   five buttons and the same gold, and app.js shows it on the same five
   screens, so a question, a test or a lesson still has the screen to itself.
   Phones, and tablets held upright, never reach 1000px and keep the bottom
   bar. Last in the file on purpose: it overrides the phone layout above. */
@media (min-width: 1000px) {
  :root { --side: 248px; }

  #tabbar {
    top: 0; right: auto; width: var(--side);
    padding: 26px 14px 24px; overflow-y: auto;
    background: var(--surface);
    -webkit-backdrop-filter: none; backdrop-filter: none;
    border-top: 0; border-right: 1px solid var(--hairline);
  }
  /* The mark sits over the tab icons and the words start where the tab words do. */
  .tabs-brand { display: block; padding: 0 8px 24px 10px; }
  .tabs-brand .brand { margin: 0; gap: 16px; line-height: 1.4; }
  .tabs-plan { display: block; margin-top: 12px; padding-left: 44px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
  .tabs-in { max-width: none; margin: 0; display: flex; flex-direction: column; gap: 4px; }
  .tab {
    flex-direction: row; justify-content: flex-start; gap: 10px;
    min-height: 48px; padding: 0 12px 0 4px;
    font-size: 16px; line-height: 1.2;
    transition: color .2s, background-color .2s, transform .15s var(--ease);
  }
  .tab:active { transform: scale(.98); }
  .tabic { width: 40px; height: 32px; }
  /* Where you are: the whole row is the gold pill, not just its icon. */
  .tab.on { background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold-line); }
  .tab.on .tabic { background: none; box-shadow: none; }
  /* No keyboard covers a sidebar, so typing in a box keeps it. */
  body:has(:is(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]), textarea, select):focus) #tabbar:not(.hide) { display: block; }

  /* The page starts right of the sidebar and gets the room a screen has. */
  body.tabs-on { padding-left: var(--side); }
  body.tabs-on .wrap, body.tabs-on:has(#tabbar:not(.hide)) .wrap { max-width: 980px; padding: 40px 40px 72px; }
  body.tabs-on :is(#s-listen, #s-pick, #s-prog, #info-body) > h1 { font-size: 34px; letter-spacing: -.9px; }
  body.tabs-on .wrap .sub, body.tabs-on #prog-body .why p { max-width: 46em; }
  body.tabs-on .btn :is(strong, .meta) { text-wrap: pretty; }   /* no one word alone on a line */
  body.tabs-on #gloss { left: calc(var(--side) + 40px); right: 40px; bottom: 24px; }

  /* Home: the day's card beside the percentage, then the days two by two. */
  body.tabs-on #s-home {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: 24px; align-items: start;
  }
  body.tabs-on #s-home > * { grid-column: 1 / -1; min-width: 0; }
  body.tabs-on #s-home:has(> #home-plan:not(:empty)) > #home-primary { grid-column: 1; }
  body.tabs-on #s-home > #home-plan:not(:empty) { grid-column: 2; }
  body.tabs-on .hero .brand { display: none; }   /* the sidebar carries the name */
  body.tabs-on #home-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
  body.tabs-on #home-more > * { margin: 0; }
  body.tabs-on #home-more > .outh { grid-column: 1 / -1; margin: 22px 4px 0; }
  body.tabs-on #home-more > .outh:first-child { margin-top: 18px; }

  /* Lessons and Practice: two cards to a row, the headings across both. */
  body.tabs-on :is(#listen-list, #pick-list) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  body.tabs-on :is(#listen-list, #pick-list) > * { margin: 0; }
  body.tabs-on :is(#listen-list, #pick-list) > :not(.btn), body.tabs-on #listen-list > .btn-primary { grid-column: 1 / -1; }
  body.tabs-on :is(#listen-list, #pick-list) > h2:not(:first-child) { margin-top: 16px; }

  /* Words: the list in two columns, and a search box of a sensible width. */
  body.tabs-on #info-body > .field { max-width: 560px; }
  body.tabs-on .dict { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.tabs-on .dictrow:nth-child(2) { border-top: 0; }
  body.tabs-on .dictrow:nth-child(odd) { border-right: 1px solid var(--hairline); }
  body.tabs-on .dictrow:nth-child(odd):last-child { grid-column: 1 / -1; border-right: 0; }

  /* Progress: the percentage beside the tests count, the tests two by two. */
  body.tabs-on #prog-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  body.tabs-on #prog-body > * { grid-column: 1 / -1; margin: 0; }
  body.tabs-on #prog-body > .planbox:has(+ .score), body.tabs-on #prog-body > .planbox + .score,
  body.tabs-on #prog-body > :is([data-mockmod], [data-mockpaper]) { grid-column: auto; }
  body.tabs-on #prog-body > .planbox:has(+ .score) { display: flex; flex-direction: column; justify-content: center; }

  /* A lesson gets a bigger picture, as big as the window's height allows, so
     the play button and the scrub bar never go under the dock. The sidebar
     still stays away while it plays. */
  body:has(#s-watch:not(.hide)) :is(.wrap, .tb-in) {
    max-width: clamp(640px, calc((100vh - 260px) * 16 / 9 + 44px), 960px);
  }
}
@media (min-width: 1000px) and (hover: hover) {
  .tab:not(.on):hover { background: var(--surface-2); }
}
/* "Want it as an icon on your phone?" means nothing at a desk with a mouse. */
@media (hover: hover) and (pointer: fine) {
  .why:has(> [data-a2hs]) { display: none; }
}
