/* Results — slice 6 of 9 of the former components.css.

   ⚠️ LOAD ORDER IS PART OF THESE FILES. They are CONTIGUOUS slices of one
   6841-line sheet, cut at section banners and never re-sorted, so concatenating
   them in the order index.html lists them reproduces the original byte for byte
   — which is the proof the cascade did not shift. Moving a rule to a different
   slice throws that guarantee away. index.html and sw.js's SHELL_ASSETS must
   list all 9 in the same order as each other.

   Contents: Path puzzle, drill results, quest composer, times table. */

/* ── Path puzzle ─────────────────────────────────────────── */

/* Centred with BOTH insets and auto margins, not left:50% + translateX(-50%).
   An absolutely positioned box at left:50% shrink-to-fits into the space right
   of its left edge, i.e. HALF the pane, so on a phone the sentence was squeezed
   to its longest word and cut off: measured at 375×812 (v418), Path's prompt
   wrapped one word per line and ended "Portu…". With both insets the bar can
   use the whole pane and still centres. */
.wu-path-bar {
  position: absolute;
  top: var(--space-md);
  left: 0;
  right: 0;
  margin-inline: auto;
  width: fit-content;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-pill);
  padding: var(--space-xs) var(--space-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  max-width: min(92%, 600px);
}

.wu-path-quit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-size-md);
  color: var(--colour-text-secondary);
  /* 32 → 44px (v289 audit). It sits inside a pill, so the glyph stays the same
     size; only the target grows. */
  min-width: 44px;
  min-height: 44px;
}

.wu-path-prompt {
  /* The FLEXIBLE item in the bar: it must yield to the fixed controls rather
     than push them off-screen. Growing the ▸ to a 44px target (v291) took the
     bar 14px past the right edge on a phone — the caught-in-the-sweep example
     of a control minimum propagating into its container. Without min-width:0 a
     flex item refuses to shrink below its text. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  color: var(--colour-text-primary);
  /* Wrap long instructions onto multiple lines instead of truncating —
     the pill grows taller and the quit/errors stay vertically centred. */
  white-space: normal;
  line-height: var(--line-height-tight);
  text-align: center;
}

.wu-path-prompt::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--path-color, var(--colour-accent));
  margin-right: 6px;
}

.wu-path-errors {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--colour-danger);
  flex: none;
}

/* One slip in — the warning takes the error tally's place so the bar keeps
   its three-part layout on a phone (v274). Amber, not red: it's a caution,
   and red is already what a wrong tap flashes. */
.wu-path-warn {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  color: var(--colour-warning);
  white-space: nowrap;
}

.wu-path-wrong .wu-hex {
  animation: wu-path-shake 320ms;
}

@keyframes wu-path-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.wu-path-start .wu-hex {
  animation: wu-path-pulse 1.4s ease-in-out infinite;
}

@keyframes wu-path-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

/* ── Drill results ───────────────────────────────────────── */

.wu-results {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
}

/* Compact: a footer under the exercise, not a takeover of the layer. `flex: 1`
   would have it stretch to eat whatever room the grid left. */
.wu-results-compact {
  flex: none;
  gap: var(--space-sm);
}

.wu-results-emoji {
  font-size: 64px;
  line-height: 1;
}

.wu-results-score {
  font-family: var(--font-mono);
  font-size: var(--font-size-3xl);
  margin: 0;
  color: var(--colour-text-primary);
}

.wu-results-time {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  color: var(--colour-text-secondary);
  margin: 0;
}

/* 🗺️ Quest progression modal. A LIST of the whole set, not a progress bar: the
   question the child is answering is "what have I done and what is next", and a
   bar answers neither. Three states, with the next one called out rather than
   merely being the first undone. */
.wu-quest-list {
  list-style: none;
  margin: var(--space-md) 0;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.wu-quest-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 32px;
  font-size: var(--font-size-sm);
  color: var(--colour-text-secondary);
}
.wu-quest-mark {
  flex: 0 0 20px;
  text-align: center;
  font-weight: var(--font-weight-bold);
}
.wu-quest-item[data-state="done"] { color: var(--colour-success); }
.wu-quest-item[data-state="next"] {
  color: var(--colour-text-primary);
  font-weight: var(--font-weight-bold);
}
.wu-quest-item[data-state="next"] .wu-quest-mark { color: var(--colour-brand-deep); }
.wu-quest-item[data-state="todo"] { opacity: 0.6; }

/* The answer language, sitting on the letter strip directly above the keys —
   "what to type" over "where to type". A full-width caption rather than a chip:
   the strip owns the whole width in both crossword layouts, so it costs one
   short line and can never squeeze a control off screen (which is exactly what
   it did on the clue bar at 375px). */
.wu-xw-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  margin-bottom: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--colour-accent);
  white-space: nowrap;
}

/* The child asked, rather than a threshold inferring it — the stronger signal
   of the two, so it is marked rather than left to look like a stray good score
   in a panel about struggling. */
.wu-support-asked {
  display: inline-block;
  margin-left: var(--space-xs);
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--colour-accent) 14%, var(--colour-surface));
  color: var(--colour-accent);
  font-size: var(--font-size-xs, 12px);
  font-weight: var(--font-weight-bold);
  white-space: nowrap;
}

/* 🙋 "I found this tricky" (v355). Quiet and BELOW the two main actions: it is
   always available, at any score, but it must not compete with "carry on" or
   look like the expected response to a good run. Full-width so it is easy to
   hit without being loud. */
.wu-results-help {
  display: block;
  width: 100%;
  margin-top: var(--space-md);
  min-height: 44px; /* tap floor, #88–#90 */
  padding: var(--space-sm);
  background: transparent;
  border: 1px dashed var(--colour-border);
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--colour-text-secondary);
  cursor: pointer;
}
.wu-results-help:hover { border-color: var(--colour-accent); color: var(--colour-accent); }
/* Stays pressed rather than vanishing — a child who taps it should SEE that it
   worked, and a disappearing button reads as "did that register?". */
.wu-results-help.wu-set-on {
  border-style: solid;
  border-color: var(--colour-success);
  color: var(--colour-success);
  cursor: default;
}

/* A rail stat that just went UP (Phase 6) — in practice the ⭐, at the moment a
   weekly flower pays out. Fires only on an increase, so the number a child has
   held all week never re-celebrates itself on every app launch. */
.wu-rail-stat.wu-stat-up {
  animation: wu-stat-bump 620ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes wu-stat-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* The results emoji arrives rather than appearing. Deliberately NOT applied to
   the low band (🔁) or a rushed run (⏳): a bounce is a celebration, and
   celebrating a run that went badly is the tonal mistake #117 set out to fix. */
.wu-results-emoji {
  animation: wu-result-in 520ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wu-results-emoji[data-quiet="1"] { animation: none; }
@keyframes wu-result-in {
  0%   { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wu-rail-stat.wu-stat-up,
  .wu-results-emoji { animation: none; }
}

/* ✋ Abandon guard (v354). The SAFE action is the primary one and sits on the
   right, where this app's sheets already put the go-ahead (the quest sheet's
   "▶ Keep going", the study choice's confirm) — so the muscle memory the child
   has says "carry on", and stopping takes a deliberate reach to the quieter
   button. */
/* .wu-abandon-backdrop .wu-sheet-primary lived here and declared exactly what
   the shared .wu-sheet-primary in sheets.css now declares — a generic class
   name scoped to one sheet, which meant the next sheet to use it got an
   unstyled button. Moved, not duplicated (#68). */
/* Since #287 the leave is the ONLY button (the ✕ and a tap outside stay), so
   the "quieter button" grey above no longer had a louder one beside it — and
   on the shared primary's blue it read as grey on blue, barely legible (owner
   2026-11-21: "close confirmation button. colour review and font", then "keep
   the close button colour linked to the activity"). It now wears the colour of
   the activity being closed — the rail's own tint, `--rail-tint`, copied onto
   the sheet when it opens — with the dark text every activity colour carries
   (they are mid-tones: white on them fails #121's contrast floor), a slightly
   deeper border, and the display face. No tint (nothing on the rail) → brand. */
.wu-abandon-backdrop .wu-abandon-leave {
  min-width: 180px;
  background: var(--leave-tint, var(--colour-brand));
  border-color: color-mix(in srgb, var(--leave-tint, var(--colour-brand)) 75%, #000);
  color: var(--colour-text-primary);
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
}
.wu-abandon-backdrop .wu-abandon-leave:hover { filter: brightness(0.95); }
.wu-abandon-sheet .wu-sheet-title { text-wrap: balance; }
.wu-abandon-sheet .wu-timer-notes {
  font-family: var(--font-display);
  font-size: var(--font-size-md);
  color: var(--colour-text-secondary);
}

/* ── 🗺️ Quest composer (parent dashboard, v353) ──────────────────────────────
   "The setup should be as simple as to add the 1,2,3 badge to the activities."
   A row IS the exercise; tapping it appends a step and the badge appears on the
   row itself, so what-is-in-the-quest is readable from the tree with nothing
   else open. Repeats show as ①③ on one row — no counter to explain. */
.wu-q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
  min-height: 44px; /* tap floor, #88–#90 */
  padding: var(--space-xs) var(--space-sm);
  background: var(--colour-bg);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--colour-text-primary);
  cursor: pointer;
  margin-bottom: var(--space-xs);
}
.wu-q-row:hover { border-color: var(--colour-accent); }
.wu-q-row.wu-set-on {
  border-color: var(--colour-brand-deep);
  background: color-mix(in srgb, var(--colour-brand) 12%, var(--colour-surface));
}
.wu-q-row:disabled {
  opacity: 0.45;
  cursor: default;
}
.wu-q-row:disabled:hover { border-color: var(--colour-border); }
.wu-q-row-label { text-align: left; }
.wu-q-row-badges {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

/* The step-number badge — the same disc in the tree, the steps list and (via
   the shared sheet) nowhere else, so "①" always means "step 1 of the quest". */
.wu-q-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--colour-brand-deep);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* The ＋ affordance on an unbadged row: quiet, so the badges stay the loudest
   thing in the column. */
.wu-q-add {
  color: var(--colour-text-secondary);
  font-size: var(--font-size-md);
  opacity: 0.7;
}

/* Times-table rows pack as a grid — twelve list rows would be a wall.
   ⚠️ IT REFLOWS, it does not shrink. `repeat(4, 1fr)` is `minmax(auto, 1fr)`
   four times, so no track could go below a row's min-content 56px: measured at
   375px inside the doubly-nested ×-tables panel, a 62px button overflowing its
   column by 42px. `auto-fit` + a 56px floor drops to three columns, or two, and
   keeps every row whole — the same answer the rail drawer's button grid reached
   in v399, and the same reason: at these widths the choice is reflow or clip,
   and shrinking a 44px-tall tap target is not on the table (#88–#90). */
.wu-q-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: var(--space-xs);
}
.wu-q-grid .wu-q-row { margin-bottom: 0; justify-content: center; gap: 4px; }
.wu-q-grid .wu-q-row .wu-q-row-label { text-align: center; }

/* Nested accordion inside the quest panel — one visual step in from its parent
   so the tree reads as a tree. */
.wu-q-sub {
  margin-left: var(--space-sm);
}
.wu-q-sub > summary { font-size: var(--font-size-sm); }

/* A quest row inside the weekly mix — indented under its subject's slider so it
   reads as a property of those tiles, not a competing activity. */
.wu-set-row.wu-set-sub {
  margin-left: var(--space-lg);
  padding-top: 0;
}

.wu-results-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

/* ⚠️ THE BUTTON SHAPE IS THE CLASS'S OWN, not the container's. Everything here
   used to be scoped to `.wu-results-actions button`, so `.wu-results-done` on
   its own — which is exactly how the stacked grid renders "✓ Check answers" —
   matched NO rule and came out as a bare UA button: measured 23px tall, half
   the Phase 6 tap floor, on the control that submits a whole round. It had been
   that way since the times table gained two rounds (#124/v379) and went unseen
   because the layout walker only ever reached the times-table PICKER; 🪜 Ladder
   sits on the approach flower, so the walker finally entered a running grid and
   reported it on the first run.

   Third instance of the same shape: `.wu-sheet-go` (#167a) and `.wu-sheet-
   primary` (#68) were both class names that looked like components and matched
   nothing outside one ancestor. A class that names a control has to carry that
   control's own shape. */
.wu-results-actions button,
.wu-results-done {
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-display);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  background: var(--colour-bg);
  color: var(--colour-text-primary);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-button);
  cursor: pointer;
  min-height: var(--tap-target-min);
}

