/* The learning platform's look: a maths exercise book.

   Warm paper, pen-blue ink, a highlighter yellow for points and a tick green
   for work done. Buttons are chunky keys with a bottom edge, so a child can see
   what is pressable and feel it go down.

   Mobile first. Large type, big tap targets, high contrast. System fonts only:
   the app loads nothing from anyone else. Motion is short, never blocks input,
   and switches off for anyone who asks their device for less of it.

   Every colour is a variable, so the dark block near the end swaps the lot. */

:root {
  color-scheme: light dark;

  --ink: #1b2430;
  --ink-soft: #56606c;
  --paper: #f5f1e8;
  --paper-dot: rgba(34, 82, 122, 0.07);
  --card: #fffdf8;
  --line: #e2dacb;
  --line-strong: #8c8575;
  --key-edge: #d8cfbd;

  --accent: #22527a;
  --accent-dark: #173a58;
  --accent-edge: #122e46;
  --accent-soft: #e3ebf2;
  --on-accent: #ffffff;

  --right: #1e7a4c;
  --right-bg: #e3f1e8;
  --wrong: #a4402a;
  --wrong-bg: #f9e7e0;
  --sun: #f2c14b;
  --sun-bg: #fff2c2;
  --sun-ink: #6a4d00;
  --plum: #7a3f6e;

  --current-bg: var(--accent-soft);
  --head-bg: #efe8da;

  --chip-new: #efebe2;
  --chip-learning: #fcefd2;
  --chip-practised: #e2efe6;
  --chip-mastered: #c9e5d4;
  --chip-stable: #b1dac2;
  --chip-gap: #f6d9d1;

  --bar-new: #d8d1c3;
  --bar-learning: #efbd57;
  --bar-practised: #93c6a2;
  --bar-stable: #4ea878;
  --bar-mastered: #1e7a4c;
  --bar-gap: #c9573d;

  --focus: #c0561b;
  --tap: 56px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(27, 36, 48, 0.04), 0 10px 28px -16px rgba(27, 36, 48, 0.28);

  --font-body: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito",
    "Segoe UI Variable Display", system-ui, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Graph paper behind the child's pages: a faint dot every 22px, the grid of a
   maths book, too light to compete with a question. */
body.kid {
  font-size: 22px;
  background-image: radial-gradient(var(--paper-dot) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  background-attachment: fixed;
}

.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

h1, h2, h3 { text-wrap: balance; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 0.5rem; line-height: 1.25; }
p { margin: 0 0 1rem; }

body.kid h1, body.kid h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
body.kid h1 { font-size: 1.85rem; font-weight: 800; }

.lead { color: var(--ink-soft); }
.meta { color: var(--ink-soft); font-size: 0.85em; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--accent-dark); }

button {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  min-height: var(--tap);
  padding: 0.6rem 1rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 80ms ease, box-shadow 80ms ease, background-color 120ms ease;
}

button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

/* The one big thing to press on a page. A key with a darker bottom edge that
   travels down when pressed. */
.big {
  display: block;
  width: 100%;
  margin: 1.25rem 0 0;
  padding: 1rem;
  min-height: 64px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--accent-edge);
  transition: transform 80ms ease, box-shadow 80ms ease, filter 120ms ease;
}
a.big:hover { color: var(--on-accent); filter: brightness(1.08); }
.big:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-edge); }

/* Not ready yet, rather than gone: the button keeps its place in the tab order
   and keeps saying what it is, and the script holds an empty answer back. */
.big[disabled], .big[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.big[aria-disabled="true"]:active { transform: none; box-shadow: 0 5px 0 var(--accent-edge); }

.quiet {
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 1rem;
  min-height: 44px;
  padding: 0.5rem 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  box-shadow: none;
}
.quiet:hover { color: var(--ink); }

/* A link styled big and quiet at once is the second choice beside a big one. */
.big.quiet {
  color: var(--accent);
  background: var(--card);
  border: 2px solid var(--accent);
  box-shadow: 0 5px 0 var(--key-edge);
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.9rem 1rem;
}

.error {
  background: var(--wrong-bg);
  border: 2px solid var(--wrong);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--wrong);
}

/* A nudge, not a telling off. Nothing here is red, because nothing has gone
   wrong yet: the child has simply not answered. */
.notice {
  background: var(--current-bg);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: 0.95rem;
}

/* -------------------------------------------------------------- motion */

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* The hint button asking to be pressed. Small enough not to pull a child off
   the question, and it stops on its own after a few beats. */
@keyframes nudge {
  0%, 100% { transform: none; }
  50% { transform: scale(1.04); }
}

/* Pages a child reads rather than answers come in with a short stagger. The
   question page does not, so nothing ever sits between a child and the box. */
