/* ============================================================================
   STEMeUp — the shared application shell.

   The rail, the canvas, the design tokens and the component vocabulary, lifted
   out of the learner home (home/home.css) so the professional surfaces can
   adopt the same product rather than a second copy of it. There is exactly one
   rail in this codebase and this is where it lives.

   LOAD ORDER — always these three, in this order:
       branding.css      fonts, the legacy palette, .sm-* overlay chrome
       shell.css         this file: tokens, scales, rail + canvas, components
       <your page>.css   whatever is genuinely local to one screen

   HOW A PAGE OPTS IN
       <link rel="stylesheet" href="/static/branding.css">
       <link rel="stylesheet" href="/static/shell.css">
       <script src="/static/shell.js"></script>   then call Shell.mount(...)
   (each with its ?v= stamp, written by scripts/dev/sync_asset_versions.py)
   A professional page also sets <html data-density="pro"> — see DENSITY below.
   The twelve director screens do all of that through one shared config,
   static/director-shell.js, rather than repeating it twelve times; the two
   carer screens do the same through static/carer-shell.js.

   A surface where navigation may not hide behind a hamburger also sets
   <html data-rail="wide-only"> — see NAVIGATION TIERS below. The two attributes
   are independent: the carer surface takes the tier and NOT the density.

   A page may adopt this file for its tokens ALONE — link it, never call
   mount(). carer-primer.html does: it is public, static and printable, and a
   rail whose main section is "Your children" has nothing to populate for a
   signed-out visitor. Such a page writes its own <main> and skip link, because
   mount() is what would otherwise have rendered them.

   WHAT THIS FILE DELIBERATELY DOES NOT DEFINE
     .top-bar / .glass-chrome   branding.css:172 owns them; eight pages layer
                                their own display:flex on top, so redefining
                                here would move all eight at once.
     .toast / .sm-*             the product toast is SM.toast (static/utils.js,
                                styled branding.css:98-105). Three toasts
                                already exist; a fourth would be the fork.
     --status-risk, --status-good, --status-safeguard(-rgb)
                                these belong to branding.css. CONSUME them here
                                and on any page; never redeclare them, or the
                                safeguarding amber ends up meaning two things.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens --
   The three themes, written against theme-able names. Purple is the default;
   the black and white blocks moved here from home/home.css on 2026-08-24 —
   the founder's 2026-08-22 build list (items 4+5) made the background choice
   an accessibility setting for EVERY signed-in account (carers first, staff
   next), so it stopped being a learner-only feature. The learner home keeps
   only its Quest-specific [data-theme] contrast overrides. Values are
   Quest's, unchanged — extraction, not redesign. */
:root, :root[data-theme="purple"]{
  --paper:#260B37; --surface:#37164E; --rail:#2E1242; --rail-edge:#412158;
  --ink:#F5EEFB; --muted:#C6B4DE; --faint:#9A86BD; --line:rgba(255,255,255,.12);
  --accent:#F6BD00; --accent-ink:#FFD23F; --on-accent:#260B37; --accent-wash:rgba(246,189,0,.16);
  /* --xp / --xp-track have no consumer anywhere in the tree (grep: zero
     var(--xp) uses). Carried unchanged so the three theme blocks stay
     symmetric; a deliberate cleanup can drop all three copies at once. */
  --xp:#F6BD00; --xp-track:rgba(255,255,255,.14); --goldtext:#FFCB3A; --track:rgba(255,255,255,.16);
  /* Hearts (engagement.hearts). The palette had no red at all: gold already
     means "at stake" on the streak chip, so reusing it would make the two
     mechanics visually indistinguishable. Light enough to clear 3:1 on dark. */
  --heart:#FF6B7A;
  /* The rail's current page (.nav-item.on): the logo's violet, flat, white text and a gold icon.
     The same in all three themes. */
  --nav-on-bg:#4C1FCB; --nav-on-ink:#FFFFFF; --nav-on-icon:#FFD23F;
  --glass-bg:rgba(66,32,92,.5); --glass-border:rgba(255,255,255,.22);
  --glass-shadow:0 22px 54px -12px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.28);
  --shadow:0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.4);
}
:root[data-theme="black"]{
  --paper:#0E1116; --surface:#171C24; --rail:#12161C; --rail-edge:#242B35;
  /* --faint was #6B7787: 3.76 on --surface, below the 4.5 WCAG AA floor for the
     11–12.5px labels that use it. Same hue and saturation, lifted until every
     surface in this theme clears it (paper 5.13, surface 4.64, rail 4.92). */
  --ink:#EAEEF3; --muted:#9AA6B4; --faint:#7B8696; --line:rgba(255,255,255,.10);
  --accent:#F6BD00; --accent-ink:#FFD23F; --on-accent:#1A1205; --accent-wash:rgba(246,189,0,.15);
  --xp:#F6BD00; --xp-track:rgba(255,255,255,.12); --goldtext:#FFCB3A; --track:rgba(255,255,255,.13);
  --heart:#FF6B7A;
  --nav-on-bg:#4C1FCB; --nav-on-ink:#FFFFFF; --nav-on-icon:#FFD23F;
  --glass-bg:rgba(23,28,36,.55); --glass-border:rgba(255,255,255,.16);
  --glass-shadow:0 22px 54px -12px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.18);
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.5);
}
:root[data-theme="white"]{
  --paper:#FBF9FC; --surface:#FFFFFF; --rail:#F4ECF6; --rail-edge:#E9DEEE;
  /* --faint was #9A8AAC: 2.75–3.18 across this theme's surfaces, the worst of
     the three. Same hue and saturation, darkened until all clear (paper 5.10,
     surface 5.34, rail 4.62). */
  --ink:#260B37; --muted:#6B5A7A; --faint:#76638C; --line:#ECE3F0;
  /* --accent-ink was #B8890B, which is fine at large sizes but 2.84–3.17:1 as
     NORMAL text on this theme's white and cream surfaces (role chips, gold
     counts, group headings — measured on the rendered VSH pages, 2026-09-01).
     Darkened until the WORST white-theme surface it writes on (the gold-wash
     cream behind a role chip) clears the 4.5 floor: 4.93 there, 5.51 on pure
     white. As a FILL under this theme's near-white text it is also 5.26+, so
     the gold buttons that paint with it stay readable too. */
  --accent:#F6BD00; --accent-ink:#826508; --on-accent:#260B37; --accent-wash:rgba(246,189,0,.18);
  --xp:#E0A800; --xp-track:#EDE2CF; --goldtext:#B8890B; --track:#E4D9EC;
  --heart:#C2334A;
  --nav-on-bg:#4C1FCB; --nav-on-ink:#FFFFFF; --nav-on-icon:#FFD23F;
  --glass-bg:rgba(255,255,255,.6); --glass-border:rgba(255,255,255,.75);
  --glass-shadow:0 20px 50px -14px rgba(38,11,55,.28), inset 0 1px 0 rgba(255,255,255,.95);
  --shadow:0 1px 2px rgba(38,11,55,.05), 0 10px 26px rgba(38,11,55,.09);

  /* THE FIGURE INK, RE-INKED FOR A LIGHT GROUND.
     Every SVG this product draws takes its colours from --fig-* with DARK
     fallbacks baked into visuals/primitives.py (`var(--fig-text, #e5e7eb)`),
     because the platform's default ground is dark purple. Nothing overrode
     them on the white theme, so #e5e7eb — a near-white grey — was the ink on
     a white card: measured at 1.2:1 on the carer primer's chart legends and
     its £14,579 value labels, which is not "low contrast", it is invisible.

     DECLARED HERE, ONCE, rather than on a host. There are ten figure hosts
     (.guide-visual, .dg-fig, .wm-fig, .ask-visual, .teach-visual, .we-visual,
     .t-visual, .d-visual, .av-fig, .av-opt-fig) and carer-progress.html had
     already copied this set onto one of them; a second copy on a second host
     is how three of them end up disagreeing. A host that genuinely needs
     different ink still wins on specificity.

     The values are the ones carer-progress measured and shipped, not new
     guesses. `background` is NOT set here: an opaque paper is a property of a
     particular figure box, and the hosts that need one set it themselves. */
  --fig-text:#1e293b; --fig-axis:#475569;
  --fig-gold:#a16207; --fig-teal:#0e7490;
  --fig-faint:rgba(71,85,105,0.35);
  --fig-shade:rgba(14,116,144,0.45);  /* a stored drawing's shaded shape (2026-11-05) */
  --fig-knockout:rgba(255,255,255,0.85);
  --fig-knockout-soft:rgba(255,255,255,0.55);
  --fig-iso-top:#3f9aa4; --fig-iso-right:#2b6d75; --fig-iso-left:#174449;
  /* the edge becomes the card-coloured SEAM between faces — the dark fallback
     edge read 1.08:1 against the darkened left face */
  --fig-iso-edge:#ffffff;
}

/* ---- the three scales neither half had --------------------------------
   Named after their own value, so substituting a token for a literal is
   verifiable by reading rather than by trusting a lookup table. The
   professional pages carry 32 distinct font sizes and 19 distinct radii
   today; these are what replace them, one screen at a time. */
:root{
  --space-2:2px;   --space-4:4px;   --space-6:6px;   --space-8:8px;
  --space-10:10px; --space-12:12px; --space-14:14px; --space-16:16px;
  --space-18:18px; --space-20:20px; --space-24:24px; --space-32:32px;
  --space-40:40px; --space-56:56px; --space-64:64px;

  --text-10:10px;   --text-11:11px;     --text-11-5:11.5px; --text-12:12px;
  --text-12-5:12.5px; --text-13:13px;   --text-13-5:13.5px; --text-14:14px;
  --text-16:16px;   --text-19:19px;     --text-22:22px;     --text-26:26px;
  --text-34:34px;

  --radius-xs:6px;  --radius-sm:8px;  --radius-md:10px; --radius-lg:12px;
  --radius-xl:16px; --radius-2xl:20px; --radius-pill:99px; --radius-circle:50%;

  --focus-ring:2px solid var(--accent);

  /* One ladder, so a new overlay stops being a guess. NB the skip link and
     the learner home's PIN overlay both sit at 400 today; documented rather
     than silently changed, because moving either is a Quest change.

     --z-modal is the one an ADOPTING PAGE needs, and it is above the rail on
     purpose. A page-local overlay written before the shell existed picks a
     number like 60 — which was fine when the page was the whole document, and
     puts the overlay UNDERNEATH the rail (200) the moment the page mounts.
     Above --z-rail-open too, or the floating show-menu button punches through
     a modal at narrow widths. Below --z-skip: the first Tab stop wins. */
  --z-topbar:20; --z-sheet:120; --z-backdrop:150; --z-rail:200;
  --z-rail-resize:210; --z-rail-open:300; --z-modal:350; --z-skip:400;
  --z-toast:500;
}

/* ---- DENSITY ------------------------------------------------------------
   Share the scale, not the step. A carer looks at one child; a Virtual School
   Head looks at three hundred. The raw scale above never moves; these
   semantic tokens do, and the shell's own rules are written against them.

   The defaults ARE the learner home's current numbers, so the extraction is
   value-identical there. A professional page opts into the tighter set with
   <html data-density="pro">. */
:root{
  --pad-page:32px 36px 64px;
  --pad-card:22px;
  --gap-stack:18px;
  --text-body:14px;
  --text-label:11px;
  --nav-item-pad:9px 10px;
  --nav-gap:12px;
  --row-min-h:44px;
  /* How tall the sticky .topbar actually renders, and it is a DENSITY token
     because it depends on one: the bar's height is its padding plus whatever
     the page put in it, and a .btn at this density is 45px against 33px at pro.
     Measured, not guessed — 14+45+14+1px border here, 10+33+10+1 at pro.

     Why a page needs it: an in-page #anchor jump scrolls the target to viewport
     top, which is BEHIND a sticky bar, so a page with anchor navigation sets
     scroll-margin-top: calc(var(--topbar-h) + <its own breathing room>).
     Deliberately NOT enforced with a min-height on .topbar — that would move
     every already-adopted screen's bar to whichever number won. Overshooting
     leaves a heading sitting slightly low; undershooting hides it. */
  --topbar-h:74px;
}
:root[data-density="pro"]{
  --pad-page:24px 28px 48px;
  --pad-card:16px 18px;
  --gap-stack:12px;
  --text-body:13px;
  --text-label:10.5px;
  /* The rail is the one thing a professional page draws LARGER than the learner
     home, not tighter: staff read it at a glance between tasks, and at 7px 10px
     it read as small print (2026-10-26). The row's height is set with it, under
     "THE PROFESSIONAL RAIL". */
  --nav-item-pad:0 12px;
  --nav-gap:12px;
  --row-min-h:36px;
  /* 55, not 54. Measured on /access and /alerts at 1440/1024/820: the bar
     renders 55px because .topbar carries a 1px border-bottom that
     getBoundingClientRect includes, and 54 was set without it — so the token
     UNDERSHOT on all 19 staff/director pages, which is the direction this
     token's own comment calls the bug ("undershooting hides it"). PRE-EXISTING:
     measured identically with the background switch removed, so item 5 did not
     cause it and the compact 24px seg (32px tall) fits inside the 34px the
     sign-out button already sets. The default tier's 74px was evidently
     measured WITH the border and needs no change. */
  --topbar-h:55px;
}

