/* Layout — app shell, split-pane home, responsive collapse. */

.wu-app {
  min-height: var(--vh);
}

.wu-view-root {
  position: relative;
  min-height: 0;
}

/* ── Home — full-width honeycomb with floating calendar overlay ─── */

.wu-home {
  position: relative;
  padding: var(--space-md);
  height: 100%;
  min-height: var(--vh);
  box-sizing: border-box;
}

.wu-honeycomb-pane {
  position: relative;
  /* Shows through the hex gaps — quiet padding, not line weight */
  background: var(--colour-grid-bg);
  border: 1px solid var(--colour-border);
  /* Outermost surface — rounds concentrically with the phone screen so the
     margin reads parallel at the corners (v265). */
  border-radius: var(--radius-shell);
  overflow: hidden;
  height: 100%;
  min-height: calc(var(--vh) - 34px);
}

/* HUD — top-left. The ★ pill + its dropdown live in .wu-hud-bar; breadcrumb
   "progression" pills (section / trail) stack VERTICALLY below the pill (better
   on mobile than running sideways). */
.wu-hud {
  position: absolute;
  /* Clears the camera wherever the phone puts it (v265) — the pane behind it
     still runs full-bleed. Equals --space-md on web/PWA, where the inset is 0. */
  top: var(--content-top);
  left: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  z-index: 5;
}

/* The pill row — relative so the dropdown anchors under the pill, not under the
   stacked breadcrumb pills below it. */
.wu-hud-bar {
  position: relative;
  display: flex;
  align-items: center;
}

/* Dropdown the ★ menu collapses/expands (decision #50, restyle #56) — drops
   DOWN below the pill as a flat card of labelled rows. */
.wu-hud-menu {
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 224px;
  padding: var(--space-xs);
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.wu-hud[data-collapsed="true"] .wu-hud-menu {
  display: none;
}

/* Flat menu row — icon + text label, no round button, follows the flat flower
   look (decision #56) */
.wu-hud-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  border-radius: var(--radius-button);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.wu-hud-ic {
  flex: 0 0 1.7em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.wu-hud-lbl {
  white-space: nowrap;
}

/* Profile avatar dot inside its menu row */
.wu-prof-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-family: var(--font-display);
  background: var(--colour-text-secondary);
}

.wu-hud-item:hover {
  background: color-mix(in srgb, var(--colour-brand) 16%, transparent);
}

/* At-a-glance chips BELOW the ★ Menu pill (home only): 🔥 week streak,
   🧾 awaiting parent ✓, ⭐ stars to spend. Separate tappable pills (each opens
   a "what is this?" sheet with a shortcut); each hides at 0. The pill above
   stretches to the row's width so pill + chips read as one block. */
.wu-hud-stats {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.wu-hud > .wu-hud-bar {
  align-self: stretch;
}

.wu-hud .wu-brand-chip {
  width: 100%;
  justify-content: center;
}

.wu-hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--colour-border);
  background: var(--colour-surface);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
  white-space: nowrap;
  cursor: pointer;
}

.wu-hud-stat:hover {
  border-color: var(--colour-text-secondary);
}

.wu-hud-stat[hidden] {
  display: none;
}

.wu-stat-streak {
  background: color-mix(in srgb, var(--colour-warning) 14%, var(--colour-surface));
  border-color: color-mix(in srgb, var(--colour-warning) 55%, var(--colour-border));
}

.wu-stat-confirm {
  background: color-mix(in srgb, var(--colour-accent) 12%, var(--colour-surface));
  border-color: color-mix(in srgb, var(--colour-accent) 55%, var(--colour-border));
}

.wu-stat-stars {
  background: color-mix(in srgb, var(--colour-brand) 16%, var(--colour-surface));
  border-color: color-mix(in srgb, var(--colour-brand) 55%, var(--colour-border));
}

/* Brand pill — the ★ menu toggle, amber to match the app icon (decision #56):
   amber fill, white star + wordmark. */
.wu-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  height: 44px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-pill);
  background: var(--colour-brand);
  border: 1px solid var(--colour-brand-deep);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--colour-brand-deep) 32%, transparent);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast),
              background var(--transition-fast);
}

/* Keep the ★ optically centred with the wordmark */
.wu-brand-chip > span {
  display: block;
  font-size: 17px;
  line-height: 1;
  color: #fff;
}

.wu-brand-chip:hover {
  transform: translateY(-2px);
  background: var(--colour-brand-deep);
  border-color: var(--colour-brand-deep);
}

/* Section badge — identifies the current sub-flower (Maths / Vocab / Settings) */
.wu-hud-section {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--sec-colour) 14%, var(--colour-surface));
  border: 1px solid color-mix(in srgb, var(--sec-colour) 50%, var(--colour-border));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--colour-text-primary);
}

.wu-hud-section-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

/* Hide the HUD while a drill / panel layer is up — those have their own ✕.
   EXCEPT the games layer (v240, owner call): a game keeps the ★ Menu pill and
   its section badge on screen so the WarmUp frame is always present and the
   game grows BELOW it, the same way Maths and Vocab sub-views behave. The
   game grows BELOW it. (The rail used to be offset by --hud-stack-h to clear
   a top-left pill stack; that stack and that reserve are both gone — v395.) */
/* THE RAIL SURVIVES ACTIVITIES (owner, 2026-08-16). This used to hide the HUD
   outright during a drill, because the old top-left pill stack ate the space a
   drill needs. A 56px spine does not, and keeping it means the child always has
   the same exit and the same way home — instead of a ✕ whose position depended
   on which view built the screen. Lite mode strips the home-only blocks so the
   spine is just the quit and the ★. */
/* Hides .wu-rail-STATS, not .wu-rail-below — see the note on the lite rules
   further down. The wrapper also holds .wu-rail-extra, which is the view's own
   control and must survive an activity. */
.wu-honeycomb-pane:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer)) .wu-rail-top,
.wu-honeycomb-pane:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer)) .wu-rail-stats {
  display: none;
}

/* ── HUD LITE — an activity is running, so the HUD shrinks to the ★ ───────
   (owner, v287: "when an activity starts I reckon the HUD can be reduced to
   the Star to make space… this will free up screen space.")

   A DRILL already hides the HUD outright (rule above). The gap was the
   PANE PUZZLES — Path and Cross Words run alongside the flower rather than in
   the drill layer, so they kept the full stack: ★ Menu · VOCAB · GB → PT ·
   CROSS WORDS, four rows deep down the left. That is what forced Cross Words
   to reserve 190px of width purely to clear it, on the axis boards are already
   short of.

   What survives: the ★ (still the menu, still the way home) and any trail
   badge that carries a ✕ — in games that pill IS the quit control, and hiding
   it would re-create the "the ✕ is not visible on the APK" bug twice reported
   in 2026-07. Everything else is a label for something the child is currently
   looking at. */
.wu-honeycomb-pane:is(:has(.wu-path-bar), :has(.wu-game-layer:not(.wu-hidden))) .wu-hud {
  gap: var(--space-xs);
}

/* The wordmark is a bare text node next to the star, so it can't be hidden
   directly — zero the button's type and restore it on the star itself. */
.wu-honeycomb-pane:is(:has(.wu-path-bar), :has(.wu-game-layer:not(.wu-hidden))) .wu-brand-chip {
  font-size: 0;
  /* 44px minimum — collapsing the pill to a star (v287) shrank it to a 39px
     target, which the v289 audit then caught. The star is the only way back to
     the menu while an activity is running, so it is the last control that
     should be hard to hit. */
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  line-height: 1;
}

.wu-honeycomb-pane:is(:has(.wu-path-bar), :has(.wu-game-layer:not(.wu-hidden))) .wu-brand-chip > span {
  font-size: var(--font-size-lg);
}

/* The home stats go in lite mode. This rule used to carry the trail badge's
   exception as well; the trail lives on the spine since v416, where lite mode
   never reaches it. */
.wu-honeycomb-pane:is(:has(.wu-path-bar), :has(.wu-game-layer:not(.wu-hidden))) .wu-hud-stats {
  display: none;
}
/* The games rail's top reserve and Path's rule hiding the pill both went with
   the pill itself (v416): the trail is a circle on the spine now, so nothing
   above a panel needs clearing. */

.wu-hud-item[aria-pressed="true"] {
  background: color-mix(in srgb, var(--colour-brand) 22%, transparent);
}

/* Blurred backdrop behind the calendar modal — tap to close.
   ABOVE the rail (z 60), see the panel's note below. */
.wu-cal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: color-mix(in srgb, var(--colour-text-primary) 14%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: wu-overlay-in 140ms ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .wu-cal-backdrop { animation: none; }
}

/* Calendar opens as a modal above the blurred backdrop.

   ⚠️ FULL WIDTH, AND ABOVE THE RAIL (owner, 2026-09-24: "calendar shows
   broken. why not keep full width but above the rail? its a modal that will be
   closed once used so no need to see the rail"). This REVERSES the v440 fix,
   which cleared the spine by insetting the panel by --rail-w — correct for a
   panel that shares the screen, and wrong for this one: it cost 56px of width
   on the axis a 7-column month grid needs most (measured at 375×812, 343 → 287,
   the cells squeezed against a spine that had no job while the modal was open).

   So the modal OWNS the screen instead of sitting beside the rail: the backdrop
   covers the spine and both sit above it (z 70/71 over the rail's 60). Once the
   spine is covered there is no content centre to be off from, so the panel is
   simply viewport-centred with safe-area gutters.

   This deliberately differs from the journey panel (#152a), which keeps the
   rail ON TOP so ★ Home and ✕ never go. The difference is the exit: that panel
   is a place you navigate away from, this one is dismissed — it has its own ✕
   and a tap-outside, so the one thing a covered rail costs (a tap on ★ now
   closes the calendar first) is the documented close gesture, not a dead end.

   Border-box, because there is no global reset here (#90) and the 1px border
   would otherwise hang outside the max-width cap. */
.wu-calendar-floating {
  position: fixed;
  top: 50%;
  left: calc(var(--safe-left) + var(--space-lg));
  right: calc(var(--safe-right) + var(--space-lg));
  margin-inline: auto;
  max-width: 920px;
  box-sizing: border-box;
  transform: translateY(-50%);
  max-height: calc(var(--vh) - 2 * var(--space-lg));
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  z-index: 71;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.wu-calendar-floating.wu-hidden,
.wu-cal-backdrop.wu-hidden {
  display: none;
}

/* ── ★ centre-tile menu (decision #63) — sub-flower overlay, blurred home ── */
.wu-centre-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--colour-text-primary) 14%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: wu-overlay-in 140ms ease forwards;
}

/* The reported "opens the secondary flower with a flicker" (v278).
   The backdrop had NO animation: the whole screen snapped to full blur and
   tint in a single frame, while the menu's hex tiles then took the honeycomb's
   0.5 s wu-fadeUp to arrive. Background instantly, foreground half a second
   later — that mismatch is what reads as a flash.

   The calendar shares this backdrop style and never showed it, which is the
   tell: its panel is static HTML that lands in one piece, so there is nothing
   to lag behind. Only the centre menu puts an ANIMATING flower on top.

   Two halves to the fix: ramp the backdrop (which also spreads the cost of
   promoting a full-screen backdrop-filter layer, the expensive part on the
   APK) and shorten the tiles so both land together. */
.wu-centre-stage .wu-hex-wrap {
  animation-duration: 220ms;
}

@keyframes wu-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wu-centre-backdrop { animation: none; }
  .wu-centre-stage .wu-hex-wrap { animation-duration: 1ms; }
}

.wu-centre-menu {
  position: relative;
  padding: var(--space-xl);
}

.wu-centre-stage {
  position: relative;
}

/* Empty website slots — faint ➕ pointers to the parent settings */
.wu-centre-add {
  opacity: 0.45;
}

.wu-calendar-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--colour-text-secondary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
}

/* 44px of HIT AREA under a 26px disc — the house pattern (#88–#90), measured
   here because this is the control that closes the modal and it was a bare 26px
   button with nothing under it. The disc stays 26px: a bigger circle would
   crowd the month nav, and it is the target that has to clear the floor, not
   the paint. Nothing else sits in that corner, so there is no neighbouring
   hit area for it to overlap (#150a).

   Grown DOWN and LEFT rather than centred on the disc: the panel clips its own
   overflow in short landscape, so a centred 44px box loses its top and right
   edges to the corner radius — measured 44×37 instead of 44×44. Offset by the
   disc's own 6px inset it lands flush inside the content box, a true 44×44. */
.wu-calendar-close::after {
  content: "";
  position: absolute;
  top: -6px;
  right: -6px;
  width: 44px;
  height: 44px;
}

.wu-calendar-close:hover {
  color: var(--colour-text-primary);
  background: color-mix(in srgb, var(--colour-text-secondary) 18%, transparent);
}

/* Streak chip — lives inside the calendar modal */
.wu-streak-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin: var(--space-md) var(--space-md) 0;
  padding: var(--space-xs) var(--space-md);
  background: color-mix(in srgb, var(--colour-warning) 14%, var(--colour-surface));
  border: 1px solid color-mix(in srgb, var(--colour-warning) 40%, transparent);
  border-radius: var(--radius-pill);
  width: fit-content;
}

.wu-streak-flame {
  font-size: var(--font-size-md);
  line-height: 1;
}

.wu-streak-count {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--colour-warning);
  line-height: 1;
}

.wu-streak-label {
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--colour-text-secondary);
}

/* ── Responsive — a tighter gutter for the floating calendar on a phone ─── */

/* ⚠️ A GUTTER, NOT A WIDTH. This said `width: calc(100vw - 2 * --space-md)`,
   and with `left` and `width` both set the box is over-constrained, so `right`
   is DROPPED — measured at 375×812 the panel ran 48px off the right edge.
   Setting only the insets keeps one way of saying where the panel goes. */
@media (max-width: 720px) {
  .wu-calendar-floating {
    left: calc(var(--safe-left) + var(--space-md));
    right: calc(var(--safe-right) + var(--space-md));
  }
}

/* ⚠️ THE MODAL IS TWO COLUMNS WHEREVER THERE IS ROOM — AND THE STREAK CHIP
   BELONGS IN THE RIGHT ONE (owner, 2026-09-26: "just checked and tablet is
   still with the streak count on the left").

   #163 built this arrangement INSIDE the short-landscape query, so it fired on
   a landscape phone and nowhere else: a tablet at 768×1024 and a laptop at
   1280×800 both fell through to the old flex card — head spanning the full
   width, chip parked at the top-left above it. Nothing about the arrangement
   was ever height-driven; it is simply what the card should look like whenever
   it has two columns at all. So it moves out here, and only the genuine
   short-screen concessions stay behind the query below.

   The condition is a media LIST, i.e. OR: above the calendar's own 720px
   stacking breakpoint, or in landscape at any width — a 640×360 phone is 640
   wide and still wants two columns, since stacking a modal on the axis it has
   least of is the thing #163 was fixing.

   `display: contents` is what makes it one grid. The streak chip is rendered by
   home.js OUTSIDE the calendar, so taking the calendar's own box out of the flow
   lets its head / grid / panel join the card's grid as siblings of the chip, and
   the chip takes the top-right cell without being moved in the DOM. Scoped
   `:not(.wu-hidden)` because .wu-hidden is a LATER rule at the same specificity
   — a bare `display: grid` here would out-order it and paint a closed calendar
   over the flower. */