.wu-results-actions button:hover,
.wu-results-done:hover {
  border-color: var(--colour-accent);
}

/* The success tint, which the results footer and the grid's ✓ Check share. */
.wu-results-actions .wu-results-done,
.wu-results-done {
  background: color-mix(in srgb, var(--colour-success) 22%, var(--colour-bg));
  border-color: var(--colour-success);
  color: var(--colour-success);
}

/* ── Times Table summary (replaces the mixed Path tile) ───────── */
.wu-tt-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}
.wu-tt-prompt {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
}
.wu-tt-pickgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  width: min(360px, 100%);
}
.wu-tt-pickbtn {
  aspect-ratio: 1;
  font-family: var(--font-mono);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  background: var(--colour-surface);
  border: 2px solid var(--colour-border);
  border-radius: var(--radius-card);
  color: var(--colour-text-primary);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.wu-tt-pickbtn:hover {
  border-color: var(--colour-accent);
  background: color-mix(in srgb, var(--colour-accent) 8%, var(--colour-surface));
}
.wu-tt-pickbtn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.wu-tt-pickbtn:disabled:hover {
  border-color: var(--colour-border);
  background: var(--colour-surface);
}
/* Already credited today (v274) — same green "done" reading as a filled hex.
   Still tappable: a spent table remains open as practice, it just won't fill a
   slot, and the child can see that before choosing rather than after. */
.wu-tt-done {
  position: relative;
  border-color: color-mix(in srgb, var(--colour-success) 55%, var(--colour-border));
  background: color-mix(in srgb, var(--colour-success) 14%, var(--colour-surface));
}
.wu-tt-done::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 5px;
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: 800;
  color: var(--colour-success);
}

/* The full table — one column of 12 rows on phones, two columns when wide. */
/* Order toggle, under the number grid (owner, 2026-08-29). Two named buttons
   rather than one switch: "In order" and "Mixed up" are two different
   exercises, and a labelled pair says which one you are in without the child
   having to work out what a switch's position means. */
/* Round banner. There is no toggle: the exercise IS both rounds, in order then
   shuffled (#124, owner: "saves on UI clutter"), so this only has to say where
   the child currently is. */
.wu-tt-round {
  margin: var(--space-sm) 0 0;
  text-align: center;
  color: var(--colour-text-secondary);
  font-size: var(--font-size-sm);
}
/* The split. It is the most useful line on the footer for a grown-up: 12/12
   then 8/12 says the ladder held and the recall did not, which neither number
   says alone. */
.wu-results-split {
  margin: var(--space-xs) 0 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--colour-text-primary);
}
/* A 20-row ladder is taller than a short screen, and .wu-drill-layer is a flex
   column with no overflow of its own — so without this the last rows and the
   ✓ Check button are simply unreachable (the #161(c) shape: `min-height: 0` so
   the flex child can shrink, and `safe` centring so an overflow is not pushed
   off the unreachable start edge). */
.wu-drill-layer:has(.wu-tt-grid) {
  justify-content: safe center;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ⌨️ THE BOXES ARE TAPPED, NOT TYPED INTO — the house keypad, exactly the
   one the 🧩 Grid ends with (#179). It began as a device-keyboard report
   (owner, on a tablet, 2026-09-27: "the input panel comes up and hides part of
   the exercise") and the pad is the fix rather than a compensation for it.
   Android does not shrink the LAYOUT viewport for the keyboard, so a layer at
   `inset: 0` keeps its full height and centres the rows inside a box whose
   lower half nobody can see; re-centring against `visualViewport` would have
   worked, and would have been a listener, a focus latch and a zoom guard spent
   compensating for a keyboard this screen never wanted. Two more things went
   with it: `inputmode="numeric"` is only a HINT, so some devices raised a full
   QWERTY with an autocorrect bar in front of a seven-year-old, and a native box
   measured ~51×32px — under the 44px floor (#88–#90) on every row. */
.wu-tt-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 0;
}
.wu-tt-side { flex: none; }
/* An element with its own `display` beats the UA's `[hidden]` rule; this one
   has none, but the guard is cheap and the trap has bitten three times. */
.wu-tt-side[hidden] { display: none; }
.wu-tt-pad {
  /* The standalone drill's pad lifts itself off the screen bottom; here it sits
     with its own grid, so it keeps neither the lift nor the padding. */
  margin: var(--space-md) 0 0;
  padding-bottom: 0;
}
/* ▸ is a move and ✓ is a commit, so ▸ wears the SAME green at a whisper and
   ✓ wears it in full — the key says which of the two it is before it is
   pressed. v470 drew ▸ as a plain digit, which kept the distinction and lost
   the family: the owner asked for it back ("can the next keep a green tone").
   The pair now reads as one control at two strengths rather than two
   unrelated keys that happen to share a slot. */
.wu-numpad.wu-tt-pad .wu-numpad-enter:not(.wu-tt-go-ready) {
  background: color-mix(in srgb, var(--colour-success) 9%, var(--colour-bg));
  color: var(--colour-success-ink);
  border-color: color-mix(in srgb, var(--colour-success) 50%, var(--colour-border));
}
.wu-tt-anyway {
  background: none;
  border: none;
  color: var(--colour-text-secondary);
  font-size: var(--font-size-sm);
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px;
  padding: 0 var(--space-md);
}

.wu-tt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xs);
  width: min(440px, 100%);
  margin: var(--space-md) auto 0;
  /* wu-portrait-stack ── UPRIGHT, THE ROWS SIT ABOVE AND THE PAD BELOW, BOTH
     ON SCREEN (owner, on a tablet held upright, 2026-09-28: "on vertical it
     should keep the times table above and pad below"). The TABLE scrolls
     inside its own box, not the whole layer: with the layer scrolling, a
     12- or 20-row table put the pad below the fold, so tapping a digit meant
     scrolling the row being filled out of sight. `min-height: 0` lets this
     flex item shrink below its rows; the wrap already can; the pad is
     `flex: none` and never gives up height. The selected row is scrolled into
     view inside this box on every move (`scrollIntoView`, block: nearest). */
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (min-width: 760px) {
  .wu-tt-grid {
    /* ⚠️ FLOW DOWN, NOT ACROSS — this was the bug behind "it said 2 × 3 = 6
       was wrong" (owner, 2026-08-29). With the default row-major flow, two
       columns lay 1× and 2× SIDE BY SIDE, so reading down the left column gave
       the odd multiples only (1, 3, 5, 7, 9, 11) while Enter advanced to the
       cell on the RIGHT. A child filling the table in sequence — which is the
       one thing a times table is FOR — put every answer in the wrong box.
       Column flow makes DOM order, keyboard order and reading order the same
       single sequence: 1-6 down the left, 7-12 down the right. It cannot
       reproduce on a phone (single column), which is why the same child got it
       right on one run and wrong on the next. */
    grid-auto-flow: column;
    /* ⚠️ ALWAYS EXACTLY TWO COLUMNS, whatever the row count. This was
       `repeat(6, auto)`, which is 12 rows in two columns and nothing else —
       correct while the times table was the only caller, and silently wrong the
       moment 🪜 Ladder arrived with the parent's 10/15/20 questions: 15 rows
       would have flowed into THREE columns and 20 into four, inside a 440px
       box. Worse than cramped — it re-opens the #124 bug, where the sequence
       the child reads is not the sequence Enter follows.
       The caller sets --tt-rows to ceil(n / 2), so column flow keeps DOM order,
       keyboard order and reading order one single sequence at any length. */
    grid-template-rows: repeat(var(--tt-rows, 6), auto);
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-lg);
    width: min(640px, 100%);
  }
}
.wu-tt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  /* Fixed slots, not `fit-content`: every row is the same width, so the ×, the
     = and the boxes line up down the column the way a printed table does, and
     the reserved → slot means nothing MOVES when the answers are revealed. */
  width: min(100%, 17em);
  /* BORDER-BOX (#267): content-box put the 32px padding and 2px border ON TOP
     of `100%`, so in the two-column tablet table every row was 34px wider than
     its column and the table scrolled sideways. */
  box-sizing: border-box;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  background: var(--colour-bg);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-button);
}
.wu-tt-q {
  font-family: var(--font-mono);
  font-size: var(--font-size-md);
  color: var(--colour-text-primary);
  min-width: 5ch;
  text-align: right;
}
.wu-tt-eq {
  color: var(--colour-text-secondary);
}
.wu-tt-q {
  min-width: 4.4em;
  text-align: right;
}
/* The correct answer, shown BESIDE the child's own — never over it. Always in
   the DOM so the row does not jump when it is filled in. */
.wu-tt-fix {
  min-width: 3.4em;
  flex: none;
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--colour-success);
}
.wu-tt-input {
  width: 3.4em;
  /* The 44px floor. A native input was ~32px tall, which nobody had measured
     because a text box does not read as a tap target until it becomes one. */
  min-height: 44px;
  cursor: pointer;
  flex: none;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-md);
  padding: var(--space-xs) var(--space-xs);
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-button);
  color: var(--colour-text-primary);
}
.wu-tt-input:focus-visible {
  outline: 2px solid var(--colour-accent);
  outline-offset: 2px;
}
/* WHERE THE NEXT DIGIT LANDS. Nothing else on this screen is selected, so the
   ring is the only thing saying which of twenty boxes the pad is typing into
   — it is information, not decoration. */
.wu-tt-input.wu-tt-sel {
  border-color: var(--colour-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--colour-accent) 38%, transparent);
}
.wu-tt-input.wu-tt-right {
  border-color: var(--colour-success);
  background: color-mix(in srgb, var(--colour-success) 14%, var(--colour-surface));
  color: var(--colour-success);
}
.wu-tt-input.wu-tt-wrong {
  border-color: var(--colour-danger);
  background: color-mix(in srgb, var(--colour-danger) 12%, var(--colour-surface));
  color: var(--colour-danger);
}
/* SIDE BY SIDE IN LANDSCAPE, AND ONLY IN LANDSCAPE (owner, on a tablet:
   "maths grid has lots of space on tablet. keep grid on left and input on the
   right"). Stacked, four 66px key rows plus a ladder do not fit under 400px of
   height at any padding; side by side, width is the axis a sideways screen has
   spare.

   ⚠️ This was `(min-width: 700px), (orientation: landscape)` until v472, and
   the WIDTH arm was the bug: an upright tablet is 768px or more across, so it
   took the side-by-side layout on the axis it has LEAST of, and at 760px the
   table also switches to two columns of rows — which then had ~360px beside a
   268px pad (owner: "vertical times table … gets hidden below the input pad").
   Upright, height is the spare axis, so the page stacks, whatever the width. */
@media (orientation: landscape) {
  .wu-tt-wrap {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    flex: 1 1 auto;
  }
  .wu-tt-grid {
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    max-height: 100%;
  }
  .wu-tt-pad { margin: 0; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .wu-tt-pad { grid-template-columns: repeat(3, 60px); }
  .wu-tt-pad button { height: 48px; }
  .wu-tt-grid { max-width: 520px; }
}

.wu-tt-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
/* The compact results headline (v362) — was .wu-tt-score, renamed when the
   times table adopted the shared results screen. Same one-line treatment, now
   available to any footer-shaped result. */
.wu-results-line {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
  margin: 0;
}

/* In-app APK update banner (native shell only) — fixed bottom pill */
/* A CARD, not a pill: it has to hold a progress bar and a line saying where the
   file went, because the shell hides the status bar the download notification
   would otherwise appear in (see app-update.js). A pill can hold neither. */
.wu-update-banner {
  position: fixed;
  /* Centred on the CONTENT, not the viewport. The rail is `position: fixed`, so
     the body's padding-left never reaches another fixed element — the same trap
     `notice.js` documents. Centring on 50vw put this card 16px under the spine
     on a phone. */
  left: calc(var(--safe-left) + var(--rail-bar-w) + var(--space-md));
  right: calc(var(--safe-right) + var(--space-md));
  bottom: var(--support-bottom);
  z-index: 220;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-sm);
  width: max-content;
  /* BORDER-BOX, or the clamp below bounds only the content and the padding and
     border hang outside it: on a phone the card ran 26px past the right gutter
     (device test 10, v425). There is no global box-sizing here (#90), so every
     clamp written against the viewport has to say so itself (#99). The 420px
     cap keeps its old content width, so a tablet sees the same card. */
  box-sizing: border-box;
  max-width: min(
    calc(420px + var(--space-sm) + var(--space-md) + 2px),
    calc(100vw - var(--safe-left) - var(--safe-right) - var(--rail-bar-w) - 2 * var(--space-md))
  );
  margin-inline: auto;
  padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-md);
  background: var(--colour-surface);
  border: 1px solid var(--colour-accent);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  font-size: var(--font-size-sm);
  color: var(--colour-text-primary);
}
.wu-update-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}
/* min-width:0 or the text refuses to shrink below its content size and shoves
   the ✕ off the card — a flex item's automatic minimum, the same trap that
   pushed Cross Words' ▸ off screen (#90). It WRAPS rather than ellipsising:
   truncating a version number loses the one fact the line carries. */