/* ---- NAVIGATION TIERS ---------------------------------------------------
   A second named tier, and a sibling to DENSITY above rather than a special
   case: DENSITY answers "how much does this audience look at", this answers
   "how is navigation allowed to be reached".

   The default is the drawer. Below the mobile breakpoint the rail slides
   off-canvas and .rail-open — a hamburger — brings it back. That is right for
   the professional console: sixteen destinations cannot sit on a phone screen,
   and the audience uses this software daily.

   <html data-rail="wide-only"> is for a surface where a hamburger is not
   allowed. The carer surface is the first: it has an explicit design rule that
   NOTHING is hidden behind a toggle, because the audience has low digital
   confidence and the current design deliberately shows everything. A drawer
   behind a hamburger IS a disclosure control, so the drawer does not apply —
   the rail simply stops existing below the breakpoint, and the page's
   .nav-fallback (in the topbar, always visible) carries navigation instead.

   This is a TIER and not carer page CSS on purpose. Written page-side, the two
   halves — suppressing the drawer, and revealing what replaces it — would sit
   in different files from the rules they override, and the next surface with
   the same constraint would re-derive it or quietly get a hamburger back.

   Never both, never neither: above the breakpoint the rail is the navigation
   and .nav-fallback is hidden; below it, the reverse. */
/* THIS RULE OWNS `display`. Do not also give the element a component class
   that sets display — .back-link does, and it is declared later in this file, so
   it wins and the fallback appears at every width including the ones that
   already have a rail (it also carries a 20px bottom margin written for a link
   sitting above page content, which pads the topbar). Style the element from the
   page instead; that is all the carer pages do. */
.nav-fallback{ display:none; align-items:center; gap:var(--space-6);
  /* A tap target, not a text link. This is the ONLY navigation at these
     widths and the audience is on a phone. */
  min-height:44px; }

@media (max-width:840px){
  :root[data-rail="wide-only"] .rail,
  :root[data-rail="wide-only"] .rail-open,
  :root[data-rail="wide-only"] .backdrop{ display:none; }
  /* The default mobile rule pads the topbar 60px on the left to clear the
     floating show-menu button. Under this tier there is no button to clear.
     14px vertical, matching the wide bar, so --topbar-h stays exact at every
     width on a surface whose anchor navigation depends on it. */
  :root[data-rail="wide-only"] .topbar{ padding:14px 18px; }
  /* Narrow bars got a third occupant when the background switch moved into the
     topbar (a11y-parity). Measured at 390px: the lead is 145px, the seg 96px
     and Sign out needs 96px = 337px, against 318px of content width — 19px
     over, so Sign out was squeezed to 77px, its label wrapped to two lines,
     and the bar grew 74px -> 95px while --topbar-h still said 74. That token
     is what anchor jumps offset by, so undershooting hides the heading a
     carer just tapped to reach.
     The space is recovered from SPACING, not from the controls: shrinking the
     seg is the one thing not worth doing here, because a 28px target on a
     phone is already the smallest any of this should get, and it is the
     accessibility control. Nothing is hidden and nothing shrinks. */
  :root[data-rail="wide-only"] .topbar{ gap:6px; padding:14px 14px; }
  /* ...and the space has to come from the RIGHT thing. Tightening the gaps
     alone did nothing: .topbar-lead simply absorbed it (145px -> 166px) and
     Sign out stayed crushed. In a flex row the item that gives way should be
     the flexible LABEL, not the fixed control — so the button holds its
     intrinsic width and refuses to wrap, and the lead (already min-width:0)
     truncates instead. */
  :root[data-rail="wide-only"] .topbar > .btn{ flex:0 0 auto; white-space:nowrap; }
  /* ...and the shortfall has to land on the DECORATION, never on navigation.
     The first version of this rule was measured on the hub only, whose lead is
     the wordmark alone. The SPOKE (carer-progress) also carries the "All
     children" back link — and under this tier the rail does not exist below
     840px, so that link IS the navigation. Making .btn rigid pushed the whole
     shortfall into .topbar-lead; .brand has min-width:0 but .brand-name is
     white-space:nowrap, so the wordmark overflowed its own box and painted
     across the link: 62.7px of 74px at 360, 32.8px at 390 (measured).
     So: navigation never shrinks, and the wordmark TRUNCATED instead of
     overflowing. The clip lives on .brand, not on .topbar-lead — putting it on
     the lead cut 4px off the back link's focus ring, which is the one control
     a keyboard user has at that width. Since 2026-11-21 the brand is the logo
     artwork, which cannot truncate, so it SHRINKS inside the clip (THE LOGO,
     below: .brand-mark gives way, its picture is max-width:100%). */
  :root[data-rail="wide-only"] .topbar .nav-fallback{ flex:0 0 auto; }
  :root[data-rail="wide-only"] .topbar .brand{ min-width:0; overflow:hidden; }
  /* The brand lives in the rail, and the rail is gone: it moves into the bar
     the rail vacated rather than disappearing off the product entirely. */
  :root[data-rail="wide-only"] .topbar .brand{ display:flex; }
  :root[data-rail="wide-only"] .nav-fallback{ display:inline-flex; }
}

/* ----------------------------------------------------------------- base -- */
*{ box-sizing:border-box; }
/* The page is flat --paper. It used to carry a radial glow of --accent at 9%
   from the top; gold over the purple paper mixes to a plum-brown (#391B32 at its
   peak), which read as a stain, not light. Removed 2026-11-18 alongside the
   plain rail (PR #480), which dropped its own glow for the same reason. */
body{ margin:0; background:var(--paper); color:var(--ink);
  font-family:"Poppins",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  -webkit-font-smoothing:antialiased; line-height:1.5; transition:background .3s ease, color .3s ease; }
.display{ font-family:"ITC Ronda","Poppins",sans-serif; }
.num{ font-family:"Poppins",sans-serif; font-variant-numeric:tabular-nums; }
a{ color:inherit; }

/* ---------------------------------- shell --------------------------------
   --rail-w is written as an INLINE style on <html> by the drag-resize in
   shell.js and is deliberately not declared in :root: the resize handler
   reads the computed value back to decide whether to persist it, and an
   always-present declaration would change that read. 270px is the default. */
.app{ display:grid; grid-template-columns:var(--rail-w,270px) 1fr; min-height:100vh; }
.app.railhidden{ grid-template-columns:1fr; }
.app.railhidden .rail{ display:none; }
.backdrop{ display:none; }

.rail{ background:var(--rail); border-right:1px solid var(--rail-edge); display:flex; flex-direction:column;
  padding:16px 12px; position:sticky; top:0; height:100vh; overflow-y:auto; overflow-x:hidden; z-index:200;
  box-shadow:7px 0 22px -10px rgba(0,0,0,.35); }
.rail::-webkit-scrollbar{ width:6px; } .rail::-webkit-scrollbar-thumb{ background:var(--rail-edge); border-radius:99px; }
.rail-resize{ position:absolute; top:0; right:0; width:9px; height:100%; cursor:col-resize; z-index:210; }
.rail-resize::after{ content:""; position:absolute; top:0; right:2px; width:2px; height:100%; background:transparent; transition:background .15s; }
.rail-resize:hover::after,.rail-resize.dragging::after{ background:var(--accent); }

.rail-head{ display:flex; align-items:center; justify-content:space-between; gap:6px; padding:10px 2px 30px 12px; margin-top:-4px; }
/* text-decoration:none on the three rail controls: the learner home builds
   them as <span>/<button>, where it is the default and this changes nothing,
   but a professional page builds them as <a> (they are real navigation to
   another document) and would otherwise render the whole rail underlined. */
/* colour, not just text-decoration: six professional pages carry a bare
   `a { color: var(--gold) }`, which reaches the brand link (a real <a> here,
   a <span> on the learner home) and made the wordmark gold on half the
   console and not the other half. */
.brand{ display:flex; align-items:center; gap:10px; padding:4px 6px; min-width:0;
  text-decoration:none; color:var(--ink); }

/* THE LOGO (2026-11-21, the founder's pick "a" on the logo review: "Your registered
   logo"). The trademarked artwork, the drawing the sign-in page, the emails and the
   website use: the four tiles and STEMeUp®, so every rail and the adults' phone bar
   wear the one logo the platform draws (tests/contracts/test_trademarked_logo.py). It
   replaces the staircase mark (MCD, 2026-11-16: six of the tiles as steps in the rail's
   corner, cut by its edges, with maths drawn behind them), which the founder called "the
   scramble logo"; the maths behind it went too (in each of the review's options).

   The box is WIDE now. It was square because the staircase was; the artwork is 3450 x 786,
   so it is sized by width: 150px in a rail (34px tall, its tiles 33px against the
   staircase's 20px) and 118px in a top bar (27px, inside the bar's 32px row). It shrinks
   rather than overflow: on the narrowest rail (210px, shell.js RAIL_MIN) it narrows to
   about 130px to stay clear of the hide button, and in a phone's crowded bar it gives way
   to the navigation (see NAVIGATION TIERS). The rail's head lines the tiles up with the
   menu's icons (12px in, on the pro rail too) and keeps the menu where it started, 86px
   down (-4px + 10px + 34px + 30px under the rail's padding, where it was -10px + 4px +
   the staircase's 40px row + 36px).

   Two copies, one shown at a time: stemeup_logo.svg, white lettering, on the purple and
   black backgrounds; stemeup_logo_ink.svg, the brand ink, on white (the pair the cohort
   report and the carer primer use for screen and paper). Both carry alt="STEMeUp" and the
   one not shown is display:none, so a screen reader hears the name once. ONE builder draws
   it (shell.js, buildBrandArt); the learner home's rail is its hand-written twin. */
.brand-mark{ flex:0 1 auto; min-width:0; display:block; line-height:0; }
.rail .brand{ padding-top:0; padding-bottom:0; padding-left:0; }
.brand-mark img{ display:block; width:118px; max-width:100%; height:auto; }
.rail .brand-mark img{ width:150px; }
.brand-mark .brand-art-ink{ display:none; }
:root[data-theme="white"] .brand-mark .brand-art-screen{ display:none; }
:root[data-theme="white"] .brand-mark .brand-art-ink{ display:block; }
/* padding:0 / margin:0 are load-bearing, not tidiness. Three professional
   screens style a BARE `button { padding:8px 14px; margin-top:18px }`, which is
   lower specificity than this rule but sets properties this rule did not — so
   the rail's own toggle grew padding it never asked for and dropped 18px down
   the rail, on those pages only. The shell states its geometry completely. */
.rail-toggle{ flex:0 0 auto; width:32px; height:32px; border-radius:9px; border:none; background:none; color:var(--muted); display:grid; place-items:center; cursor:pointer; padding:0; margin:0; }
.rail-toggle:hover{ background:var(--accent-wash); color:var(--ink); }
.rail-toggle svg{ width:18px; height:18px; }
.rail-open{ position:fixed; top:14px; left:14px; z-index:300; width:38px; height:38px; border-radius:10px; border:1px solid var(--line);
  background:var(--surface); color:var(--muted); display:none; place-items:center; cursor:pointer; box-shadow:var(--shadow); padding:0; margin:0; }
.rail-open:hover{ color:var(--ink); border-color:var(--accent); }
.rail-open svg{ width:19px; height:19px; }
.app.railhidden .rail-open{ display:grid; }

.rail-section{ font-size:var(--text-label); text-transform:uppercase; letter-spacing:.1em; color:var(--faint); font-weight:600; padding:14px 10px 8px; }

.nav-item{ display:flex; align-items:center; gap:var(--nav-gap); padding:var(--nav-item-pad); border-radius:11px; width:100%; text-align:left; min-width:0; overflow:hidden;
  border:none; background:none; color:var(--muted); cursor:pointer; font:inherit; font-size:var(--text-body); text-decoration:none; transition:background .15s,color .15s; }