@media (min-width: 721px), (orientation: landscape) {
  .wu-calendar-floating:not(.wu-hidden) {
    display: grid;
    grid-template-columns: minmax(0, var(--cal-month-w)) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "head chip"
      "grid panel";
    column-gap: var(--space-sm);
    max-height: calc(var(--vh) - 2 * var(--space-md));
    overflow: hidden;
  }

  .wu-calendar-floating > .wu-calendar {
    display: contents;
  }

  /* Aligned with the summary's own tabs below it (both --space-md in from the
     column edge), and held clear of the floating close ✕. */
  .wu-calendar-floating > .wu-streak-chip {
    grid-area: chip;
    align-self: center;
    margin: 0 34px 0 var(--space-md);
  }

  /* The ✕ sits over the RIGHT column now, so the month header stops reserving
     room for it — 28px is most of a day cell out of a column that is exactly
     seven day cells wide. */
  .wu-calendar-floating .wu-cal-head {
    margin-right: 0;
  }

  /* align-self, and it is the line that makes the rest work: .wu-calendar sets
     `align-items: start`, so a column is sized to its CONTENT and simply spills
     out of its track — measured, a 347px grid in a 262px row with overflow-y
     already set and nothing to scroll. Stretching it to the track is what turns
     the overflow into a scroll. It is a NET on a tall screen: nothing overflows
     on a tablet or a laptop, and `auto` scrolls only when there is something to
     scroll. */
  .wu-calendar-floating .wu-cal-grid,
  .wu-calendar-floating .wu-cal-panel {
    align-self: stretch;
    min-height: 0;
    overflow-y: auto;
  }

  /* The stacked-phone rule turns the panel's divider through 90° (border-left
     → border-top). A landscape phone is 640 wide, so it matches that rule AND
     is laid out in two columns here — the divider has to come back round with
     the layout, or the summary reads as the row below the month instead of the
     column beside it. */
  .wu-calendar-floating .wu-cal-panel {
    border-left: 1px solid var(--colour-border);
    border-top: none;
  }
}

/* ⚠️ SHORT LANDSCAPE — WHAT A 393px-TALL SCREEN GIVES UP.
   Found by measuring the v442 report rather than asked for: at 851×393 the
   modal's content needed 444px against a 345px budget, so the last week of the
   month sat 84px below the fold AND the month name scrolled away with it — a
   card cut off mid-month with nothing anchored, which is what reads as broken.
   Width cannot fix it: the cells are `aspect-ratio: 4/5` over a `min-height`,
   so a wider grid column makes them TALLER.

   Everything here is a concession to HEIGHT, which is why it stays behind the
   query while the two-column arrangement above does not. Portrait is untouched
   (it never clipped) and so is the calendar PAGE, which is not in this modal. */
@media (orientation: landscape) and (max-height: 500px) {
  /* The month column is the scarce axis here, so the GRID gives up its side
     padding before the DAYS give up the 44px floor — 32px of padding is three
     quarters of a day cell. The weekday row also PINS: a month grid whose column
     headings have scrolled off is the one thing worse than a clipped one, since
     "is the 24th a Thursday?" is most of what this overlay is read for. The grid
     gives up its top padding and the sticky row takes it, so the band the cells
     scroll through is covered by the heading rather than showing a sliver of the
     row above. */
  .wu-calendar-floating .wu-cal-grid {
    padding: 0 var(--space-sm) var(--space-sm);
  }

  .wu-calendar-floating .wu-cal-dayname {
    position: sticky;
    top: 0;
    z-index: 1;
    padding-top: var(--space-sm);
    background: var(--colour-surface);
  }

  /* Cells stop being WIDTH-driven. `aspect-ratio: 4/5` is right on a tall
     screen and perverse on a wide-short one: below 720px the calendar stacks,
     so the grid spans the whole modal and the ratio blows each cell up to
     99px tall — measured at 640×360, one week visible in a 100px track. With
     the ratio off, `min-height` governs and the same track shows two and a
     half. */
  .wu-calendar-floating .wu-cal-cell {
    aspect-ratio: auto;
    /* And the tall-screen 58px floor comes down to the TAP floor, which is what
       lets all six week rows fit: 6 × 58 + gaps + the weekday row needed 339px
       in a 310px box at 851×393, six rows at 44px need 307. "Keep calendar full
       height" means the whole month on screen, and 44px square is the smallest
       a day may be either way. */
    min-height: var(--cal-day-min);
  }
}

/* Generic hidden utility */
.wu-hidden {
  display: none !important;
}

/* Maths + Vocab + Parent + Games views share the home pane chrome */
.wu-maths,
.wu-vocab,
.wu-parent,
.wu-games {
  position: relative;
  padding: var(--space-md);
  height: 100%;
  min-height: var(--vh);
  box-sizing: border-box;
}

/* ── Toast — fade-in/out status message ───────────────── */

.wu-toast {
  position: fixed;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: color-mix(in srgb, var(--colour-surface) 96%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-pill);
  padding: var(--space-sm) var(--space-lg);
  /* ABOVE every overlay (v291). Sheets and the PIN gate sit at 400, so a toast
     fired while one is open rendered BEHIND the blurred backdrop — reported on
     the avatar picker when buying with too few stars, which is exactly the
     moment the message matters. A toast is the app's last word on what just
     happened; nothing should ever cover it. */
  z-index: 900;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--colour-text-primary);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
  max-width: calc(100% - var(--space-2xl));
  width: max-content;
  text-align: center;
  white-space: normal; /* a long notice wraps instead of running off a phone (#392) */
  overflow-wrap: anywhere;
}