.wu-update-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
/* Full width, below the text — the phone had all three on one row and the
   button ran off the edge. A stacked action also gives it a target the width
   of the card instead of whatever was left over. */
.wu-update-go {
  width: 100%;
  min-height: 44px;
  padding: var(--space-xs) var(--space-md);
  border: none;
  background: var(--colour-accent);
  color: #fff;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: inherit;
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  cursor: pointer;
}
.wu-update-x {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--colour-text-secondary);
  font-size: var(--font-size-md);
  cursor: pointer;
}
/* 28px disc, 44px target — the disc stays small so it does not outweigh the
   Update button beside it (the games ✕ treatment, decisions #88–#90). */
.wu-update-x::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.wu-update-prog {
  height: 6px;
  overflow: hidden;
  background: color-mix(in srgb, var(--colour-accent) 18%, transparent);
  border-radius: var(--radius-pill);
}
.wu-update-prog > i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--colour-accent);
  border-radius: var(--radius-pill);
  transition: width 0.25s ease;
}
/* Indeterminate: the shell hands the file to DownloadManager and tells us
   nothing further, so the bar must show ACTIVITY without claiming a figure. */
.wu-update-banner[data-state="starting"] .wu-update-prog > i,
.wu-update-banner[data-state="handoff"] .wu-update-prog > i {
  width: 40%;
  animation: wu-update-slide 1.4s ease-in-out infinite;
}
@keyframes wu-update-slide {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(260%);
  }
}
.wu-update-note {
  margin: 0;
  max-width: 34ch;
  color: var(--colour-text-secondary);
  font-size: var(--font-size-xs);
  line-height: 1.4;
}
.wu-update-note b {
  color: var(--colour-text-primary);
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
  .wu-update-banner[data-state="starting"] .wu-update-prog > i,
  .wu-update-banner[data-state="handoff"] .wu-update-prog > i {
    width: 100%;
    opacity: 0.45;
    animation: none;
  }
  .wu-update-prog > i {
    transition: none;
  }
}

/* 🌟 Mimi brings the update (#381): her face leads the row, the card takes
   her amber instead of the accent blue, and her line reads in the display face. */
.wu-update-mimi { border-color: var(--colour-brand, #FFB74D); }
.wu-update-mimi .wu-update-row { align-items: center; }
.wu-update-face { width: 64px; height: 64px; flex: 0 0 auto; margin: -12px -6px -12px -14px; }
.wu-update-mimi .wu-update-text { font-family: var(--font-display); font-weight: 800; font-size: var(--font-size-md); }

/* Parent dashboard → 📊 Insights (last-30-day usage) */
.wu-insight-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.wu-insight-acc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--colour-text-secondary);
}

/* Help text (the ? notes in Settings and Diagnostics) */
.wu-help-text {
  margin: 0;
  padding: 0 var(--space-xs) var(--space-sm);
  color: var(--colour-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

/* ── 🧩 The Operation Grid (owner's page 44) ─────────────────────────── wu-og-
   Its own sub-prefix per working rule 8: it shares the stacked-grid FAMILY with
   the times table but not its layout, so it does not share its classes. */
.wu-og-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  min-height: 0;
  width: 100%;
}
/* wu-og-centre ── CENTRED VERTICALLY, LIKE THE TIMES TABLE (owner, 2026-09-28:
   "times table is good centred vertically on both landscape and portrait.
   grid is aligned to the top"). The drill layer's default is `flex-start`,
   and only the stacked drill's layer overrode it, so an UPRIGHT grid packed
   everything at the top: measured 178px of empty layer under it on a 768×1024
   tablet and 206px on a 375×812 phone. This is the same rule the times table
   uses, for the same reasons: `safe` so a column that ever outgrows the layer
   starts at the top instead of being pushed off an unreachable edge, and the
   scroll is the net that makes that edge reachable.

   Sideways it changes nothing, and that was measured too: side by side the
   wrap GROWS to fill the height and centres the grid inside itself (#180), and
   on a sideways phone the layer is a grid whose fr tracks leave no free space
   for `justify-content` to act on. */
.wu-drill-layer:has(.wu-og-wrap) {
  justify-content: safe center;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wu-og-grid {
  display: grid;
  /* One track per column INCLUDING the header column, all equal, so the header
     line up with the cells they label. 1fr rather than a fixed px: the grid is
     capped by its own width below and the cell size falls out of that, which is
     what keeps a 5-column and a 7-column grid the same overall size. */
  grid-template-columns: repeat(var(--og-cols, 5), minmax(0, 1fr));
  gap: 2px;
  /* WIDTH IS SET INLINE by startOpGrid, which measures the room the grid will
     have and solves the cell size from it. This is only the fallback for a
     grid rendered before that runs; a `cols * Npx` cap here silently overrode
     the solved size and spilled the grid out of its own wrap. */
  width: min(420px, 100%);
  flex: none;
}
.wu-og-head,
.wu-og-cell {
  /* Square cells whatever the column width, so the grid reads as a table and
     not as a set of letterboxes. */
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: var(--radius-cell);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.05;
  min-width: 0;
}
.wu-og-head {
  background: color-mix(in srgb, var(--colour-accent) 14%, var(--colour-bg));
  color: var(--colour-text-primary);
  font-weight: var(--font-weight-bold);
}
.wu-og-corner {
  background: color-mix(in srgb, var(--colour-accent) 30%, var(--colour-bg));
  font-size: var(--font-size-md);
}
.wu-og-cell {
  padding: 0;
  border: 1px solid var(--colour-border);
  background: var(--colour-surface);
  color: var(--colour-text-primary);
  cursor: pointer;
  font-weight: var(--font-weight-bold);
}
/* A GIVEN cell is the worked example, so it reads as printed rather than as
   something the child left blank. */
.wu-og-given {
  background: var(--colour-bg);
  color: var(--colour-text-secondary);
  border: 1px solid var(--colour-border);
  cursor: default;
}
.wu-og-cell.wu-og-sel {
  border-color: var(--colour-accent);
  box-shadow: inset 0 0 0 2px var(--colour-accent);
}
.wu-og-cell.wu-og-right {
  background: color-mix(in srgb, var(--colour-success) 18%, var(--colour-bg));
  border-color: var(--colour-success);
}
.wu-og-cell.wu-og-wrong {
  background: color-mix(in srgb, var(--colour-danger) 12%, var(--colour-bg));
  border-color: var(--colour-danger);
}
/* The child's own answer stays, struck through; the right one goes UNDER it,
   never over it (#124). */
.wu-og-cell.wu-og-wrong .wu-og-in {
  text-decoration: line-through;
  color: var(--colour-danger);
  font-size: var(--font-size-xs);
}
.wu-og-fix {
  color: var(--colour-success);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}
/* The pad is the sudoku-style input the owner asked for. Ten digits plus ⌫ in
   a fixed three-across block, so the digits sit where they do on every other
   numpad in the app. */
.wu-og-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  flex: none;
}
/* An element with its own `display` needs its own [hidden] rule, or the UA's
   `display: none` loses to it — the trap #145 hit with the two-player overlay. */
.wu-og-side[hidden] { display: none; }

.wu-og-pad {
  margin-bottom: 0;
  padding-bottom: 0;
  grid-template-columns: repeat(3, 64px);
  gap: var(--space-xs);
  flex: none;
}
.wu-og-pad button { height: var(--tap-target-min); }
/* Inherits .wu-numpad-enter's green from drills.css — declared there once for
   every numpad in the app, so the ✓ cannot end up a different green here. */

/* ⚠️ THE GRID RESERVES THE CHROME COLUMN, and it is the only drill that has
   to. During an activity the rail sheds its spine (#171) but the trail circle
   and the ✕ stay, floating over the content at the top left. Every other
   drill CENTRES its work in the layer, so it clears them by accident; the grid
   fills its half from the top-left corner and ran under them — 5px of
   clearance at 851×393 and none at all on a phone (owner: "grid to be clear
   of the left padding for the pills").

   Same reserve a full-screen modal makes (#164) and the SAME TOKEN, so a pill
   that changes size takes the gutter with it rather than this going stale —
   the hardcoded-reserve failure this file has recorded five times (#89, #90,
   #98, #114, #143). startOpGrid reads the layer's real padding when it solves
   the cell size, so the grid simply comes out a little smaller and nothing
   else has to know.

   ⚠️ SCOPED TO THE STATE WHERE THE SPINE IS ACTUALLY HIDDEN — the same
   query #171 uses, and it has to be the same one. Where the rail still draws
   its spine the pills sit ON it, the layer already starts past them (measured:
   layer at x=73 against pills ending at 50 on a 1280×800 desktop), and this
   reserve would push the grid 52px right of centre to clear something that was
   never in the way. A gutter for chrome that is not overlapping is just a
   margin nobody asked for. */
/* #279/#280 — the gate matches the phone FOOT BAR's (#233): the spine hides
   wherever the foot bar replaces it. #279 found a 600–720px portrait band with
   neither bar; #280 then made EVERY upright screen the phone layout, so the
   gate is simply portrait (or a sideways phone). */
@media (orientation: portrait), (orientation: landscape) and (max-height: 500px) {
  .wu-drill-layer:has(.wu-og-wrap) {
    padding-left: calc(var(--layer-pad-x) + var(--safe-left) + var(--chrome-w));
  }
}

/* ── HALF THE SCREEN IS THE GRID, HALF IS EVERYTHING ELSE ───────────────
   Owner, on this screen specifically: "half for the grid and half for the
   title, timer, input". The same trade the two-column drill (#172) and the
   games rail (#88) make — in short landscape height is the scarce axis and
   width is the plentiful one, so chrome that sat ABOVE the work moves BESIDE
   it and the work keeps the full height.

   `display: contents` on the wrap is what lets the head, the hint, the grid,
   the pad and the results be placed as five items of ONE grid while the DOM
   keeps its honest reading order (head → hint → work → results) for portrait,
   for a screen reader and for tab order. Same technique as the calendar's
   two-column card (#163), and for the same reason: no DOM move, no second
   copy of anything.

   ⚠️ `--og-split` is a CONTRACT with startOpGrid, which solves the cell size
   from the room the grid will have. The two layouts leave it very different
   room (here the grid spans every row and loses half the WIDTH; stacked it
   keeps the width and loses the head, hint and pad out of its HEIGHT), and a
   flag set where the layout is decided is the only honest way for the
   measurement to know which it is. Inferring it from a flex-direction broke
   the moment the wrap stopped being a flex container. */
/* ▸ in a whisper of the ✓'s green — the stacked drill's rule, above. */
.wu-numpad.wu-og-pad .wu-numpad-enter:not(.wu-og-go-ready) {
  background: color-mix(in srgb, var(--colour-success) 9%, var(--colour-bg));
  color: var(--colour-success-ink);
  border-color: color-mix(in srgb, var(--colour-success) 50%, var(--colour-border));
}

/* THE TIMES TABLE'S KEYS ON ANY ROOMY SCREEN (owner, on a tablet: "maths
   grid input is too small… the size of the times table is better"). The base
   64×44 is a PHONE size, kept only where a phone needs it: upright, where the
   pad sits under the grid and every pixel of key comes out of the cells.

   On a roomy screen the house numpad costs the grid nothing it needs, in
   either orientation. Sideways the pad is beside a height-bound grid; upright
   (a tablet, v472) the pad is below and the height is spare — worked through at
   768×1024, the solver still deals one 6×6 grid at 64px cells with a 288px
   pad under it. So the Grid, the Ladder and the Times table share one pad.

   ⚠️ These blocks come BEFORE the short-landscape one, which a sideways
   phone also matches and which must win there (60×48 keys). */
@media (min-width: 700px) {
  .wu-og-pad {
    grid-template-columns: repeat(3, 84px);
    gap: var(--space-sm);
  }
  .wu-og-pad button { height: 66px; }
}
/* SIDE BY SIDE ON A SIDEWAYS ROOMY SCREEN, and only sideways (owner: "keep
   grid on left and input on the right", then, of an upright tablet: "on
   vertical it should keep the times table above and pad below. same with the
   grid"). The head and hint keep the full width across the top and only the
   grid and the pad share the row, which also leaves the header centred over
   the whole screen rather than half of it (#101).

   It also sets the owner's "1/3 proportion" without a number of its own: the
   side is `flex: none`, so its width IS the pad's (~268px), and startOpGrid
   subtracts the side's MEASURED width before it solves. The grid is
   height-bound here, so 1024×768, 1024×600 and 1280×800 all deal one 6×6.

   ⚠️ Until v472 this was `(min-width: 700px)` alone, so an UPRIGHT tablet
   (768+ across) was side by side too — on the axis it has least of. Upright it
   now stacks (`--og-split` 0): the solver subtracts the pad's measured height
   instead, which is the contract working as designed. */
@media (min-width: 700px) and (orientation: landscape) {
  .wu-drill-layer:has(.wu-og-wrap) { --og-split: 2; }
  .wu-og-wrap {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-lg);
    flex: 1 1 auto;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .wu-drill-layer:has(.wu-og-wrap) {
    --og-split: 1;
    display: grid;
    /* TWO THIRDS FOR THE GRID, ONE FOR EVERYTHING ELSE (owner, 2026-09-28:
       "the 1/3 proportion works better", replacing #179's half and half).
       ⚠️ The third has a FLOOR: at 640×360 a strict third is ~172px and
       the pad is 196px, so `minmax(0, 1fr)` would have spilled the ✓ key
       over the screen edge. `min-content` lets the side take what the pad
       needs and hands the grid the rest — which at 640 is MORE than the old
       half gave it, and takes that phone from a 3×3 grid to a 4×4. */
    grid-template-columns: minmax(0, 2fr) minmax(min-content, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "grid head"
      "grid hint"
      "grid pad"
      "grid res";
    column-gap: var(--space-lg);
    align-items: center;
    justify-items: center;
  }
  .wu-drill-layer:has(.wu-og-wrap) > .wu-drill-head {
    grid-area: head;
    width: 100%;
    align-self: start;
  }
  .wu-drill-layer:has(.wu-og-wrap) > .wu-og-hint { grid-area: hint; margin: 0; }
  .wu-og-wrap { display: contents; }
  .wu-og-grid { grid-area: grid; }
  /* Full width of its own half, so the measurement can read one rect and know
     what is left for the grid without re-deriving the track sizes. */
  .wu-og-side { grid-area: pad; width: 100%; }
  .wu-drill-layer:has(.wu-og-wrap) > .wu-og-results { grid-area: res; }
  /* The Times table's sideways keys, exactly (.wu-tt-pad under 500px tall,
     at the house gap), so the two screens share a pad here too. 4 × 48 +
     gaps = 216px against a ~250px pad row at 640×360, the tightest case.
     Never under the 44px floor — the 40px this block once set was caught by
     tools/layout-audit.js (#88–#90). */
  .wu-og-pad {
    grid-template-columns: repeat(3, 60px);
    gap: var(--space-sm);
  }
  .wu-og-pad button { height: 48px; }
}

/* ── 🏛️ Columns — column addition and subtraction (#189) ─────────── wu-col-
   The SCREEN is the Grid's (wu-og-wrap / wu-og-side / wu-og-pad, the same
   --og-split contract and two-thirds split sideways); only the SUM is new.
   --col-cell is solved in startColumns from the room the sum has — never left
   to a CSS cap the measurement cannot see (#179). */
.wu-col-sum {
  --col-cell: 56px;
  display: grid;
  grid-template-columns: repeat(var(--col-cols, 4), var(--col-cell));
  gap: var(--space-xs) var(--space-sm);
  justify-content: center;
  align-items: center;
  flex: none;
  font-family: var(--font-mono);
}
.wu-col-blank,
.wu-col-dig,
.wu-col-sign {
  height: var(--col-cell);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--col-cell) * 0.55);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
}
.wu-col-sign { color: var(--colour-accent); }
/* The carry / exchange row is shorter than a digit row, never under the tap
   floor. */