.nav-item .nav-label{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-item svg{ flex:0 0 auto; width:19px; height:19px; stroke:currentColor; fill:none; }
/* An icon's tile (shell.js, svg()): the one piece of it filled, in the icon's own colour,
   so it turns gold with the rest on the current page. */
.nav-item svg .tile{ fill:currentColor; fill-opacity:.3; stroke:none; }
/* THE CURRENT PAGE (MCD, 2026-11-16: "redo the sidebar active state"). It was the gold
   wash, which over the purple rail came out a muddy brown, and on this rail hover wore
   the same wash, so whatever the pointer crossed looked selected too. Now the current
   page is the brand's violet (the logo's divide tile), its label white at 600 and its
   icon gold: three signals, not colour alone, and nothing like hover, which is a neutral
   7% of the ink. Flat, in all three themes (MCD, 2026-11-18): it was a gradient fading
   to the right with a hairline edge, the stock highlight of a templated app.
   aria-current="page" is set on it by every shell; this is only its look. */
.nav-item:hover{ background:color-mix(in srgb,var(--ink) 7%,transparent); color:var(--ink); }
.nav-item:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.nav-item.on,.nav-item.on:hover{ background:var(--nav-on-bg); color:var(--nav-on-ink); font-weight:600; }
.nav-item.on svg{ color:var(--nav-on-icon); }
/* 11px, from 10px: "28 ready", BETA (2026-11-21, the founder's pick X: no label under 11px). */
.nav-item .tag{ margin-left:auto; font-size:11px; font-weight:600; background:var(--accent); color:var(--on-accent); padding:2px 8px; border-radius:99px; }

.rail-spacer{ flex:1; min-height:12px; }
.rail-foot{ border:none; border-top:1px solid var(--rail-edge); width:100%; text-align:left; color:inherit; cursor:pointer; background:none;
  display:flex; align-items:center; gap:11px; padding:12px 8px 4px; margin-top:8px; text-decoration:none; }
.rail-foot:hover{ background:var(--accent-wash); }
.rail-foot:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.avatar{ flex:0 0 auto; width:34px; height:34px; border-radius:50%; display:grid; place-items:center;
  background:var(--accent); color:var(--on-accent); font-weight:700; font-size:14px; }
/* THE FOOT'S AVATAR IS A HEAD, NOT A FIGURE. The art is a full-body explorer
   in a 200x330 box; dropped into a 34px circle unchanged it renders a
   thumbnail-sized person with their feet outside the ring. Crop from the TOP
   and let the rest overflow out of sight, which is what makes it read as a
   face. Lived in home.css until the carer's rail started wearing one too. */
.rail-foot .avatar{ overflow:hidden; place-items:start center; }
/* ...and only a face is cropped from the top. A letter (staff, and anyone who
   has not built a face) sat on the circle's top edge instead of in it
   (2026-10-26). A browser without :has() ignores this and keeps the old rule. */
.rail-foot .avatar:not(:has(svg)){ place-items:center; line-height:1; letter-spacing:.02em; }
.rail-foot .avatar > svg{ width:100%; height:auto; pointer-events:none; }
/* THE ADULT BUILD NEEDS MORE SCALE FOR THE SAME FACE. Measured at 34px: the
   child art draws a 16px head, the adult art an 11.8px one — a grown-up is
   drawn taller relative to their head, which is correct in a full-body figure
   and wrong in a 34px circle, where it reads as a distant person rather than a
   face. 16 / 11.8 = 1.36, so the adult svg is drawn 136% wide and the grid's
   `start center` crops the surplus evenly. Same head size in both feet. */
.rail-foot .avatar.is-adult > svg{ width:136%; }
.rail-foot-text{ min-width:0; }
/* Inline spans again: without display:block the name and the sub-line ran into
   each other ("L220Year 11 · Maths"), and nowrap/text-overflow were inert. */
.rail-foot-text .n{ display:block; font-weight:600; font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rail-foot-text .s{ display:block; font-size:12px; color:var(--faint); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rail-foot-cog{ margin-left:auto; width:17px; height:17px; flex:0 0 auto; color:var(--faint); }
.rail-foot:hover .rail-foot-cog{ color:var(--ink); }

/* collapsed rail: hide text, centre icons */
.collapsed .rail-section,.collapsed .w-text,.collapsed .nav-label,.collapsed .rail-foot-text,.collapsed .tag{ opacity:0; pointer-events:none; }
.collapsed .world{ justify-content:center; padding:8px 4px; }
.collapsed .rail-foot{ justify-content:center; }
.collapsed .nav-item{ justify-content:center; }

/* THE PROFESSIONAL RAIL (2026-10-26: "it feels small and the items ... shift on
   different pages"). Staff and directors read it at a glance between tasks, so
   at pro density it is larger than the canvas text, not smaller: 42px rows, a
   15px label, 20px icons. Hover is a quiet neutral wash and only the current
   page wears the violet (THE CURRENT PAGE, above) — they used to look the same.

   Every size is stated here, with line-height and font family: the twenty-odd
   pages that wear this rail each have their own stylesheet, and anything left
   to inherit came out a pixel or two different from page to page. */
:root[data-density="pro"] .rail{ padding:18px 14px 12px; font-family:"Poppins",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; line-height:1.25; }
:root[data-density="pro"] .rail-head{ padding:2px 2px 36px 12px; }
:root[data-density="pro"] .rail-section{ font-size:11px; line-height:14px; letter-spacing:.09em; padding:18px 12px 8px; margin:0; }
:root[data-density="pro"] .nav-item{ position:relative; box-sizing:border-box; height:42px; min-height:42px; margin:0 0 2px;
  font-size:15px; line-height:20px; font-weight:500; letter-spacing:0; }
:root[data-density="pro"] .nav-item svg{ width:20px; height:20px; }
:root[data-density="pro"] .nav-item.on{ font-weight:600; }
/* The foot: who is signed in, and the way to their settings. It stays on screen
   when the director's longer list scrolls (it used to be the last thing in the
   list, under the fold on a laptop), on a backdrop of the rail's own colour
   that also carries the divider. Its hover is the nav items' rounded wash,
   drawn on ::after — the backdrop on ::before would hide a background on the
   link itself. Sticky at bottom:0, not 12px: a sticky offset is measured from
   inside the rail's 12px bottom padding (Chrome and Safari both), so 12px stood
   it 24px up, and the list showed through the 12px its backdrop did not reach
   (2026-10-27). */
:root[data-density="pro"] .rail-foot{ position:sticky; bottom:0; z-index:1; isolation:isolate;
  margin:14px 0 0; padding:10px; gap:12px; border:none; border-radius:12px; background:none; }
:root[data-density="pro"] .rail-foot::before{ content:""; position:absolute; z-index:-2; left:-14px; right:-14px; top:-11px; bottom:-12px;
  background:linear-gradient(var(--rail-edge),var(--rail-edge)) 14px 0 / calc(100% - 28px) 1px no-repeat, var(--rail); }
:root[data-density="pro"] .rail-foot::after{ content:""; position:absolute; z-index:-1; inset:0; border-radius:inherit; transition:background .15s; }
:root[data-density="pro"] .rail-foot:hover{ background:none; }
:root[data-density="pro"] .rail-foot:hover::after{ background:color-mix(in srgb,var(--ink) 7%,transparent); }
:root[data-density="pro"] .rail-foot .avatar{ width:38px; height:38px; font-size:14px; }
:root[data-density="pro"] .rail-foot-text .n{ font-size:14.5px; line-height:19px; }
:root[data-density="pro"] .rail-foot-text .s{ font-size:12.5px; line-height:17px; }
:root[data-density="pro"] .rail-foot-cog{ width:19px; height:19px; }

/* THE ACCOUNT ROW (Shell.mount's account:true; shell.js buildAccountTools): the
   background switch and Sign out, under the name card — they were the whole of
   the staff and director top bar. It and the name card stay put at the foot of
   the rail together: the row on the rail's 12px bottom padding (bottom:0, for
   the reason given at .rail-foot), the card stacked on it (44px, the row's own
   height). The row is laid out in fixed heights for
   exactly that reason. */
.rail-tools{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.rail-tools-out{ display:inline-flex; align-items:center; gap:8px; height:32px; margin:0; padding:0 10px; border:none; border-radius:9px;
  background:none; color:var(--muted); font:inherit; font-size:13.5px; font-weight:500; cursor:pointer; transition:background .15s,color .15s; }
.rail-tools-out svg{ width:17px; height:17px; flex:0 0 auto; }
.rail-tools-out:hover{ color:var(--ink); background:color-mix(in srgb,var(--ink) 7%,transparent); }
.rail-tools-out:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
/* flex:none on everything in the rail: the director's list is longer than the
   window, and a column that overflows shrinks its children — the row came out
   32px on that rail and 44px on a short one, and the card above it moved. */
:root[data-density="pro"] .rail > *{ flex-shrink:0; }
:root[data-density="pro"] .rail-tools{ position:sticky; bottom:0; z-index:1; isolation:isolate; box-sizing:border-box; height:44px; padding:0 0 0 6px; }
:root[data-density="pro"] .rail-tools::before{ content:""; position:absolute; z-index:-1; left:-14px; right:-14px; top:0; bottom:-12px; background:var(--rail); }
:root[data-rail-account][data-density="pro"] .rail-foot{ bottom:44px; }
.collapsed .rail-tools{ flex-direction:column; height:auto; }
.collapsed .rail-tools-out span{ display:none; }

/* The top bar holds the Notifications bell (2026-11-11, MCD decision: "show a top bar"),
   so it is on every staff and director page again. While the rail is on screen the
   rail carries the logo and the bar carries only the bell, top right; wherever the
   rail is not — a phone's drawer, or the rail hidden on a computer — the bar carries
   the logo too, clear of the floating show-menu button. (From 2026-10-26 to the bell
   the bar was dropped beside the rail, being 55px of empty band.) */
:root[data-rail-account] .topbar .brand{ display:flex; padding:0; }
/* The show-menu button sits in the bar, level with the logo beside it. The bar
   keeps the pro height (--topbar-h, 55px): 10px + the 32px mark + 10px + border. */
:root[data-rail-account] .rail-open{ top:8px; }
:root[data-rail-account][data-density] .app.railhidden .topbar{ padding-left:64px; }
@media (max-width:840px){
  :root[data-rail-account][data-density] .topbar{ padding-left:64px; }
}
@media (min-width:841px){
  :root[data-rail-account] .app:not(.railhidden) .topbar .brand{ display:none; }
}

/* THE BELL (shell.js, buildBell): a 40px round control with the count on its shoulder
   — a link on a phone and on the Notifications page, a button that opens the panel
   below on a computer (the reset lines are for the button). The count is the risk red
   because it counts what is waiting. Its figure is the page colour, so it holds on
   every theme: white on #AA2300 (white theme), the dark page on #ff8f72 (purple and
   dark), both above 4.5:1; a ring of the page colour parts it from the bell. */
.bell-wrap{ position:relative; display:flex; flex:none; }
.bell-wrap[hidden]{ display:none; }
.bell{ position:relative; display:inline-grid; place-items:center; flex:none; width:40px; height:40px;
  margin:0; padding:0; border:0; border-radius:50%; background:none; color:var(--ink); font:inherit;
  text-decoration:none; cursor:pointer; }
/* A 40px target that takes 32px of the bar's height, the logo's: the pro bar is
   --topbar-h, 55px (10px + the 32px mark + 10px + border), and must stay so. */
:root[data-density="pro"] .topbar .bell{ margin-block:-4px; }
.bell svg{ width:21px; height:21px; }
.bell:hover{ background:color-mix(in srgb,var(--ink) 7%,transparent); }
.bell:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.bell[aria-current="page"]{ background:var(--accent-wash); box-shadow:inset 0 0 0 2px var(--ink); }
.bell[aria-expanded="true"]{ background:var(--accent-wash); }
.bell-count{ position:absolute; top:1px; right:-2px; min-width:19px; height:19px; padding:0 5px;
  box-sizing:border-box; border-radius:99px; background:var(--status-risk); color:var(--paper);
  font-size:11px; font-weight:700; line-height:19px; text-align:center; box-shadow:0 0 0 2px var(--paper); }
.bell-count[hidden]{ display:none; }

/* THE BELL'S PANEL (shell.js, buildBellPanel): a glance, not a second page — what
   needs you, the newest updates, the way to everything. It hangs from .bell-wrap and
   not from the viewport: the bar is sticky with a backdrop filter, so it is its own
   stacking context and anything fixed inside it would be measured from the bar.
   Header and footer stay put; the middle scrolls. Every face, size and weight is
   stated, because the panel lands inside thirty pages' own stylesheets (a bare
   `a { color: gold }`, the display face on every h2/h3) and must look the same on
   each. Motion is a 140ms settle; Reduce motion and prefers-reduced-motion stop it
   with everything else (MOTION, below). */
/* `top` clears the bar's own bottom padding and border, then leaves 8px: the bell sits
   14px above the carer bar's edge and 10px above the pro bar's (whose bell is drawn
   4px past its 32px box). */
.bell-panel{ position:absolute; top:calc(100% + var(--space-24)); right:0; z-index:1;
  width:min(380px, calc(100vw - 16px));
  max-height:min(640px, calc(100vh - var(--topbar-h) - 24px));
  max-height:min(640px, calc(100dvh - var(--topbar-h) - 24px));
  display:flex; flex-direction:column; overflow:hidden; box-sizing:border-box;
  background:var(--surface); color:var(--ink); border:1px solid var(--line);
  border-radius:var(--radius-lg); box-shadow:var(--glass-shadow); text-align:left;
  font:400 var(--text-13-5)/1.4 "Poppins",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  letter-spacing:0; animation:bell-panel-in .14s var(--sm-ease-out); }
:root[data-density="pro"] .bell-panel{ top:calc(100% + var(--space-18)); }
.bell-panel[hidden]{ display:none; }
@keyframes bell-panel-in{ from{ opacity:0; transform:translateY(-4px); } to{ opacity:1; transform:none; } }
.bell-panel-head{ display:flex; align-items:center; justify-content:space-between; gap:var(--space-12); flex:none;
  padding:var(--space-10) var(--space-10) var(--space-10) var(--space-16); border-bottom:1px solid var(--line); }
/* Three classes deep on purpose: the staff screens' `:root[data-density="pro"] h2`
   and `h3` (below, 0-2-1) set every heading's margins and size, and these must win. */
.bell-panel .bell-panel-head .bell-panel-title{ margin:0; font:600 var(--text-16)/1.3 "Poppins",system-ui,sans-serif;
  letter-spacing:0; color:var(--ink); }
.bell-panel-settings{ display:inline-flex; align-items:center; gap:var(--space-6); min-height:32px; padding:0 var(--space-10);
  border-radius:var(--radius-sm); color:var(--muted); font-size:var(--text-12-5); font-weight:500; text-decoration:none; }
.bell-panel-settings svg{ width:16px; height:16px; flex:none; }
.bell-panel-settings:hover{ color:var(--ink); background:color-mix(in srgb,var(--ink) 7%,transparent); }
.bell-panel-body{ flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 0 var(--space-8); }
.bell-status.is-loading{ display:grid; place-items:center; min-height:200px; color:var(--muted); }
.bell-status.is-error{ padding:var(--space-24) var(--space-16); color:var(--muted); text-align:center; }
.bell-status a{ color:var(--ink); font-weight:600; }
.bell-sec + .bell-sec{ border-top:1px solid var(--line); }
.bell-panel .bell-sec .bell-sec-h{ margin:0; padding:var(--space-14) var(--space-16) var(--space-6);
  font:600 var(--text-12)/1.4 "Poppins",system-ui,sans-serif; letter-spacing:0; color:var(--muted); }
.bell-list{ margin:0; padding:0 var(--space-6); list-style:none; }
.bell-list > li{ margin:0; padding:0; }
/* A whole row is the link: 44px at least, 40px on the denser staff screens. */
.bell-row{ display:flex; align-items:flex-start; gap:var(--space-12); box-sizing:border-box; min-height:44px;
  padding:var(--space-8) var(--space-10); border-radius:var(--radius-sm); color:var(--ink); text-decoration:none; }
:root[data-density="pro"] .bell-row{ min-height:40px; }
.bell-row:hover{ background:color-mix(in srgb,var(--ink) 7%,transparent); }
.bell-row:focus-visible,
.bell-panel-settings:focus-visible,
.bell-panel-all:focus-visible,
.bell-status a:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
.bell-tile{ display:grid; place-items:center; flex:none; width:32px; height:32px; border-radius:var(--radius-sm);
  background:var(--accent-wash); color:var(--ink); }
.bell-tile svg{ width:18px; height:18px; }
.bell-row-text{ display:flex; flex-direction:column; gap:var(--space-2); flex:1 1 auto; min-width:0; padding-top:1px; }
.bell-row-title{ font-size:var(--text-13-5); font-weight:600; line-height:1.35; }
.bell-row-detail{ overflow:hidden; color:var(--muted); font-size:var(--text-12-5); line-height:1.4;
  white-space:nowrap; text-overflow:ellipsis; }
.bell-upd .bell-row-title{ font-weight:500; }
.bell-upd.is-unread .bell-row-title{ font-weight:700; }
.bell-upd .bell-row-detail{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; white-space:normal; }
/* --muted, not --faint: --faint drops to 3.9:1 under a hovered row on purple and dark. */
.bell-when{ color:var(--muted); font-size:var(--text-12); line-height:1.4; }
.bell-pill{ display:inline-flex; align-items:center; justify-content:center; gap:var(--space-4); flex:none; align-self:center;
  box-sizing:border-box; min-width:24px; height:22px; padding:0 var(--space-8); border-radius:var(--radius-pill);
  background:var(--accent); color:var(--on-accent); font-size:var(--text-12); font-weight:700; line-height:1; }
.bell-pill.is-urgent{ background:var(--status-risk); color:var(--paper); }
.bell-pill-word{ font-weight:600; }
/* Unread: the dot, the bold title and the words "Unread: " for a screen reader —
   never the colour alone. The ring is the ink, so the gold reads on the white theme. */
.bell-dot{ flex:none; width:8px; height:8px; margin:var(--space-6) var(--space-4) 0; border-radius:var(--radius-circle);
  background:var(--accent); box-shadow:0 0 0 2px var(--ink); }
/* Clearing updates (2026-11-16). "Clear all" sits on the heading's line; each update
   has its own Clear beside its row (never inside the link). With a mouse, a row's
   Clear shows while the row is hovered or the button has keyboard focus; on a touch
   screen, with no hover to show it, it is always there. */
.bell-sec-top{ display:flex; align-items:center; justify-content:space-between; gap:var(--space-8);
  padding-right:var(--space-10); }
.bell-panel .bell-sec .bell-sec-h:focus{ outline:none; }
.bell-panel .bell-sec .bell-sec-h:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
.bell-clear-all{ flex:none; min-height:28px; margin:var(--space-8) 0 0; padding:0 var(--space-8); border:0;
  border-radius:var(--radius-sm); background:none; color:var(--muted); cursor:pointer;
  font:500 var(--text-12)/1.4 "Poppins",system-ui,sans-serif; letter-spacing:0; }
.bell-clear-all:hover{ color:var(--ink); background:color-mix(in srgb,var(--ink) 7%,transparent); }
.bell-clear-all:disabled{ opacity:.6; cursor:default; }
.bell-item{ display:flex; align-items:flex-start; gap:var(--space-2); border-radius:var(--radius-sm); }
.bell-item > .bell-row{ flex:1 1 auto; min-width:0; }
/* The whole row lights up, its Clear included, not only the link beside it. */
.bell-item:hover{ background:color-mix(in srgb,var(--ink) 7%,transparent); }
.bell-item > .bell-row:hover{ background:none; }
.bell-clear{ display:grid; place-items:center; flex:none; width:32px; height:32px; margin:var(--space-8) 0 0;
  padding:0; border:0; border-radius:var(--radius-sm); background:none; color:var(--muted); cursor:pointer; }
.bell-clear svg{ width:16px; height:16px; }
.bell-clear:hover{ color:var(--ink); background:color-mix(in srgb,var(--ink) 7%,transparent); }
.bell-clear-all:focus-visible,
.bell-clear:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
@media (hover:hover){
  .bell-clear{ opacity:0; }
  .bell-item:hover .bell-clear, .bell-clear:focus-visible{ opacity:1; }
}
.bell-quiet{ display:flex; align-items:center; gap:var(--space-8); margin:0; padding:var(--space-4) var(--space-16) var(--space-10);
  color:var(--muted); font-size:var(--text-13); }
.bell-quiet svg{ width:16px; height:16px; flex:none; color:var(--ink); }
.bell-panel-foot{ flex:none; padding:var(--space-6); border-top:1px solid var(--line); }
.bell-panel-all{ display:flex; align-items:center; justify-content:center; min-height:40px; border-radius:var(--radius-sm);
  color:var(--ink); font-size:var(--text-13-5); font-weight:600; text-decoration:none; }
.bell-panel-all:hover{ background:color-mix(in srgb,var(--ink) 7%,transparent); }

/* ---------------------------------- canvas -------------------------------- */
.canvas{ min-width:0; display:flex; flex-direction:column; }
.topbar{ display:flex; align-items:center; gap:12px; padding:14px 32px; border-bottom:1px solid var(--line);
  position:sticky; top:0; background:color-mix(in srgb,var(--paper) 86%,transparent); backdrop-filter:blur(8px); z-index:20; }
.topbar .spacer{ flex:1; }
/* mount() appends config.topbar AFTER the spacer, which right-aligns it — right
   for the director's lone Sign out, wrong for a page that also has something to
   say on the LEFT. `order:-1` puts this group before the spacer wherever it
   lands in the DOM, so one config.topbar (pass a DocumentFragment) can carry
   both ends of the bar without the page reaching into the shell's children. */
.topbar .topbar-lead{ order:-1; display:flex; align-items:center; gap:var(--space-10); min-width:0; }
/* The brand belongs in the rail, so it is OFF in the topbar by default. The
   rail-tier above turns it on at the widths where there is no rail to hold it —
   see NAVIGATION TIERS. */
.topbar .brand{ display:none; }

.content{ padding:var(--pad-page); max-width:1000px; width:100%; margin:0 auto; }
.view{ display:none; } .view.active{ display:block; animation:rise .35s ease both; }

/* ------------------------------ components ------------------------------
   .btn / .back-link / .chip are the learner home's own, moved unchanged.
   .card / .input / .empty-state are NEW names for recipes that already exist
   fourteen, six and nineteen times respectively across the tree — no element
   in the learner home carries them, so adding them here changes nothing and
   gives the professional screens something to adopt.

   The empty state is .empty-state, NOT .empty: the learner home already uses
   `empty` as a modifier on .answer-display (home.js:1383), so a bare .empty
   rule would land on the maths answer box. */
/* text-decoration:none because a .btn is sometimes an <a> — the CSV download on
   /impact and /insights is one — and six professional pages carry a bare
   `a { color: var(--gold) }` with no decoration rule, which underlined them.
   Every .btn in the learner home is a <button>, where this is already the
   default and changes nothing. */
.btn{ display:inline-flex; align-items:center; gap:8px; padding:11px 18px; border-radius:12px; border:none; cursor:pointer;
  font:inherit; font-weight:600; font-size:14px; background:var(--accent); color:var(--on-accent); text-decoration:none; }
.btn.ghost{ background:transparent; border:1px solid var(--line); color:var(--ink); }
.btn svg{ width:18px; height:18px; stroke:currentColor; fill:none; }

/* Press feedback. The primary button carried NO hover state at all, on any
   surface, which is why Send and every submit felt dead under the cursor.
   `brightness` rather than a hard-coded lighter colour on purpose: --accent is
   themed and, on the map, per-world — any literal would be wrong somewhere. It
   also matches how .node already signals hover (filter:brightness(1.06)), so
   the platform gains one consistent gesture rather than a second vocabulary.
   The 1px press is what makes a click feel received rather than merely noticed. */
.btn{ transition:filter .14s ease, transform .08s ease, box-shadow .14s ease; }
.btn:hover:not(:disabled){ filter:brightness(1.09); box-shadow:0 4px 12px -4px rgba(0,0,0,.28); }
.btn:active:not(:disabled){ filter:brightness(.96); transform:translateY(1px); box-shadow:none; }
.btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
/* The ghost variant has no fill to brighten, so it gains one on hover instead. */
.btn.ghost:hover:not(:disabled){ filter:none; background:var(--accent-wash); border-color:var(--accent); }
.btn:disabled{ opacity:.55; cursor:not-allowed; filter:none; transform:none; box-shadow:none; }
@media (prefers-reduced-motion: reduce){
  .btn{ transition:none; }
  .btn:active:not(:disabled){ transform:none; }
}
.back-link{ display:inline-flex; align-items:center; gap:5px; border:none; background:none; color:var(--muted); cursor:pointer;
  font:inherit; font-size:13.5px; padding:0; margin-bottom:20px; }
.back-link:hover{ color:var(--ink); } .back-link svg{ width:17px; height:17px; stroke:currentColor; fill:none; }
.chip{ display:inline-block; font-size:12px; font-weight:600; padding:5px 11px; border-radius:99px; background:color-mix(in srgb, var(--ink) 10%, transparent); color:var(--ink); }

/* margin-bottom is part of the component, not the page's job: every
   professional screen that adopts .card was hand-writing `margin-bottom:14px`
   next to it, and a card that has to be spaced by hand is a card half the
   pages will space differently. Nothing in the learner home carries .card, so
   this moves nothing there. */
.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-xl);
  box-shadow:var(--shadow); padding:var(--pad-card); margin-bottom:var(--gap-stack); }
.input{ width:100%; min-width:0; font:inherit; font-size:16px; padding:12px 14px; border-radius:var(--radius-lg);
  border:1px solid var(--line); background:color-mix(in srgb, var(--ink) 4%, transparent); color:var(--ink); }
/* The 2px wash ring is the accessible half of this: a 1px border-colour change
   alone is the near-miss the audit kept finding. */
.input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-wash); }