body.today .wrap > *, body.done .wrap > *, body.shop .wrap > *, body.pick .wrap > * {
  animation: rise 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
body.kid .wrap > *:nth-child(2) { animation-delay: 40ms; }
body.kid .wrap > *:nth-child(3) { animation-delay: 80ms; }
body.kid .wrap > *:nth-child(4) { animation-delay: 120ms; }
body.kid .wrap > *:nth-child(n+5) { animation-delay: 160ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* -------------------------------------------------------------- maths type */

/* The maths filter writes a power as <sup>, so a power must not stretch the
   line it sits in. */
sup, sub { font-size: 0.75em; line-height: 0; }
sup { vertical-align: super; }
sub { vertical-align: sub; }

/* 3/4 arrives as <span class="frac"><sup>3</sup>&frasl;<sub>4</sub></span>.
   The slash is the only bare text in the span, so font-size: 0 collapses it
   and the two halves stack with a thin bar between them. Each half then names
   its own size, because an em of nothing is nothing: --frac-size carries it,
   and a bigger context, such as a stem, raises it. */
.frac {
  --frac-size: 1rem;
  display: inline-block;
  font-size: 0;
  line-height: 1;
  margin: 0 0.15em;
  text-align: center;
  vertical-align: middle;
}

.frac sup, .frac sub {
  display: block;
  font-size: var(--frac-size);
  line-height: 1.15;
  padding: 0 0.15em;
  vertical-align: baseline;
}

.frac sup { border-bottom: 1px solid currentColor; }

.stem .frac, .answer-line .frac, .given .frac { --frac-size: 1rem; }

/* -------------------------------------------------------------- pick a child */

body.pick h1 { font-size: 2.1rem; margin-top: 1.5rem; }

.students { display: grid; gap: 0.9rem; }

.student {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 92px;
  padding: 0.8rem 1.2rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  text-align: left;
  border: 2px solid var(--line-strong);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 5px 0 var(--key-edge);
}
.student::before {
  content: "";
  width: 52px; height: 52px; flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.55) 0 18%, transparent 19%),
    var(--accent);
}
.students .student:nth-child(2)::before { background-color: var(--plum); }
.students .student:nth-child(2)::before {
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.55) 0 18%, transparent 19%),
    var(--plum);
}
.student:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--key-edge); }

.student[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent-edge);
  box-shadow: 0 5px 0 var(--accent-edge);
}
.student[aria-pressed="true"]::before {
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.55) 0 18%, transparent 19%),
    var(--sun);
}

.pad {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.pad .who { margin: 0 0 0.6rem; font-family: var(--font-display); font-weight: 700; }

.pin {
  display: block;
  width: 100%;
  font-size: 2rem;
  letter-spacing: 0.6rem;
  text-align: center;
  padding: 0.5rem;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}

.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.65rem; margin-top: 0.8rem; }

/* Every keypad key on every page: a paper key with a bottom edge. */
.key {
  font-family: var(--font-display);
  font-weight: 700;
  background: var(--card);
  border: 2px solid var(--line-strong);
  box-shadow: 0 4px 0 var(--key-edge);
}
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--key-edge); }
.keys .key { font-size: 1.5rem; min-height: 64px; }
.keys .key.wide { font-size: 1.05rem; }
.keys .go {
  background: var(--accent); color: var(--on-accent);
  border-color: var(--accent-edge); box-shadow: 0 4px 0 var(--accent-edge);
}

.parent-link { margin-top: 2.5rem; text-align: center; }

/* -------------------------------------------------------------- the front page */

.kid-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 1.1rem;
}
.kid-top h1 { margin: 0; }

/* Points are always a highlighter-yellow pill: the same colour on the front
   page, the done page and the shop, so a child learns what it means. */
.shop-link { margin: 0; }
.shop-link a, .points-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.35rem 0.9rem 0.35rem 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--sun-ink);
  background: var(--sun-bg);
  border: 2px solid var(--sun);
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 3px 0 var(--sun);
}
.shop-link a::before, .points-pill::before {
  content: "\2605";
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--card);
  font-size: 0.95rem;
}
.shop-link a:hover { color: var(--sun-ink); filter: brightness(1.03); }