.wu-col-hrow,
.wu-col-help { height: max(var(--tap-target-min), calc(var(--col-cell) * 0.72)); }
.wu-col-help,
.wu-col-ans {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-cell);
  cursor: pointer;
}
/* Dashed and quiet: these boxes are the child's own working, never marked. */
.wu-col-help {
  border: 1px dashed var(--colour-border);
  background: transparent;
  color: var(--colour-text-secondary);
  font-size: calc(var(--col-cell) * 0.36);
}
.wu-col-rule {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 2px;
  background: var(--colour-text-primary);
}
.wu-col-ans {
  height: var(--col-cell);
  border: 2px solid var(--colour-border);
  background: var(--colour-surface);
  color: var(--colour-text-primary);
  font-size: calc(var(--col-cell) * 0.55);
}
/* The extra leading box addition always gets, so the width never gives away
   whether the answer carries into a new column. */
.wu-col-ans.wu-col-opt { border-style: dashed; }
.wu-col-help.wu-col-sel,
.wu-col-ans.wu-col-sel {
  border-color: var(--colour-accent);
  box-shadow: inset 0 0 0 2px var(--colour-accent);
}
.wu-col-ans.wu-col-right {
  background: color-mix(in srgb, var(--colour-success) 18%, var(--colour-bg));
  border-color: var(--colour-success);
}
.wu-col-ans.wu-col-wrong {
  background: color-mix(in srgb, var(--colour-danger) 12%, var(--colour-bg));
  border-color: var(--colour-danger);
}
/* The child's digit stays, struck through; the right one goes under it (#124). */
.wu-col-ans.wu-col-wrong .wu-col-in {
  text-decoration: line-through;
  color: var(--colour-danger);
  font-size: 0.6em;
}
.wu-col-fix {
  color: var(--colour-success-ink);
  font-size: 0.5em;
}
.wu-col-fix:empty { display: none; }
.wu-col-ans:disabled,
.wu-col-help:disabled { cursor: default; }

/* Sideways phone: the sum takes the Grid's grid area. */
@media (orientation: landscape) and (max-height: 500px) {
  .wu-col-sum { grid-area: grid; }
}

/* ── 🚌 Short division — the bus stop (#191) ──────────────────────── wu-sd-
   The SCREEN is the Grid's and Columns' (wu-og-*); only the bus stop is new.
   The grid columns are written by startShortDiv (divisor, then a carry column
   and a digit column per digit, then r on hard), and --sd-cell / --sd-carry
   are solved there from the room the sum has (#179). No column gap, so the
   roof runs unbroken over the number being divided. */
.wu-sd-sum {
  --sd-cell: 56px;
  --sd-carry: 44px;
  display: grid;
  column-gap: 0;
  row-gap: var(--space-xs);
  justify-content: center;
  align-items: end;
  flex: none;
  font-family: var(--font-mono);
}
.wu-sd-blank,
.wu-sd-dig,
.wu-sd-divisor,
.wu-sd-rlabel,
.wu-sd-roof {
  height: var(--sd-cell);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--sd-cell) * 0.55);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
}
/* The bus stop: a roof over the number, a wall between it and the divisor. */
.wu-sd-roof { border-top: 3px solid var(--colour-text-primary); }
.wu-sd-divisor {
  border-right: 3px solid var(--colour-text-primary);
  color: var(--colour-accent);
}
.wu-sd-rlabel {
  color: var(--colour-text-secondary);
  font-size: calc(var(--sd-cell) * 0.4);
}
.wu-sd-ans,
.wu-sd-carry {
  box-sizing: border-box;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-cell);
  cursor: pointer;
}
.wu-sd-ans {
  width: calc(100% - 6px);
  justify-self: center;
  height: var(--sd-cell);
  border: 2px solid var(--colour-border);
  background: var(--colour-surface);
  color: var(--colour-text-primary);
  font-size: calc(var(--sd-cell) * 0.55);
}
/* Dashed and quiet: the child's own working, never marked — sat in front of
   the digit it belongs to. */
.wu-sd-carry {
  width: calc(100% - 4px);
  height: max(var(--tap-target-min), calc(var(--sd-cell) * 0.62));
  border: 1px dashed var(--colour-border);
  background: transparent;
  color: var(--colour-text-secondary);
  font-size: calc(var(--sd-cell) * 0.34);
}
/* A leading box over a digit smaller than the divisor: blank or 0. */
.wu-sd-ans.wu-sd-opt { border-style: dashed; }
.wu-sd-ans.wu-sd-sel,
.wu-sd-carry.wu-sd-sel {
  border-color: var(--colour-accent);
  box-shadow: inset 0 0 0 2px var(--colour-accent);
}
.wu-sd-ans.wu-sd-right {
  background: color-mix(in srgb, var(--colour-success) 18%, var(--colour-bg));
  border-color: var(--colour-success);
}
.wu-sd-ans.wu-sd-wrong {
  background: color-mix(in srgb, var(--colour-danger) 12%, var(--colour-bg));
  border-color: var(--colour-danger);
}
/* The child's digit stays, struck through; the right one goes under it (#124). */
.wu-sd-ans.wu-sd-wrong .wu-sd-in {
  text-decoration: line-through;
  color: var(--colour-danger);
  font-size: 0.6em;
}
.wu-sd-fix {
  color: var(--colour-success-ink);
  font-size: 0.5em;
}
.wu-sd-fix:empty { display: none; }
.wu-sd-ans:disabled,
.wu-sd-carry:disabled { cursor: default; }

@media (orientation: landscape) and (max-height: 500px) {
  .wu-sd-sum { grid-area: grid; }
}

/* ── ✍️ Long multiplication — the column method (#193) ───────────── wu-lm-
   The SCREEN is the Grid's, Columns' and Short ÷'s (wu-og-*); only the sum is
   new. --lm-cell is solved in startLongMult from the room the sum has (#179).
   Each row is a display:contents group so its boxes sit in the same grid as
   the digits above them, while the DOM still says which row a box is in. */
.wu-lm-sum {
  --lm-cell: 56px;
  display: grid;
  grid-template-columns: repeat(var(--lm-cols, 5), var(--lm-cell));
  gap: var(--space-xs) var(--space-sm);
  justify-content: center;
  align-items: center;
  flex: none;
  font-family: var(--font-mono);
}
.wu-lm-row { display: contents; }
.wu-lm-blank,
.wu-lm-dig,
.wu-lm-sign {
  height: var(--lm-cell);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--lm-cell) * 0.55);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
}
.wu-lm-sign { color: var(--colour-accent); }
/* The carry row is shorter than a digit row, never under the tap floor. */
.wu-lm-hrow,
.wu-lm-help { height: max(var(--tap-target-min), calc(var(--lm-cell) * 0.72)); }
.wu-lm-help,
.wu-lm-ans {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-family: inherit;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-cell);
  cursor: pointer;
}
/* Dashed and quiet: the child's own carries, never marked. */
.wu-lm-help {
  border: 1px dashed var(--colour-border);
  background: transparent;
  color: var(--colour-text-secondary);
  font-size: calc(var(--lm-cell) * 0.36);
}
.wu-lm-rule {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 2px;
  background: var(--colour-text-primary);
}
.wu-lm-ans {
  height: var(--lm-cell);
  border: 2px solid var(--colour-border);
  background: var(--colour-surface);
  color: var(--colour-text-primary);
  font-size: calc(var(--lm-cell) * 0.55);
}
/* The extra leading box every row gets, so its width never gives the answer
   away: blank or 0. */
.wu-lm-ans.wu-lm-opt { border-style: dashed; }
/* The place-holder 0 box: required, and tinted so the second row reads as
   "this one starts differently" before anything is typed. */