/* A title and its actions on one line. Written out by hand on four
   professional screens today, one of them as a `style="display:flex;…"`
   attribute. The learner home has no such row. */
.page-head{ display:flex; align-items:baseline; justify-content:space-between;
  gap:var(--space-12); flex-wrap:wrap; }

/* ------------------------------- data table ------------------------------
   The learner home has no tables at all — not one — so this is the codebase's
   first shared table, and it belongs here rather than on whichever
   professional screen happened to need it first.

   THE SCROLLER IS THE POINT. A wide table with no scroller of its own pushes
   the whole PAGE sideways on a phone, which is exactly the overflow the audit
   found on the staff grid.

   THE STICKY HEADER IS THE PART WITH A CATCH, and it is worth knowing before
   you reach for it. `overflow-x:auto` forces the used value of overflow-y to
   auto as well, so .table-scroll is a scroll container in both axes whether
   you asked for one or not — and `position:sticky` resolves against the
   nearest scrolling ancestor. With no height on the pane there is nothing to
   scroll vertically, so the header simply never moves, which is exactly right.
   Give the pane a height with `.tall` and the same rule starts doing real
   work. That is the only way to have both: capping every table by default
   turns a thirty-row list into a window with a row sliced in half, and these
   pages are reviewed as full-page screenshots. */