.day-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.1rem 1.2rem 1.3rem;
  margin: 0 0 1.4rem;
  box-shadow: var(--shadow);
}
.day-card .lead { margin: 0 0 0.35rem; font-size: 1.05rem; }
.day-card .big { margin-top: 1rem; }
/* What a check is like, under its size line, before the first question. */
.check-notes {
  margin: 0.6rem 0 0.2rem;
  padding-left: 1.2rem;
  font-size: 1.02rem;
  line-height: 1.45;
}
.check-notes li { margin: 0 0 0.35rem; }
.day-card .read-aloud { margin-top: 0.4rem; }
.day-kicker {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.paper-offer {
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  border-radius: 22px;
  padding: 1rem 1.2rem 1.2rem;
  margin: 0 0 1.4rem;
}
.paper-offer h2 { margin-top: 0; }

/* -------------------------------------------------------------- one question */

.progress {
  display: flex;
  gap: 0.7rem;
  margin: 0 0 1.25rem;
  padding: 0.55rem 0.8rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.progress .dots { display: flex; gap: 0.6rem; align-items: flex-start; flex-wrap: wrap; row-gap: 0.5rem; }
.progress .group { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.progress .block { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; padding: 0.25rem 0.4rem; border-radius: 999px; }
.progress .group.current .block { background: var(--current-bg); }
.progress .label { font-size: 0.72rem; color: var(--ink-soft); line-height: 1; }
.progress .group.current .label { color: var(--accent); font-weight: 700; }
.progress .count { color: var(--ink-soft); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.progress .stop { margin: 0 0 0 auto; }
.progress .stop-button { min-height: 44px; font-size: 0.9rem; }
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block; background: transparent;
  box-shadow: inset 0 0 0 2px var(--line-strong);
}
.dot.filled { background: var(--accent); box-shadow: none; }
.dot.now {
  width: 15px; height: 15px; background: var(--sun-bg);
  box-shadow: inset 0 0 0 3px var(--accent);
}

/* This week's school-day streak on the child's front page. Five day tiles,
   filled green as each school day is done, the +75 bonus explained beneath. */
.weekstreak {
  margin: 0 0 1.4rem;
  padding: 0.9rem 1rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.weekbar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.45rem; }
.weekbar .wday {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  min-width: 0; padding: 0.5rem 0.2rem 0.4rem;
  border-radius: 14px; background: var(--paper); border: 2px solid var(--line);
}
.weekbar .wdot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1rem; font-weight: 800;
  background: transparent; box-shadow: inset 0 0 0 2px var(--line-strong); color: #fff;
}
.weekbar .wlabel {
  font-family: var(--font-display);
  font-size: 0.8rem; font-weight: 800; color: var(--ink-soft); line-height: 1;
}
.weekbar .wday.done { background: var(--right-bg); border-color: var(--right); }
.weekbar .wday.done .wdot { background: var(--right); box-shadow: none; animation: pop 360ms ease both; }
.weekbar .wday.done .wlabel { color: var(--right); }
.weekbar .wday.now { border-color: var(--accent); background: var(--accent-soft); }
.weekbar .wday.now .wdot { box-shadow: inset 0 0 0 3px var(--accent); }
.weekbar .wday.now .wlabel { color: var(--accent); }
.weekbar .wday.miss .wdot { box-shadow: inset 0 0 0 2px var(--line-strong); opacity: 0.5; }
.weekbar .wday.miss .wlabel { opacity: 0.6; }
.weekbar .wday.off { opacity: 0.45; border-style: dashed; }
.week-line { margin: 0.65rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.week-line b {
  color: var(--sun-ink);
  background: var(--sun-bg);
  padding: 0 0.3em;
  border-radius: 6px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* The points a child just earned are the hero of the done page: a big number
   on a highlighter card, the day's earnings itemised, and the balance to spend. */
.points-hero {
  position: relative;
  overflow: hidden;
  background: var(--sun-bg);
  border: 2px solid var(--sun);
  border-radius: 24px;
  padding: 1.2rem 1.3rem;
  margin: 0 0 1.4rem;
  box-shadow: 0 6px 0 var(--sun);
}
.points-hero::after {
  content: "\2605";
  position: absolute;
  right: -0.1em; top: -0.25em;
  font-size: 7rem;
  line-height: 1;
  color: var(--sun);
  opacity: 0.35;
  pointer-events: none;
}
.points-hero .ph-earned {
  position: relative;
  margin: 0; font-family: var(--font-display);
  font-weight: 800; color: var(--sun-ink); font-size: 1.25rem;
}
.points-hero .ph-num {
  display: inline-block;
  font-size: 3.2rem; font-weight: 900; line-height: 1; vertical-align: -0.14em;
  animation: pop 420ms 120ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.points-hero .ph-breakdown { position: relative; list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.points-hero .ph-breakdown li {
  display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.98rem;
  padding: 0.25rem 0; border-bottom: 1px dashed rgba(106, 77, 0, 0.25);
}
.points-hero .ph-what { color: var(--ink); }
.points-hero .ph-plus { font-weight: 800; color: var(--sun-ink); font-variant-numeric: tabular-nums; }
.points-hero .ph-bonus {
  position: relative;
  margin: 0.8rem 0 0; padding: 0.55rem 0.8rem; border-radius: 12px;
  background: var(--card); font-weight: 700; color: var(--right);
}
.points-hero .ph-total { position: relative; margin: 0.9rem 0 0; font-size: 1.05rem; }
.points-hero .ph-total strong { font-size: 1.25rem; }
.points-hero .ph-shop { margin-left: 0.4rem; font-weight: 800; color: var(--accent-dark); }

/* What the balance is for, and how close it is. The bar is decoration for the
   line above it, so it carries no text and no label of its own. */
.points-hero .ph-next { position: relative; margin: 0.7rem 0 0.35rem; font-size: 1rem; }
.points-hero .np-bar {
  position: relative;
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--sun-bg);
  border: 1px solid var(--sun);
  overflow: hidden;
}
.points-hero .np-fill { display: block; height: 100%; background: var(--sun); }

.puzzle-open { margin: 0.9rem 0; }
.puzzle-open a { font-weight: 700; }
.short-day { margin: 0.9rem 0; color: var(--ink-soft); }

/* The skill behind the question. It names what is being practised without
   competing with the question itself. */
.working-on {
  display: inline-block;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin: 0 0 0.4rem;
}

.stem {
  font-size: 1.4rem;
  font-weight: 650;
  line-height: 1.4;
  margin: 0.5rem 0 1.1rem;
}
body.kid h1.stem { font-family: var(--font-body); font-size: 1.4rem; font-weight: 650; letter-spacing: 0; }

/* The question's own diagram. It sits above the words, centred, and never wider
   than the figures inside the lesson card, so the page keeps one measure. */
.figure {
  max-width: 340px;
  margin: 0.75rem auto 1rem;
  padding: 0.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.figure svg { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }

/* Under a dots picture shown for a moment (setUpFlash in app.js): the picture
   keeps its room while it is hidden, and this shows it, first and again.
   While the picture is up the button stays in place, dimmed, and waits. A
   five year old's tap gets the first years' 56px target. */
.flash-again {
  display: block;
  margin: 0.6rem auto 0;
  min-height: 56px;
  color: var(--accent);
  border-color: var(--accent);
}
.flash-again[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.example {
  background: var(--card);
  border: 2px solid var(--line);
  border-left: 6px solid var(--right);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.example h2 { margin-top: 0.2rem; font-size: 1.05rem; color: var(--right); }
.example ol { margin: 0.5rem 0; padding-left: 1.25rem; }
.example li { margin-bottom: 0.35rem; }
.answer-line { font-weight: 650; }

.read-aloud {
  margin-bottom: 1rem;
  font-size: 1rem;
  min-height: 48px;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 3px 0 var(--key-edge);
}
.read-aloud[aria-pressed="true"] { background: var(--accent-soft); }
.read-aloud.choices, .read-aloud.hint-read { margin-top: 0.75rem; font-size: 0.95rem; min-height: 48px; }

/* The spelling word. It is the only way to hear the question, so it is the
   biggest thing under the stem and nothing else sits beside it. */
.read-aloud.big {
  display: block;
  width: 100%;
  min-height: var(--tap);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.25rem 0 1rem;
  color: var(--on-accent);
  border: 0;
  box-shadow: 0 5px 0 var(--accent-edge);
}

/* A question read aloud to a grown-up: the words big enough to read from the
   next chair, and the grown-up's two buttons in a box of their own. */
.spoken-text {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  line-height: 1.4;
  margin: 0.5rem 0 1.25rem;
}
.grown-up {
  border: 2px dashed var(--line-strong);
  border-radius: 16px;
  padding: 0.85rem 1.1rem;
  margin: 0.5rem 0 1rem;
  background: var(--card);
}
.grown-up h2 { font-size: 1.05rem; margin: 0 0 0.35rem; }

/* The reading passage. A soft panel, a short line, and it stays on screen the
   whole time the child is answering. */
.passage {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 8px solid var(--accent);
  border-radius: 16px;
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.25rem;
  box-shadow: var(--shadow);
}
.passage h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.passage-text { max-width: 34em; }
.passage-text p { font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.7; margin: 0 0 0.75rem; white-space: pre-line; }
.passage-text p:last-child { margin-bottom: 0; }
body.kid.young .passage-text p { font-size: 1.2rem; line-height: 1.8; }

/* A spelling answer is letters, so the box gives them room and the child can
   see each one they have typed. */
.answer.word { letter-spacing: 0.05em; font-size: 1.6rem; max-width: 100%; }

.options { display: grid; gap: 0.75rem; }
/* An option is a full-width label wrapping a real radio, so the choice submits
   without any script. It looks like a tappable key. */
.option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 72px;
  font-size: 1.25rem;
  text-align: left;
  padding: 0.6rem 1.1rem;
  border: 2px solid var(--line-strong);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 0 var(--key-edge);
  /* Colour and background change together, never one after the other, so a
     chosen answer never flashes white text on a pale card. */
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.option:hover { border-color: var(--accent); }
.option:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--key-edge); }
.option-input { width: 26px; height: 26px; flex: none; margin: 0; accent-color: var(--accent); }
.option-text { flex: 1; }
/* A picture choice: the picture is the answer, so it gets the room the text
   would have had. */
.option-picture { display: block; width: 96px; height: 96px; flex: none; }
.option:has(.option-input:checked),
.option[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent-edge);
  box-shadow: 0 4px 0 var(--accent-edge);
}
.option:has(.option-input:checked) .option-input { accent-color: var(--sun); }
.option-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.answer {
  display: block;
  width: 100%;
  font-size: 1.8rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--line-strong);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 2px 0 rgba(27, 36, 48, 0.06);
}
.answer:focus { border-color: var(--accent); }

/* The keypad is there at every width. A tablet and a phone held sideways are
   both touch screens, and a child who taps digits keeps tapping digits. */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-top: 0.85rem; }
.keypad .key { font-size: 1.5rem; min-height: 64px; }

/* Sound tiles for a first-years spelling word: one key per sound, big enough
   for a five year old's finger. */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}
.tiles .key { font-size: 1.6rem; min-height: 56px; min-width: 56px; border-width: 2px; }
.tiles .key.back { grid-column: span 2; font-size: 1.05rem; }
/* On a paper the same tiles are boxes to copy from: a dashed edge and no key
   edge, so nothing looks pressable. They sit above the answer box. */
.tile-boxes { list-style: none; padding: 0; margin: 0 0 0.85rem; }
.tile-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  min-width: 56px;
  font-size: 1.6rem;
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}

.symbols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.symbols .key { font-size: 1.2rem; min-height: 48px; padding: 0.4rem 0.2rem; }
.symbols .key.wide { grid-column: span 5; font-size: 1rem; }

/* Ten keys across need a real tablet width. On a phone they are too narrow to
   hit, so the five wide grid holds until 560px. */
@media (min-width: 560px) {
  .symbols { grid-template-columns: repeat(10, 1fr); }
  .symbols .key.wide { grid-column: span 1; }
}

.hint-button { margin-top: 0.75rem; }
/* A long pause on one question marks the button, never the hint. The colour
   change carries it on its own, so a reduced-motion browser, which switches
   every animation off, still gets the cue. */
.hint-button.nudge {
  border-color: var(--sun);
  background: var(--sun-bg);
  color: var(--sun-ink);
  animation: nudge 1.6s ease-in-out 3;
}
.hint {
  background: var(--sun-bg);
  border-left: 5px solid var(--sun);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  margin-top: 0.75rem;
  color: var(--ink);
}

.send-row { display: grid; gap: 0.9rem; margin-top: 0.6rem; }
.send.unsure {
  background: var(--card);
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: 0 5px 0 var(--key-edge);
}
.send.unsure[disabled], .send.unsure[aria-disabled="true"] { opacity: 0.45; }

@media (min-width: 480px) {
  .send-row { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .send-row .big { margin-top: 0.75rem; }
}

/* A phone held sideways leaves about 300px of page. The way to send stays on
   screen rather than below a keypad the child has to scroll past. */
@media (max-height: 480px) {
  .send-row {
    position: sticky;
    bottom: 0;
    background: var(--paper);
    padding: 0.4rem 0 0.7rem;
  }
}

.flag-wrap { margin-top: 2.5rem; border-top: 1px dashed var(--line); padding-top: 0.5rem; }
.flag { display: grid; gap: 0.4rem; margin-top: 0.4rem; }
.flag input {
  padding: 0.6rem;
  min-height: 48px;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--card);
  color: var(--ink);
}
.stop { margin-top: 0.5rem; }

/* -------------------------------------------------------------- feedback */

h1.right { color: var(--right); }
h1.wrong { color: var(--wrong); }

/* The big right/wrong banner (_verdict.html). A correct answer is loud: a large
   green tick and a bold word, so a child sees the win at a glance. */
.verdict {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.5rem 0 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 20px;
}
.verdict-mark { width: 3rem; height: 3rem; flex: none; animation: pop 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.verdict-word { font-family: var(--font-display); font-size: 2rem; font-weight: 900; line-height: 1.1; }
.verdict.is-right { color: var(--right); background: var(--right-bg); border: 2px solid var(--right); }
.verdict.is-right .verdict-word { color: var(--right); }
.verdict.is-wrong { color: var(--ink-soft); background: var(--card); border: 2px solid var(--line); }
.verdict.is-wrong .verdict-word { color: var(--ink-soft); font-size: 1.5rem; }
@media (min-width: 34rem) {
  .verdict-mark { width: 3.5rem; height: 3.5rem; }
  .verdict.is-right .verdict-word { font-size: 2.4rem; }
}

.message { font-weight: 650; }

/* The right answer after a miss: said plainly, in the tick green, so it is the
   last thing a child reads before Next. */
body.feedback .wrap > .answer-line {
  margin: 1.1rem 0 0;
  padding: 0.6rem 0.9rem;
  background: var(--right-bg);
  border-left: 5px solid var(--right);
  border-radius: 12px;
  color: var(--ink);
}
.reason {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 1rem;
}
.reason.second { border-style: dashed; background: var(--sun-bg); border-color: var(--sun); }
/* A miss on a check day: one calm line under the verdict, before the reason. */
.check-note { margin: 0.2rem 0 0.9rem; font-weight: 650; color: var(--ink-soft); }

/* What the child typed, shown back in a plain even width so a digit that was
   misread stands out. It is a statement of fact, not a scolding. */
.given {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
/* A picture the child tapped (the first years) has no digits to misread. */
.given.picked { font-family: var(--font-body); }

/* The sentence of the passage that held the answer. It is a quotation, so it is
   set apart from the reason in the platform's own words. */
.quote {
  border-left: 6px solid var(--accent);
  background: var(--card);
  border-radius: 0 12px 12px 0;
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
}

/* On the feedback page the read aloud button sits above the reason, so it
   reads as part of that block rather than as another thing to press. */
body.feedback .read-aloud {
  display: block;
  width: 100%;
  margin: 0 0 0.5rem;
  font-size: 1rem;
  min-height: 48px;
}

/* -------------------------------------------------------------- done */

ul.tally {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
ul.tally li {
  font-size: 1rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink-soft);
}
ul.tally li:last-child:nth-child(odd) { grid-column: span 2; color: var(--ink); }
ul.tally strong { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1.1; color: var(--ink); }
.skills { padding-left: 1.25rem; }
.skills li { margin-bottom: 0.2rem; }

/* What the child can now do without help. This list is the reward on the page,
   so it is cards rather than bullets, and it reads as settled. */
.skills.new {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.skills.new li {
  background: var(--right-bg);
  border-left: 5px solid var(--right);
  border-radius: 12px;
  color: var(--ink);
  font-weight: 650;
  margin-bottom: 0.45rem;
  padding: 0.5rem 0.9rem;
}
.trend { list-style: none; padding: 0; margin: 0.5rem 0 1rem; display: grid; gap: 0.35rem; }
.trend li { display: grid; grid-template-columns: 6.5rem 1fr 3rem; align-items: center; gap: 0.5rem; }
.trend .date { color: var(--ink-soft); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.trend .bar { height: 14px; background: var(--accent); border-radius: 7px; min-width: 2px; }
.trend .value { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.9rem; }

.spark-offer, .spark-hook, .spark-why, .spark-more {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem 1.2rem;
  margin: 0 0 1.25rem;
  box-shadow: var(--shadow);
}
.spark-offer { border: 2px solid var(--plum); }
.spark-offer h2, .spark-more h2 { margin-top: 0; }
.spark-offer h2 { color: var(--plum); }

/* -------------------------------------------------------------- practice paper */

.paper-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 0.5rem;
}
.paper-top h1 { margin: 0; font-size: 1.35rem; }
.paper-clock {
  margin: 0;
  padding: 0.3rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--card);
  border: 2px solid var(--line-strong);
  border-radius: 999px;
}
.paper-clock.low { color: var(--wrong); border-color: var(--wrong); background: var(--wrong-bg); }
.paper-skip { margin-top: 1rem; }
.paper-score {
  font-family: var(--font-display);
  font-size: 1.4rem;
  padding: 1rem 1.2rem;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  border-radius: 20px;
}
.paper-review { padding-left: 1.4rem; }
.paper-review li { margin: 0 0 0.8rem; padding: 0.5rem 0.8rem; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.paper-review li.right { border-left: 5px solid var(--right); }
.paper-review li.wrong { border-left: 5px solid var(--wrong); }
.paper-review li.skipped { border-left: 5px dashed var(--line-strong); }
.paper-review .stem { font-size: 1.05rem; margin: 0 0 0.3rem; }
.paper-review .meta { margin: 0; }

/* -------------------------------------------------------------- tables and chips */

table.grid { border-collapse: collapse; width: 100%; margin-bottom: 1.5rem; }
table.grid th, table.grid td {
  border-bottom: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}
table.grid thead th {
  background: var(--head-bg);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-strong);
}
table.grid tr.no td { background: var(--wrong-bg); }
table.map th { width: 9rem; }

.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin: 0.1rem 0.15rem;
  font-size: 0.8rem;
  border: 1px solid var(--line);
  background: var(--card);
}
.chip.new { background: var(--chip-new); color: var(--ink-soft); }
.chip.learning { background: var(--chip-learning); }
.chip.practised { background: var(--chip-practised); }
.chip.mastered { background: var(--chip-mastered); }
.chip.stable { background: var(--chip-stable); }
.chip.gap { background: var(--chip-gap); color: var(--wrong); font-weight: 650; }
.chip.frozen { border-style: dashed; }

/* ------------------------------------------------------------- lesson card */

/* Calm, and the same width as the question so a child's eye does not re-track.
   It is folded away until they ask for it or get the same skill wrong twice. */

.help-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1rem 0 0.5rem; }
.help-row .quiet { flex: 1 1 10rem; min-height: 48px; }

.lesson {
  margin: 1rem 0 1.25rem;
  max-width: 40rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.lesson > summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 0.5rem;
  min-height: 52px;
  padding: 0.7rem 2.6rem 0.7rem 1rem;
  position: relative;
  color: var(--accent-dark);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.lesson > summary::-webkit-details-marker { display: none; }
.lesson > summary::after {
  content: "+";
  position: absolute;
  right: 0.9rem; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.lesson[open] > summary::after { content: "\2212"; }

.lesson[open] > summary { border-bottom: 1px solid var(--line); }
.lesson > summary .sub { display: block; width: 100%; font-size: 0.9rem; font-weight: 400; color: var(--ink-soft); margin-top: 0.1rem; }

.lesson-body { padding: 0.9rem 1rem 1rem; }
.lesson-body h3 {
  margin: 1.1rem 0 0.35rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.lesson-body > *:first-child { margin-top: 0; }
.lesson-body .stem { font-size: 1.15rem; margin: 0.25rem 0 0.5rem; }

.lesson-intro {
  max-width: 40rem;
  margin: 0 0 1rem;
}
.lesson-lead { margin: 0 0 0.6rem; font-size: 1.05rem; line-height: 1.5; }

.lesson-figure { margin: 0.5rem 0 0.9rem; }
.lesson-figure svg { max-width: 320px; width: 100%; height: auto; display: block; }

.lesson-steps { margin: 0.35rem 0 0.6rem; padding-left: 1.3rem; }
.lesson-steps li { margin-bottom: 0.55rem; }
.lesson-steps .do { display: block; }
.lesson-steps .why { display: block; color: var(--ink-soft); font-size: 0.92rem; }

.lesson-mistake {
  background: var(--wrong-bg);
  border-radius: 12px;
  padding: 0.5rem 0.8rem 0.6rem;
  margin-top: 0.8rem;
}
.lesson-mistake h3 { margin-top: 0.2rem; color: var(--wrong); }
.lesson-mistake .what { margin: 0 0 0.3rem; font-weight: 650; }
.lesson-mistake .fix { margin: 0; color: var(--ink); }

.lesson-other p { line-height: 1.5; }

.lesson-words dl { margin: 0.3rem 0 0; }
.lesson-words dt { font-weight: 650; }
.lesson-words dd { margin: 0 0 0.5rem; color: var(--ink-soft); }

.lesson-videos { display: grid; gap: 0.6rem; margin-top: 1rem; }
.lesson-videos .video-button { text-align: left; min-height: 48px; }

.lesson-player {
  display: block;
  width: 100%;
  max-width: 40rem;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 0.6rem;
}

/* ------------------------------------------------- third strand card (today) */

.thinking {
  margin-top: 2rem;
  padding: 1rem 1.15rem 1.15rem;
  background: var(--card);
  border: 2px solid var(--plum);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.thinking h2 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--plum);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* What the puzzle pays, beside the heading, so the offer is not a mystery. */
.thinking h2 .puzzle-points { color: var(--sun-ink); letter-spacing: 0.04em; }

.thinking-prompt { margin: 0 0 0.75rem; font-size: 1.15rem; line-height: 1.45; }

.thinking-form { margin: 0.75rem 0 0; }

.thinking-options {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.thinking-options .option { width: 100%; font-size: 1.05rem; min-height: 60px; }

/* 16px, so tapping the box does not zoom the page on a phone. */
.thinking-input {
  width: 100%;
  min-height: 48px;
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.7rem;
  font-size: 16px;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.thinking-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.thinking-check { min-height: 52px; }

.thinking-given { margin: 0.75rem 0 0.25rem; color: var(--ink-soft); }
.thinking-mark { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 700; }
.thinking-mark.right { color: var(--accent-dark); }
.thinking-mark.wrong { color: var(--ink); }
.thinking-answer { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 650; }
.thinking-why { margin: 0; color: var(--ink-soft); line-height: 1.45; }

.thinking-count {
  margin: 0.9rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

@media (min-width: 34rem) {
  .thinking-options { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------------ the shop */

.points-big {
  margin: 0 0 1.2rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--sun-ink);
  background: var(--sun-bg);
  border: 2px solid var(--sun);
  border-radius: 20px;
  padding: 0.8rem 1.1rem;
  box-shadow: 0 5px 0 var(--sun);
}

.points-line a { margin-left: 0.4rem; }

.shop-notice,
.shop-waiting {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink-soft);
}
.shop-waiting { border-color: var(--sun); background: var(--sun-bg); color: var(--sun-ink); }
.shop-decision { border-color: var(--accent); color: var(--ink); }

/* Two lists, not one: what a child can have now leads, what they are saving for
   follows, quieter but never hidden. */
.shop [data-prizes] h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.shop [data-prizes] h2 + .prizes { margin-bottom: 1.4rem; }
.prizes.saving .prize { background: transparent; box-shadow: none; }
.prizes.saving .prize-name { font-size: 1.05rem; }

.prizes { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: 0.9rem; }

.prize {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 0.9rem 1rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.prize .big { margin-top: 0.5rem; min-height: 54px; font-size: 1.05rem; }

.prize-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; }
.prize-cost {
  justify-self: start;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--sun-ink);
  background: var(--sun-bg);
  border: 1px solid var(--sun);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
}
.prize-note { color: var(--ink-soft); font-size: 0.95rem; }
.prize-off { color: var(--ink-soft); font-size: 0.95rem; }

.points-log { list-style: none; margin: 0 0 1.2rem; padding: 0; }

/* Three columns, so a long reason wraps inside its own and never splits the
   number from its sign. */
.points-log li {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.points-when { font-size: 0.9em; font-variant-numeric: tabular-nums; }
.points-what { color: var(--ink); }
.points-delta { font-weight: 700; color: var(--right); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.points-minus { color: var(--wrong); }

.points-rules { list-style: none; margin: 0 0 1.2rem; padding: 0; }

.points-rules li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}

/* The worth may wrap: kept on one line, "every point you earn that day is
   doubled" pushed a phone 160 px sideways. On a phone each rule reads as two
   lines, the rule and then what it is worth. */
.rule-what { flex: 1 1 50%; min-width: 0; }
.rule-worth { flex: 0 1 auto; max-width: 50%; min-width: 0; font-weight: 700; text-align: right; }
@media (max-width: 34rem) {
  .points-rules li { flex-direction: column; gap: 0.1rem; }
  .rule-worth { max-width: none; text-align: left; }
}

@media (min-width: 34rem) {
  .prizes { grid-template-columns: 1fr 1fr; }
}

/* -------------------------------------------------------------- a set lesson */

/* A lesson a parent set: numbered cards down the page, like a worked page in
   the exercise book. The child's own mistake comes first, then the rule, then
   one worked out. Every colour is a token, so dark mode follows. */
.ls-title { margin: 0 0 0.3rem; font-family: var(--font-display); font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.15; }
.ls-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 0.9rem 1.1rem 1rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}
.ls-card h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.6rem; font-size: 1.1rem; }
.ls-step {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 0.95rem;
}
.ls-last { border-left: 6px solid var(--wrong); }
.ls-last .ls-step { background: var(--wrong); }
.ls-rule { border-left: 6px solid var(--accent); }
.ls-example { border-left: 6px solid var(--right); }
.ls-example .ls-step { background: var(--right); }
.ls-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.7rem; margin: 0.25rem 0; }
.ls-label {
  display: inline-block;
  min-width: 6.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.ls-given { font-family: var(--font-mono); font-size: 1.1rem; color: var(--wrong); text-decoration: line-through; text-decoration-thickness: 2px; }
.ls-answer { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; color: var(--right); }
.ls-why { margin: 0.6rem 0 0.2rem; padding: 0.6rem 0.8rem; background: var(--paper); border-radius: 12px; }
.ls-watch { margin-top: 0.6rem; padding: 0.6rem 0.8rem; background: var(--sun-bg); border-radius: 12px; }
.ls-watch p { margin: 0.2rem 0; }
.ls-watch .ls-label, .ls-remember .ls-label { display: block; min-width: 0; margin: 0 0 0.1rem; }
.ls-go { margin: 0.4rem 0 0.8rem; }
.ls-offer { background: var(--sun-bg); border-color: var(--sun); }
.ls-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin: 0 0 1rem; }
.ls-top .day-kicker { margin: 0; flex: 1 1 100%; }
.ls-top .dots { display: flex; gap: 0.35rem; }
.ls-top .count { margin: 0; color: var(--ink-soft); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ls-big { margin: 0 0 0.4rem; font-family: var(--font-display); font-size: 3rem; font-weight: 800; line-height: 1; }
.ls-big span { font-size: 1.1rem; font-weight: 600; color: var(--ink-soft); }
.ls-score.got-it { border-left: 6px solid var(--right); }
.ls-remember { margin: 0.7rem 0 0; padding: 0.6rem 0.8rem; background: var(--sun-bg); border-radius: 12px; }

/* -------------------------------------------------------------- dark mode */

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2f5;
    --ink-soft: #afbac4;
    --paper: #10151b;
    --paper-dot: rgba(150, 190, 225, 0.07);
    --card: #19212a;
    --line: #2c3743;
    --line-strong: #6f7d8a;
    --key-edge: #0a0e12;

    --accent: #7fb9e6;
    --accent-dark: #a8d1f1;
    --accent-edge: #3e6f96;
    --accent-soft: #1d2d3b;
    --on-accent: #0b1219;

    --right: #7fd4a6;
    --right-bg: #15271e;
    --wrong: #f2a596;
    --wrong-bg: #321d19;
    --sun: #e9b949;
    --sun-bg: #332a13;
    --sun-ink: #f6d983;
    --plum: #d9a1cf;

    --head-bg: #1f2831;

    --chip-new: #252e37;
    --chip-learning: #3b3320;
    --chip-practised: #1d3128;
    --chip-mastered: #234436;
    --chip-stable: #2b5340;
    --chip-gap: #40231d;

    --bar-new: #3a4550;
    --bar-learning: #c99a3a;
    --bar-practised: #5f9a72;
    --bar-stable: #53b27f;
    --bar-mastered: #7fd4a6;
    --bar-gap: #e07a62;

    --focus: #ffb26b;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 28px -18px rgba(0, 0, 0, 0.8);
  }

  .lesson-figure svg, .figure svg { color: var(--ink); }
  .chip { color: var(--ink); }
  .chip.new { color: var(--ink-soft); }
  .points-hero .ph-breakdown li { border-bottom-color: rgba(246, 217, 131, 0.2); }
  .weekbar .wdot { color: var(--on-accent); }
}

/* landing */
body.landing .promise { font-size: 1.05rem; color: var(--ink-soft); max-width: 30rem; }
body.landing .codeform { margin: 1.5rem 0 1rem; }
body.landing .codeform label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
body.landing .codeform .code {
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  width: 7ch;
  padding: 0.4rem 0.5rem;
}
body.landing .codeform button { font-size: 1.1rem; padding: 0.5rem 1.2rem; margin-left: 0.5rem; }
body.landing .start-free { margin-top: 0.25rem; }