.wu-lm-ans.wu-lm-hold { background: color-mix(in srgb, var(--colour-accent) 8%, var(--colour-surface)); }
.wu-lm-help.wu-lm-sel,
.wu-lm-ans.wu-lm-sel {
  border-color: var(--colour-accent);
  box-shadow: inset 0 0 0 2px var(--colour-accent);
}
.wu-lm-ans.wu-lm-right {
  background: color-mix(in srgb, var(--colour-success) 18%, var(--colour-bg));
  border-color: var(--colour-success);
}
.wu-lm-ans.wu-lm-wrong {
  background: color-mix(in srgb, var(--colour-danger) 12%, var(--colour-bg));
  border-color: var(--colour-danger);
}
/* The child's digit stays, struck through; the right one goes under it (#124). */
.wu-lm-ans.wu-lm-wrong .wu-lm-in {
  text-decoration: line-through;
  color: var(--colour-danger);
  font-size: 0.6em;
}
.wu-lm-fix {
  color: var(--colour-success-ink);
  font-size: 0.5em;
}
.wu-lm-fix:empty { display: none; }
.wu-lm-ans:disabled,
.wu-lm-help:disabled { cursor: default; }

@media (orientation: landscape) and (max-height: 500px) {
  .wu-lm-sum { grid-area: grid; }
}

/* ── THE WRITTEN-METHOD SCREENS ON A PORTRAIT PHONE (#250, owner 2026-11-16:
   "columns keypad is not good") ── Grid, Columns, Short ÷ and Long × share
   the wu-og- shell, and upright on a phone it had fallen behind every other
   drill in three ways at once:

   • THE CHROME RESERVE IS GONE. The `--chrome-w` gutter above was cut for the
     trail circle and ✕ floating at the top left. On a portrait phone they
     live in the foot bar now (#233), so the reserve only shoved the sum and
     the pad ~50px right of centre and clipped Columns' right-hand box.
   • THE HOUSE KEYPAD. 84×66 keys at the house gap, the drill numpad's size
     (#247), instead of the 64×44 phone fallback. Every solver here measures
     the side's REAL height before sizing its cells (the --og-split contract),
     so a bigger pad shrinks the cells and nothing else has to know.
   • THE WHITE BAND. The hint (the question) and the work (where the reply
     is written) sit in one white band near the top, and the pad is centred
     in what is left down to the foot bar — the #247 rule. The work is
     narrower than the screen, so it bleeds by the shadow-and-clip trick; the
     second shadow is the band's bottom rule, drawn full width. */
@media (orientation: portrait) {
  .wu-drill-layer:has(.wu-og-wrap) {
    padding-left: calc(var(--layer-pad-x) + var(--safe-left));
    justify-content: flex-start;
    gap: 0;
  }
  .wu-drill-layer:has(.wu-og-wrap) > .wu-og-hint {
    align-self: stretch;
    margin: var(--space-md) calc(-1 * var(--layer-pad-x)) 0;
    padding: var(--space-lg) var(--layer-pad-x) var(--space-md);
    background: var(--colour-surface);
    border-top: 1px solid var(--colour-border);
  }
  .wu-og-wrap {
    flex: 1 1 auto;
    gap: 0;
  }
  .wu-og-wrap > :is(.wu-og-grid, .wu-col-sum, .wu-sd-sum, .wu-lm-sum) {
    padding-bottom: var(--space-lg);
    background: var(--colour-surface);
    box-shadow: 0 0 0 100vmax var(--colour-surface), 0 1px 0 100vmax var(--colour-border);
    clip-path: inset(0 -100vmax -1px);
  }
  .wu-og-side {
    margin-block: auto;
    padding-block: var(--space-md);
  }
  .wu-og-pad {
    grid-template-columns: repeat(3, 84px);
    gap: var(--space-sm);
  }
  .wu-og-pad button { height: 66px; }
}

/* ✍️ THE WRITTEN METHODS FIT A PHONE (v546, owner 2026-11-18: "on mobile the
   keypad is being pushed too far down on the screen" · "the helper text should
   be reduced to a (?)"). Measured at 375×812 on Long × (the tallest: carry row,
   two factors, two partials and the answer, six rows at the 44px tap floor):
   the work and the pad came to 610px in 528, so the keypad's last row
   (⌫ 0 ▸) sat under the foot bar. The cells cannot shrink, so:
   • the HINT BAND goes on a portrait phone — the (?) chip in the header shows
     the same text on a tap (hintChip in maths.js), ~80px back;
   • the empty results row stops reserving its 16px margin;
   • Long × also trims its sum foot and pad padding.
   The work then becomes the top of the white band. */
/* (The (?) and the 1/X are visible on every screen size since #267 — they
   carry `wu-head-help` / `wu-head-count`, styled with the #265 standard.) */
@media (orientation: portrait) {
  .wu-drill-layer:has(.wu-og-wrap) > .wu-og-hint { display: none; }
  .wu-drill-layer:has(.wu-og-wrap) > .wu-og-results:empty { display: none; }
  .wu-og-wrap > :is(.wu-og-grid, .wu-col-sum, .wu-sd-sum, .wu-lm-sum) {
    padding-top: var(--space-md);
    border-top: 1px solid var(--colour-border);
  }
  .wu-lm-wrap > .wu-lm-sum {
    padding-top: var(--space-sm);
    padding-bottom: var(--space-md);
    row-gap: 2px;
  }
  .wu-lm-wrap > .wu-og-side { padding-block: var(--space-md) 0; }
  .wu-og-hintbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    margin-right: var(--space-sm);
    border: 1px solid var(--colour-border);
    border-radius: 999px;
    background: var(--colour-surface);
    color: var(--colour-accent);
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md);
    cursor: pointer;
  }
  .wu-og-count {
    display: inline;
    margin-left: var(--space-xs);
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--colour-text-secondary);
  }
  /* THE PAD GIVES WAY BEFORE IT OVERLAPS (v547, owner: "the pad is now visible
     but it is overlapping with the question band"). Its 66px keys were fixed,
     so on a shorter phone (360×720 with a camera inset: ~80px short on Long ×)
     there was nothing left to give. The side may now SHRINK (never grow — the
     cell solvers measure it), and the key rows run 66px down to the 44px tap
     floor to fit what is left under the work. */
  .wu-og-wrap > .wu-og-side {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .wu-og-wrap .wu-og-pad {
    flex: 0 1 auto;
    min-height: 0;
    grid-template-rows: repeat(4, minmax(44px, 66px));
  }
  .wu-og-wrap .wu-og-pad button { height: auto; min-height: 44px; }
  /* 44px hit area around the 32px disc (#88–#90). */
  .wu-og-hintbtn { position: relative; }
  /* -7px, not -6: the inset is measured inside the 1px border (#321). */
  .wu-og-hintbtn::after { content: ""; position: absolute; inset: -7px; }
  .wu-og-hintbtn-new { animation: wu-og-hint-pulse 900ms ease 2; }
}
@keyframes wu-og-hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--colour-accent) 45%, transparent); }
  50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--colour-accent) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .wu-og-hintbtn-new { animation: none; }
}

/* THE FOOT RESERVE IS GIVEN BACK on the written methods (v548, owner: "the key
   pad is still too tight to the question band. why so much padding at the
   base?"). The 64px --foot-reserve (#252 R5) keeps an activity clear of the
   exercise-name pill that opens above the foot bar for a few seconds on
   arrival — and those few seconds cost the screen 64px for the whole run.
   These four screens already name themselves in the header ("✍️ Long ×"), so
   here the pill stays an icon and the reserve becomes the ordinary 8px; the
   keypad spends the room on a gap under the work and on taller keys.
   Selector repeats R5's (layout.css) plus :has(.wu-og-wrap), to outrank it. */
@media (orientation: portrait) {
  body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked):has(.wu-og-wrap) {
    padding-bottom: var(--space-sm);
  }
  body:has(.wu-drill-layer:not(.wu-hidden) .wu-og-wrap) .wu-hud .wu-rail-trail-name { display: none; }
  .wu-og-wrap > .wu-og-side { padding-top: var(--space-md); }
}
/* The hint sheet's body reads as instructions, not as a subtitle. */
.wu-help-step { font-size: var(--font-size-md); color: var(--colour-text-primary); text-align: center; }

/* A CHECKED SUM / A FINISHED RUN ON A PHONE (v549, owner 2026-11-18: "keyboard
   fix on long multiplication broke the layout. Keypad missing" · "end of
   exercise as an update on white band with input below repeat/report
   help/done").
   • v547's `display: flex` on the side outranked `.wu-og-side[hidden]`, so the
     keypad stayed up after a check with ▶ Next sum squeezed under it. Restored.
   • Every screen writes its verdict ("right! ✓", "3 of 5 right") into the
     hint, which v546 hides on a phone — so a checked sum said nothing. The side
     is hidden exactly while a verdict is up, so that is the switch: the hint
     returns as the TOP LINE OF THE WHITE BAND, over the marked-up work.
   • The keypad's zone then holds the next step — ▶ Next sum, or the results
     (↻ Repeat · 🙋 I found this tricky · ✓ Done) — centred where the keys were. */
@media (orientation: portrait) {
  .wu-og-wrap > .wu-og-side[hidden] { display: none; }
  .wu-drill-layer:has(.wu-og-side[hidden]) > .wu-og-hint {
    display: block;
    margin: 0 calc(-1 * var(--layer-pad-x));
    padding: var(--space-md) var(--layer-pad-x) var(--space-sm);
    border-top: 0;
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md);
    color: var(--colour-text-primary);
  }
  .wu-drill-layer:has(.wu-og-side[hidden]) > .wu-og-wrap { flex: none; }
  /* The band already gives the score and the header timer the time. */
  .wu-drill-layer:has(.wu-og-side[hidden]) > .wu-og-results .wu-results-line { display: none; }
  .wu-drill-layer:has(.wu-og-side[hidden]) > .wu-og-results .wu-results-nudge { text-align: center; }
  .wu-drill-layer:has(.wu-og-side[hidden]) > .wu-og-results:not(:empty) {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-block: auto;
    width: 100%;
  }
}

/* ── ✨ Magic squares (#262) ───────────────────────────────────── wu-ms-
   The Grid's shell; only the totals and the type size are its own. The totals
   sit where the Grid's headers do, in the brand amber so they read as the
   TARGET each line has to reach, not as a number to copy. */
.wu-ms-grid .wu-og-cell,
.wu-ms-grid .wu-og-head { font-size: var(--font-size-lg); }
.wu-ms-grid .wu-ms-total {
  background: color-mix(in srgb, var(--colour-warning) 22%, var(--colour-bg));
  color: var(--colour-text-primary);
  font-size: var(--font-size-md);
  flex-direction: row; /* "= 45" on one line */
}
.wu-ms-grid .wu-ms-total::before { content: "= "; opacity: 0.55; }
.wu-ms-corner { aspect-ratio: 1; }
/* Given boxes are part of the puzzle here, not a worked example to skim —
   printed in full ink. */
.wu-ms-grid .wu-og-given { color: var(--colour-text-primary); }
.wu-ms-grid .wu-og-cell.wu-og-wrong .wu-og-in,
.wu-ms-grid .wu-og-fix { font-size: var(--font-size-sm); }

/* ── THE MATHS STANDARD (#265) ─────────────────────────────────────────────
   Owner, 2026-11-18: "go with your recommendation, apply to all maths
   screens". Three rules, one per question the audit asked:
   1. THE TOP LINE — timer · 1/X on one side, the exercise's NAME in the
      middle, (?) on the other. `headHelp` in maths.js adds the (?) and the
      count to every screen that has no step text; the written methods already
      had both through hintChip. Visible on every screen size here, because a
      drill's progress used to BE its header.
   2. THE THUMB ZONE (phone) — the keypad, the answer chips, the times-table
      pad and the end-of-run buttons sit at the BOTTOM, just above the foot
      bar, on every maths screen. The band is at the top; whatever is left is
      the gap between them. Same place every time, where the thumb already is.
   3. THE END IS AN UPDATE TO THE BAND — the question band becomes the
      verdict, the buttons take the input's place (#261 for the written
      methods; `showResults` in maths.js for the question drill).
   Scoped by `#wu-drill-layer`, the maths view's own layer — vocab is not
   part of this pass, and the id also outranks the shared drill rules. */