.wu-toast.wu-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══ LEFT RAIL (decision #98) ═══════════════════════════════════════════════
   Replaces the HUD's top-left pill stack with a brand-amber spine down the left
   edge. Keeps the .wu-hud outer class so HUD-lite (#87), the layout reserves and
   setHudTrail() all keep working untouched — .wu-hud.wu-rail simply outranks the
   base .wu-hud rules.

   WHY THE LEFT EDGE: the top band is where every recurring layout bug has come
   from (§6 — the Android status overlay draws over it). A spine with its handle
   at mid-height clears that overlay AND the bottom gesture bar, and mid-height
   is where a thumb rests on a tablet in landscape.

   WIDTH: 56px, which is NARROWER than the left reserve the layout already keeps
   for the HUD (190px full / 76px lite, #87), so content needs no re-flowing. */
.wu-hud.wu-rail {
  position: fixed;
  left: var(--safe-left, 0px);
  top: 0;
  bottom: 0;
  width: var(--rail-bar-w);
  padding: 0;
  display: block;
  z-index: 60;
  pointer-events: none; /* only the spine + drawer take taps, not the column */
}

.wu-rail-spine {
  pointer-events: auto;
  position: absolute;
  inset: 0;
  width: var(--rail-bar-w);
  /* The ★ is positioned absolutely at 50% rather than flex-centred: flex would
     centre the star+stats COLUMN, which pushes the handle above the midpoint by
     half the stats' height (measured 72px off at 1334×936). The brief is the
     HANDLE at mid-height — that is the thumb's resting position on a tablet in
     landscape, and the point furthest from both system bands. */
  display: block;
  background: linear-gradient(
    180deg,
    var(--colour-brand) 0%,
    var(--colour-brand-deep) 100%
  );
  border-radius: 0 var(--radius-shell) var(--radius-shell) 0;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
}

/* The radius NEVER changes (owner: "to swap between rounded and squared is
   odd"). v302 squared the join on open to kill the grey crescent behind the
   spine's rounded edge — which fixed the gap but made the bar read as a
   different shape while opening, worse than either state on its own. The
   drawer instead starts at x=0 and pads itself past the rail, so its white
   fills that crescent and the amber sits ON white rather than on the app
   background. It is painted BEFORE the spine in the DOM, so the spine covers
   the padded strip. */

/* ── The ★ handle, with today's warm-up as an arc around its rim ───────────── */
.wu-rail-star {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--rail-star);
  height: var(--rail-star);
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
/* Hit area ≥44px regardless of the disc's visual size (#88–#90). */
.wu-rail-star::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: max(44px, 100%);
  height: max(44px, 100%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.wu-rail-star:hover {
  transform: translate(-50%, -50%) scale(1.06); /* keep the centring translate */
}
.wu-rail-star-glyph {
  font-size: calc(var(--rail-star) * 0.42);
  line-height: 1;
  color: var(--colour-brand-deep);
}
.wu-rail-arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* start the arc at 12 o'clock */
}
.wu-rail-arc circle {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
}
.wu-rail-arc-bg {
  stroke: color-mix(in srgb, var(--colour-brand-deep) 22%, transparent);
}
.wu-rail-arc-fg {
  stroke: var(--colour-brand-deep);
  transition: stroke-dashoffset 420ms ease;
}
/* Day's warm-up complete — the ring goes green, holds for a beat so the child
   SEES it close, then fades away (owner: "it should fade after it's completed").
   A progress ring with no progress left to show is just decoration around the
   button, and the ★ has a job of its own. */
.wu-rail[data-full="1"] .wu-rail-arc-fg {
  stroke: var(--colour-success);
}
.wu-rail[data-full="1"] .wu-rail-arc-fg,
.wu-rail[data-full="1"] .wu-rail-arc-bg {
  animation: wu-arc-done 900ms ease 1200ms forwards;
}
@keyframes wu-arc-done {
  to {
    opacity: 0;
  }
}

/* Scrim behind the open drawer. The board does NOT move (a flower that re-fits
   on every menu open would resize the whole board each time — the flicker class
   of #257/#272/#276, and on a phone there is nothing to re-centre into anyway).
   Dimming instead says "a panel over your flower" rather than "your flower went
   away", and it gives tap-outside-to-close a visible affordance it never had. */
.wu-rail-scrim {
  position: fixed;
  inset: 0;
  background: rgba(43, 41, 38, 0.34);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease;
  z-index: -1; /* under the spine and drawer, over everything else */
}
.wu-rail[data-collapsed="false"] .wu-rail-scrim {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .wu-rail[data-full="1"] .wu-rail-arc-fg,
  .wu-rail[data-full="1"] .wu-rail-arc-bg {
    animation-duration: 1ms;
  }
  .wu-rail-scrim {
    transition: none;
  }
}

/* ── Stat readouts: FIXED SLOTS, dimmed at zero ───────────────────────────── */
/* Directly below the handle, so the readouts hang off the control they describe
   and both stay clear of the top overlay and the gesture bar. */
/* IN FLOW inside .wu-rail-below — deliberately NOT positioned. It was absolute
   in v296 when it hung straight off the spine; once .wu-rail-below became its
   wrapper the stale rule made it overlap .wu-rail-quick, because a percentage
   `top` resolves against the nearest POSITIONED ancestor and .wu-rail-below's
   height is only the shortcut column. Two shortcuts hid it; the third (📖) put
   the streak on top of the diary (owner screenshot, 2026-08-16). */
.wu-rail-stats {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}
.wu-rail-stat {
  position: relative;
  width: 40px;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 0;
  border: none;
  border-radius: var(--radius-card);
  /* DARKEN, don't lighten (v360, contrast audit). This was
     rgba(255,255,255,0.22) — a white wash under WHITE text, on an already-light
     amber spine. It lifted the chip off the spine visually and took the numbers
     to 1.54:1, the worst reading on the home screen, on the one thing here that
     is pure information: the streak, the approvals count, the stars. Same wash
     in black reads as a recess rather than a lift and takes white text to
     AA (measured 5.2:1). */
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}
.wu-rail-stat::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
/* Dimmed, NOT hidden: hiding shifts the others so the ⭐ is never in the same
   place and muscle memory can't form — and "none yet" is information a missing
   chip doesn't carry (same call as #79's greyed times tables). */
.wu-rail-stat[data-zero="true"] {
  opacity: 0.4;
}
.wu-rail-stat:hover {
  background: rgba(255, 255, 255, 0.34);
}
.wu-rail-stat-ic {
  font-size: 15px;
  line-height: 1;
}
.wu-rail-stat-n {
  font-family: var(--font-mono);
  font-size: max(10px, 11px); /* floored — every layout bug here came from a floor */
  font-weight: var(--font-weight-bold);
  line-height: 1;
}

/* ── The drawer ───────────────────────────────────────────────────────────── */
.wu-rail-drawer {
  pointer-events: auto;
  position: absolute;
  left: 0; /* runs UNDER the spine so its white fills the rounded corner */
  top: 0;
  bottom: 0;
  /* ⚠️ BORDER-BOX, and it is load-bearing. There is no global `* { box-sizing }`
     in this project (#90), so a bare `width` is the CONTENT width — the clamp
     below reads as "never wider than the screen" and, in content-box, bounds
     only the middle: 336 content + 88 padding + 1 border = 425px on a 360px
     phone, i.e. the right-hand column simply off the screen. The clamp was
     written believing it bounded the whole drawer; this is what makes it true. */
  box-sizing: border-box;
  /* 320, not 280: three 92px activity buttons + 2 gaps need 284px of CONTENT,
     and this box spends 89px on the rail inset, the right padding and the
     border. So the grid gets three columns wherever the screen allows and
     falls to two below ~389px, where the clamp takes over. That reflow IS
     the narrow-screen protection — never a zoom, which would blur the type
     and drag tap targets under the 44px floor (#88-#90). */
  width: min(calc(320px + var(--rail-bar-w)), calc(100vw - var(--space-md)));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: calc(var(--safe-top) + var(--space-md)) var(--space-md)
    calc(var(--safe-bottom) + var(--space-md)) calc(var(--rail-bar-w) + var(--space-md));
  border-radius: 0 var(--radius-shell) var(--radius-shell) 0;
  background: var(--colour-surface);
  border-right: 1px solid var(--colour-border);
  box-shadow: 6px 0 28px rgba(0, 0, 0, 0.18);
  transition: transform 200ms ease, opacity 160ms ease;
}
.wu-rail[data-collapsed="true"] .wu-rail-drawer {
  transform: translateX(-8px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.wu-rail-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wu-rail-group-t {
  margin: 0 0 var(--space-xs);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--colour-text-secondary);
}
/* Rows stay CHILD-sized (#98). The flower's real value was never the hex shape,
   it was unmissable targets — a 44px settings list would be a downgrade for a
   7-year-old, so the rail is adult-thin but its rows are not. */
.wu-rail-row {
  min-height: 52px;
  gap: var(--space-sm);
  border-radius: var(--radius-card);
  font-size: var(--font-size-md);
}
.wu-rail-row-ic {
  font-size: 22px;
}

/* ⬡ ACTIVITY BUTTONS (owner, 2026-08-30) — "keep the 6 activities items as
   buttons to compress the menu height … to try to differentiate the activity
   items from the informative ones".

   Two jobs in one change. The SHAPE separates doing from configuring, so the
   child does not have to read a label to tell a game from a sound toggle; and
   icon-over-label roughly halves the height (6 rows at 52px = 324px, 6 buttons
   ≈ 150px), which on several screens is the difference between the drawer
   fitting and needing a scroll.

   `auto-fit` rather than a fixed 3 columns: the drawer is narrower on a phone,
   and a hard 3-up would squeeze "Practice Maths" into a column too thin to read.
   It settles at 3 where there is room and 2 where there is not, and the minimum
   is the widest label's comfortable width rather than a guess at column count. */
.wu-rail-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wu-rail-grid .wu-rail-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: var(--space-xs);
}
.wu-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  /* Comfortably past the 44px floor on both axes even at the narrowest
     column — these are the most-tapped controls in the drawer. */
  min-height: 74px;
  padding: var(--space-xs);
  border-radius: var(--radius-card);
  text-align: center;
}
.wu-rail-btn .wu-hud-ic {
  flex: none;
  font-size: 26px;
  line-height: 1;
}
.wu-rail-btn .wu-rail-row-img {
  width: 26px;
  height: 26px;
}
/* Two lines, then ellipsis — "Practice Maths" and "School websites" both wrap,
   and a third line would make the buttons uneven. */
.wu-rail-btn .wu-hud-lbl {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--font-size-sm);
  line-height: 1.2;
  /* RESERVE the second line rather than relying on every label being two words.
     Whether a label wraps depends on the column width, which is fluid — at 3
     columns "Practice Maths" wraps and "Study Timer" does not, so the icons sat
     at two different heights across one row. A fixed 2-line box makes the icon
     and label land identically in every tile at every width, and it is the same
     reasoning as the rail's dimmed stat slots (#98): reserve the space so
     nothing shifts. */
  min-height: 2.4em;
  text-wrap: balance;
}
/* SVG activity icons (Maths, Vocab, Reading …) need an explicit box — as an
   <img> they have no intrinsic size here, so without this they collapse. */
.wu-rail-row-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
/* The spine reads as one control: the whole bar opens the drawer. */
.wu-rail-spine {
  cursor: pointer;
}
/* The avatar disc must stay CIRCULAR. .wu-hud-ic sizes by `flex: 0 0 1.7em`,
   which at the rail's 22px row icon is 37px WIDE while the height still comes
   from line-height — a 37×24 ellipse. Pin both axes on the rail's own row so the
   disc can't be reshaped by the icon font size again. */
.wu-rail-row .wu-prof-ic {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  font-size: 16px;
}

/* ── HUD-lite (#87): during an activity, the ★ alone ──────────────────────── */
.wu-rail[data-lite="1"] .wu-rail-stats {
  display: none;
}
.wu-rail[data-lite="1"] .wu-rail-spine {
  background: none;
  box-shadow: none;
}

/* ── Persistent mode: DEFERRED, deliberately ──────────────────────────────────
   #98 proposed the drawer staying open at ≥900px (the split-screen behaviour).
   Measured at 1334×936 it overlaps the board by 47px, because every layout
   reserve in this app is still keyed to the OLD top-left HUD geometry. Making it
   persistent means re-deriving those reserves (--hud-stack-h, the games-rail
   gates, Path's and Cross Words' clue reserves) and re-running
   tools/layout-audit.js across five viewports — deliberate work, not a media
   query. Until then the drawer is an OVERLAY at every size, which is the same
   contract the old HUD dropdown had: nothing is covered unless it is open. */

@media (prefers-reduced-motion: reduce) {
  .wu-rail-drawer,
  .wu-rail-arc-fg,
  .wu-rail-star {
    transition: none;
  }
}

/* ── Spine blocks: countdown above the ★, shortcuts + stats below ──────────── */
.wu-rail-top {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  bottom: calc(50% + var(--rail-star) / 2 + var(--space-sm));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse; /* grows UP from the star, so it never jumps */
  align-items: center;
  gap: 4px;
}
.wu-rail-below {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: calc(50% + var(--rail-star) / 2 + var(--space-sm));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}
/* Anchored to the FOOT of the rail (owner, 2026-08-17) — profile at the bottom,
   ★ in the centre, ✕ at the top. Absolute rather than in flow so it stays put
   whatever the stats and countdown do above it, and clear of the gesture bar via
   --safe-bottom. */
.wu-rail-quick {
  pointer-events: auto;
  position: absolute;
  bottom: calc(var(--space-md) + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
/* Set by fitRail() when a block's item does not fit the half it lives in.
   display:none rather than opacity so it stops consuming the budget. */
.wu-rail-clip {
  display: none !important;
}

/* Countdown chip — activity colour, remaining count. A finished activity keeps
   its slot and shows ✓ (tapping it practises) instead of vanishing: a chip that
   disappears shifts every chip below it, which is the muscle-memory problem the
   fixed stat slots exist to avoid. */
.wu-rail-chip,
.wu-rail-q[hidden] {
  /* `display: flex` below beats the browser's own [hidden] rule, so a button
     marked hidden stayed on screen — the 🗓️ showed on a profile with the
     Weekly Dock switched off and opened an empty window (owner, 2026-11-21). */
  display: none !important;
}
.wu-rail-q {
  position: relative;
  width: 40px;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 0;
  border: none;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.9);
  color: var(--colour-text-primary);
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}
/* 44px hit area under a 40px visual — the rule the whole #88–#90 audit was about. */
.wu-rail-chip::after,
.wu-rail-q::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.wu-rail-chip:hover,
.wu-rail-q:hover {
  transform: scale(1.06);
}
.wu-rail-chip[data-done="true"] {
  opacity: 0.55;
}
.wu-rail-chip-ic,
.wu-rail-q-ic {
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wu-rail-chip-img,
.wu-rail-q-img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}
.wu-rail-chip-n {
  font-family: var(--font-mono);
  font-size: max(10px, 11px); /* floored — every layout bug here came from a floor */
  font-weight: var(--font-weight-bold);
  line-height: 1;
  color: var(--chip, var(--colour-text-secondary));
}
/* The profile disc keeps its circle on the spine too. */
.wu-rail-q .wu-prof-ic {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  font-size: 14px;
}

/* ── Inside an activity, the spine is the ★ (and the view's own control) ───────
   Same selector the HUD-lite rules use, extended to the rail's own blocks. The
   countdown and the stats are a HOME concern; mid-drill they are a distraction
   at the worst possible moment, and the space is the scarce axis.

   ⚠️ These target .wu-rail-STATS, not the .wu-rail-below wrapper (owner,
   2026-08-28: "keep the language icon visible on the rail so the child is
   always aware of the focus language setting through vocab exercises").

   The wrapper holds TWO things — the stats and .wu-rail-extra, the view's own
   control — and hiding the container took both. The sub-view rule at the bottom
   of this file already got this right and says so in as many words ("`.wu-rail-
   extra` therefore stays"), but the moment an activity started these rules
   overruled it, so vocab's language pair vanished exactly when it mattered most:
   during ✏️ Spell it, whose entire instruction is "spell it in Portuguese".

   The line HUD-lite is drawing is not "hide everything but the ★" — it is
   REWARDS AND NAVIGATION GO, TASK CONTEXT STAYS. A ⭐ ticking up mid-drill is a
   distraction; the language you are answering in is the question. Same class of
   bug as #102: a rule written against a container before that container gained
   a second child. */
.wu-honeycomb-pane:is(:has(.wu-path-bar), :has(.wu-game-layer:not(.wu-hidden))) .wu-rail-top,
.wu-honeycomb-pane:is(:has(.wu-path-bar), :has(.wu-game-layer:not(.wu-hidden))) .wu-rail-stats,
.wu-rail[data-lite="1"] .wu-rail-top,
.wu-rail[data-lite="1"] .wu-rail-stats {
  display: none;
}
/* 🧭 Path keeps the top bar of every other exercise (#322): the circle and ✕
   only. It runs on the flower's own pane, not in a drill layer, so the flower's
   chips stayed up — the language (which the prompt already names) and the
   ❓ help-MODE toggle, which belongs to the Practice list and sat beside the
   band's own (?). */
.wu-honeycomb-pane:has(.wu-path-bar) .wu-rail-extra { display: none !important; }

/* ── The spine carries the SECTION (owner, 2026-08-16) ─────────────────────────
   Replaces the top-left section pill entirely. Those pills were still anchored
   to the old HUD geometry (left: --space-md, i.e. inside the 56px spine) and so
   rendered underneath the rail; re-anchoring was the small fix, adopting the
   colour is the better one — a bar that is always on screen can say where you
   are for free, and nothing can overlap it.

   --rail-tint is set inline by railHtml from the section's colour. Home leaves
   it unset and keeps brand amber. */
.wu-rail-spine {
  background: linear-gradient(
    180deg,
    var(--rail-tint, var(--colour-brand)) 0%,
    color-mix(in srgb, var(--rail-tint, var(--colour-brand)) 78%, #000) 100%
  );
}

/* The ★ handle is the one thing that does NOT tint — it stays the brand mark so
   the child always has the same target, whatever section they are in. */
.wu-rail-star-glyph {
  color: var(--colour-brand-deep);
}

/* A view's own control, as a rail line rather than a floating pill. A COLUMN
   because a screen may carry more than one (the journey's 📋 and 📍); with a
   single chip this is identical to the block it replaced. */
.wu-rail-extra {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}
/* A CIRCLE, like everything else on the spine (owner, device test 1.7: the
   journey's rounded squares "look out of place" beside the round ★, trail and
   profile). ONE rule for every view's chip: the journey's 📋 Log and 📍 Today,
   the games' ℹ️ Help and 🎟️ left, vocab's language pair. The icon sits over its
   word and the word is always shown: a rail control that only names itself
   when opened is one the child has to try to find out what it does.

   44px, the tap floor, so the hit area IS the circle. `flex: none` because it
   is a flex ITEM in a column that would otherwise shrink it into an oval (#90).
   No global box-sizing here, so the 44 is border-box on purpose.

   A modal's chrome column reuses .wu-rail-extra itself (#164), so it inherits
   every number here rather than carrying a second copy — which is how two
   renderings of one control drift apart (#117). Only the COLOURS differ, below:
   a white disc reads on the amber spine and vanishes on white paper. */
.wu-rail-extra .wu-hud-chip {
  position: relative;
  flex: none;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  color: var(--colour-text-primary);
  font-family: var(--font-display);
  font-size: 10px; /* the font floor: the word is the widest thing in the circle */
  font-weight: var(--font-weight-bold);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}
.wu-rail-extra .wu-hud-chip:active { background: var(--colour-bg); }
/* The chip's own font-size is the WORD's, so an icon written as bare text
   inherits it and renders unreadably small. It gets its own size. */
.wu-rail-extra .wu-chip-ic,
.wu-rail-extra .wu-hud-chip-ic {
  font-size: 15px;
  line-height: 1;
}
/* The language pair has no word under a picture: the two flags ARE the label,
   on one line through the middle of the circle, where it is widest. Its label
   span steps aside so 🌍 and "Mixed" stack like any other chip's icon and word. */
.wu-rail-extra #wu-vocab-lang-lbl { display: contents; }
.wu-rail-extra .wu-lang-pair {
  display: flex;
  align-items: center;
  gap: 1px;
}
.wu-rail-extra .wu-lang-flag {
  font-size: 12px;
  line-height: 1;
  vertical-align: 0;
}
.wu-rail-extra .wu-lang-to {
  font-size: 10px;
  color: var(--colour-text-secondary);
}
.wu-rail-extra .wu-hud-chip::after { content: none; }

/* ── The TRAIL: where you are, as a circle on the spine (owner, 2026-09-13) ──
   "the pill on the top left should move below the x on the rail. we keep the
   logo in a circle. the child taps and the pill expands for a small amount of
   time. this will free up in full the panels for games, maths, etc."
   The pill used to sit fixed at the top-left of the CONTENT, which is the band
   every panel wants: it cost the games rail a reserve (#127) and had to be
   hidden outright over Path's clue bar (#87). On the spine it costs the content
   nothing. It is the TOP of the spine, always, and the ✕ sits under it during
   an activity (owner, after seeing a gap above the circle on flowers with no
   ✕: "it looks odd placed down when there is no X"). It names the place for
   about 3 s on arrival and on a tap, then shrinks back to the icon; the name
   opens to the RIGHT, over the content. */
.wu-rail-trail-slot {
  position: absolute;
  top: var(--support-top);
  left: calc((var(--rail-bar-w) - 44px) / 2);
  pointer-events: auto;
}
.wu-rail-trail {
  /* No global box-sizing here (#90): the 44px has to include the border. */
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  height: 44px;
  min-width: 44px;
  /* 1 + 8 + 26 + 8 + 1 = 44: the icon box has to hold the widest emoji at 18px
     (measured 25px); at 22px every trail icon overflowed by 1-3px (v417 audit). */
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--sec-colour) 14%, var(--colour-surface));
  border: 1px solid color-mix(in srgb, var(--sec-colour) 50%, var(--colour-border));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--colour-text-primary);
  white-space: nowrap;
  cursor: pointer;
}
.wu-rail-trail-ic {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}
.wu-rail-trail-name {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 240ms ease, opacity 180ms ease, margin 240ms ease;
}
.wu-rail-trail.wu-open .wu-rail-trail-name {
  max-width: 60vw;
  margin: 0 4px 0 8px;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .wu-rail-trail-name { transition: none; }
}

/* SUB-TRAIL (#205) — a second circle under the subject one, naming the
   exercise. Same 44px pitch as the ✕, which steps down one place while a sub
   is showing so the three read top to bottom: subject, exercise, way out. */
.wu-rail-sub-slot {
  position: absolute;
  top: calc(var(--support-top) + 44px + var(--space-sm));
  left: calc((var(--rail-bar-w) - 44px) / 2);
  pointer-events: auto;
}
.wu-rail-sub-slot:empty { display: none; }
.wu-hud:has(.wu-rail-sub-slot:not(:empty)) .wu-rail-quit-slot {
  top: calc(var(--support-top) + 2 * (44px + var(--space-sm)));
}

/* MODE CIRCLE (#219) — 🏃 Practice, always named. The next 44px place down
   from whatever is above it; the ✕ steps down once more while it shows. */