.table-scroll{ max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
/* Opt-in: a table long enough to be a pane rather than a list. Nothing on the
   director console needs it yet (the longest is thirty rows); it is here so the
   sticky header below is a switch a page can throw, not a rule to rediscover. */
.table-scroll.tall{ max-height:70vh; }
.data-table{ width:100%; border-collapse:collapse; font-size:var(--text-body); }
.data-table th, .data-table td{ text-align:left; white-space:nowrap;
  padding:var(--space-8) var(--space-10); border-bottom:1px solid var(--line); }
/* The header needs an opaque fill or the rows scroll THROUGH it. --surface
   because a professional table lives inside a .card. */
.data-table thead th{ position:sticky; top:0; z-index:1; background:var(--surface);
  color:var(--muted); font-weight:600; font-size:var(--text-11);
  text-transform:uppercase; letter-spacing:.06em; }
.data-table tbody tr:last-child td{ border-bottom:none; }
/* Numbers line up under each other or the column cannot be read down. */
.data-table td.num, .data-table th.num{ text-align:right; font-variant-numeric:tabular-nums; }
/* On paper there is no scrolling to do, and a clipped table is a lost table. */
@media print{
  .table-scroll, .table-scroll.tall{ max-height:none; overflow:visible; }
  .data-table thead th{ position:static; }
}

/* One owned focus ring for the professional surfaces, replacing the twelve
   hand-copied outline declarations. Scoped to [data-density="pro"] on purpose:
   an unscoped :focus-visible would give the learner home a focus style on
   every control that does not have one today, which is a visual change and
   this session is a refactor. */
:root[data-density="pro"] :focus-visible{ outline:var(--focus-ring); outline-offset:1px; }

/* ------------------------- the professional page -------------------------
   Everything below is scoped to [data-density="pro"], and not only out of
   caution. Two of these names are ALREADY TAKEN on the learner side and mean
   something else there: `.sub` is home.css:263, the maths SUBSCRIPT, and an
   unscoped rule here would resize every subscript a child is shown. The scope
   is what lets the professional screens have the obvious name for a
   sub-heading without renaming a maths primitive.

   These replace, one screen at a time, the 32 distinct font sizes and the
   eight separate `.sub` recipes the professional pages carry today. The
   brand face still comes from branding.css — only the size and rhythm are
   set here. */
:root[data-density="pro"] .content{ max-width:1120px; }
:root[data-density="pro"] .topbar{ padding:10px var(--space-24); }
/* The background switch, compact for the professional bar. Measured before
   writing this: the pro topbar is --topbar-h:54px with 10px padding, so the
   content budget is 34px and the default seg is 36px — it would have pushed
   the bar 2px past the token on all 19 staff/director pages, and that token is
   what their anchor offsets and sticky rails are computed from.
   24px is the WCAG 2.5.8 target-size floor, taken here and NOT on the carer
   phone bar, where the same shortcut was refused: these are pointer-driven
   desktop surfaces, and the full-size controls still exist in Settings. */
:root[data-density="pro"] .theme-seg button{ width:24px; height:24px; }
:root[data-density="pro"] .theme-seg svg{ width:13px; height:13px; }
:root[data-density="pro"] .theme-seg .swatch{ width:12px; height:12px; }
/* margin:0 for the same reason .rail-toggle carries it — safeguarding-settings
   gives every bare <button> an 18px top margin. */
:root[data-density="pro"] .topbar .btn{ padding:var(--space-6) var(--space-14); font-size:var(--text-13); margin:0; }

:root[data-density="pro"] h1{ font-size:var(--text-26); line-height:1.2; margin:0 0 var(--space-4); }
:root[data-density="pro"] h2{ font-size:var(--text-16); line-height:1.3; margin:var(--space-24) 0 var(--space-10); }
:root[data-density="pro"] h3{ font-size:var(--text-14); line-height:1.35; margin:var(--space-16) 0 var(--space-6); }
:root[data-density="pro"] .sub{ color:var(--muted); font-size:var(--text-13-5); line-height:1.55;
  margin:0 0 var(--space-20); max-width:78ch; }
:root[data-density="pro"] .note{ color:var(--faint); font-size:var(--text-12-5); line-height:1.5; }
:root[data-density="pro"] .empty{ color:var(--muted); font-size:var(--text-13-5); }

/* A form is not a cohort table: 1120px of input box is unusable, and the
   pages that are mostly a form were 640–720px wide before the canvas gave
   them the whole width. Opt a block back down rather than narrowing the
   canvas for screens that earn it. */
:root[data-density="pro"] .measure{ max-width:72ch; }

/* ---- WIDE CANVAS --------------------------------------------------------
   The counterpart to .measure, and the one thing the twelve director screens
   did not need. 1120px is a READING width: right for a form, a settings page
   or a thirty-row table. It is wrong for a screen whose content is a grid.

   Measured on the staff dashboard: a Virtual School Head's 300 learner cards
   render four across in a 1232px column and THREE across in 1064px (1120 less
   the canvas padding), which is a hundred rows instead of seventy-five and
   made an already-too-long page 17% longer. A cap that turns the rail into a
   net loss of vertical space is the wrong cap for that screen.

   Opt in with Shell.mount({ canvas: "wide" }); it sets data-canvas on <html>
   the way density does. Deliberately an opt-in and not a new default: every
   page that reads as prose should keep the 1120. */
:root[data-canvas="wide"] .content,
:root[data-density="pro"][data-canvas="wide"] .content{ max-width:1520px; }

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

/* mobile: the rail becomes an off-canvas drawer opened by the top-left button */
@media (max-width:840px){
  .app{ grid-template-columns:1fr; }
  .rail{ position:fixed; left:0; top:0; width:min(84vw,300px); transform:translateX(-102%); transition:transform .22s ease; }
  .app.drawer-open .rail{ transform:none; }
  .rail-open{ display:grid; }
  /* The show-menu button floats above everything, so with the drawer open it sat
     on the drawer's own logo (2026-10-26). The drawer has its own hide button. */
  .app.drawer-open .rail-open{ display:none; }
  .app.drawer-open .backdrop{ display:block; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:150; }
  .content{ padding:24px 18px 56px; }
  .topbar{ padding:12px 18px 12px 60px; }
}

/* ------------------------------ accessibility ----------------------------- */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* Skip link: visually hidden until keyboard focus reveals it (WCAG 2.4.7 —
   the first Tab stop must be visible; an off-screen link never coming back
   made the page look unresponsive to keyboard users).
   Hidden with the sr-only clip pattern, NOT an off-screen top offset: an
   element parked at top:-48px sits in the strip above the document that
   elastic overscroll (iOS rubber-banding, macOS trackpad bounce) exposes,
   so the pill flashed into view whenever a page was bounced past its top.
   A clipped 1px box has nothing to expose (founder report 2026-08-22). */
.skip-link{ position:absolute; left:8px; top:0; width:1px; height:1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;
  background:var(--accent); color:var(--on-accent); z-index:400; }
/* left:60px, not 8px: .rail-open (the fixed "Show menu" button, 14px/14px)
   is visible on every mobile viewport and on a collapsed desktop rail, and
   the focused pill painted straight over it (z-skip deliberately wins the
   stacking). 60px mirrors the topbar's own clearance for the same button. */
.skip-link:focus{ position:fixed; top:8px; left:60px; width:auto; height:auto;
  clip:auto; overflow:visible; padding:8px 14px; border-radius:8px; }

/* ---------------------------------- paper --------------------------------
   The shell is screen furniture and none of it belongs on paper. Until now
   this file said nothing about print, and branding.css:306 only strips glass
   off .top-bar — so a printable page that mounts the shell printed a 270px
   rail, a sticky bar and a floating hamburger down the side of the sheet, and
   the content in a column the width of the canvas.

   It lives here rather than on the page for the reason the 2026-07-29 PEP
   report gave: the surface that offers to print is not usually the surface
   that knows what furniture is on screen around it. Every adopter needs this
   and none of them should have to rediscover it.

   `display:block` on .app, not `initial`: .canvas and .rail are grid children,
   and taking the grid away is what lets the canvas run the full width.

   Phase 4b arrived at the same block independently, for /access's learner
   WELCOME PACK — printed one card per child into a welcome folder, on a page
   whose own @media print hides .screen and reveals .print-only on white. Two
   blocks doing one job is the fork this file exists to prevent, so there is
   one, and it is this one. The single line 4b contributed is the pro-scoped
   max-width below.

   Phase 4c arrived at it a THIRD time, from the staff dashboard's "Save /
   Print" — a Virtual School Head printing the live cohort view for board
   papers. Three surfaces, three sessions, one week, all finding the same
   missing rule: that is the measure of how much this block was needed, and it
   is why it is here rather than on any of the three pages. Nothing of 4c's
   copy survives except this note, because this block already said all of it.

   What each page still owns is its own INK. This block deliberately sets no
   colour: whether a surface needs a dark-on-white reset depends on its own
   base colours, and the dashboard's showed 42 of 58 painted text roles below
   4.5:1 on paper (worst 1.13:1) until it wrote one. See
   tests/playwright/test_print.py, which is what measures it. */
@media print{
  .app{ display:block; min-height:0; }
  .rail, .rail-open, .backdrop, .topbar, .skip-link{ display:none !important; }
  .canvas{ display:block; }
  .content{ max-width:none; width:auto; margin:0; padding:0; }
  /* Not redundant with the line above: a media query adds no specificity, so
     `.content` at (0,1,0) loses max-width to :root[data-density="pro"] .content
     at (0,2,0), and every professional screen would print in a centred 1120px
     column. Measured on /access: `none` here, 1120px without it. */
  :root[data-density="pro"] .content{ max-width:none; }
  /* The same trap one rung further up, and it was missed when the wide canvas
     landed after this block was written: [data-canvas="wide"] .content is
     (0,2,0) and the density-plus-canvas pair is (0,3,0), so both outrank the
     line above and the dashboard printed capped at 1520px. Harmless on A4 —
     a sheet is about 794px, so the cap never binds — but the rule is here to
     say what this block MEANS, not to be right by accident on one paper size.
     Measured on the staff dashboard: `none` here, 1520px without it. */
  :root[data-canvas="wide"] .content,
  :root[data-density="pro"][data-canvas="wide"] .content{ max-width:none; }
}

/* Respect a reduced-motion preference — kill every animation/transition. */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
}
/* Persisted reduce-motion preference mirrors the media query (Settings toggle). */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after{
  animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }

/* PAGE TO PAGE (MCD, 2026-11-16: "a nice tab switch", not a jump). The staff, director
   and carer screens are separate pages, so every item in the rail was a full page load:
   the screen blanked and was redrawn, rail and all. A cross-document view transition
   holds the old page until the new one can paint, then:
     - the rail and the top bar stay still: they are named, so they are not part of the
       page that fades, and the only thing that changes in them, the highlight, fades
       from the old item to the new one;
     - the page itself fades out quickly and the new one fades in, rising 6px.
   The learner home switches its tabs inside one page and already has its own entrance
   (.view.active's rise), so this only touches it on a real navigation. A browser
   without view transitions loads the page as before.

   The opt-in itself, @view-transition, is NOT in this sheet: shell.js adds it, and
   leaves it out under automation. Headless Chromium, the browser suite's and CI's,
   never reveals a page a view transition is waiting on (measured on two bare pages:
   the second never paints), so in this sheet it would hang every test that follows a
   link. Reduced motion turns it off: the system setting is in shell.js's media query,
   and data-motion="off" (set before the first paint, from the saved preference) stops
   the animations, which the * rule above does not reach. The rail keeps its scroll through
   the switch: keepRailScroll (shell.js) restores it before the new page is shown. */
.rail{ view-transition-name:rail; }
.topbar{ view-transition-name:topbar; }
::view-transition-group(rail),::view-transition-group(topbar){ animation-duration:.2s; }
::view-transition-old(root){ animation:.12s ease-out both stemeup-page-out; }
::view-transition-new(root){ animation:.24s cubic-bezier(.2,.7,.2,1) .05s both stemeup-page-in; }
@keyframes stemeup-page-out{ to{ opacity:0; } }
@keyframes stemeup-page-in{ from{ opacity:0; transform:translateY(6px); } }
:root[data-motion="off"]::view-transition-group(*),
:root[data-motion="off"]::view-transition-old(*),
:root[data-motion="off"]::view-transition-new(*){ animation:none !important; }

/* ------------------------------------------------ accessibility settings --
   The shared controls (moved from home/home.css 2026-08-24 — founder build
   list 2026-08-22 items 4+5; the learner Settings page renders these same
   classes) and the adult tiers' panel (Shell.mountAccessibilitySettings).
   The switch is scoped to .set-row DELIBERATELY: /experiments ships its own
   local .switch on a 40px track, and the bare selector leaking there put
   the knob outside its rail (verifier find, 2026-08-24). */
/* The settings card. MOVED here from home/home.css by the a11y-parity round:
   the carer's Settings surface renders the same card, so it is shared chrome
   and the anti-fork ratchet forbids it living in both files. */
.set-card{ background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:22px 24px; box-shadow:var(--shadow); }
/* The notification-email switches (buildNotificationEmailsCard): one row per kind. */
.set-list .set-row{ padding:12px 0; }
.set-list .set-row + .set-row{ border-top:1px solid var(--line); }
.set-card h3{ font-family:"ITC Ronda","Poppins",sans-serif; font-weight:400; font-size:18px; margin:0 0 3px; }
.set-card .ch{ font-size:12.5px; color:var(--muted); margin:0 0 16px; }
.set-pw-form label{ display:block; font-size:13px; font-weight:500; margin:12px 0 6px; }
.set-pw-form input{ display:block; width:100%; max-width:360px; height:44px; padding:0 12px; border-radius:12px; border:1px solid var(--line); background:var(--paper); color:var(--ink); font:inherit; }
.set-pw-form .btn{ margin-top:16px; }
/* The options buildPasswordCard takes (shell.js): a Show button inside each field,
   and Cancel beside the submit. */