.wu-head-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 32px;
  height: 32px;
  margin-left: auto;
  margin-right: var(--space-sm);
  border: 1px solid var(--colour-border);
  border-radius: 999px;
  background: var(--colour-surface);
  color: var(--colour-accent);
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  cursor: pointer;
}
.wu-head-help::after { content: ""; position: absolute; inset: -7px; } /* 44px hit area — -7, the inset is inside the 1px border (#321) */
.wu-head-count {
  display: inline;
  margin-left: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--colour-text-secondary);
}
/* ONE ORDER for the maths top line, whatever the DOM order a screen wrote:
   timer and count on the left, the name centred (it is absolute), the (?) on
   the right. Explicit, because drills.css pushes a railed header's LAST child
   right — which was the count, and put the timer on top of the name. */
#wu-drill-layer > .wu-drill-head > .wu-drill-timer { order: 1; text-align: left; min-width: 0; }
#wu-drill-layer > .wu-drill-head > .wu-og-count { order: 2; margin-left: var(--space-xs); margin-right: auto; }
#wu-drill-layer > .wu-drill-head > .wu-og-hintbtn { order: 3; margin-left: auto; margin-right: 0; }
/* The (?) disc keeps a 44px hit area on EVERY screen (#321): the rule above it
   sat inside the Grid's media query, so the phone top line's (?) was 32px. */
.wu-og-hintbtn { position: relative; }
.wu-og-hintbtn::after { content: ""; position: absolute; inset: -7px; }
/* A hidden part of the drill stays hidden: the pad and the chips set their own
   `display`, which outranks the UA's [hidden] rule (the trap of v549). */
#wu-drill-layer > [hidden] { display: none; }
.wu-drill-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding-block: var(--space-md);
}
:is(.wu-drill-results, .wu-tt-actions) .wu-results-compact .wu-results-line { display: none; } /* the band says it */
.wu-drill-results .wu-results-nudge { text-align: center; max-width: 34ch; margin: 0; }
.wu-q-verdict {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
}
@media (orientation: landscape) and (max-height: 500px) {
  #wu-drill-layer > .wu-drill-results { grid-area: pad; }
}

@media (orientation: portrait) {
  /* 2. The thumb zone. */
  #wu-drill-layer > :is(.wu-numpad, .wu-drill-choices, .wu-drill-results) {
    margin-top: auto;
    margin-bottom: 0;
  }
  #wu-drill-layer .wu-og-wrap > .wu-og-side { margin-top: auto; margin-bottom: 0; }
  #wu-drill-layer:has(.wu-og-side[hidden]) > .wu-og-results { margin-top: auto; margin-bottom: 0; }
  #wu-drill-layer:has(.wu-tt-grid) { justify-content: flex-start; }
  #wu-drill-layer .wu-tt-wrap { flex: 1 1 auto; }
  #wu-drill-layer .wu-tt-grid { flex: 0 1 auto; }
  #wu-drill-layer .wu-tt-side { margin-top: auto; }
  #wu-drill-layer:has(.wu-tt-side[hidden]) > .wu-tt-actions { margin-top: auto; }
  /* The times-table band: the round line and the rows, in white. */
  #wu-drill-layer > .wu-tt-round {
    align-self: stretch;
    margin: var(--space-md) calc(-1 * var(--layer-pad-x)) 0;
    padding: var(--space-md) var(--layer-pad-x) var(--space-sm);
    background: var(--colour-surface);
    border-top: 1px solid var(--colour-border);
    text-align: center;
  }
  #wu-drill-layer .wu-tt-grid {
    margin-top: 0;
    padding-bottom: var(--space-md);
    background: var(--colour-surface);
    box-shadow: 0 0 0 100vmax var(--colour-surface), 0 1px 0 100vmax var(--colour-border);
    clip-path: inset(0 -100vmax -1px);
  }
  /* The picker: its prompt is the band, the twelve numbers the input. */
  #wu-drill-layer > .wu-tt-pick {
    flex: 1 1 auto;
    align-self: stretch;
    margin-top: 0;
    gap: var(--space-md);
  }
  #wu-drill-layer .wu-tt-prompt {
    align-self: stretch;
    margin: var(--space-md) calc(-1 * var(--layer-pad-x)) 0;
    padding: var(--space-lg) var(--layer-pad-x);
    background: var(--colour-surface);
    border-block: 1px solid var(--colour-border);
    text-align: center;
  }
  #wu-drill-layer .wu-tt-pickgrid { margin-top: auto; }
  /* 3. The drill's end: the question band closes under the verdict. */
  #wu-drill-layer:has(> .wu-drill-results) > .wu-drill-q {
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--colour-border);
  }
  /* 1. Every maths screen names itself in its header now, so the name pill
     over the foot bar is a repeat — it stays an icon, and the 64px it reserved
     goes back to the screen (v548's rule, widened from the written methods). */
  body:has(#wu-drill-layer:not(.wu-hidden)) #wu-drill-layer:not(.wu-hidden) {
    padding-bottom: var(--space-sm);
  }
  body:has(#wu-drill-layer:not(.wu-hidden)) .wu-hud .wu-rail-trail-name { display: none; }
}

/* ── THE MATHS STANDARD ON A TABLET (#267) ─────────────────────────────────
   Owner, 2026-11-18: "ok go through with the tablet" → sketches → "agreed.
   proceed". On a sideways tablet (or a desktop):
   1. QUESTION LEFT, INPUT RIGHT — the arrangement the times table and the
      written methods already had, now the question drill's too. The keypad,
      the answer chips and the end buttons share the right-hand column, where a
      right hand holding the tablet rests; the question, the answer line and the
      verdict take the rest. Measured before (1024×768): the drill stacked a
      268px keypad under the question with ~370px empty either side, and a
      choice question jumped to the middle with its chips at the foot.
   2. THE TOP LINE RUNS THE FULL WIDTH of the frame (it was a 560px strip).
   3. THE STEP LINE STAYS on the written methods (there is room), and the (?)
      beside it opens the full help card (hintChip).
   Height-gated like #172's short-landscape rule, the other side of the same
   500px line, so a sideways phone keeps that rule and nothing here. */
#wu-drill-layer > .wu-drill-head { max-width: none; }
.wu-path-bar > .wu-path-help { margin: 0 0 0 var(--space-xs); flex: none; }
.wu-results-compact > .wu-results-help { align-self: center; width: auto; }
@media (orientation: landscape) and (min-height: 501px) {
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    /* The question, its ✓/✗ and its answer line are ONE group, centred in
       the left column: the two 1fr rows are the room above and below it. */
    grid-template-rows: auto minmax(0, 1fr) auto auto auto minmax(0, 1fr);
    grid-template-areas:
      "head head"
      ".    pad"
      "ask  pad"
      "fb   pad"
      "ans  pad"
      ".    pad";
    align-items: center;
    justify-items: center;
    column-gap: var(--space-2xl);
  }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > .wu-drill-head { grid-area: head; justify-self: stretch; }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > .wu-drill-q { grid-area: ask; }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > .wu-drill-feedback { grid-area: fb; }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > .wu-drill-answer { grid-area: ans; }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > :is(.wu-numpad, .wu-drill-choices, .wu-drill-results) {
    grid-area: pad;
    align-self: center;
    margin: 0 var(--space-lg) 0 0;
    padding: 0;
  }
  #wu-drill-layer > :is(.wu-drill-choices, .wu-drill-results) { width: 340px; }
  #wu-drill-layer > .wu-drill-choices .wu-termpad { margin: 0; }
  /* The letter chips are one row of six on a phone; in a column, three across. */
  #wu-drill-layer > .wu-varpad {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 72px);
    grid-auto-columns: auto;
  }
  #wu-drill-layer > .wu-varpad button { height: auto; }
}

/* ── THE MATHS STANDARD, APPLIED TO VOCAB (#268) ───────────────────────────
   Owner, 2026-11-19: "proceed" (the vocab half of the #265 audit). The same
   three rules, scoped by `#wu-vocab-layer`:
   1. THE TOP LINE — timer · 1/X left, NAME centred, (?) right. vocab.js
      re-shapes every new header with one observer (the old progress span is
      the count now). Verb match's verb, which lived in the header, becomes
      the top of the band.
   2. THE THUMB ZONE (phone) — answer chips and keyboards sit at the bottom,
      above the foot bar. #252 R2 had centred them in the gap; the maths audit
      chose the thumb's place, and one rule for both subjects is the point.
   3. The end stays the results page for now (vocab's results are shared with
      the warm-up's part break) — the band verdict is a later step. */
#wu-vocab-layer > .wu-drill-head { max-width: none; }
#wu-vocab-layer > .wu-drill-head > .wu-drill-timer { order: 1; text-align: left; min-width: 0; }
#wu-vocab-layer > .wu-drill-head > .wu-head-count { order: 2; margin-left: var(--space-xs); margin-right: auto; }
#wu-vocab-layer > .wu-drill-head > .wu-head-help { order: 3; margin-left: auto; margin-right: 0; }
.wu-vm-verb {
  margin: var(--space-sm) 0 0;
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  text-align: center;
}
@media (orientation: portrait) {
  #wu-vocab-layer > .wu-verb-options,
  #wu-vocab-layer > .wu-match-stage,
  #wu-vocab-layer > .wu-vt-nav {
    margin-top: auto;
    margin-bottom: 0;
  }
  /* Keyboards are CENTRED in the room below the band (owner, 2026-11-19:
     "query keyboard could be centred on the lower half rather than anchored
     to the bottom") — #252 R2's margin-block: auto. Chips stay at the foot. */
  #wu-vocab-layer > :is(.wu-spell-stage, .wu-alpha-stage) { flex: 1 1 auto; }
  /* ✍️ Conjugate "appears small": the table is read, not glanced at — sized
     from the height so a short phone still fits six rows and the keys. */
  #wu-vocab-layer .wu-cj-verb { font-size: clamp(22px, 3.8vh, 32px); }
  #wu-vocab-layer .wu-cj-tense { font-size: var(--font-size-md); }
  #wu-vocab-layer .wu-cj-table {
    width: auto;
    min-width: 72%;
    margin-inline: auto;
    gap: 8px var(--space-md);
  }
  #wu-vocab-layer .wu-cj-pron { font-size: var(--font-size-md); }
  #wu-vocab-layer .wu-cj-form { font-size: clamp(20px, 3.4vh, 28px); }
  /* Verb match: the verb is the band. */
  #wu-vocab-layer > .wu-vm-verb {
    align-self: stretch;
    margin: var(--space-md) calc(-1 * var(--layer-pad-x)) 0;
    padding: var(--space-lg) var(--layer-pad-x);
    background: var(--colour-surface);
    border-block: 1px solid var(--colour-border);
  }
  /* The header names the exercise, so the name pill over the foot bar is a
     repeat (as on maths, #265). */
  body:has(#wu-vocab-layer:not(.wu-hidden)) #wu-vocab-layer:not(.wu-hidden) {
    padding-bottom: var(--space-sm);
  }
  body:has(#wu-vocab-layer:not(.wu-hidden)) .wu-hud .wu-rail-trail-name { display: none; }
}

/* ── THE RESULTS CARD (#270) ───────────────────────────────────────────────
   Owner, 2026-11-19: the end of an exercise is a card over the work. It reuses
   the sheet backdrop (z 400, over the rail) and the sheet card; the stack
   inside is the ordinary full results, so #120's flourish plays unchanged. */
.wu-results-card { width: min(380px, calc(100vw - 2 * var(--space-md))); }
.wu-results-incard { flex: none; gap: var(--space-sm); }
.wu-results-incard .wu-results-actions { width: 100%; }
.wu-results-peek {
  border: 0;
  background: none;
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--colour-accent);
  cursor: pointer;
}
.wu-results-reopen {
  position: fixed;
  left: 50%;
  bottom: calc(var(--rail-bot-h, 0px) + var(--space-lg) + var(--safe-bottom, 0px));
  transform: translateX(-50%);
  z-index: 300;
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--colour-border);
  border-radius: 999px;
  background: var(--colour-surface);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--colour-text-primary) 18%, transparent);
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  color: var(--colour-text-primary);
  cursor: pointer;
}
.wu-results-veil[hidden], .wu-results-reopen[hidden] { display: none; }
.wu-results-incard .wu-results-actions { gap: var(--space-sm); }
.wu-results-incard .wu-results-actions button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: var(--space-sm);
  white-space: nowrap;
}