.wu-rail-mode-slot {
  position: absolute;
  top: calc(var(--support-top) + 44px + var(--space-sm));
  left: calc((var(--rail-bar-w) - 44px) / 2);
  pointer-events: auto;
}
.wu-rail-mode-slot:empty { display: none; }
.wu-hud:has(.wu-rail-sub-slot:not(:empty)) .wu-rail-mode-slot {
  top: calc(var(--support-top) + 2 * (44px + var(--space-sm)));
}
/* Practice reads as the activity colour's opposite number: a solid amber
   circle, so it is told apart from the tinted subject/exercise circles at a
   glance without needing its name open. */
.wu-rail-mode {
  background: color-mix(in srgb, var(--sec-colour) 55%, var(--colour-surface));
  border-color: var(--sec-colour);
}
.wu-hud:has(.wu-rail-mode-slot:not(:empty)) .wu-rail-quit-slot {
  top: calc(var(--support-top) + 2 * (44px + var(--space-sm)));
}
.wu-hud:has(.wu-rail-mode-slot:not(:empty)):has(.wu-rail-sub-slot:not(:empty)) .wu-rail-quit-slot {
  top: calc(var(--support-top) + 3 * (44px + var(--space-sm)));
}

/* Quit slot — top of the spine, shown only while an activity is running. */
.wu-rail-quit-slot {
  position: absolute;
  /* Under the trail circle (v416), which holds the top of the spine. Both start
     from --support-top, the one rule for "how far down does chrome start". */
  top: calc(var(--support-top) + 44px + var(--space-sm));
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
}
/* 44px, not 40 — measured in-browser at 40x40 (2026-08-17), under the Phase 6
   floor that #88-#90 established. This is now the close control for the WHOLE
   app, so it is the last one that should be hard to hit. */
.wu-rail-quit {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  /* White and bold on a thin outline, NOT a filled disc (owner, 2026-08-17:
     "less presence on the screen"). It sits on the rail's own tint, so the
     glyph already has a coloured ground to read against — the white disc was
     doing that job twice and pulling the eye to a control you use once. The
     TARGET is untouched at 44px; only the paint got quieter. */
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.wu-rail-quit:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.9);
}
/* 44px hit area — this is the control reported invisible/unhittable twice. */
.wu-rail-quit::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
/* The v315 restyle (transparent ground, white bold glyph) was being undone
   HERE: this older hover rule sits after it at equal specificity, so it won,
   repainting the disc solid white on hover — the exact "presence" the restyle
   removed. Third time in this file that a later same-specificity rule has
   quietly reverted an earlier one (see also the tokens.css inset note and
   .wu-hud-ic); when restyling, grep the class, don't just edit the first hit. */
/* An activity is running — strip the home-only blocks wherever it was set.
   .wu-rail-stats, not the .wu-rail-below wrapper: the view's own control lives
   in there too and has to survive the activity (see the lite rules above). */
.wu-rail-quit[hidden] { display: none; } /* the practice fallback ✕ (#217) */
.wu-rail[data-activity="1"] .wu-rail-top,
.wu-rail[data-activity="1"] .wu-rail-stats {
  display: none;
}

/* ── Off the main flower the rail is a MENU (owner, 2026-08-16) ────────────────
   The stats are a BOARD concern — streak, approvals and stars answer "how is my
   week going", which is not the question mid-activity, and a ⭐ ticking up
   during a drill is a distraction at the worst moment. The quick shortcuts go
   for the same reason.

   What survives is the ★ (which IS Home here) and the view's own control as an
   icon under it — one or two things, which is exactly why the drawer is not
   justified off the board. `.wu-rail-extra` therefore stays. */
/* ⚠️ .wu-rail-quick JOINS THEM (owner, 2026-09-23) — reversing the 2026-08-17
   call that kept the profile as one of three permanent points. It collided with
   the games' ℹ️/🎟️ chips on a phone: the disc is bottom-ANCHORED while
   .wu-rail-extra grows DOWN from the ★, so the two meet as soon as a view owns
   two controls and the gesture bar lifts the foot (--safe-bottom).
   It belongs with the board-only blocks anyway: "which child's board is this" is
   the same kind of question as the streak and the countdown, and switching child
   RELOADS the app (#47), so the one place it must not be offered is mid-drill. */
.wu-rail[data-sub="1"] .wu-rail-top,
.wu-rail[data-sub="1"] .wu-rail-stats,
.wu-rail[data-sub="1"] .wu-rail-quick,
.wu-rail[data-sub="1"] .wu-rail-drawer,
.wu-rail[data-sub="1"] .wu-rail-scrim {
  display: none;
}
/* Nothing to open, so the bar must not offer itself as a control (#86). */
.wu-rail[data-sub="1"] .wu-rail-spine {
  cursor: default;
}

/* ── One ✕, in the rail (owner, 2026-08-17) ──────────────────────────────────
   rail.js adopts the visible screen's close control and forwards clicks to it.
   The original stays in the DOM — it still owns the close BEHAVIOUR, and
   .click() works on a display:none element — but it stops being a second, and
   inconsistently placed, target. Header type simply re-flows left, which reads
   better than the gap `visibility: hidden` would leave. */
.wu-drill-quit[data-railed] {
  display: none;
}

/* ── THE MODAL CHROME COLUMN (#164) ─────────────────────────────────
   A full-screen modal covers the rail, so the rail's pills go with it. This is
   the same stack in the same order at the same edge — where you are, then the
   way out, then this screen's own controls — rebuilt from the SAME slot
   elements, so setHudTrail / setRailExtra / syncQuit need no idea which host
   they are writing into (chromeHost in rail.js).

   Anchored on --support-top like the spine's trail slot, so the circle does not
   JUMP when a flower hands over to a modal; and at the layer's own x-inset, so
   the column and the content that clears it are measured from one number.

   z 72: one above the modal (71), which is one above the rail (60). It sits
   OUTSIDE the layer in the view's markup, because every parent screen replaces
   the layer's innerHTML wholesale — chrome that is rebuilt is chrome that
   flickers, and the ✕ would be destroyed mid-adoption. */
:root { --chrome-w: calc(44px + var(--space-sm)); }

.wu-modal-chrome {
  position: fixed;
  top: var(--support-top);
  left: calc(var(--layer-pad-x) + var(--safe-left));
  z-index: 72;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  /* flex-start, not center: the trail pill grows sideways to show its name, and
     a centred column would shove the ✕ and the chips as it opened. They share
     a left edge instead, exactly as they do on the 56px spine. */
  align-items: flex-start;
  pointer-events: none;
}
.wu-modal-chrome > * { pointer-events: auto; }
/* Nothing to show is not the same as an empty column with gaps in it. */
.wu-modal-chrome:not(:has(button)) { display: none; }

/* ⚠️ A SURFACE THAT COVERS THE COLUMN TAKES IT DOWN WITH IT. The journey's log
   panel slides over the map from the same edge — full screen in portrait, a
   400px side panel in landscape — and the column sits at x=24, so it is covered
   either way. Left drawn it is the MAP's chrome (📋 Log, 📍 Today) floating over
   a panel those controls have nothing to do with, printed across its first rows.
   The panel carries its own ✕, so nothing is stranded: closing it brings the
   column back. Caught by LOOKING at it — an elementFromPoint probe said the
   column was on top and reported that as a pass, which is the wrong question
   when the complaint would have been "why is Log written over my list". */
.wu-honeycomb-pane:has(.wu-jrnpage-panel-open) .wu-modal-chrome { display: none; }

/* The slots are absolutely placed ON THE SPINE, where the ★ owns the middle and
   everything else is measured from an edge. In the column they are plain flex
   items, so the stack's own gap does the spacing. */
.wu-modal-chrome .wu-rail-trail-slot,
.wu-modal-chrome .wu-rail-sub-slot,
.wu-modal-chrome .wu-rail-mode-slot,
.wu-modal-chrome .wu-rail-quit-slot,
.wu-modal-chrome .wu-rail-below {
  position: static;
  top: auto;
  left: auto;
  transform: none;
}
/* The below-stack and the extra are centred columns ON THE SPINE, where every
   control is 44px wide and centring is invisible. Here the column is only as
   wide as its widest child — and the trail pill WIDENS while it announces — so
   centred chips would slide sideways for three seconds on arrival. They take
   the column's own left edge instead. */
.wu-modal-chrome .wu-rail-below,
.wu-modal-chrome .wu-rail-extra {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
}
/* A screen with no chips of its own leaves the slot empty, and an empty flex
   item still earns the column's gap — 8px of nothing under the ✕. */
.wu-modal-chrome .wu-rail-below:empty { display: none; }

/* COLOURS, and this is the only thing that genuinely differs from the spine.
   Both controls are painted for an amber ground — the ✕ is white on a white
   55% outline, the chips are white discs — and on a white modal that is white
   on white. They take the trail pill's construction instead: a light disc with
   a real border, which is what makes three different controls read as one set. */
/* ⚠️ THE ACTIVITY STATE NEEDS THESE SAME FOUR RULES and cannot share this
   selector list — it is gated on a media query now (owner: "side rail hiding is
   useful on mobile only"), and a media query cannot be applied to half a list.
   Its copy lives at the end of this file under THE RAIL SHEDS ITS SPINE; the
   declarations are three lines each and both sides name the other. */
.wu-modal-chrome .wu-rail-quit {
  box-sizing: border-box;
  border-color: var(--colour-border);
  background: var(--colour-surface);
  color: var(--colour-text-primary);
}
.wu-modal-chrome .wu-rail-quit:hover {
  background: var(--colour-bg);
  border-color: var(--colour-text-secondary);
}
.wu-modal-chrome .wu-hud-chip {
  border: 1px solid var(--colour-border);
  background: var(--colour-surface);
}
.wu-modal-chrome .wu-hud-chip:active { background: var(--colour-bg); }

/* ── THE RAIL SHEDS ITS SPINE DURING AN ACTIVITY (#164 step 2) ────────────
   Owner, 2026-09-26: "this activity should go full screen and hide the side
   rail while keeping the title pill and the x."

   The rail is the BOARD's chrome — where you are in the week, what is left
   today, who you are. Inside one activity all of that is already answered, and
   the only questions left are what am I doing, how do I get out, and how do I
   get home. HUD lite (#87) had already shed everything else; what was left to
   remove is the 56px the SPINE itself costs every screen.

   WHAT SURVIVES: the trail circle, the ✕ and the ★. The owner named the first
   two; the ★ stays because it is the only way HOME from a drill (the ✕ goes
   back one step, #143) and because the abandon guard (#115) intercepts both.
   It is already a white disc with its own shadow, so it needs no repaint.

   WHY IT IS PURE CSS: every rail control is positioned inside the spine, so
   nothing moves in the DOM and `chromeHost`/`setHudTrail`/`syncQuit` are all
   untouched. `.wu-hud.wu-rail` is ALREADY `pointer-events: none` with only its
   children taking taps, so releasing the spine's own `auto` is the whole of it
   — the 56px strip stops swallowing taps meant for the board underneath.

   THE DISCRIMINATOR excludes both of the other layers that share the class:
   games (`.wu-game-layer` — #164 measured zero gain there, landscape is
   height-bound) and the parent area (`.wu-layer-modal` — it covers the rail
   outright and carries its own chrome column). Same shape as HUD lite's own
   `:has()` a few hundred lines up, which is the precedent for all of this. */
/* ⚠️ MOBILE ONLY (owner, 2026-09-27: "side rail hiding is useful on mobile
   only"), which reverses the un-deployed v451 rule that applied it everywhere.
   Measured, that is the honest scope: releasing the spine's 56px is worth a
   fifth of a portrait phone's width and a landscape phone's only spare axis,
   and worth nothing on a laptop, where the pane is 1248px wide and the 56px it
   gives back is 4% that buys no extra content. On a big screen the spine is
   just furniture the child can always see, which is what it is for.

   WIDTH-OR-LANDSCAPE, the same gate the games rail uses (#88) and the calendar
   after it (#163/v444): a landscape phone is 851px WIDE, so a width test alone
   would miss the screen that needs this most, and a tablet in landscape is 768+
   tall so it correctly keeps the spine. */