.set-pw-wrap{ position:relative; max-width:360px; }
.set-pw-form .set-pw-wrap input{ max-width:none; padding-right:72px; }
.set-pw-eye{ position:absolute; top:4px; right:4px; bottom:4px; min-width:58px; padding:0 12px; border:none; border-radius:9px;
  background:color-mix(in srgb, var(--ink) 8%, transparent); color:var(--ink); font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.set-pw-eye:hover{ background:var(--accent-wash); }
.set-pw-eye:focus-visible{ outline:var(--focus-ring); outline-offset:1px; }
.set-pw-actions{ display:flex; flex-wrap:wrap; gap:10px; }
.set-pw-status{ font-size:13px; color:var(--muted); margin:10px 0 0; min-height:1.2em; }

/* The .a11y-panel / .a11y-close rules are GONE with this round. The floating
   accessibility panel #154 shipped was replaced, at the founder's request, by
   the child platform's treatment: the segmented background switch in the
   topbar (built by Shell.buildThemeSeg) plus the full set in a Settings card.
   A segmented switch has no open/close state, so the panel's focus-trap
   choreography went with it rather than being carried over unused. */

/* The segmented background switch, top-right of the canvas. MOVED here from
   home/home.css by the a11y-parity round: it is shared chrome now (learner +
   carer; staff/director at item 5). Built by Shell.buildThemeSeg — one
   builder, per the wordmark rule.
   The button rule resets the box (padding, margin, min sizes) because it sits on
   every page's rail, and two pages style bare `button`: Data retention's
   `padding:8px 13px` pushed the glyphs 6px right and 2px down and stretched the
   ring into an oval (staging, 2026-10-28). test_director_rail_everywhere.py
   measures the switch on every director screen. */
.theme-seg{ display:flex; gap:2px; padding:3px; border:1px solid var(--line); border-radius:99px; background:var(--surface); }
.theme-seg button{ box-sizing:border-box; flex:none; width:28px; height:28px; min-width:0; min-height:0; margin:0; padding:0;
  border-radius:50%; border:none; background:none; color:var(--muted); cursor:pointer; display:grid; place-items:center; }
.theme-seg button:hover{ color:var(--ink); }
/* The selected state may NOT be a tint alone. Measured (WCAG 2.x relative
   luminance, --accent-wash composited over --surface): the active pill reads
   1.37 : 1 on purple and black and 1.11 : 1 on white, against the 3 : 1 floor
   SC 1.4.11 sets for a state indicator — and on white the ACTIVE icon
   (--accent-ink #B8890B) fell to 2.86 while the inactive ones sat at 6.23, so
   choosing an option made it the hardest one to see. No alpha could fix that
   theme: #F6BD00 at FULL opacity on #FFFFFF is 1.72 : 1, a ceiling.
   So the state carries a shape, not just a hue: an inset ring in --ink, which
   measures 9.7 / 10.7 / 16.0 : 1 against the pill in the three themes, and
   --ink for the glyph, which ends the white-theme inversion (2.86 -> 16.0).
   Found by the verifier fan-out on the a11y-parity round; PRE-EXISTING on the
   learner surface, but this round is what put the control in front of carers. */
.theme-seg button.active{ background:var(--accent-wash); color:var(--ink);
  box-shadow:inset 0 0 0 2px var(--ink); }
.theme-seg svg{ width:15px; height:15px; stroke:currentColor; fill:none; }
.theme-seg .swatch{ width:14px; height:14px; border-radius:50%; background:conic-gradient(#7A3FB0,#F6BD00,#F58BAF,#7A3FB0); box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.5); }

.set-theme{ display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap; }
.set-theme button{ display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); background:transparent; color:var(--ink); border-radius:12px; padding:9px 14px; font:inherit; font-size:13px; cursor:pointer; }
.set-theme button.active{ border-color:var(--accent); background:var(--accent-wash); }
.set-theme .sw{ width:16px; height:16px; border-radius:50%; box-shadow:inset 0 0 0 1px var(--line); }
.set-theme .sw-purple{ background:#260B37; } .set-theme .sw-black{ background:#0E1116; } .set-theme .sw-white{ background:#EFEAF2; }
.set-row{ display:flex; align-items:center; justify-content:space-between; gap:14px; padding:10px 0; }
.set-row .lab{ font-size:13.5px; font-weight:600; }
.set-row .desc{ font-size:12px; color:var(--muted); margin-top:2px; }
.set-dev{ display:flex; align-items:center; gap:14px; }
.set-dev .dev-icon{ color:var(--muted); }
.set-row .switch{ width:44px; height:25px; flex:0 0 auto; border-radius:99px; border:none; cursor:pointer; background:var(--track); position:relative; transition:background .18s ease; }
.set-row .switch::after{ content:""; position:absolute; top:3px; left:3px; width:19px; height:19px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.3); transition:transform .18s ease; }
.set-row .switch.on{ background:var(--accent); } .set-row .switch.on::after{ transform:translateX(19px); }

/* The carer progress chart, drawn by CarerShell.progressChart on BOTH carer
   surfaces (the hub's For You panel and the child's own page). Defined here
   rather than in either page because a rule used by two pages that lives in one
   of them is a fork waiting to happen — the other page renders the chart
   unstyled and nothing fails. ROADMAP item 13. */
.prog-card {
  background: linear-gradient(180deg, rgba(95, 208, 168, 0.05), transparent), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
/* The ink belongs HERE, with the rule, for the reason the rule itself moved: a
   property of a shared component defined on one page is a fork waiting. This
   card paints `--bg-card`, which is hard-coded dark in ALL three themes, while
   `body` is themed `--ink` — so without a stated colour its contents render
   dark-on-dark at ~1.18:1 on the white theme (ROADMAP 5b, PR #184).
   SCOPED TO `screen`: the print block above deliberately sets no colour, so
   paper ink is inherited from `body`, and an unscoped light ink here would
   print at 1.16:1. PR #184 originally stated this in carer-progress.html, which
   collided with item 13's "rules live in the shared stylesheet" contract — both
   were right, and this is where the two agree. */
@media screen {
  .prog-card { color: var(--text); }
}
/* The chart's date labels live in HTML, not in the SVG. Inside the viewBox a
   font-size is in USER UNITS, so it scales with the container — 10 units in a
   640-wide box renders at 3.19px on a 320px viewport, and at 3.17px in the
   child page's 260px rail on a FULL DESKTOP, which is the inversion that made
   it easy to miss. `visuals/primitives.py` avoids this by capping with
   max-width; that only helps when the container is WIDER than the viewBox, and
   here it is narrower. HTML text does not scale, so it is simply the right home.
   aria-hidden: the SVG's own label already states both dates. */
.prog-dates { display: flex; justify-content: space-between; margin: 4px 2px 0;
  font-size: 11.5px; color: var(--text-dim); }
.prog-cap { margin: 6px 2px 0; font-size: 13.5px; color: var(--text); }
/* The primer's Try / Skip callouts. They live in `body_html`, which renders on
   the carer hub as well as on /carer-primer, and were defined ONLY in that
   page's own <style> — so the hub shipped the guide's words as bare divs and the
   green/red contrast that IS the Try-vs-Skip pair simply was not there. "Content
   unchanged" has to mean the reader sees the same thing. ROADMAP item 7. */
.say { border-left: 3px solid var(--mint); background: rgba(95, 208, 168, 0.07); }
.avoid { border-left: 3px solid var(--status-risk); background: rgba(255, 122, 89, 0.07); }
.say,
.avoid { padding: 8px 12px; margin: 8px 0; border-radius: 0 8px 8px 0; font-size: 13.5px; line-height: 1.55; }
.say strong,
.avoid strong { font-weight: 600; }

/* ---- THE EMOJI PICKER (2026-08-30) --------------------------------------
   Shared chrome, so it lives in shell.css: four surfaces mount the same
   `emoji.js` and none of them should own a copy of these rules. The characters
   are drawn by the SYSTEM font — there is no sprite sheet and nothing loaded,
   which is what keeps the app's `'self'`-only CSP untouched. */
.emoji-btn{ flex:0 0 auto; width:34px; height:34px; display:grid; place-items:center;
  border:1px solid var(--line); border-radius:50%; background:transparent;
  color:var(--muted); font-size:16px; line-height:1; cursor:pointer; }
.emoji-btn:hover{ color:var(--ink); border-color:var(--accent); }
.emoji-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.emoji-host{ position:relative; display:flex; align-items:flex-end; }
.emoji-pop{ position:absolute; bottom:calc(100% + 8px); right:0; z-index:400;
  width:min(268px, 78vw); max-height:248px; overflow-y:auto;
  padding:10px 12px 12px; border-radius:14px;
  background:var(--surface); color:var(--ink); border:1px solid var(--line);
  box-shadow:var(--glass-shadow, 0 18px 40px -12px rgba(0,0,0,.5)); }
.emoji-h{ margin:8px 0 5px; font-size:9.5px; font-weight:700; letter-spacing:.11em;
  text-transform:uppercase; color:var(--faint); }
.emoji-h:first-child{ margin-top:0; }
.emoji-row{ display:grid; grid-template-columns:repeat(8, 1fr); gap:2px; }
.emoji-b{ aspect-ratio:1; display:grid; place-items:center; border:none; border-radius:7px;
  background:transparent; font-size:17px; line-height:1; cursor:pointer; padding:0; }
.emoji-b:hover{ background:var(--accent-wash); }
.emoji-b:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }

/* ---- THE CARER TOPBAR'S PIPS (2026-08-30) -------------------------------
   Messages and the Board moved out of the carer rail and into the topbar,
   beside the background switch, because that is where the child platform
   carries them and a carer looking at both screens should not have to learn
   two placements for one pair of surfaces.

   Labelled, for the reason the child's are: two bare outline glyphs next to a
   three-way theme switcher read as part of that cluster, and the founder could
   not find either of them. The `.topbar-pip` / `.pip-label` / `.pip-dot` names
   are the learner home's, deliberately — one vocabulary for one control. */
.topbar-pips{ display:flex; align-items:center; gap:8px; }
.topbar-pip{ position:relative; flex:0 0 auto; display:inline-flex;
  align-items:center; gap:7px; height:36px; padding:0 13px 0 11px;
  border:1px solid var(--line); border-radius:var(--radius-pill, 99px);
  background:var(--surface); color:var(--muted); text-decoration:none; cursor:pointer; }
.topbar-pip:hover{ color:var(--ink); }
.topbar-pip:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
/* display:inline-flex beats the UA's [hidden]{display:none}, so the entry a
   child with no carer must not see needs this said explicitly. */
.topbar-pip[hidden]{ display:none; }
.topbar-pip svg{ width:17px; height:17px; stroke:currentColor; fill:none; }
.pip-label{ font-size:12.5px; font-weight:600; line-height:1; white-space:nowrap;
  color:inherit; }
/* The page you are on carries the ring the rest of these surfaces use for a
   selected state — a tint alone is 1.11:1 on the white theme. */
.topbar-pip[aria-current="page"]{ background:var(--accent-wash);
  color:var(--ink); box-shadow:inset 0 0 0 2px var(--ink); }
/* A DOT, not a count, and it carries a ring in --ink as well as the hue:
   --accent measures 1.64:1 against --surface on the white theme, under the 3:1
   floor SC 1.4.11 sets for a non-text indicator. */
.pip-dot{ position:absolute; top:-3px; right:-3px; width:9px; height:9px;
  border-radius:50%; background:var(--accent); box-shadow:0 0 0 2px var(--ink); }
.pip-dot[hidden]{ display:none; }

/* THE ONE PLACE THE TWO SIDES DIFFER, and it is a founder decision rather than
   an accident. The word survives a phone on the CHILD's topbar — "a label that
   disappears at 430px disappears on the device a child actually uses" — so it
   gives way only at 380px, where the rail toggle, both entries and the theme
   switcher genuinely stop fitting. The CARER's topbar also carries Sign out and
   a wider switch, so its row runs out of width sooner and hides at 640. Either
   way the entry stays, with its accessible name; it is the word that goes. */
@media (max-width: 640px){
  .topbar-pips .pip-label{ position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
  .topbar-pips .topbar-pip{ width:36px; padding:0; justify-content:center; }
  .topbar-pips .pip-dot{ top:2px; right:2px; }
}
@media (max-width: 380px){
  .pip-label{ position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
  .topbar-pip{ width:36px; padding:0; justify-content:center; }
  .pip-dot{ top:2px; right:2px; }
}

/* The `.id-*` identity picker was removed on 2026-08-31. It was the carer's
   own bespoke name-and-face control; the founder asked for the LEARNER's
   ("look exactly like the learners"), so carer-shell.js now emits `.av-*` and
   the two are one control painted by one block below. Deleted rather than
   left behind: dead CSS for a control nobody renders is the next person's
   twenty minutes. */

/* ==========================================================================
   THE AVATAR CREATOR AND THE NAME PICKER — shared by the learner and the carer
   ==========================================================================
   These lived in home/home.css while the explorer builder was a learner-only
   screen. On 2026-08-31 the founder asked for the carer's name-and-face
   picker to "look exactly like the learners", and the only way to make that
   TRUE rather than approximately true is for one stylesheet to paint both:
   a second copy is a promise to diverge.

   The learner-only concepts stay learner-only in the MARKUP, not here — a
   carer has no level and nothing locked, so carer-shell.js simply does not
   emit `.av-lvl` or `.av-lock`. Everything else is the same control. */

/* ---- PIN modal + toast --------------------------------------------------- */
.pin-overlay{ position:fixed; inset:0; z-index:400; display:grid; place-items:center; padding:20px;
  background:rgba(0,0,0,.5); backdrop-filter:blur(3px); }
.pin-box{ width:100%; max-width:390px; border:1px solid var(--line); border-radius:20px;
  background:var(--surface); box-shadow:var(--glass-shadow); padding:24px 24px 20px; }
.pin-box h2{ font-family:"ITC Ronda","Poppins",sans-serif; font-size:21px; font-weight:400; margin:0 0 8px; }
.pin-box p{ font-size:13.5px; line-height:1.6; color:var(--muted); margin:0 0 14px; }
.pin-input{ width:100%; font:inherit; font-size:16px; padding:11px 13px; border-radius:12px;
  border:1px solid var(--line); background:color-mix(in srgb, var(--ink) 4%, transparent); color:var(--ink); }
.pin-input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-wash); }
.pin-err{ font-size:12.5px; color:#FF8A5B; min-height:1.15em; margin:7px 0 4px; }
.pin-box .set-lab{ display:block; font-size:13px; font-weight:500; color:var(--ink); margin:12px 0 6px; }
/* SCOPED, because "pin" means two things in this product. This is the button
   row of the PIN / name-picker DIALOG; `.pin-actions` in home.css is the
   heart-and-Reply row of a board PIN — a post on the home boards, the
   founder's own word. The two are unrelated and were in different sheets
   until this block moved here, at which point they began overriding each
   other by load order. The board's is the one with the wider claim on the
   name, so the dialog's is the one that gets qualified. */
.pin-box .pin-actions{ display:flex; gap:9px; justify-content:flex-end; margin-top:8px; }
/* They arrive like every pop-up: branding.css (3c) owns the keyframes and timing. */
.pin-overlay, .rc-overlay{ animation:sm-scrim-in .24s ease-out; }
.pin-box, .rc-box{ animation:sm-pop-in var(--sm-in) var(--sm-ease-out); }

/* ---- recent chats (item 6) ------------------------------------------------
   Every colour comes from a token, so both themes resolve; the rows are the
   only new shape here, and they reuse the pin-overlay shell above rather than
   introducing a second modal idiom. -------------------------------------- */
.rc-overlay{ position:fixed; inset:0; z-index:400; display:grid; place-items:center; padding:20px;
  background:rgba(0,0,0,.5); backdrop-filter:blur(3px); }
.rc-box{ width:100%; max-width:520px; max-height:min(80vh, 680px); display:flex; flex-direction:column;
  border:1px solid var(--line); border-radius:20px; background:var(--surface);
  box-shadow:var(--glass-shadow); padding:22px 20px 18px; }
.rc-box h2{ font-family:"ITC Ronda","Poppins",sans-serif; font-size:21px; font-weight:400; margin:0 4px 6px; }
.rc-list{ overflow-y:auto; display:flex; flex-direction:column; gap:6px; margin:0 -6px; padding:0 6px 2px; }
.rc-empty{ font-size:13.5px; line-height:1.6; color:var(--muted); margin:6px 2px 10px; }
/* Tidied 2026-11-10: the chats in days, each row what it was about (its topic), where it
   got to (the tutor's last words, never a board's transcript), when, and the boards it drew. */
.rc-day{ margin:12px 4px 2px; font-size:12.5px; font-weight:600; color:var(--muted); }
.rc-day:first-child{ margin-top:6px; }
.rc-item{ display:flex; align-items:flex-start; gap:12px; width:100%; text-align:left; font:inherit; cursor:pointer;
  border:1px solid var(--line); border-radius:14px; padding:12px;
  background:color-mix(in srgb, var(--ink) 3%, transparent); color:var(--ink); }
.rc-item:hover{ border-color:var(--accent); background:color-mix(in srgb, var(--ink) 6%, transparent); }
.rc-item:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.rc-item.here{ border-color:color-mix(in srgb, var(--accent) 55%, var(--line)); }
/* The kind is the icon, and a hidden word for a screen reader: no colour variant, so there
   is no second encoding to get wrong. */
.rc-ic{ flex:none; display:grid; place-items:center; width:36px; height:36px; border-radius:11px;
  background:color-mix(in srgb, var(--ink) 7%, transparent); color:var(--ink); }
.rc-ic svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round; }
.rc-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.rc-title{ font-size:15px; font-weight:600; line-height:1.3; }
.rc-snip{ font-size:13px; line-height:1.45; color:var(--muted); display:-webkit-box;
  -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
/* --muted, not --faint. --faint is sized for text on --paper/--surface; on this
   card's 3% ink tint it computes 4.38:1 (purple) and 4.33:1 (dark) — under the
   floor by a whisker, which is the kind of miss that only ever shows up in an
   audit. Size carries the hierarchy instead. */
.rc-time{ font-size:12px; color:var(--muted); }
/* Ink on a line border, like .cway-chip: an accent colour as text computed 2.72:1 on the
   white theme. */
.rc-tag{ flex:none; display:inline-block; font-size:11.5px; font-weight:600; padding:3px 9px;
  border-radius:999px; border:1px solid var(--line); color:var(--ink); white-space:nowrap; }
.rc-tag::first-letter{ text-transform:uppercase; }
.rc-tag.here{ border-color:color-mix(in srgb, var(--accent) 55%, var(--line)); }
.rc-actions{ display:flex; gap:9px; justify-content:flex-end; margin-top:14px; }

/* ---- the explorer-name picker (rides the pin-overlay shell) -------------- */
.name-box{ max-width:470px; }
.name-preview{ font-family:"ITC Ronda","Poppins",sans-serif; font-size:24px; text-align:center;
  padding:14px 10px; margin:2px 0 12px; border-radius:14px; color:var(--ink);
  background:color-mix(in srgb, var(--accent) 12%, var(--surface));
  border:1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.name-grid{ display:flex; flex-wrap:wrap; gap:7px; margin-bottom:12px; }
.name-chip{ font:inherit; font-size:13.5px; font-weight:600; color:var(--ink); cursor:pointer;
  padding:7px 12px; border-radius:99px; border:1px solid var(--line);
  background:color-mix(in srgb, var(--ink) 5%, transparent); }
.name-chip:hover{ border-color:var(--accent); }
.name-chip:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.name-tools{ display:flex; gap:9px; margin-bottom:6px; }
#nameKeep:disabled{ opacity:.55; cursor:default; }

/* Settings row + avatar bar for the picked name */
.set-namerow{ display:flex; align-items:center; gap:10px; }
.set-namecur{ font-size:15px; font-weight:600; color:var(--ink); min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.set-namehint{ font-size:12px; color:var(--muted); margin:6px 0 0; line-height:1.5; }
/* ==========================================================================
   THE AVATAR PICKER (avatar round, founder decisions 2026-11-19, ROADMAP.md): one control,
   home/avatar-picker.js, for the learner's creator and the carer's name-and-face picker.
   As drawn for P4 a: the name with "Change name"; the preview, with "Shuffle" on it; the
   parts in one row, who-you-are first; the options under it; Undo, the quiet line and the
   one gold button at the foot. On a phone the learner's preview and parts stay in sight
   while the options scroll under them, and the foot stays at the bottom (.is-screen);
   on a computer, two columns.
   ========================================================================== */
.avp-host{ container-type:inline-size; min-width:0; }
/* Narrow (the default): one column, in the drawing's order for a phone: the name, the preview,
   the parts, the options, what earns a locked item, then Undo and Done. */
.avp{ position:relative; display:flex; flex-direction:column; gap:14px; min-width:0; }
.avp-side, .avp-main{ display:contents; }
.avp-stage{ order:1; display:grid; gap:12px; min-width:0; }
.avp-parts{ order:2; }
.avp-panel{ order:3; }
.avp-earn{ order:4; }
.avp-foot{ order:5; }
.avp-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; }
.avp-name{ margin:0; min-width:0; font:400 24px/1.2 "ITC Ronda", "Poppins", sans-serif; color:var(--ink);
  overflow-wrap:anywhere; text-wrap:balance; }
/* A quiet pill: 44 high, a tint of the text colour (THE-LOOK's second action). */
.avp-pill{ display:inline-flex; align-items:center; justify-content:center; gap:8px; flex:none; min-height:44px;
  padding:0 18px; border:0; border-radius:22px; cursor:pointer; color:var(--ink);
  background:var(--look-tintq, color-mix(in srgb, var(--ink) 14%, transparent));
  font:600 15px/1 "Poppins", system-ui, sans-serif; }
.avp-pill svg{ width:18px; height:18px; flex:none; }
.avp-pill:disabled{ opacity:.45; cursor:default; }
.avp-pill:focus-visible, .avp-part:focus-visible, .avp-done:focus-visible, .avp-look:focus-visible{
  outline:3px solid var(--accent); outline-offset:2px; }
.avp-preview{ position:relative; overflow:hidden; border-radius:22px; display:flex; justify-content:center;
  align-items:flex-start; aspect-ratio:1.6; max-height:250px; transition:background .25s; }
/* Today's gentle float, kept as it was (no movement is added in this round). */
.avp-fig{ height:100%; display:flex; justify-content:center; animation:floaty 4s ease-in-out infinite; }
@keyframes floaty{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-8px);} }
/* From the waist up, bigger, as drawn; the whole figure while Mobility is open. */
.avp-fig svg{ display:block; height:185%; width:auto; margin-top:4%; }
.avp.is-whole .avp-fig svg{ height:94%; margin-top:3%; }
.avp-lvl{ position:absolute; top:12px; left:12px; padding:6px 12px; border-radius:99px; background:rgba(38,11,55,.62);
  color:#fff; font:600 12.5px/1.2 "Poppins", system-ui, sans-serif; }
.avp-shuffle{ position:absolute; top:10px; right:10px; background:rgba(38,11,55,.72); color:#fff; }
.avp-trying{ position:absolute; left:12px; bottom:12px; max-width:46%; padding:8px 12px; border-radius:14px;
  background:rgba(38,11,55,.86); color:#fff; font:500 14px/1.35 "Poppins", system-ui, sans-serif; }
/* THE PARTS: one row that slides sideways on a phone (a tab list, arrow keys inside it). */
.avp-parts{ display:flex; gap:8px; overflow-x:auto; padding:3px 2px; scrollbar-width:none; min-width:0; }
.avp-parts::-webkit-scrollbar{ display:none; }
.avp-part{ flex:none; display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 16px; border:0;
  border-radius:22px; cursor:pointer; white-space:nowrap; color:var(--ink);
  background:var(--look-tintq, color-mix(in srgb, var(--ink) 14%, transparent));
  font:600 15px/1 "Poppins", system-ui, sans-serif; }
.avp-part svg{ width:18px; height:18px; flex:none; }
/* The open part is the light pill of the drawing: the text colour, with the page's own ink. */
.avp-part.on{ background:var(--ink); color:var(--paper); }
.avp-panel{ min-width:0; }
.avp-sec{ margin:6px 0 10px; }
.avp-sec-h{ font:600 13.5px/1.3 "Poppins", system-ui, sans-serif; color:var(--muted); }
.avp-sec-h b{ font-weight:600; color:var(--ink); }
.avp-swatches{ display:flex; flex-wrap:wrap; gap:10px; margin-bottom:16px; }
/* THE LOOKS (P7 a): no names; each on its own backdrop. */
.avp-looks{ display:grid; grid-template-columns:repeat(auto-fill, minmax(84px, 1fr)); gap:12px; }
.avp-look{ aspect-ratio:1; overflow:hidden; border:0; padding:0; border-radius:16px; cursor:pointer;
  box-shadow:inset 0 0 0 1px rgba(44,32,56,.14); }
.avp-look svg{ display:block; width:100%; height:100%; }
.avp-note{ margin:12px 0 0; font-size:13.5px; line-height:1.45; color:var(--muted); }
/* A LOCKED ITEM (P6 a): a small lock in the plate's corner, what earns it under its name. */
.avp-lock{ position:absolute; top:6px; left:6px; width:26px; height:26px; border-radius:50%; display:grid; place-items:center;
  background:rgba(38,11,55,.86); color:#F6BD00; }
.avp-lock svg{ width:14px; height:14px; }
.avp-need{ font-size:12.5px; line-height:1.3; color:var(--muted); }
.avp-earn{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; border-radius:18px;
  background:var(--look-tint2, color-mix(in srgb, var(--ink) 7%, transparent)); }
.avp-earn[hidden]{ display:none; }
.avp-earn p{ margin:0; min-width:0; font-size:15px; line-height:1.4; color:var(--ink); }
.avp-earn b{ font-weight:600; }
.avp-foot{ display:flex; align-items:center; gap:12px; min-width:0; }
.avp-status{ flex:1; min-width:0; margin:0; display:flex; align-items:center; gap:6px; font-size:14px; line-height:1.35;
  color:var(--muted); }
.avp-status svg{ width:16px; height:16px; flex:none; }
/* THE ONE GOLD BUTTON: Done (the carer's Save). */
.avp-done{ flex:none; min-height:54px; padding:0 30px; border:0; border-radius:27px; cursor:pointer;
  background:var(--accent); color:var(--on-accent); font:600 17px/1 "Poppins", system-ui, sans-serif;
  box-shadow:var(--look-gold-edge, none); }
.avp-done:disabled{ opacity:.5; cursor:default; }
.avp-live, .avp-sr{ position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.av-readonly{ font-size:13.5px; line-height:1.5; color:var(--muted); margin:0 0 12px;
  padding:10px 12px; border-radius:12px; background:color-mix(in srgb, var(--ink) 6%, transparent); }
/* Nothing pressable under 44 high in the creator, the way back included (repair 4). On a
   phone its title line goes, so the preview is in sight from the start (P4 a). */
#view-avatar .back-link{ min-height:44px; }
@media (max-width:820px){
  /* The page's title stays for a screen reader; the picker's own name line is the heading on show. */
  #view-avatar.active .pg-sub{ display:none; }
  #view-avatar .pg-title{ position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
}
/* AN OPTION: its picture on one light plate, cut close to the part it changes, its name
   underneath (repairs 3 and 8). The plate is the same on every background, so the figure's
   outline, dark hair and the darkest skin always have something to stand on. */
.av-opts{ display:grid; grid-template-columns:repeat(auto-fill,minmax(84px,1fr)); gap:14px 12px; margin-bottom:8px; }
.av-opt{ position:relative; cursor:pointer; display:flex; flex-direction:column; align-items:stretch; gap:6px;
  border:none; background:none; padding:0; font:inherit; color:var(--ink); text-align:center; }
.av-opt-fig{ position:relative; display:block; width:100%; aspect-ratio:1; border-radius:16px; overflow:hidden;
  background:#EFE7F6; box-shadow:inset 0 0 0 1px rgba(44,32,56,.12); }
.av-opt-fig > svg{ width:100%; height:100%; display:block; }
/* Chosen: the gold ring of the drawing round the plate (the gold-for-text tone, which reads
   on white too), and the tick. Being tried on: a ring in the text colour. */
.av-opt.sel .av-opt-fig{ box-shadow:0 0 0 3px var(--accent-ink, #F6BD00); }
.av-opt.trying .av-opt-fig{ box-shadow:0 0 0 3px var(--ink); }
.av-opt:focus-visible{ outline:none; }
.av-opt:focus-visible .av-opt-fig{ outline:3px solid var(--accent); outline-offset:3px; }
.av-opt-name{ font-size:13px; font-weight:600; line-height:1.25; overflow-wrap:anywhere; }
.av-opt.locked .av-opt-name{ color:var(--ink); }
.av-bgswatch{ width:100%; height:100%; display:block; }
/* The tick sits inside the plate's corner (repair 10); it is drawn on every option and
   shown on the chosen one. */
.av-tick{ position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%; background:var(--accent); color:var(--on-accent);
  display:none; place-items:center; box-shadow:0 0 0 2px #EFE7F6; }
.av-opt.sel .av-tick{ display:grid; }
.av-tick svg{ width:13px; height:13px; stroke:currentColor; fill:none; stroke-width:3; }
.av-swatch{ width:44px; height:44px; border-radius:50%; padding:0; cursor:pointer; border:3px solid transparent; box-shadow:0 2px 6px rgba(0,0,0,.18); }
.av-swatch.sel{ border-color:var(--ink); }
.av-swatch:focus-visible{ outline:3px solid var(--accent); outline-offset:2px; }

/* THE FACE IN ITS CIRCLE (avatar round, 19 Nov 2026, P2 a): every place that shows a person
   under 64 px wide, learner or carer, draws head and shoulders in a circle of that person's
   own backdrop (QuestAvatar.face). It fills whatever holds it. A faint ring in the text
   colour keeps a dark backdrop off a dark page and a pale one off a white card. */
.av-face{ display:block; width:100%; height:100%; border-radius:50%; overflow:hidden; flex:none;
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--ink, #260B37) 24%, transparent); }
.av-face > svg{ display:block; width:100%; height:100%; }

/* NARROW (a phone, a dialog): in the learner's creator (P4 a) the name, the preview and the
   parts stay in sight while the options scroll under them, and Undo, the line and Done stay at
   the bottom. The control's own width decides, not the screen's. */
@container (max-width:699px){
  .is-screen .avp-stage{ position:sticky; top:var(--avp-top, 0px); z-index:7; padding:8px 0 0;
    background:var(--avp-ground, var(--paper)); }
  .is-screen .avp-parts{ position:sticky; top:calc(var(--avp-top, 0px) + var(--avp-stage-h, 300px)); z-index:6;
    margin-top:-14px; padding:12px 2px 10px; background:var(--avp-ground, var(--paper)); }
  .is-screen .avp-foot{ position:sticky; bottom:0; z-index:6; margin:0 -16px;
    padding:10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background:var(--avp-ground, var(--paper));
    box-shadow:0 -1px 0 var(--line); }
}
/* WIDE (a computer): two columns, as drawn. The preview, the name and the foot on the left;
   the parts and their options on a card on the right. */
@container (min-width:700px){
  .avp{ display:grid; grid-template-columns:minmax(280px, 360px) minmax(0, 1fr); column-gap:28px; align-items:start; }
  .avp-side{ display:flex; flex-direction:column; gap:16px; min-width:0; }
  .avp-stage{ display:flex; flex-direction:column; gap:16px; }
  .avp-head{ order:2; }
  .avp-preview{ aspect-ratio:auto; height:380px; max-height:none; }
  .avp-fig svg{ height:94%; margin-top:4%; }
  .avp-main{ display:flex; flex-direction:column; gap:14px; min-width:0; padding:22px 24px; border-radius:24px;
    background:var(--surface); border:1px solid var(--line); }
  .avp-parts{ flex-wrap:wrap; overflow:visible; padding:0; }
}

/* A QUESTIONNAIRE, until it's finished — the carer's and college parent's notice on every
   carer screen (founder decisions 2026-10-11; carer-shell.js paints it). THE LOOK, founder
   2026-10-12 (canvas L1aeVjFuqM5cyuUq8TKtMd): "Carer A" — a pop-up the first time, their
   own face beside a yellow "5 MIN" token — and, once they close it without answering,
   "Carer C"'s yellow box under the topbar. The rail item beside them is an ordinary
   .nav-item with a .tag. The green panels are pictures, the same in every theme; the box is
   the theme's accent yellow, which all three themes share. The STUDENT's box is this same
   component (home-survey.js, founder 2026-10-12: "Student A"), with the XP tag added. */
.survey-banner{ display:grid; grid-template-columns:72px minmax(0,1fr);
  grid-template-areas:"face words" "private private" "actions actions"; align-items:center; gap:12px 14px;
  margin:12px 12px 0; padding:14px; border-radius:22px; background:var(--accent); color:var(--on-accent);
  font-size:14px; line-height:1.45; }
.survey-banner[hidden]{ display:none; }
.survey-banner.no-face{ grid-template-columns:minmax(0,1fr); grid-template-areas:"words" "private" "actions"; }
.survey-banner-face{ grid-area:face; width:72px; height:72px; border-radius:18px; background:#9BE2C8; overflow:hidden;
  display:flex; align-items:flex-end; justify-content:center; }
.survey-banner-face svg{ display:block; width:66px; height:72px; }
.survey-banner-words{ grid-area:words; display:flex; flex-direction:column; gap:3px; min-width:0; }
.survey-banner-title{ margin:0; font-size:18px; font-weight:700; line-height:1.25; }
.survey-banner-text{ margin:0; font-size:13.5px; line-height:1.45; }
.survey-banner-private{ grid-area:private; margin:0; display:flex; align-items:center; gap:8px; font-size:12.5px; }
.survey-banner-private svg{ flex:0 0 auto; width:15px; height:15px; }
/* What finishing pays — a student's box only; adults earn no XP. */
.survey-banner-xp{ flex:0 0 auto; margin-left:auto; padding:3px 9px; border-radius:99px; background:var(--on-accent);
  color:var(--accent); font-size:12.5px; font-weight:700; white-space:nowrap; }
.survey-banner-actions{ grid-area:actions; display:flex; align-items:center; gap:14px; }
.survey-banner-open{ flex:1; display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:48px;
  box-sizing:border-box; padding:0 20px; border-radius:14px; background:var(--on-accent); color:var(--accent);
  font-weight:600; font-size:15px; text-decoration:none; }
.survey-banner-open svg{ flex:0 0 auto; width:16px; height:16px; }
.survey-banner-no{ background:none; border:0; color:var(--on-accent); font:inherit; font-size:14px;
  text-decoration:underline; cursor:pointer; min-height:44px; padding:10px 2px; }
.survey-banner a:focus-visible, .survey-banner-no:focus-visible{ outline:2px solid var(--on-accent); outline-offset:2px; }
@media (min-width: 841px){
  .survey-banner{ grid-template-columns:84px minmax(0,1fr) auto; grid-template-areas:"face words actions" "face private actions";
    gap:4px 18px; margin:16px 32px 0; padding:14px 22px 14px 14px; }
  .survey-banner.no-face{ grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"words actions" "private actions";
    padding-left:22px; }
  .survey-banner-face{ width:84px; height:84px; }
  .survey-banner-face svg{ width:78px; height:84px; }
  .survey-banner-words{ align-self:end; gap:4px; }
  .survey-banner-private{ align-self:start; }
  .survey-banner-xp{ margin-left:6px; }
  .survey-banner-title{ font-size:19px; }
  .survey-banner-text{ font-size:14px; }
  .survey-banner-actions{ flex-direction:column; gap:2px; }
  .survey-banner-open{ flex:none; }
  .survey-banner-no{ font-size:13.5px; padding:8px 4px; }
}

/* The pop-up: a bottom sheet on a phone; from 900px a two-column card in the middle of the
   screen, the green panel on the left — the student's sheet ("C", home.css) in the carer's
   words, with a "5 MIN" token where the student has the +XP coin. */
.survey-pop-wrap{ position:fixed; inset:0; z-index:var(--z-modal); display:flex; align-items:flex-end; justify-content:center;
  background:rgba(12,4,20,.62); }
/* A sheet up from the bottom on a phone; from 900px it pops in like a dialog (below).
   Keyframes: branding.css (3c). */
.survey-pop-wrap{ animation:sm-scrim-in .24s ease-out; }
.survey-pop{ animation:sm-sheet-in var(--sm-in) var(--sm-ease-out); }
.survey-pop{ position:relative; width:100%; max-width:520px; box-sizing:border-box; background:var(--surface); color:var(--ink);
  border-radius:28px 28px 0 0; padding:12px 20px 22px; display:flex; flex-direction:column; gap:16px;
  box-shadow:0 -12px 40px rgba(0,0,0,.35); max-height:100%; overflow-y:auto; }
.survey-pop-grab{ align-self:center; width:40px; height:5px; border-radius:99px; background:color-mix(in srgb, var(--ink) 28%, transparent); }
.survey-pop-x{ display:none; position:absolute; right:14px; top:14px; z-index:1; width:44px; height:44px; border-radius:50%; border:0;
  align-items:center; justify-content:center; padding:0; cursor:pointer;
  background:color-mix(in srgb, var(--ink) 8%, transparent); color:var(--ink); }
.survey-pop-x svg{ width:18px; height:18px; }
.survey-pop-x:focus-visible{ outline:2px solid var(--accent-ink); outline-offset:2px; }
/* The picture's own colours, named here: it is the same in every theme on purpose, so it
   tracks no theme token (the student's sheet in home.css is drawn in the same ones). */
.survey-pop-stage{ --pic-gold:#F6BD00; --pic-gold-rim:#FFE08A; --pic-gold-shadow:#C99A00; --pic-ink:#260B37;
  position:relative; height:178px; flex:0 0 auto; border-radius:22px; background:#9BE2C8; overflow:hidden;
  display:flex; align-items:flex-end; justify-content:space-between; padding:0 28px 0 22px; }
.survey-pop-stage.no-face{ justify-content:center; }
.survey-pop-blob{ position:absolute; display:block; }
.survey-pop-blob-a{ left:-30px; top:-40px; width:140px; height:140px; border-radius:50%; background:#B8EDDA; }
.survey-pop-blob-b{ right:70px; bottom:-50px; width:120px; height:120px; border-radius:30px; background:#86D6B9; transform:rotate(18deg); }
.survey-pop-face{ position:relative; display:block; }
.survey-pop-face svg{ display:block; width:118px; height:170px; }
.survey-pop-token{ position:relative; align-self:center; flex:0 0 auto; width:118px; height:118px; box-sizing:border-box; border-radius:50%;
  background:var(--pic-gold); border:6px solid var(--pic-gold-rim); box-shadow:0 8px 0 var(--pic-gold-shadow); color:var(--pic-ink);
  display:flex; flex-direction:column; align-items:center; justify-content:center; }
.survey-pop-token b{ font-size:38px; font-weight:800; line-height:1; }
.survey-pop-token span{ font-size:14px; font-weight:700; letter-spacing:.08em; }
.survey-pop-spark{ position:absolute; display:block; stroke:var(--pic-ink); fill:none; }
.survey-pop-spark-a{ right:22px; top:18px; width:22px; height:22px; stroke-width:2; }
.survey-pop-spark-b{ right:150px; top:26px; width:14px; height:14px; stroke-width:2.4; }
.survey-pop-body{ display:flex; flex-direction:column; gap:16px; min-width:0; }
.survey-pop-words{ display:flex; flex-direction:column; gap:8px; }
.survey-pop-kicker{ display:none; font-size:12px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--accent-ink); }
.survey-pop h2{ margin:0; font-size:26px; line-height:1.15; font-weight:700; letter-spacing:-.015em; }
.survey-pop p{ margin:0; font-size:15.5px; line-height:1.55; }
.survey-pop .survey-pop-private{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); }
.survey-pop-private svg{ flex:0 0 auto; width:16px; height:16px; }
.survey-pop .survey-pop-go{ display:flex; align-items:center; justify-content:center; gap:10px; min-height:56px; box-sizing:border-box;
  text-decoration:none; font-weight:600; font-size:16px; background:var(--accent); color:var(--on-accent); border-radius:18px; padding:0 16px; }
.survey-pop-go svg{ width:18px; height:18px; }
.survey-pop .survey-pop-go:focus-visible{ outline:2px solid var(--ink); outline-offset:2px; }
.survey-pop-foot{ display:flex; justify-content:space-between; gap:12px; margin-top:-6px; }
.survey-pop-quiet{ background:none; border:0; color:var(--muted); font:inherit; font-size:14px; text-decoration:underline;
  cursor:pointer; padding:10px 4px; min-height:44px; }
.survey-pop-later{ text-decoration:none; }
.survey-pop-quiet:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
@media (min-width: 900px){
  .survey-pop-wrap{ align-items:center; padding:24px; }
  .survey-pop{ animation-name:sm-pop-in; }
  .survey-pop{ max-width:770px; flex-direction:row; gap:28px; padding:14px; border-radius:28px; box-shadow:0 24px 60px rgba(0,0,0,.45); }
  .survey-pop-grab{ display:none; }
  .survey-pop-x{ display:flex; }
  .survey-pop-stage{ flex:0 0 300px; height:auto; min-height:410px; border-radius:20px; justify-content:center; padding:0; }
  .survey-pop-blob-a{ left:-50px; top:-50px; width:200px; height:200px; }
  .survey-pop-blob-b{ right:-40px; bottom:60px; width:150px; height:150px; border-radius:36px; }
  .survey-pop-face{ margin-left:-50px; }
  .survey-pop-face svg{ width:180px; height:259px; }
  .survey-pop-token{ position:absolute; right:24px; top:24px; }
  .survey-pop-stage.no-face .survey-pop-token{ position:relative; right:auto; top:auto; }
  .survey-pop-spark-a{ left:30px; right:auto; top:40px; width:24px; height:24px; }
  .survey-pop-spark-b{ right:40px; top:180px; width:15px; height:15px; }
  .survey-pop-body{ flex:1; justify-content:center; gap:18px; padding:28px 30px 20px 0; }
  .survey-pop-words{ gap:10px; }
  .survey-pop-kicker{ display:block; }
  .survey-pop h2{ font-size:34px; line-height:1.12; letter-spacing:-.02em; }
  .survey-pop p{ font-size:16.5px; }
  .survey-pop .survey-pop-private{ font-size:13.5px; }
}