/* ── THE TABLET BAND (#271) ────────────────────────────────────────────────
   Owner, 2026-11-19: "a similar question band on tablet — central white and
   right with the hex and floating keypad", plan → "A for maths, B for vocab
   typing". A: the question is a white PAGE on the left; the right is the
   faded lattice (the pane's own .wu-hex-bg, uncovered by a transparent layer)
   with the keypad / chips floating on it as a card. The page is the layer's
   ::before, placed in the grid — the layer is positioned with a z-index, so
   z-index -1 stays inside it, behind its children. */
/* The layer's own lattice (keepLattice) — hidden unless a tablet band
   uncovers it, and faded like the wallpaper behind any activity (#243). */
.wu-layer-lattice { display: none; opacity: 0.5; z-index: -2; }
@media (orientation: landscape) and (min-height: 501px) {
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) { background: transparent; }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > .wu-layer-lattice { display: block; }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad))::before {
    content: "";
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch;
    justify-self: stretch;
    z-index: -1;
    margin: 0;
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
  /* The top line is the PAGE's: as wide as the question column (owner,
     2026-11-19: "keep the top white band with timer count etc aligned with
     the question width"), so the lattice runs to the top on the right. */
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) {
    grid-template-areas:
      "head ."
      ".    pad"
      "ask  pad"
      "fb   pad"
      "ans  pad"
      ".    pad";
  }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > .wu-drill-head {
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border-bottom: 1px solid var(--colour-border);
    box-sizing: border-box;
  }
  /* The input floats on the lattice. */
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > :is(.wu-numpad, .wu-drill-choices, .wu-varpad) {
    padding: var(--space-md);
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
}

/* The same band for the times table, 🪜 Ladder and the written methods (the
   tt / og shell: header · step line · [work | keypad side] · actions). The
   wrap steps aside (display: contents) so its two children join the layer's
   grid: the work and the step line on the white page, the keypad floating on
   the lattice. The solvers still read the layer, the side and the header —
   the same three boxes as before. */
@media (orientation: landscape) and (min-height: 501px) {
  #wu-drill-layer:has(> :is(.wu-tt-wrap, .wu-og-wrap)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "head  ."
      "round side"
      "work  side"
      "acts  side";
    column-gap: var(--space-lg); /* the two-column table needs the width */
    align-items: center;
    justify-items: center;
    background: transparent;
  }
  #wu-drill-layer:has(> :is(.wu-tt-wrap, .wu-og-wrap)) > .wu-layer-lattice { display: block; }
  #wu-drill-layer:has(> :is(.wu-tt-wrap, .wu-og-wrap))::before {
    content: "";
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch;
    justify-self: stretch;
    z-index: -1;
    margin: 0;
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
  #wu-drill-layer:has(> :is(.wu-tt-wrap, .wu-og-wrap)) > .wu-drill-head {
    grid-area: head;
    justify-self: stretch;
    max-width: none;
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border-bottom: 1px solid var(--colour-border);
    box-sizing: border-box;
  }
  #wu-drill-layer:has(> :is(.wu-tt-wrap, .wu-og-wrap)) > .wu-tt-round { grid-area: round; margin-top: var(--space-sm); }
  #wu-drill-layer > :is(.wu-tt-wrap, .wu-og-wrap) { display: contents; }
  #wu-drill-layer > :is(.wu-tt-wrap, .wu-og-wrap) > :not(.wu-tt-side, .wu-og-side) {
    grid-area: work;
    max-width: calc(100% - 2 * var(--space-md)); /* inside the page card */
    box-sizing: border-box;
  }
  #wu-drill-layer > :is(.wu-tt-wrap, .wu-og-wrap) > :is(.wu-tt-side, .wu-og-side) {
    grid-area: side;
    align-self: center;
    margin: 0 var(--space-sm) 0 0;
    padding: var(--space-md);
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
  #wu-drill-layer > :is(.wu-tt-wrap, .wu-og-wrap) > :is(.wu-tt-side, .wu-og-side)[hidden] { display: none; }
  #wu-drill-layer:has(> :is(.wu-tt-wrap, .wu-og-wrap)) > .wu-tt-actions { grid-area: acts; }
}

/* ── Vocab on a tablet (#271) ──
   B — TYPING (✏️ Write it, ⌨️ Typing, ✍️ Conjugate, ⬜ Missing letters,
   🔀 Unscramble, 🅰️ Alphabet): a QWERTY is too wide for a side column, so the
   question is a white BAND across the top (the top line on it) and the
   keyboard floats below on the lattice.
   A — CHOICE and MATCHING (🎯 Tap form, ⏳ Tenses, 🧩 Fill the gap, 💬
   Definition, 🔗 Matching, 🔗 Verb match): the maths arrangement — a white
   page on the left, the chips or the pair columns floating right. 🌐 Verb
   translate has no question to put on a page, and keeps the plain layer. */
@media (orientation: landscape) and (min-height: 501px) {
  /* B */
  #wu-vocab-layer:has(> :is(.wu-spell-stage, .wu-alpha-stage)) { background: transparent; }
  #wu-vocab-layer:has(> :is(.wu-spell-stage, .wu-alpha-stage)) > .wu-layer-lattice { display: block; }
  #wu-vocab-layer:has(> :is(.wu-spell-stage, .wu-alpha-stage)) > .wu-drill-head {
    max-width: none;
    width: auto;
    align-self: stretch;
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
  #wu-vocab-layer > :is(.wu-spell-stage, .wu-alpha-stage) {
    flex: 1 1 auto;
    align-self: stretch;
    max-width: none;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
  }
  #wu-vocab-layer .wu-spell-stage > .wu-spell-card,
  #wu-vocab-layer .wu-alpha-stage > .wu-alpha-ref,
  #wu-vocab-layer .wu-alpha-stage > .wu-alpha-q {
    flex: none;
    align-self: stretch;
    width: auto;
    max-width: none;
    margin: 0;
    padding: var(--space-md) var(--space-md) var(--space-lg);
    border: 1px solid var(--colour-border);
    border-block: 0;
    border-radius: 0;
    background: var(--colour-surface);
    box-shadow: none;
  }
  #wu-vocab-layer .wu-spell-stage > .wu-spell-card,
  #wu-vocab-layer .wu-alpha-stage > .wu-alpha-q {
    border-bottom: 1px solid var(--colour-border);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
  #wu-vocab-layer .wu-spell-stage > .wu-spell-keys,
  #wu-vocab-layer .wu-alpha-stage > #wu-lt-keys {
    margin-block: auto;
    align-self: center;
    width: min(760px, 100%);
    box-sizing: border-box;
    padding: var(--space-md);
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }

  /* A */
  #wu-vocab-layer:has(> :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
      "head ."
      ".    pad"
      "ask  pad"
      ".    pad";
    column-gap: var(--space-2xl);
    align-items: center;
    justify-items: center;
    background: transparent;
  }
  #wu-vocab-layer:has(> :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb)) > .wu-layer-lattice { display: block; }
  #wu-vocab-layer:has(> :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb))::before {
    content: "";
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch;
    justify-self: stretch;
    z-index: -1;
    margin: 0;
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
  #wu-vocab-layer:has(> :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb)) > .wu-drill-head {
    grid-area: head;
    justify-self: stretch;
    max-width: none;
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border-bottom: 1px solid var(--colour-border);
    box-sizing: border-box;
  }
  #wu-vocab-layer > :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb) {
    grid-area: ask;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  #wu-vocab-layer:has(> :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb)) > :is(.wu-verb-options, .wu-match-stage) {
    grid-area: pad;
    align-self: center;
    margin: 0 var(--space-lg) 0 0;
    padding: var(--space-md);
    width: auto;
    min-width: 320px;
    max-width: 440px;
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
}

/* NO FRAME ON A TABLET EITHER (#271, owner 2026-11-19: "the hex background
   should be taking no padding to the screen. this way the keypad and activity
   zone can have the rounded corners and appear to float above the hex — which
   keeps reference to the flower pattern"). #239's phone rule, for the maths
   and vocab layers on a sideways tablet: the pane runs edge to edge, and the
   page and the keypad are the rounded cards floating on its lattice. */
@media (orientation: landscape) and (min-height: 501px) {
  body:has(:is(#wu-drill-layer, #wu-vocab-layer):not(.wu-hidden)) .wu-view-root > :has(> .wu-honeycomb-pane) {
    padding: 0;
  }
  body:has(:is(#wu-drill-layer, #wu-vocab-layer):not(.wu-hidden)) .wu-honeycomb-pane:has(> :is(#wu-drill-layer, #wu-vocab-layer):not(.wu-hidden)) {
    border: none;
    border-radius: 0;
    min-height: var(--vh); /* the 34px it reserved was the margin it no longer has */
  }
}

/* ── THE PHONE BAND FLOATS TOO (#272) ──────────────────────────────────────
   Owner, 2026-11-19: "should the question band get the rounded corners and a
   small left right padding? this would make it consistent" → yes. The phone
   was the last place a white panel ran to the screen edge (#247/#252's
   shadow-and-clip bleed). Now the top line and the band are ONE rounded card
   inside the layer's gutter, floating on the lattice like the tablet's
   (#271). The pieces differ per screen — the maths question / ✓✗ / answer
   line, the times-table round line + rows, the picker prompt, the written
   method's step line + work, the vocab stage, spelling card, Alphabet strip,
   Matching instruction, Verb match's verb — so: every piece loses the bleed
   and gains side borders; the top line closes the card's top when a band
   follows it; the LAST piece of each screen closes the bottom. The QWERTY
   stays full width (#239 — the keys need it). */
@media (orientation: portrait) {
  :is(#wu-drill-layer, #wu-vocab-layer) > :is(.wu-drill-q, .wu-drill-feedback, .wu-drill-answer, .wu-tt-round, .wu-og-hint, .wu-verb-stage, .wu-match-band, .wu-vm-verb),
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-tt-pick > .wu-tt-prompt,
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-tt-wrap > .wu-tt-grid,
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-og-wrap > :is(.wu-og-grid, .wu-col-sum, .wu-sd-sum, .wu-lm-sum, .wu-ms-grid),
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-spell-stage > .wu-spell-card,
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-alpha-stage > :is(.wu-alpha-ref, .wu-alpha-q) {
    align-self: stretch;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    margin-inline: 0;
    margin-top: 0;
    padding-inline: var(--space-md);
    background: var(--colour-surface);
    box-shadow: none;
    clip-path: none;
    border: 1px solid var(--colour-border);
    border-block: 0;
    border-radius: 0;
  }
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-og-wrap > :is(.wu-og-grid, .wu-col-sum, .wu-sd-sum, .wu-lm-sum, .wu-ms-grid) {
    justify-content: center;
  }
  /* The top line closes the card's top. */
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-drill-head:has(+ :is(.wu-drill-q, .wu-tt-round, .wu-tt-pick, .wu-og-hint, .wu-verb-stage, .wu-spell-stage, .wu-alpha-stage, .wu-match-band, .wu-vm-verb)) {
    align-self: stretch;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    margin-inline: 0;
    padding-inline: var(--space-sm);
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }
  /* The last piece closes its bottom. */
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-drill-answer,
  :is(#wu-drill-layer, #wu-vocab-layer).wu-q-terms > .wu-drill-q,
  :is(#wu-drill-layer, #wu-vocab-layer):has(> .wu-drill-answer[hidden]) > .wu-drill-q,
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-tt-pick > .wu-tt-prompt,
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-tt-wrap > .wu-tt-grid,
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-og-wrap > :is(.wu-og-grid, .wu-col-sum, .wu-sd-sum, .wu-lm-sum, .wu-ms-grid),
  :is(#wu-drill-layer, #wu-vocab-layer) > :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb),
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-spell-stage > .wu-spell-card,
  :is(#wu-drill-layer, #wu-vocab-layer) > .wu-alpha-stage > .wu-alpha-q {
    border-bottom: 1px solid var(--colour-border);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--colour-text-primary) 12%, transparent);
  }
}

/* ── ONE PAGE WIDTH ON EVERY MATHS SCREEN (#273) ──────────────────────────
   Owner, 2026-11-19, on a tablet: "recheck width standardisation on maths …
   there is plenty of space for the question frame. keep the width
   consistent". Measured at 1024×768 before: the question drill's page was
   530px (an `auto` keypad column plus a 2xl gap and a 24px margin), the times
   table and the written methods' 586px (an lg gap and an 8px margin) — the
   same screen, two page widths. Now one rule for all of them: the right-hand
   column is a FIXED width, the keypad card's own (84px keys × 3 + gaps +
   padding = 302px), and one lg gap. The page takes the rest, so it is the
   same width on every maths screen of a device, and wider than either was.
   The written methods' solvers subtract the page's inner padding (maths.js,
   `split === 2`), so a wide sum cannot run past the page's edge. */
@media (orientation: landscape) and (min-height: 501px) {
  #wu-drill-layer { --band-side: 302px; }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)),
  #wu-drill-layer:has(> :is(.wu-tt-wrap, .wu-og-wrap)) {
    grid-template-columns: minmax(0, 1fr) var(--band-side);
    column-gap: var(--space-lg);
  }
  #wu-drill-layer:has(> .wu-numpad:not(.wu-pin-pad)) > :is(.wu-numpad, .wu-drill-choices, .wu-drill-results, .wu-varpad),
  #wu-drill-layer > :is(.wu-tt-wrap, .wu-og-wrap) > :is(.wu-tt-side, .wu-og-side) {
    justify-self: stretch;
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
  }
  /* The keypad never gives up its column to a wide sum. */
  #wu-drill-layer > .wu-og-wrap > .wu-og-side { z-index: 1; position: relative; }
  /* The step line wraps inside the page instead of running off its left. */
  #wu-drill-layer:has(> :is(.wu-tt-wrap, .wu-og-wrap)) > .wu-tt-round {
    max-width: calc(100% - 2 * var(--space-md));
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
  }
}

/* The vocab ending (#278): the input steps aside once the band is the verdict.
   These elements set their own display, so `hidden` needs saying here. */
#wu-vocab-layer > .wu-verb-options[hidden],
#wu-vocab-layer .wu-spell-keys[hidden],
#wu-vocab-layer #wu-lt-keys[hidden] { display: none !important; }
#wu-vocab-layer .wu-q-verdict { margin: 0; }

/* THE PHONE BAND RUNS THE FULL WIDTH ON GRID AND MAGIC SQUARES TOO (#278,
   owner: "the exercise zone and the top with the timer and help align. there
   were some gaps"). Their width is SOLVED inline for the cells (1fr tracks, so
   the box cannot simply stretch), which left the white band 26px (Grid) and
   46px (Magic squares) short of the top line on a 390px phone. The box now
   takes the band's full width and pads its sides back to the solved width, so
   the cells keep their size and the band meets the top line edge to edge. */
@media (orientation: portrait) {
  #wu-drill-layer > .wu-og-wrap > :is(.wu-og-grid, .wu-ms-grid) {
    width: 100% !important;
    box-sizing: border-box;
    padding-inline: max(var(--space-sm), calc((100% - var(--og-w, 100%)) / 2));
  }
}