/* #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 all {
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) { --rail-w: 0px; }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-spine {
    background: none;
    box-shadow: none;
    pointer-events: none;
  }
  /* The spine's `auto` was covering every child, so each survivor re-asserts it.
     Listed rather than `> *`: a slot is a full-width block, and re-enabling the
     empty ones would put an invisible 56px catcher back over the board. */
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) :is(
    .wu-rail-trail-slot, .wu-rail-sub-slot, .wu-rail-mode-slot, .wu-rail-quit-slot
  ) { pointer-events: auto; }

  /* ── THE FLOATING COLUMN TAKES THE FRAME'S OWN MARGIN ────────────────────
     Owner, same message: "the activity frame outline … at the moment they have
     different paddings from the screen edge and dont align."

     Measured: every control is centred in the 56px bar, so it sits at
     (56 − 44) / 2 = 6px from the screen edge, while the pane — the rounded
     surface that IS the frame — sits at --space-md, 16px. With the spine
     painted those 6px are correct, because the control is centred in a column
     you can see. With the spine gone there is no column, so 6px is just a
     control hanging 10px off the frame's left edge.

     The TOP already lines up and is left alone: --support-top is --space-md
     plus the insets, and on web that is the pane's own 16px, so the pill's top
     edge and the frame's top edge share a line. On a device they deliberately
     part company — the pane runs full-bleed behind the camera (§6/v265) while
     chrome must clear it, and a pill under the cutout is invisible AND inert
     (#101). Aligned where it can be, clear where it must be. */
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) :is(.wu-rail-trail-slot, .wu-rail-sub-slot, .wu-rail-mode-slot) { left: var(--space-md); }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-quit-slot {
    left: var(--space-md);
    transform: none;
  }
  /* ── THE ★ GOES WITH THE SPINE ───────────────────────────────────────
     Owner, 2026-09-27: "the central star should hide when the rail hides."
     This reverses the un-deployed v451 call to keep it, and the owner is right
     on the rule the rest of this block is built from: the ★ is the BOARD's
     control — the menu, the week's arc, the way back to the flower you launch
     from — and the argument for hiding the spine is that inside one activity
     none of that is the question any more. Keeping the one control that opens
     a nav drawer over the child's work was the inconsistent part.

     NOT A DEAD END, which is the only thing that made it safe to drop: the ✕
     directly above it goes back one step (#143), and stepping back out of a
     drill lands on the flower, where the spine — and the ★ — are painted again.
     Home is two taps rather than one, from a screen the child is meant to be
     concentrating on.

     It also retires, on the day it was written, a rule that existed only
     because the ★ floated over the keys: at 375×812 it sat at x 16–60 across
     the left column of a pad starting at x 54, and the rail's z-index 60 beat
     the layer's 2, so a tap aimed at "4" opened the menu. Cause removed, fix
     removed — the collision cannot recur while the ★ is not drawn. */
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-star { display: none; }
  /* …and so does the below-stack, for the same reason (owner, same session:
     "same with the language pill. once the vocab activity started it is not
     need if the rail is hiding"). In an activity that stack holds exactly one
     thing — vocab's 🇬🇧 → 🇵🇹 chip — and the language is a SETTING chosen before
     the round, not a control the child needs mid-word; #114 already made every
     vocab exercise NAME its answer language on screen, which is where a child
     actually looks. The stats and the countdown above it were hidden during an
     activity long before this (HUD lite, #87), so what is left after the ★ and
     the chip go is precisely the owner's "title pill and the x".

     The chip is still one ✕ away: stepping back to the flower paints the spine
     again, and the rail drawer's own Word-languages row never went anywhere. */
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-below { display: none; }

  /* The twin of the four .wu-modal-chrome colour rules above — same job (these
     controls are painted for an amber ground and are now on white paper), same
     declarations, kept apart only by this media query. Change one, change both. */
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-quit {
    box-sizing: border-box;
    border-color: var(--colour-border);
    background: var(--colour-surface);
    color: var(--colour-text-primary);
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-quit:hover {
    background: var(--colour-bg);
    border-color: var(--colour-text-secondary);
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-hud-chip {
    border: 1px solid var(--colour-border);
    background: var(--colour-surface);
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-hud-chip:active { background: var(--colour-bg); }
}

/* ── The SUPPORT ZONE ────────────────────────────────────────────────────────
   Where an activity's secondary controls live: the crossword's letter strip, a
   game's score rail, a puzzle's clue bar. One definition so every activity puts
   them in the same place and none of them can drift under the Android status
   overlay — the failure that hit Survivor's ✕ (#88) and the crossword keys
   (owner, 2026-08-17).

   The rule, stated once: secondary chrome belongs on the RAIL SIDE or BELOW the
   top inset — never in the top-right band, which is the one region the system
   reserves and the browser cannot show you. */
:root {
  --support-w: 190px;
  /* The Android status overlay's own height. env(safe-area-inset-top) does NOT
     cover it — on Android WebView that inset reports the DISPLAY CUTOUT, so on a
     phone without a notch it is 0px while the clock/network/battery pill is
     still drawn over the app. Every "clear the pill with --safe-top" rule has
     therefore been clearing nothing, which is why the crossword clue was moved
     off the top-right in v291 and the KEYS then hit the same pill (owner,
     2026-08-17). Reserved only under .wu-native, so web and PWA pay nothing. */
  --system-band: 0px;
  --support-top: calc(var(--safe-top) + var(--system-band) + var(--space-md));
  --support-bottom: calc(var(--safe-bottom) + var(--space-md));
}
/* ⚠️ Keyed on .wu-native-CLUSTER, not .wu-native (v392). Being inside the shell
   and having a band to clear are two different questions, and conflating them
   is why this reserve outlived the thing it stood for. A shell that no longer
   paints its own status cluster declares it (`Android.uiFlags()` →
   `{"statusCluster": false}`) and pays nothing; a shell that says nothing is
   assumed to paint one and keeps its clearance, because failing the other way
   puts controls somewhere invisible AND inert — the system takes those touches.

   44px is MEASURED, not guessed (2026-08-29): the shell has hidden the system
   bars since APK 1.8 (`hideSystemBars()`) and draws WarmUp's own `StatusCluster`
   in their place — a white pill top-right, 44 CSS px tall at a 16 CSS px inset,
   bottom edge at 60px. The earlier 34px guess put `--support-top` at 50px, i.e.
   10px INSIDE the cluster, which is the "the letter pad on the right hand side
   does not work" report.
   ⚠️ While any shipped shell still draws it, this must match C:\_apk_warmup. */
.wu-native-cluster {
  --system-band: 44px;
}
.wu-support {
  padding-top: var(--support-top);
  padding-bottom: var(--support-bottom);
}

/* ── The drill/game layer's own inset, as a token (2026-09-23) ─────────────
   A layer that gives its inset up so a fixed-size BOARD can grow (#160) still
   owes its side panel the standard gap, or the panel sits 8px off the screen
   edge while every other game's sits at 16-24 (owner: "the side information on
   the games does not have consistent padding from the top and right"). The
   panel therefore re-adds exactly what the layer gave up — which it can only do
   if the standard value has a NAME rather than being written out per
   breakpoint in two files. Declared on :root, so a layer that overrides its own
   padding does not also move the value its panel measures against.

   ⚠️ This also fixes a silent clobber: the ≤720px rule lived in games.css and
   set the `padding` SHORTHAND, which lands after .wu-drill-layer's
   `padding-top: calc(... + var(--safe-top))` and therefore DROPPED the camera
   inset on every phone. On web env() is 0, so it looked identical either way —
   the same trap tokens.css records for the body inset (§6). */
:root {
  --layer-pad-y: var(--space-lg);
  --layer-pad-x: var(--space-lg);
}
@media (max-width: 720px) {
  :root {
    --layer-pad-y: var(--space-md);
    --layer-pad-x: var(--space-sm);
  }
}

/* ── The three permanent points: ✕ top · ★ centre · profile foot ─────────────
   The profile reads as a ROUND disc, not a labelled row (owner, 2026-08-17), so
   it belongs to the same family as the ✕ and the ★ rather than looking like a
   drawer item that escaped. The label is dropped — the avatar IS the label, and
   at the foot of a 56px rail there is no room for both. */
.wu-rail-quick .wu-rail-q {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.wu-rail-quick .wu-rail-q:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.9);
}
/* The avatar disc fills the button; the row's text label is not rendered here. */
.wu-rail-quick .wu-rail-q .wu-hud-lbl { display: none; }
.wu-rail-quick .wu-prof-ic {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  font-size: 16px;
}


/* A pill is never drawn outside the spine-column mode (the phone drawer has
   its own names). */
.wu-rail-pill {
  pointer-events: none;
}
/* The name is a pill hanging off the button, over the flower. Inside the button,
   so a tap on the words is a tap on the activity. */
.wu-rail-act-lbl {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translate(-6px, -50%);
  white-space: nowrap;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--colour-surface);
  color: var(--colour-text-primary);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  opacity: 0;
  visibility: hidden;
  transition: opacity 140ms ease, transform 140ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .wu-rail-act-lbl {
    transition: none;
  }
}
.wu-dock-ic {
  width: var(--dock-row);
  height: var(--dock-row);
  font-size: calc(var(--dock-row) * 0.86);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.wu-dock-img,
.wu-dock-ic .wu-bag {
  width: var(--dock-row);
  height: var(--dock-row);
  object-fit: contain;
}

/* 🎒 Day-coloured homework backpack (#195). The body is currentColor (set
   inline from --colour-day-N); the strap, flap and pocket are drawn over it. */
.wu-bag {
  width: 22px;
  height: 22px;
  flex: none;
}
.wu-bag-body { fill: currentColor; }
.wu-bag-strap { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wu-bag-flap { stroke: rgba(0, 0, 0, 0.22); stroke-width: 1.4; }
.wu-bag-pocket { fill: rgba(255, 255, 255, 0.35); }
.wu-dock-ic { position: relative; }
/* The subject look (📐, 🔬 …) rides the backpack as a small badge. */
.wu-bag-badge {
  position: absolute;
  right: -8px;
  bottom: -4px;
  font-size: calc(var(--dock-row) * 0.6);
  line-height: 1;
}
.wu-bag-badge .wu-dock-img { width: calc(var(--dock-row) * 0.6); height: calc(var(--dock-row) * 0.6); }
.wu-hw-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.wu-hw-bag { width: 26px; height: 26px; }

/* DIRECT START (#219) — a home warm-up tile opens an exercise, never a flower.
   The subject view still builds its flower underneath (components/direct-start.js
   sends the child home when the exercise ends), so it is hidden, not removed.
   A pane puzzle (🧭 Path, ✳️ Cross Words) draws on that stage and stays visible. */
.wu-direct:not(:has(.wu-path-bar)) .wu-honeycomb-wrap { visibility: hidden; }

/* ══ THE BOTTOM BAR — the rail on a portrait phone (#230) ═══════════════════
   Owner, 2026-11-09: "on mobile the side pills take a full vertical cut.
   should this be converted to a Top bar?" — built as a top bar (v522), then
   moved to the BOTTOM the same day: "make it bottom bar instead. easier to
   reach." A phone held upright is used one-handed, and the thumb lives at the
   foot of the screen; the top corners are the hardest place on it to reach.

   Measured at 375×812: the side spine took 56px of 375 (15%), and a phone
   flower is WIDTH-bound, so the board sat small with empty height above and
   below it. Across the screen the spine costs height instead, which a portrait
   phone has spare.

   SAME ELEMENTS, SAME DOM — only where they sit changes, so setHudTrail,
   setRailExtra, syncQuit and the drawer wiring need no idea it happened:
     far left   the profile (main flower) · the trail, exercise, mode and ✕
                circles (everywhere else — the two never show together)
     left of ★  today's countdown, as many chips as fit (fitRail)
     centre     the ★
     right of ★ the stats, then the view's own chips (language, how-to)
   The drawer RISES from the bar, and a circle's name opens ABOVE it.

   The bar sits on the gesture bar's inset (--safe-bottom), so its controls
   clear the system's own swipe area, and it is nowhere near the Android
   status overlay at the top (§6) — which is the other thing the move buys.

   NOT DURING AN ACTIVITY. The #173 rule already sheds the spine there and
   floats the trail and ✕ over the content's own header slot; a bar would only
   put a band back. So every rule here carries the same discriminator as that
   block, negated — the two can never apply at once.

   Gate (#284, owner 2026-11-21: "bottom bar on all devices"): every screen
   EXCEPT a sideways phone — `(orientation: portrait), (min-height: 501px)`.
   A phone turned sideways only ever shows a game, and there the side rail
   stays on the side away from the camera (#237). The same gate is on every
   bar block below; the spine-hide during an activity (#279) is now global. */
@media (orientation: portrait), (min-height: 501px) {
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) {
    --rail-w: 0px;
    --rail-bot-h: calc(var(--rail-bar-w) + var(--safe-bottom));
    --rail-mid: calc(var(--rail-bar-w) / 2);
    /* Every height in the app is var(--vh) (§6), so taking the bar off it
       once is what keeps every flower and panel fitting above it. The bar
       already contains the gesture inset, so it replaces that term. */
    --vh: calc(100vh - var(--rail-bot-h));
    padding-bottom: var(--rail-bot-h);
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-hud.wu-rail {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: var(--rail-bot-h);
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-spine {
    width: auto;
    border-radius: var(--radius-shell) var(--radius-shell) 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
    background: linear-gradient(
      90deg,
      var(--rail-tint, var(--colour-brand)) 0%,
      color-mix(in srgb, var(--rail-tint, var(--colour-brand)) 78%, #000) 100%
    );
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-star {
    top: var(--rail-mid);
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-top {
    top: var(--rail-mid);
    bottom: auto;
    left: auto;
    right: calc(50% + var(--rail-star) / 2 + var(--space-sm));
    transform: translateY(-50%);
    flex-direction: row;
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-below {
    top: var(--rail-mid);
    left: calc(50% + var(--rail-star) / 2 + var(--space-sm));
    transform: translateY(-50%);
    flex-direction: row;
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) :is(.wu-rail-stats, .wu-rail-extra) {
    flex-direction: row;
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-quick {
    top: var(--rail-mid);
    bottom: auto;
    left: var(--space-sm);
    transform: translateY(-50%);
    flex-direction: row;
  }
  /* The circles run left to right at the same 52px pitch they ran down the
     spine: subject, exercise, mode, then the ✕. */
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) :is(.wu-rail-trail-slot, .wu-rail-sub-slot, .wu-rail-mode-slot, .wu-rail-quit-slot) {
    top: calc(var(--rail-mid) - 22px);
    transform: none;
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-trail-slot { left: var(--space-sm); }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) :is(.wu-rail-sub-slot, .wu-rail-mode-slot, .wu-rail-quit-slot) {
    left: calc(var(--space-sm) + 44px + var(--space-sm));
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-hud:has(.wu-rail-sub-slot:not(:empty)) :is(.wu-rail-mode-slot, .wu-rail-quit-slot),
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-hud:has(.wu-rail-mode-slot:not(:empty)) .wu-rail-quit-slot {
    left: calc(var(--space-sm) + 2 * (44px + var(--space-sm)));
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-hud:has(.wu-rail-mode-slot:not(:empty)):has(.wu-rail-sub-slot:not(:empty)) .wu-rail-quit-slot {
    left: calc(var(--space-sm) + 3 * (44px + var(--space-sm)));
  }
  /* No trail circle (the games launcher), so the ✕ takes the first place
     rather than leaving a hole at the start of the bar. */
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-hud:not(:has(.wu-rail-trail-slot .wu-rail-trail)):not(:has(.wu-rail-mode-slot:not(:empty))):not(:has(.wu-rail-sub-slot:not(:empty))) .wu-rail-quit-slot {
    left: var(--space-sm);
  }
  /* A circle's NAME opens ABOVE it instead of sideways. Across a bar the
     circles sit side by side, so a name opening to the right covered the next
     circle — the ✕ included — for the three seconds it announced. Above the
     bar there is nothing to cover but the board, which is what the side
     rail's names always opened over. The exercise and mode names sit one step
     higher than the subject's, so two announcing at once never overlap. */
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-trail { position: relative; }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-trail-name {
    position: absolute;
    bottom: calc(100% + var(--space-xs));
    left: 0;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    background: var(--colour-surface);
    border: 1px solid color-mix(in srgb, var(--sec-colour) 50%, var(--colour-border));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    pointer-events: none;
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-trail.wu-open .wu-rail-trail-name { margin: 0; }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) :is(.wu-rail-sub-slot, .wu-rail-mode-slot) .wu-rail-trail-name {
    bottom: calc(100% + var(--space-xs) + 34px);
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-hud:has(.wu-rail-sub-slot:not(:empty)) .wu-rail-mode-slot .wu-rail-trail-name {
    bottom: calc(100% + var(--space-xs) + 68px);
  }
  /* The drawer rises from the bar. Its bottom padding runs UNDER the bar, the
     same trick the side drawer uses to fill the spine's rounded corner. */
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: calc(100vh - var(--safe-top) - var(--system-band) - var(--space-md));
    padding: var(--space-md) var(--space-md) calc(var(--rail-bot-h) + var(--space-md));
    border-right: none;
    border-top: 1px solid var(--colour-border);
    border-radius: var(--radius-shell) var(--radius-shell) 0 0;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.18);
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail[data-collapsed="true"] .wu-rail-drawer {
    transform: translateY(8px);
  }
}

/* ── The home bar, re-ordered for the thumb and for rotation (#237) ───────
   Owner, 2026-11-15: "on portrait mode the profile should live on the right
   corner so on rotation the avatar just needs to rotate 90 degrees. The stats
   pills should move … left on portrait." So on the MAIN flower the bar reads
   stats · ★ · today's countdown · profile. Sub-views keep their circles on the
   left and their own chips on the right, so only the home bar changes, and
   fitRail's width budget is direction-free (countdown and profile still share
   one side of the ★). */
@media (orientation: portrait), (min-height: 501px) {
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail:not([data-sub="1"]) .wu-rail-below {
    left: auto;
    right: calc(50% + var(--rail-star) / 2 + var(--space-sm));
    flex-direction: row-reverse;
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail:not([data-sub="1"]) .wu-rail-top {
    right: auto;
    left: calc(50% + var(--rail-star) / 2 + var(--space-sm));
  }
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail:not([data-sub="1"]) .wu-rail-quick {
    left: auto;
    right: var(--space-sm);
  }
}

/* ── …and the full-screen pages' circles join it (#230c) ──────────────────
   Owner, 2026-11-10, on the Word Bank: "verbs did not add the 'bottom bar' to
   free up the width." A full-screen page (.wu-layer-modal: the Word Bank, the
   parent area, the journey, Diagnostics) covers the rail and carries its own
   COLUMN of circles down the left (#164), reserving --chrome-w (52px) of a
   375px screen for it. On a portrait phone that column becomes a bar along the
   foot, in the same place and order as the rail's: where you are, the way out,
   then this screen's own chips. The page takes the full width and pads its foot
   by the bar instead.

   The bar is WHITE, not amber: these pages are paper, and the circles are
   already painted for a white ground (the #164 colour rules above). */
@media (orientation: portrait), (min-height: 501px) {
  :root { --modal-bar-h: calc(var(--rail-bar-w) + var(--safe-bottom)); }
  /* `:root` for weight: drills.css loads AFTER this file and sets the same
     padding on the same selector, so at equal specificity it would win. */
  :root .wu-drill-layer.wu-layer-modal:not(.wu-jrnpage-full) {
    padding-left: calc(var(--layer-pad-x) + var(--safe-left));
    padding-bottom: calc(var(--layer-pad-y) + var(--modal-bar-h));
  }
  /* The journey stays full bleed (journey.css) — it only stops above the bar. */
  :root .wu-drill-layer.wu-jrnpage-full { padding-bottom: var(--modal-bar-h); }
  .wu-modal-chrome {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--modal-bar-h);
    box-sizing: border-box;
    padding: 0 var(--space-sm) var(--safe-bottom);
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
    background: linear-gradient(
      90deg,
      var(--rail-tint, var(--colour-brand)) 0%,
      color-mix(in srgb, var(--rail-tint, var(--colour-brand)) 78%, #000) 100%
    );
    border-top: 0;
    border-radius: var(--radius-shell) var(--radius-shell) 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
  }
  .wu-modal-chrome :is(.wu-rail-below, .wu-rail-extra) {
    flex-direction: row;
    align-items: center;
  }
  /* A name opens ABOVE its circle, as on the rail bar — sideways it would
     cover the ✕ beside it for the three seconds it announces. */
  .wu-modal-chrome .wu-rail-trail { position: relative; }
  .wu-modal-chrome .wu-rail-trail-name {
    position: absolute;
    bottom: calc(100% + var(--space-xs));
    left: 0;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    background: var(--colour-surface);
    border: 1px solid color-mix(in srgb, var(--sec-colour) 50%, var(--colour-border));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    pointer-events: none;
  }
  .wu-modal-chrome .wu-rail-trail.wu-open .wu-rail-trail-name { margin: 0; }
  .wu-modal-chrome :is(.wu-rail-sub-slot, .wu-rail-mode-slot) .wu-rail-trail-name {
    bottom: calc(100% + var(--space-xs) + 34px);
  }
}

/* ── …and DURING AN ACTIVITY too (#233) ───────────────────────────────────
   Owner, 2026-11-10: "the pills on mobile should move to the base bar as
   otherwise they are still clashing with maths exercises." #230 kept the bar
   off during an activity on the #173 reasoning that a bar only puts a band
   back, and the circles floated over the content's top left instead. On a
   portrait phone that corner is where every exercise starts its own work (the
   head, the grid, the first row of a sum), so the circles sat on it.

   So on a portrait phone the activity gets the same foot bar the full-screen
   pages have (#230c), holding only the circles and the ✕ in their usual
   order. It is the CATEGORY colour, not white (#244, owner 2026-11-16:
   "ensure the bar colours match the category. I can see some go white") —
   the same --rail-tint gradient as the picker's bar, so the bar does not
   change colour the moment an exercise starts. The ★, stats and countdown stay hidden (#173, HUD lite) — inside an
   activity the bar is only "where you are" and "the way out". The exercise
   gets the full width and stops above the bar. */
@media (orientation: portrait), (min-height: 501px) {
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) {
    --rail-bot-h: calc(var(--rail-bar-w) + var(--safe-bottom));
    --rail-mid: calc(var(--rail-bar-w) / 2);
    --vh: calc(100vh - var(--rail-bot-h));
    padding-bottom: var(--rail-bot-h);
  }
  /* R5 (#252): KEEP THE FOOT ZONE CLEAR. The exercise's name opens as a pill
     above the bar's circles, and it covered the bottom row of the tallest
     inputs (a 6-row Grid's ⌫). The activity stops --foot-reserve above the
     bar; the solvers read the layer's padding, so a grid simply sizes to the
     room that is left. */
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) {
    padding-bottom: calc(var(--space-sm) + var(--foot-reserve));
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-hud.wu-rail {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: var(--rail-bot-h);
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-spine {
    width: auto;
    background: linear-gradient(
      90deg,
      var(--rail-tint, var(--colour-brand)) 0%,
      color-mix(in srgb, var(--rail-tint, var(--colour-brand)) 78%, #000) 100%
    );
    border-top: 0;
    border-radius: var(--radius-shell) var(--radius-shell) 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) :is(.wu-rail-trail-slot, .wu-rail-sub-slot, .wu-rail-mode-slot, .wu-rail-quit-slot) {
    top: calc(var(--rail-mid) - 22px);
    bottom: auto;
    transform: none;
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-trail-slot { left: var(--space-sm); }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) :is(.wu-rail-sub-slot, .wu-rail-mode-slot, .wu-rail-quit-slot) {
    left: calc(var(--space-sm) + 44px + var(--space-sm));
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-hud:has(.wu-rail-sub-slot:not(:empty)) :is(.wu-rail-mode-slot, .wu-rail-quit-slot),
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-hud:has(.wu-rail-mode-slot:not(:empty)) .wu-rail-quit-slot {
    left: calc(var(--space-sm) + 2 * (44px + var(--space-sm)));
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-hud:has(.wu-rail-mode-slot:not(:empty)):has(.wu-rail-sub-slot:not(:empty)) .wu-rail-quit-slot {
    left: calc(var(--space-sm) + 3 * (44px + var(--space-sm)));
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-hud:not(:has(.wu-rail-trail-slot .wu-rail-trail)):not(:has(.wu-rail-mode-slot:not(:empty))):not(:has(.wu-rail-sub-slot:not(:empty))) .wu-rail-quit-slot {
    left: var(--space-sm);
  }
  /* Names open ABOVE the bar, staggered, as on the home bar. */
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-trail { position: relative; }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-trail-name {
    position: absolute;
    bottom: calc(100% + var(--space-xs));
    left: 0;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    background: var(--colour-surface);
    border: 1px solid color-mix(in srgb, var(--sec-colour) 50%, var(--colour-border));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    pointer-events: none;
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-rail-trail.wu-open .wu-rail-trail-name { margin: 0; }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) :is(.wu-rail-sub-slot, .wu-rail-mode-slot) .wu-rail-trail-name {
    bottom: calc(100% + var(--space-xs) + 34px);
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-hud:has(.wu-rail-sub-slot:not(:empty)) .wu-rail-mode-slot .wu-rail-trail-name {
    bottom: calc(100% + var(--space-xs) + 68px);
  }
  /* The Operation Grid reserved a left gutter for the floating circles
     (results.css). They are in the bar now, so the grid takes the width back. */
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-drill-layer:has(.wu-og-wrap) {
    padding-left: calc(var(--layer-pad-x) + var(--safe-left));
  }
}


/* ══ NO INNER FRAME ON A PHONE (#239) ═══════════════════════════════════════
   Owner, 2026-11-15: "qwerty keyboard is too tight … the android keyboard
   also has it the difference is that it is full width. Should we remove the
   inner frame? That would give the whole margin to all applications. Instead
   of the margin we can add a background pattern hex inspired?"

   Measured at 375×812: the keyboard got 325px — 16px of page margin and 8px of
   layer padding on each side, inside a rounded, bordered frame. During an
   activity on a portrait phone the frame goes: the pane runs edge to edge, the
   activity's white sheet becomes transparent so the pane's hex lattice is the
   background, and a QWERTY board bleeds to the screen edges like the system
   keyboard (3px gaps, Android's own). Controls keep their own white surfaces,
   so nothing loses contrast. Tablets keep the frame — they have the room. */
@media (orientation: portrait) {
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-view-root > :has(> .wu-honeycomb-pane) {
    padding: 0;
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-honeycomb-pane {
    border: none;
    border-radius: 0;
    /* The 34px it reserved was the margin it no longer has. */
    min-height: var(--vh);
  }
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) {
    background: transparent;
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-typ-kbd {
    width: calc(100% + 2 * var(--layer-pad-x));
    max-width: none;
    margin-inline: calc(-1 * var(--layer-pad-x));
    padding-inline: 3px;
    box-sizing: border-box;
    gap: 5px;
  }
body:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked)) .wu-typ-row { gap: 3px; }
}

/* ★ menu: THREE over FOUR once there is a seventh activity (#241, owner
   2026-11-16: "compress bottom row to fit extra icon if needed. 3 upper 4 lower
   row"). Six stay 3 + 3; the seventh does not start a lonely third row. */
/* #298 replaced the 3-over-4 grid: the menu is THREE GROUPS now, and on a
   phone each group takes its own line, four buttons wide, centred. */
@media (max-width: 599px) {
  .wu-rail-grid .wu-rail-items {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .wu-rail-grid .wu-rail-items > .wu-rail-btn {
    flex: 0 0 calc((100% - 3 * var(--space-xs)) / 4);
    min-width: 0;
  }
  .wu-rail-grid .wu-rail-items > .wu-rail-sep { flex: 0 0 100%; margin: 2px var(--space-sm); }
  /* #435: the practices start their own row (no hairline: same group) */
  .wu-rail-grid .wu-rail-items > .wu-rail-brk { display: block; flex: 0 0 100%; height: 0; }
  /* 🔍 as a search bar across the top of the menu (#423, menu B). */
  .wu-rail-grid .wu-rail-items > .wu-rail-btn.wu-rail-find {
    flex: 0 0 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-sm);
    min-height: 48px;
    margin-bottom: 4px;
    padding: 0 var(--space-md);
    border: 2px solid var(--colour-brand);
    border-radius: 999px;
  }
  .wu-rail-btn.wu-rail-find .wu-hud-ic { font-size: 20px; }
  .wu-rail-btn.wu-rail-find .wu-hud-lbl {
    min-height: 0;
    -webkit-line-clamp: 1;
    color: var(--colour-text-secondary);
    font-size: var(--font-size-md);
  }
}
/* ★ MENU AS ONE ROW where there is room (#284, owner 2026-11-21: "the menu
   pops as a row of icons similarly to the previous weekly dock"). From 600px
   the drawer that rises from the bar is a centred card holding every item on
   one line; a phone keeps the 3 over 4 grid above. */
@media (min-width: 600px) and ((orientation: portrait) or (min-height: 501px)) {
body:not(:has(.wu-drill-layer:not(.wu-hidden):not(.wu-game-layer):not(.wu-layer-modal):not(.wu-jrnpage-docked))) .wu-rail-drawer {
    width: fit-content;
    max-width: calc(100% - 2 * var(--space-md));
    margin-inline: auto;
    border-radius: var(--radius-shell) var(--radius-shell) 0 0;
  }
  /* A flex line (#298): ten buttons and two hairlines fit 1024px. */
  .wu-rail-grid .wu-rail-items {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
  }
  /* Menu B (#423) has up to 14 tiles: they may give a little width back
     (84 → 62px) so the row still fits a 1024px tablet; 🔍 is icon-only here. */
  .wu-rail-grid .wu-rail-items > .wu-rail-btn { flex: 0 1 84px; min-width: 62px; }
  .wu-rail-grid .wu-rail-items > .wu-rail-btn.wu-rail-find { flex: 0 0 56px; min-width: 56px; }
  .wu-rail-btn.wu-rail-find .wu-hud-lbl { display: none; }
  .wu-rail-grid .wu-rail-items > .wu-rail-sep {
    flex: 0 0 1px;
    height: auto;
    align-self: stretch;
    margin: 10px 6px;
  }
}

/* ONE CONTEXT CIRCLE ON A PORTRAIT PHONE (#244, owner 2026-11-16: "vocab
   practice activities are clashing with the star on mobile … bar colour
   already indicates if it's vocab or maths, so should the first pill always be
   the relevant one to the window? Vocab on the picker and then change as the
   activity is started"). Yes. Subject + exercise + 🏃 + ✕ is four circles on
   the left of a ★ fixed at the centre — at 360px the ✕ already sat 2px from
   it with three, and the fourth ran under it. The bar's colour names the
   subject, so once an exercise circle exists it REPLACES the subject circle,
   and 🏃 Practice shrinks to a badge on that circle's corner. At most two
   circles sit left of the ★ on any screen.
   ⚠️ !important on the slot geometry, deliberately: the bar places each slot
   with rules of the form `body:has(…five classes…) .wu-hud:has(…):has(…)
   .wu-rail-quit-slot` — up to eleven classes of specificity, one per
   combination of which circles exist. This block REPLACES that whole matrix
   on a portrait phone (the ✕ is always second, the badge always on the first
   circle), so it states the result outright rather than out-counting each. */
@media (orientation: portrait), (min-height: 501px) {
  .wu-rail[data-sub="1"]:has(.wu-rail-sub-slot .wu-rail-trail) .wu-rail-trail-slot {
    display: none !important;
  }
  .wu-rail[data-sub="1"]:has(.wu-rail-sub-slot .wu-rail-trail) .wu-rail-sub-slot {
    left: var(--space-sm) !important;
  }
  .wu-rail[data-sub="1"]:has(.wu-rail-trail-slot .wu-rail-trail) .wu-rail-quit-slot {
    left: calc(var(--space-sm) + 44px + var(--space-sm)) !important;
  }
  /* 🏃 as a badge on the first circle's top-right corner. */
  .wu-rail[data-sub="1"] .wu-rail-mode-slot {
    left: calc(var(--space-sm) + 28px) !important;
    top: calc(var(--rail-mid) - 30px) !important;
    width: 24px;
    height: 24px;
    z-index: 3;
  }
  .wu-rail[data-sub="1"] .wu-rail-mode-slot .wu-rail-trail.wu-rail-mode {
    width: 24px !important;
    height: 24px !important;
    min-width: 0;
    padding: 0;
    gap: 0;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(43, 41, 38, 0.25);
    /* A badge, not a button (#321): a 24px target is too small to aim at, so a
       tap passes through to the 44px circle it sits on. */
    pointer-events: none;
  }
  .wu-rail[data-sub="1"] .wu-rail-mode-slot .wu-rail-trail-ic {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .wu-rail[data-sub="1"] .wu-rail-mode-slot .wu-rail-trail-name {
    display: none !important;
  }
}

/* ══ 🗓️ THE WEEK WINDOW (#283, #285) ═════════════════════════════════════════
   The Weekly Dock as a window opened from the 🗓️ beside the profile on the
   bottom bar (#285 — the corner button of #283 is gone). It grows from the
   bar's right-hand corner: the week as seven columns of icons (tap one to
   scroll to it), then every day side by side with its tiles in a row,
   scrolling across, today highlighted, empty days saying so. It floats over
   the pane and reserves nothing — except on a portrait phone, where it is
   DOCKED at the foot, open by default, and the flower re-fits above it
   (.wu-wkd-docked pads the flower's box by --wkd-h). */
.wu-wkd {
  position: absolute;
  right: calc(var(--space-md) + var(--safe-right));
  bottom: calc(var(--space-md) + var(--safe-bottom));
  z-index: 5;
}
.wu-wkd[hidden] { display: none; }
.wu-rail-q { position: relative; }
.wu-wkd-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 10px;
  background: var(--colour-accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  line-height: 20px;
  text-align: center;
}
.wu-wkd-badge[hidden] { display: none; }
.wu-wkd-panel {
  width: min(420px, calc(100vw - 2 * var(--space-md)));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-radius: 18px;
  background: var(--colour-surface);
  box-shadow: 0 8px 28px rgba(43, 41, 38, 0.2);
  transform-origin: bottom right;
  transform: scale(0.2);
  opacity: 0;
  visibility: hidden;
  position: absolute;
  right: 0;
  bottom: 0;
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
}
.wu-wkd-open .wu-wkd-panel {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .wu-wkd-panel, .wu-wkd-open .wu-wkd-panel { transition: none; }
}
.wu-wkd-head { display: flex; align-items: center; justify-content: space-between; }
.wu-wkd-title { font-family: var(--font-display); font-weight: var(--font-weight-bold); font-size: 16px; }
/* 🔭 This week ⇄ Next week (#370): the TITLE is the switch. It reads as a
   heading, with an arrow pointing at the other week, and the whole title is
   the tap target. */
.wu-wkd-flip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 12px 4px 8px;
  margin-left: -8px;
  border: 0;
  border-radius: var(--radius-pill, 999px);
  background: transparent;
  color: var(--colour-text-primary);
  cursor: pointer;
}
.wu-wkd-flip:hover { background: var(--colour-bg); }
.wu-wkd-flip:focus-visible { outline: 2px solid var(--colour-accent); outline-offset: 2px; }
.wu-wkd-arrow {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--colour-brand, #FFB74D);
  color: var(--colour-text-primary);
  font-size: 18px;
  line-height: 1;
}
/* Next week wears a faint tint so the two weeks are never mistaken. */
.wu-wkd-next .wu-wkd-week { background: color-mix(in srgb, var(--colour-brand, #FFB74D) 10%, transparent); border-radius: 12px; }
/* Last week (#472): a faint grey, so it reads as the past. The arrows are
   tap targets of their own inside the title (data-go). */
.wu-wkd-last .wu-wkd-week { background: color-mix(in srgb, var(--colour-text-secondary) 10%, transparent); border-radius: 12px; }
.wu-wkd-arrow[data-go] { cursor: pointer; }
.wu-wkd-arrow-off { opacity: 0.3; }
.wu-wkd-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--colour-bg);
  cursor: pointer;
  position: relative;
}
/* 44px to the finger, 36px to the eye (#327, audit geometry 3). */
.wu-wkd-close::after { content: ""; position: absolute; inset: -4px; }
/* B · the week — seven columns, like the journey's month (wu-cal-*). */
.wu-wkd-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wu-wkd-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  border: 1px solid var(--colour-border);
  border-radius: 8px;
  background: var(--colour-surface);
  cursor: pointer;
}
.wu-wkd-day.wu-wkd-empty { background: var(--colour-bg); }
.wu-wkd-day.wu-wkd-today { border: 2px solid var(--colour-accent); background: color-mix(in srgb, var(--colour-accent) 8%, var(--colour-surface)); }
.wu-wkd-dname { font-size: 11px; color: var(--colour-text-secondary); }
.wu-wkd-dnum { font-family: var(--font-mono); font-size: 13px; font-weight: var(--font-weight-bold); }
/* One row of dots under the date (#289) — a dot per tile, filled once done. */
.wu-wkd-dics { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; min-height: 7px; }
.wu-wkd-dot { width: 7px; height: 7px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--tile-color); }
.wu-wkd-dot.wu-wkd-done { background: var(--tile-color); }
.wu-wkd-more { font-size: 10px; color: var(--colour-text-secondary); }
/* E · every day side by side, scrolling across. */
.wu-wkd-list {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 4px;
}
.wu-wkd-group {
  flex: none;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 10px;
  background: var(--colour-bg);
  scroll-snap-align: start;
}
.wu-wkd-group.wu-wkd-today { background: color-mix(in srgb, var(--colour-accent) 12%, var(--colour-surface)); }
.wu-wkd-ghead { margin: 0; font-size: 12px; font-weight: var(--font-weight-bold); color: var(--colour-text-secondary); white-space: nowrap; }
.wu-wkd-now {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--colour-accent);
  color: #fff;
  font-size: 10px;
}
.wu-wkd-gitems { display: flex; gap: 4px; }
.wu-wkd-row {
  position: relative;
  width: 72px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: var(--colour-surface);
  box-shadow: 0 1px 3px rgba(43, 41, 38, 0.10);
  cursor: pointer;
}
.wu-wkd-ric { --dock-row: 30px; width: 32px; height: 32px; display: grid; place-items: center; }
.wu-wkd-ric .wu-dock-img, .wu-wkd-ric .wu-bag { width: 30px; height: 30px; font-size: 24px; }
.wu-wkd-rname {
  max-width: 100%;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wu-wkd-row.wu-wkd-done { opacity: 0.55; }
.wu-wkd-tick { position: absolute; top: 2px; right: 6px; color: var(--colour-success); font-weight: var(--font-weight-bold); font-size: 12px; }
.wu-wkd-rest { margin: 0; min-height: 72px; display: grid; place-items: center; font-size: 12px; color: var(--colour-text-secondary); }

/* DOCKED on a portrait phone (#285): in flow at the foot, full width; the
   flower's box gives way by the window's height so the flower moves up. */
@media (orientation: portrait) and (max-width: 599px) {
  .wu-wkd { left: var(--space-sm); right: var(--space-sm); bottom: calc(var(--space-sm) + var(--safe-bottom)); }
  .wu-wkd-panel { position: relative; width: auto; transform-origin: bottom center; }
  .wu-wkd:not(.wu-wkd-open) .wu-wkd-panel { display: none; }
  .wu-honeycomb-pane.wu-wkd-docked > .wu-honeycomb-wrap { padding-bottom: calc(var(--wkd-h, 0px) + var(--space-md)); }
}

/* ══ LAYOUT B — THE TOP BAR (#288) ══════════════════════════════════════════
   Owner, 2026-11-21: "It works better as a top bar throughout … warmup text in
   the centre keeping pill with the icon and activity text on the left … the X
   and ? live on the right corner … all other items as floating buttons on the
   bottom", then "go with B" from four drawn layouts.
   ONE OVERRIDE LAYER rather than a rewrite of the five bar blocks above: those
   place the bar at the foot with selectors up to eleven classes deep (one per
   combination of circles), so this states the RESULT with !important, in one
   place, for every state — home, sub-views and games (the home-state rules),
   an activity (the #233 block) and the full-screen pages (#230c). Same gate as
   the bar: every screen except a sideways phone, which keeps its side rail.
   Bar: ★ (home) or the trail circles (elsewhere) LEFT · WarmUp CENTRE ·
   countdown and ✕ RIGHT (Help is in the ★ menu). Names open BELOW the bar; the ★ menu drops DOWN.
   Floating at the foot (home): stats bottom-left, 🗓️ + profile bottom-right. */
@media (orientation: portrait), (min-height: 501px) {
  :root {
    --bar-top-h: calc(var(--rail-bar-w) + var(--safe-top));
    --modal-bar-h: var(--bar-top-h) !important;
    --foot-reserve: 0px !important;
  }
  body {
    --rail-mid: calc(var(--safe-top) + var(--rail-bar-w) / 2) !important;
    --vh: calc(100vh - var(--bar-top-h) - var(--safe-bottom)) !important;
    padding-top: var(--bar-top-h) !important;
    padding-bottom: var(--safe-bottom) !important;
  }
  .wu-hud.wu-rail {
    top: 0 !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    height: var(--bar-top-h) !important;
  }
  .wu-rail-spine {
    border-radius: 0 0 var(--radius-shell) var(--radius-shell) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12) !important;
  }
  /* WarmUp, centred — the brand on every screen. */
  .wu-rail-spine::after {
    content: "WarmUp";
    position: absolute;
    left: 50%;
    top: var(--rail-mid);
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    font-size: 18px;
    letter-spacing: 0.02em;
    color: #fff;
    pointer-events: none;
    white-space: nowrap;
  }
  /* ★ on the LEFT. Where a ✕ exists (sub-views, activities) the ✕ is the way
     out and the trail circles hold the left, so the ★ steps aside. */
  .wu-rail-star {
    top: var(--rail-mid) !important;
    left: calc(var(--space-sm) + var(--rail-star) / 2) !important;
  }
  .wu-hud:has(.wu-rail-quit-slot :is(button, .wu-rail-quit)) .wu-rail-star,
  .wu-hud:has(.wu-rail-trail-slot .wu-rail-trail) .wu-rail-star { display: none !important; }
  /* The ✕ in the right corner; the countdown sits beside it. Help is in the
     ★ menu (owner, 2026-11-21). */
  /* The second selector is #244's own, repeated: it pins the ✕ with
     !important at that weight, and a later rule of equal weight wins. */
  .wu-rail-quit-slot,
  .wu-rail[data-sub="1"]:has(.wu-rail-trail-slot .wu-rail-trail) .wu-rail-quit-slot {
    top: calc(var(--rail-mid) - 22px) !important;
    left: auto !important;
    right: var(--space-sm) !important;
  }
  .wu-rail-top {
    top: var(--rail-mid) !important;
    bottom: auto !important;
    left: auto !important;
    right: var(--space-sm) !important;
    transform: translateY(-50%) !important;
    flex-direction: row !important;
  }
  :is(.wu-rail-trail-slot, .wu-rail-sub-slot, .wu-rail-mode-slot) {
    top: calc(var(--rail-mid) - 22px) !important;
    bottom: auto !important;
  }
  .wu-rail-trail-slot { left: var(--space-sm) !important; }
  /* Circle names open BELOW the bar now, staggered as before. */
  .wu-rail-trail-name,
  .wu-modal-chrome .wu-rail-trail-name {
    bottom: auto !important;
    top: calc(100% + var(--space-xs)) !important;
  }
  :is(.wu-rail-sub-slot, .wu-rail-mode-slot) .wu-rail-trail-name,
  .wu-modal-chrome :is(.wu-rail-sub-slot, .wu-rail-mode-slot) .wu-rail-trail-name {
    top: calc(100% + var(--space-xs) + 34px) !important;
  }
  /* The ★ menu DROPS from the bar. */
  .wu-rail-drawer {
    top: 0 !important;
    bottom: auto !important;
    padding-top: calc(var(--bar-top-h) + var(--space-md)) !important;
    padding-bottom: var(--space-md) !important;
    border-top: 0 !important;
    border-bottom: 1px solid var(--colour-border) !important;
    border-radius: 0 0 var(--radius-shell) var(--radius-shell) !important;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18) !important;
  }
  .wu-rail[data-collapsed="true"] .wu-rail-drawer { transform: translateY(-8px) !important; }
  /* ⬇️ 🗓️ and the profile in the bar's RIGHT corner (#290, owner: "shall
     the profile and dock pill move to the bar so the modals can extend the
     full height within the hex frame?"). Only home carries them, and the ✕
     only exists off home, so the corner is never shared. */
  .wu-rail-quick {
    position: fixed !important;
    top: calc(var(--rail-mid) - 20px) !important;
    bottom: auto !important;
    left: auto !important;
    right: calc(var(--space-sm) + var(--safe-right)) !important;
    transform: none !important;
    flex-direction: row !important;
    gap: var(--space-sm) !important;
  }
  .wu-rail-quick .wu-rail-q {
    width: 40px !important;
    height: 40px !important;
    background: var(--colour-surface) !important;
    border: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  }
  /* The websites countdown sits beside the ★ on home — the right corner is
     the buttons'. Off home it stays by the ✕ (above). */
  .wu-rail:not([data-sub="1"]) .wu-rail-top {
    left: calc(var(--space-sm) + var(--rail-star) + var(--space-sm)) !important;
    right: auto !important;
  }
  /* The stats moved INTO THE PROFILE CARD (#290, owner: "the stats at the
     base appear lost and clash with the modals"). What is left at the foot
     is a view's own chip (games' Help), centred. */
  .wu-rail-stats { display: none !important; }
  /* A view's own chips (games' Help and 🎟️, Practice's ?) sit in the bar's
     RIGHT corner, beside the ✕ where there is one (owner, 2026-11-21, #294:
     "move the help and tickets to the top… move the help next to X"). */
  .wu-rail-below {
    position: fixed !important;
    top: calc(var(--rail-mid) - 22px) !important;
    bottom: auto !important;
    left: auto !important;
    right: var(--space-sm) !important;
    transform: none !important;
    flex-direction: row !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
  }
  .wu-rail:has(.wu-rail-quit-slot :is(button, .wu-rail-quit)) .wu-rail-below,
  /* …and on a full-screen page's bar too (#307: the Word Bank's 🔍 sat
     exactly under its ✕ — this offset was written for the rail only). */
  .wu-modal-chrome:has(.wu-rail-quit-slot :is(button, .wu-rail-quit)) .wu-rail-below {
    right: calc(var(--space-sm) + 44px + var(--space-sm)) !important;
  }
  .wu-rail-below .wu-rail-extra { flex-direction: row !important; gap: var(--space-sm) !important; }
  .wu-rail-below .wu-rail-extra .wu-hud-chip { background: var(--colour-surface); }
  /* A DOT on the profile button when something waits for a grown-up — a
     🧾 approval, or an app update ready — and the card says which (#290).
     Pure CSS on state the app already keeps, so it can never go stale. */
  /* ::before — ::after is the button's 44px tap area (#88). */
  .wu-rail:has(#wu-stat-confirm[data-zero="false"]) #wu-profile-chip::before,
  body:has(.wu-update-banner) #wu-profile-chip::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--colour-danger);
    border: 2px solid var(--colour-surface);
    pointer-events: none;
    z-index: 1;
  }
  /* Empty = no visible view chip (the stats are in the profile card, and
     the game chips hide with .wu-hidden, not [hidden]). */
  .wu-rail-below:not(:has(.wu-rail-extra > :not([hidden]):not(.wu-hidden))) { display: none !important; }
  /* Full-screen pages: their circle bar moves to the top as well. */
  .wu-modal-chrome {
    top: 0 !important;
    bottom: auto !important;
    height: var(--bar-top-h) !important;
    padding: var(--safe-top) var(--space-sm) 0 !important;
    border-radius: 0 0 var(--radius-shell) var(--radius-shell) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
  }
  /* The same bar as home and activities: the name in the centre, the ✕ on
     the right. Without these a page put its ✕ beside the circle. */
  .wu-modal-chrome::after {
    content: "WarmUp";
    position: absolute;
    left: 50%;
    top: calc(var(--safe-top) + (var(--bar-top-h) - var(--safe-top)) / 2);
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    font-size: 18px;
    letter-spacing: 0.02em;
    color: #fff;
    pointer-events: none;
    white-space: nowrap;
  }
  .wu-modal-chrome .wu-rail-quit-slot { order: 99; margin-left: auto; }
  /* The wordmark, larger (owner, 2026-11-21, #294) — 24px where the bar has
     room, 20px on a phone so it clears the three buttons on the right. */
  .wu-rail-spine::after,
  .wu-modal-chrome::after { font-size: 24px; }
  /* On the games flower the bar says where you are. */
  body:has(.wu-game-mark) .wu-rail-spine::after { content: "WarmUp - Play Games"; }
  :root .wu-drill-layer.wu-layer-modal:not(.wu-jrnpage-full) {
    padding-bottom: calc(var(--layer-pad-y) + var(--safe-bottom)) !important;
    padding-top: calc(var(--layer-pad-y) + var(--bar-top-h)) !important;
  }
  :root .wu-drill-layer.wu-jrnpage-full {
    padding-bottom: var(--safe-bottom) !important;
    padding-top: var(--bar-top-h) !important;
  }
  /* DOCKED, the journey lives INSIDE the frame, which already starts below the
     bar — so the bar's height was reserved twice: a 56px white band over the
     map (#304, owner: "journey to be full height"). */
  :root .wu-drill-layer.wu-jrnpage-full.wu-jrnpage-docked {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  /* The week window RISES FROM THE BOTTOM of the frame (owner, 2026-11-21:
     "the weekly to appear from the bottom, not the top"); the profile card
     drops from the top. One right-hand column inside the frame (#290), the two
     meeting in the middle. FIXED to the viewport so it shares the card's right
     edge. Its height is capped by the card above (--prof-stack), and the card
     gives up room for it when both are open (sheets.css). */
  .wu-wkd {
    position: fixed;
    right: calc(var(--space-md) + var(--space-sm) + var(--safe-right));
    top: auto;
    bottom: calc(var(--space-md) + var(--space-sm) + var(--safe-bottom));
  }
  /* The frame's corners match the cards inside it (owner, #290) — 18px,
     down from the 28px shell radius. */
  .wu-honeycomb-pane { border-radius: 18px; }
  .wu-wkd-panel {
    transform-origin: bottom right;
    max-height: calc(100vh - var(--bar-top-h) - 2 * (var(--space-md) + var(--space-sm)) - var(--prof-stack, 0px) - var(--safe-bottom));
    overflow-y: auto;
  }
}
/* A phone keeps the week window DOCKED at the foot (#285), inside the frame. */
@media (orientation: portrait) and (max-width: 599px) {
  .wu-wkd {
    top: auto;
    left: calc(var(--space-md) + var(--space-sm));
    right: calc(var(--space-md) + var(--space-sm));
    bottom: calc(var(--space-md) + var(--space-sm) + var(--safe-bottom));
  }
  .wu-wkd-panel { max-height: none; overflow-y: visible; }
}

/* Phone wordmark (#294) — after the layout-B block so it wins on size. */
@media (orientation: portrait) and (max-width: 599px) {
  .wu-rail-spine::after,
  .wu-modal-chrome::after { font-size: 20px !important; }
  body:has(.wu-game-mark) .wu-rail-spine::after { font-size: 17px !important; }
}

/* ══ THE LOCATION PILL SHOWS ITS NAME (#294) ════════════════════════════════
   Owner, 2026-11-21: "the pill on the top left now has space to display
   always the text". With the bar on top the circle no longer has to hide its
   name, so the name sits INLINE and stays open. Only one circle ever shows on
   the left in this layout (#244: the exercise circle replaces the subject one,
   🏃 rides as a badge), so nothing else has to make room. Capped so it never
   reaches the centred wordmark; on a phone the wordmark gives way instead. */
@media (orientation: portrait), (min-height: 501px) {
  :is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail-name,
  .wu-modal-chrome :is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail-name {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    max-width: calc(50vw - 200px) !important;
    opacity: 1 !important;
    margin: 0 6px 0 4px !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* 🏃 badge on the pill's top-RIGHT corner (owner), wherever the name ends —
     hud.js publishes that edge as --pill-end. */
  .wu-rail[data-sub="1"] .wu-rail-mode-slot { left: calc(var(--pill-end, 52px) - 16px) !important; top: calc(var(--rail-mid) - 24px) !important; }
}
@media (orientation: portrait) and (max-width: 599px) {
  :is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail-name,
  .wu-modal-chrome :is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail-name {
    max-width: calc(100vw - 150px) !important;
  }
  .wu-rail:has(:is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail) .wu-rail-spine::after,
  .wu-modal-chrome:has(:is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail)::after { display: none !important; }
}

/* Toasts drop BELOW the top bar (#296, final audit A): at its old 24px offset a
   toast ("This round: nós …") sat on the bar and hid the WarmUp wordmark. */
@media (orientation: portrait), (min-height: 501px) {
  .wu-toast { top: calc(var(--bar-top-h, 56px) + var(--space-sm)); }
}

/* The grid menu's "Activities" heading no longer fits a row that ends in
   Avatar and Parent Settings (#298); the groups speak for themselves. */
.wu-rail-grid .wu-rail-group-t { display: none; }
/* ★ menu group separator (#298) — a subtle hairline. Full width in the side
   drawer's grid; the row and phone layouts above turn it vertical / a line break. */
.wu-rail-brk { display: none; }
.wu-rail-sep {
  grid-column: 1 / -1;
  height: 1px;
  margin: 2px var(--space-xs);
  background: var(--colour-border);
}

/* A sideways phone (where games run, #229) shows the location CIRCLE only — the
   name sliding open broke the game's top info row (#349, owner 2026-11-23:
   "the break of the top info display on games is caused by the game pill name
   animation. We should remove it on mobile"). Tablet and desktop keep the name
   inline in the top bar, where there is room for it. */
@media (orientation: landscape) and (max-height: 500px) {
  :is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail-name,
  .wu-modal-chrome :is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail-name {
    display: none !important;
    animation: none !important;
  }
}

/* A tighter top bar on a portrait phone (#350, owner 2026-11-24: "Top bar on
   mobile to be tighter and aware of camera" → option A). 56 → 48px: the
   circles are 44px tap targets, so 48 is as low as the bar goes without the
   buttons touching its edges. The WarmUp wordmark leaves the phone bar — the
   centre is where a mid-top camera sits, and the corners hold the controls.
   The camera band itself is still cleared by --safe-top above the bar; the
   exact cut-out position comes from the APK in 1.14 (option C). */
@media (orientation: portrait) and (max-width: 599px) {
  :root { --bar-top-h: calc(48px + var(--safe-top)) !important; }
  body { --rail-mid: calc(var(--safe-top) + 24px) !important; }
  .wu-rail-spine::after { display: none !important; }
}

/* 📷 The bar IN the camera strip (#499, camera-band.js): data-cam is set only
   where the APK says exactly where the camera is and the buttons can miss it.
   The bar's height and its control line move up; the side with the camera
   slides past it. The 🏃 badge is placed from the pill's measured end, so it
   follows by itself and must not be moved twice. */
@media (orientation: portrait) and (max-width: 599px) {
  :root[data-cam] { --bar-top-h: var(--cam-bar) !important; }
  :root[data-cam] body { --rail-mid: calc(var(--cam-bar) - 26px) !important; }
  :root[data-cam] .wu-modal-chrome { padding-top: calc(var(--cam-bar) - 52px) !important; }
  :root[data-cam] .wu-modal-chrome::after { display: none !important; } /* the centre is the camera's */
  :root[data-cam] :is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail-name,
  :root[data-cam] .wu-modal-chrome :is(.wu-rail-trail-slot, .wu-rail-sub-slot) .wu-rail-trail-name {
    max-width: var(--cam-name) !important;
  }
  :root[data-cam="left"] :is(.wu-rail-star, .wu-rail-trail-slot, .wu-rail-sub-slot),
  :root[data-cam="left"] .wu-rail:not([data-sub="1"]) .wu-rail-top { translate: var(--cam-l) 0; }
  :root[data-cam="right"] :is(.wu-rail-quit-slot, .wu-rail-quick, .wu-rail-below),
  :root[data-cam="right"] .wu-rail[data-sub="1"] .wu-rail-top { translate: var(--cam-r) 0; }
}

/* 📷 The same for a game's bar on a sideways phone (#514): the bar takes the
   camera strip instead of standing beside it. With the strip's inset at 0 and
   the bar's width the plan's, everything placed from those two tokens follows.
   Off home only: at home the ★ sits in the bar's middle, where the camera is. */
@media (orientation: landscape) and (max-height: 500px) {
  :root[data-phone][data-cam-side]:has(.wu-rail[data-sub="1"]) { --rail-bar-w: var(--cam-bar); --rail-w: var(--cam-bar); }
  :root[data-phone][data-cam-side="left"]:has(.wu-rail[data-sub="1"]) { --safe-left: 0px; }
  :root[data-phone][data-cam-side="right"]:has(.wu-rail[data-sub="1"]) { --safe-right: 0px; }
  :root[data-phone][data-cam-side] .wu-rail[data-sub="1"] :is(.wu-rail-trail-slot, .wu-rail-quit-slot, .wu-rail-star) { translate: 0 var(--cam-t, 0px); }
  :root[data-phone][data-cam-side]:has(.wu-rail[data-sub="1"]) :is(.wu-rail-sub-slot, .wu-rail-mode-slot, .wu-rail-below, .wu-mimi-pill) { translate: 0 var(--cam-f, 0px); }
}

/* ✕ AT THE TOP, THE REST AT THE FOOT — a sideways phone, off home (#351, owner
   2026-11-24: "The star is working as X here. I think it should revert to X so
   it only appears as menu on the main flower screen … X at the top and other
   buttons on the bottom"). Off home the ★ already LEFT (it went home), so it was
   an exit wearing the menu's face. Now: a screen with a ✕ of its own shows only
   that ✕, at the top of the bar; a screen without one (the games launcher) gets
   the ★ repainted as a ✕ in the same place — same handler, same abandon guard.
   The circles (where you are) and the view's own chips stack from the FOOT. */
@media (orientation: landscape) and (max-height: 500px) {
  :root[data-phone] .wu-rail[data-sub="1"] .wu-rail-quit-slot,
  :root[data-phone] .wu-rail[data-sub="1"]:has(.wu-rail-sub-slot:not(:empty)) .wu-rail-quit-slot {
    top: calc(var(--support-top) + 44px + var(--space-sm)) !important;
    bottom: auto !important;
  }
  :root[data-phone] .wu-rail[data-sub="1"]:has(.wu-rail-quit-slot .wu-rail-quit:not([hidden])) .wu-rail-star {
    display: none !important;
  }
  :root[data-phone] .wu-rail[data-sub="1"] .wu-rail-star {
    top: calc(var(--support-top) + 44px + var(--space-sm) + 22px) !important;
    width: 44px !important;
    height: 44px !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 1.5px solid rgba(255, 255, 255, 0.55) !important;
  }
  :root[data-phone] .wu-rail[data-sub="1"] .wu-rail-arc { display: none !important; }
  :root[data-phone] .wu-rail[data-sub="1"] .wu-rail-star-glyph { font-size: 0 !important; }
  :root[data-phone] .wu-rail[data-sub="1"] .wu-rail-star-glyph::before {
    content: "✕";
    font-size: 18px;
    font-weight: var(--font-weight-bold);
    color: #fff;
  }
  /* The foot stack: location circle lowest, the exercise circle and the
     practice circle above it, then the view's chips. */
  :root[data-phone] .wu-rail[data-sub="1"] {
    --foot0: calc(var(--safe-bottom) + var(--space-md));
    --step: calc(44px + var(--space-sm));
  }
  /* GAME PILL AT THE TOP, ✕ UNDER IT, MIMI AT THE FOOT (#371, owner
     2026-11-25: "game pill at the top, cross below, and mimi at the bottom of
     the bar"). Mimi's pill takes the foot slot the circle had; the chips keep
     stacking above it. */
  :root[data-phone] .wu-rail[data-sub="1"] .wu-rail-trail-slot {
    top: var(--support-top) !important;
    bottom: auto !important;
  }
  :root[data-phone] .wu-rail[data-sub="1"] :is(.wu-rail-sub-slot, .wu-rail-mode-slot) {
    top: auto !important;
    bottom: calc(var(--foot0) + var(--step)) !important;
  }
  :root[data-phone] .wu-rail[data-sub="1"]:has(.wu-rail-sub-slot:not(:empty)) .wu-rail-mode-slot {
    bottom: calc(var(--foot0) + 2 * var(--step)) !important;
  }
  :root[data-phone] .wu-rail[data-sub="1"] .wu-rail-below {
    top: auto !important;
    bottom: calc(var(--foot0) + var(--step)) !important;
  }
  :root[data-phone] .wu-rail[data-sub="1"]:has(:is(.wu-rail-sub-slot, .wu-rail-mode-slot):not(:empty)) .wu-rail-below {
    bottom: calc(var(--foot0) + 2 * var(--step)) !important;
  }
  :root[data-phone] .wu-rail[data-sub="1"]:has(.wu-rail-sub-slot:not(:empty)):has(.wu-rail-mode-slot:not(:empty)) .wu-rail-below {
    bottom: calc(var(--foot0) + 3 * var(--step)) !important;
  }
}

/* ⏭ SKIP REGISTRATION (#374): the account-only chrome is not drawn. The
   profile disc and the week window go — there is no profile and no week plan
   without an account. The ★ menu builds its own reduced list (home.js). */
html.wu-trial #wu-profile-chip,
html.wu-trial #wu-wkd-btn,
html.wu-trial .wu-wkd { display: none !important; }