/* ONE PAGE WIDTH ON EVERY VOCAB CHOICE SCREEN (#278) — #273's rule for maths,
   applied to vocab's layout A. The chips / pair columns sat in an `auto`
   column between 320 and 440px, so the page was 614px on 💬 Definition and
   734px on ⏳ Tenses, 🔗 Matching and Verb match at 1280×800 — the same screen
   type, two page widths, and the top line with it. Now a fixed 420px right
   column (wide enough for Definition's longest meanings and Matching's two
   columns) and the maths gap. */
@media (orientation: landscape) and (min-height: 501px) {
  #wu-vocab-layer { --band-side: 420px; }
  #wu-vocab-layer:has(> :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb)) {
    grid-template-columns: minmax(0, 1fr) var(--band-side);
    column-gap: var(--space-lg);
  }
  #wu-vocab-layer:has(> :is(.wu-verb-stage, .wu-match-band, .wu-vm-verb)) > :is(.wu-verb-options, .wu-match-stage) {
    justify-self: stretch;
    width: auto;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
  }
}

/* ── FINAL AUDIT B + C (#296) ─────────────────────────────────────────────
   B — MATCHING ON THE PAGE. Under #271 a match board was treated like answer
   chips and floated in the right-hand card, leaving the white page empty but
   for one instruction line (owner audit, 2026-11-21). A match board IS the
   exercise, so on a sideways tablet it gets the page: header, instruction or
   verb, then the pairs across the page. 🌐 Verb translate had no page at all
   ("keeps the plain layer") — it is the same board, so it joins (C).
   Later than the #271 "A" rules at equal specificity, so it wins. */
@media (orientation: landscape) and (min-height: 501px) {
  #wu-vocab-layer:has(> .wu-match-stage) {
    display: grid;
    /* One page WIDTH, not the whole screen (#305, owner 2026-11-21: "verb
       translate has mimi in a weird position"). A full-bleed page left the
       lattice no free cell, so Mimi fell to the small corner ON the page's
       edge. The pairs are ~460px across; the page takes what they need plus
       a margin and centres, and the lattice shows either side. */
    grid-template-columns: minmax(0, min(720px, 100%));
    justify-content: center;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "head" "ask" "pad";
    column-gap: 0;
    align-items: center;
    justify-items: center;
    background: transparent;
  }
  #wu-vocab-layer:has(> .wu-match-stage) > .wu-layer-lattice { display: block; }
  #wu-vocab-layer:has(> .wu-match-stage)::before {
    content: "";
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch;
    justify-self: stretch;
    z-index: -1;
    margin: 0;
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
  #wu-vocab-layer:has(> .wu-match-stage) > .wu-drill-head {
    grid-area: head;
    justify-self: stretch;
    max-width: none;
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border-bottom: 1px solid var(--colour-border);
    box-sizing: border-box;
  }
  #wu-vocab-layer:has(> .wu-match-stage) > :is(.wu-match-band, .wu-vm-verb) {
    grid-area: ask;
    margin: var(--space-lg) 0 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  #wu-vocab-layer:has(> .wu-match-stage) > .wu-match-stage {
    grid-area: pad;
    align-self: center;
    justify-self: center;
    width: min(720px, 92%);
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: var(--space-md);
    background: none;
    border: 0;
    box-shadow: none;
  }

  /* C — the 🔢 times-table PICKER was a bare white page. It joins the typing
     screens' arrangement: the lattice behind, the top line as a white strip,
     the twelve numbers on a floating card, whose own top line carries the
     name and the (?) — a separate strip held nothing else. */
  #wu-drill-layer:has(> .wu-tt-pick) { background: transparent; }
  #wu-drill-layer:has(> .wu-tt-pick) > .wu-layer-lattice { display: block; }
  #wu-drill-layer > .wu-tt-pick {
    align-self: center;
    margin-block: auto;
    width: auto;
    padding: var(--space-lg) var(--space-xl);
    background: var(--colour-surface);
    border: 1px solid var(--colour-border);
    border-radius: 18px;
    box-shadow: 0 8px 28px color-mix(in srgb, var(--colour-text-primary) 16%, transparent);
  }
}

/* #296: the times-table picker's header lives inside its card. */
.wu-tt-pick > .wu-drill-head {
  position: static;
  align-self: stretch;
  width: auto;
  max-width: none;
  margin: calc(-1 * var(--space-sm)) 0 var(--space-sm);
  padding: 0 0 var(--space-sm);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--colour-border);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.wu-tt-pick > .wu-drill-head > .wu-drill-progress {
  position: static;
  transform: none;
  flex: 1;
  text-align: left;
  font-size: var(--text-md, 1rem);
}
.wu-tt-pick > .wu-drill-head > :is(.wu-drill-timer, .wu-head-count) { display: none; }

/* ✍️ CONJUGATE ON A SIDEWAYS TABLET (#302, owner 2026-11-21: "the conjugate
   page was the one not being used well. keyboard half hidden and half of the
   page white"). Measured at 1024×600: a 333px card across the full width with
   the table in one narrow column, and the keyboard's last 82px off the bottom.
   TWO COLUMNS (owner, same day: "keep the 5 conjugations on the right and the
   left for the larger verb with icon etc? having them split is odd" — a first
   cut split the PERSONS across two columns, which broke the table a child
   reads top to bottom). Left: the verb, large, with its icon, the tense and 🔊.
   Right: the whole table, one person per row. Type scales with the height. */
@media (orientation: landscape) and (min-height: 501px) {
  #wu-vocab-layer .wu-cj-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    grid-template-areas:
      "verb  table"
      "tense table"
      "say   table";
    grid-template-rows: auto auto 1fr;
    align-items: center;
    column-gap: var(--space-lg);
    row-gap: var(--space-xs);
  }
  #wu-vocab-layer .wu-cj-card > .wu-cj-verb { grid-area: verb; align-self: end; font-size: clamp(26px, 5vh, 40px); }
  #wu-vocab-layer .wu-cj-card > .wu-cj-tense { grid-area: tense; }
  #wu-vocab-layer .wu-cj-card > .wu-spell-say { grid-area: say; align-self: start; justify-self: center; width: 44px; min-width: 0; padding: 0; }
  #wu-vocab-layer .wu-cj-card > .wu-cj-table {
    grid-area: table;
    width: auto;
    min-width: 0;
    margin: 0;
    gap: clamp(4px, 1vh, 8px) var(--space-md);
  }
  #wu-vocab-layer .wu-cj-form { font-size: clamp(18px, 3.4vh, 30px); }
  #wu-vocab-layer .wu-cj-pron { font-size: clamp(13px, 2.2vh, var(--font-size-md)); }
}

/* 📝 Recap (#303) — the list of every answer, inside the results card. While
   it is open the score stack folds away so the list has the card's height. */
.wu-results-recap {
  border: 1px solid var(--colour-border);
  border-radius: 999px;
  background: var(--colour-surface);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  color: var(--colour-text-primary);
  cursor: pointer;
  min-height: 44px;
}
.wu-results-recap:hover { border-color: var(--colour-accent); }
.wu-recap-open > :is(.wu-results-emoji, .wu-results-score, .wu-results-time, .wu-results-nudge, .wu-results-extra) { display: none; }
.wu-recap { width: 100%; }
.wu-recap[hidden] { display: none; }
.wu-recap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: none;
  overflow-y: auto;
  display: grid;
  gap: var(--space-xs);
  text-align: left;
}
.wu-recap-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-button);
  background: var(--colour-bg);
}
.wu-recap-no { background: color-mix(in srgb, var(--colour-danger) 8%, var(--colour-surface)); }
.wu-recap-mark {
  flex: none;
  width: 1.4em;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
}
.wu-recap-ok .wu-recap-mark { color: var(--colour-success-ink); }
.wu-recap-no .wu-recap-mark { color: var(--colour-danger); }
.wu-recap-body { display: grid; gap: 2px; min-width: 0; }
.wu-recap-q { font-size: var(--font-size-sm); color: var(--colour-text-primary); overflow-wrap: anywhere; }
.wu-recap-given { font-size: var(--font-size-sm); color: var(--colour-text-secondary); text-decoration: line-through; }
.wu-recap-a {
  font-family: var(--font-display);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-md);
  color: var(--colour-success-ink);
}
.wu-recap-ok .wu-recap-a { color: var(--colour-text-primary); }

/* ONE SCROLL, NOT TWO (#303, owner 2026-11-21: "how can the UI be cleaner now
   to avoid all the nested vertical scrolling in modals"). With the recap open
   the card stops scrolling and becomes a column the height of the screen: the
   toggle at the top, the list in the middle as the ONLY scroller, Repeat /
   Done pinned at the foot. The peek link and 🙋 fold away while reading — the
   score view still has them — and the card widens so a word problem wraps
   less. */
.wu-results-card:has(.wu-recap-open) {
  width: min(560px, calc(100vw - 2 * var(--space-md)));
  max-height: calc(var(--vh, 100vh) - 2 * var(--space-md));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wu-results.wu-recap-open {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.wu-recap-open > .wu-recap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.wu-recap-open > :is(.wu-results-peek, .wu-results-help) { display: none; }
.wu-recap-open > .wu-results-actions { flex: none; }

