/* ============================================================
   THE ANNOTATED NOTEBOOK — token layer. Single source of truth.
   Scopes match the site's theme boot: html.theme-dark / html.theme-light.
   Rules: student blue = ALL interaction. Examiner red = judgment moments
   ONLY (serif italic voice). Highlighter = key terms only. Functional
   errors use --nb-error (plain UI voice, never the examiner treatment).
   ============================================================ */

html.theme-light {
  /* Native scrollbars and controls follow the theme, on every page this
     sheet reaches (the legacy styles.css does the same for its own pages). */
  color-scheme: light;
  background-color: var(--nb-paper);
  /* paper */
  --nb-paper: #F1F2EF;
  --nb-paper-raised: #F8F8F4;
  --nb-paper-sunken: #E6EAE7;
  --nb-chrome: #ECEFEC;
  /* 0.18 here, ~39/255. The dark scope runs LOWER at 0.12 on purpose -- light
     ink on dark paper reads hotter at equal alpha, so parity by number is not
     parity by eye. The original pairing was 0.045 light against 0.07 dark,
     which left the paper essentially blank at 9/255 and 1.086:1 -- the fault
     was not that the alphas differed, it was that BOTH sat far below the level
     at which a 1px dot on an 18px pitch reads at all. Radius and pitch are
     unchanged, so this is still texture rather than pattern. */
  /* the paper's dots as faint as the notes' (owner, 2026-10-08: "tone down the dots across the website to match the notes dots brightness") */
  --nb-grid-dot: rgba(17, 28, 52, 0.085);
  /* THE READING SHEET (owner picked Option A, 2026-10-05: "lets do A only
     for notes, summaries, mcqs, all these resources"). On a study page what
     you read sits on a plain sheet; the dot grid stays on the desk around it
     at a lower alpha and never runs under a word (the 18px grid sits at 2 to
     2.5 cycles per degree, the band where a repeating pattern is most
     uncomfortable). The desk is a step darker than --nb-paper so the sheet
     reads as paper on a desk; the sheet is L* 96.8, inside the 94 to 97
     reading range. notebook-reading.css is the only consumer. */
  --nb-read-desk: #E6E8E4;
  --nb-read-dot: rgba(17, 28, 52, 0.085);
  --nb-read-sheet: #F6F6F2;
  --nb-read-edge: #D3D8D3;
  --nb-read-ink: var(--nb-ink);
  --nb-read-figure: none;
  /* ink */
  --nb-ink: #111C34;
  /* ONE INK (owner, 2026-09-26: "make all the text colors that are like
     this weird bluish, purple gray into fullbright white like the rest ...
     and also do the same for whitemode but make it fully black"). The
     second and third inks are the first ink, so every word that wore them
     is full ink by day and by night; hierarchy is size, weight and colour
     that means something. The names stay so no rule has to move. */
  --nb-ink-2: var(--nb-ink);
  --nb-ink-3: var(--nb-ink);
  /* THE QUIET INKS: yesterday's second and third inks, kept ONLY for a
     state that must not read as live (a disabled control, the MCQ's
     answered and dimmed options, a board chip that is not offered) and
     for rules that are not words (a field's hover edge, a link's
     underline, a scroll thumb, the grade card's 2px rule). Never a word
     anyone reads as content. */
  --nb-quiet-2: #35415A;
  --nb-quiet-3: #5C677B;
  /* THE FOOTER'S INKS: the site footer keeps its look (the owner's one
     exception, "just not the footer"). Equal to the quiet inks today and
     owned separately: the footer is not a disabled state. */
  --nb-footer-ink-2: #35415A;
  --nb-footer-ink-3: #5C677B;
  /* THE SOFT INK (owner, 2026-10-08: "bring back gray text but a beautiful
     gray. not a gray that makes the website cheap. maybe a similar gray like
     the footer ... for supplementary text or text that is small like on
     placeholder text too ... text that is just stating stuff"). The site
     footer's own neutral grey (site-footer.css, --sf-link), never the bluish
     greys one ink retired. For words that only state something: a meta line,
     a board, the noun beside a figure, a placeholder, a caption, the names
     round a chart. Names, headings, figures and actions stay the ink.
     5.7:1 on the day surface, 6.9:1 on the night one. */
  --nb-soft: #66666B;
  --nb-border: #D8DEE3;
  --nb-border-strong: #7A8795;
  --nb-control-border: #7A8795;
  /* Figure/image frames need a firmer ink wash than the decorative hairline
     against raised paper. The 16% ink mix remains visible without becoming a
     control boundary. Decorative border, no text-contrast requirement. */
  --nb-border-figure: color-mix(in srgb, var(--nb-ink) 16%, transparent);
  /* the three pens */
  --nb-blue: #175BE8;
  --nb-blue-strong: #0B43C7;
  --nb-on-blue: #FFFFFF;
  --nb-blue-wash: #EDF3FF;
  --nb-red: #BC2B20;
  --nb-red-wash: #F9ECEB;
  --nb-hl: #DCE8FF;
  /* ─ Summary-leaf callout accent. The Summary.docx gives every one of its 700
     callout cells the same orange; --nb-summary IS that value, unrounded, in
     both themes. It is DECORATIVE ONLY — a 3px stripe and a 7% wash — and is
     never used as text: at 2.19:1 on --nb-paper it would fail the palette's
     own 4.5:1 rule and it is deliberately absent from the PAIRS list in
     tools/audit/contrast_check.py for exactly that reason.
     --nb-summary-ink is the text grade, and it also drives the NOTES
     Examiner Insight and Proportionality registers (notebook-notes.css)
     so those two read the same orange without recolouring the shared
     admonition tokens. Light holds the source hue and clears 4.5:1 on
     BOTH --nb-paper (5.11:1) and the 7% wash (4.85:1). The computed
     minimum was #A05913, but it cleared the wash by 0.007 — inside
     browser compositing error — so this is the same hue one step
     darker, with headroom. Dark needs no substitute — the raw orange
     is 7.74:1 on night
     paper and 7.08:1 on its own wash. Names are shared with
     notebook-summaries.css on redesign/homepage-conversion so the two do not
     invent separate vocabularies; that branch's dark --nb-summary is #EDA05C
     rather than #E8913A, which is a value conflict to settle at merge. ─ */
  --nb-summary: #E8913A;
  --nb-summary-ink: #9C5310;
  /* semantic selection */
  --nb-selection-fill: var(--nb-blue);
  --nb-selection-fill-hover: var(--nb-blue-strong);
  --nb-selection-ink: var(--nb-on-blue);
  --nb-selection-border: var(--nb-blue);
  --nb-selection-marker: transparent;
  --nb-selection-wash: var(--nb-blue-wash);
  --nb-selection-soft-ink: var(--nb-blue-strong);
  --nb-selection-soft-border: var(--nb-blue);
  /* functional (plain UI voice) */
  --nb-error: #9B3028;
  --nb-success: #176B57;
  /* ─ The AI marker's comment, and ONLY that. Owner-specified 2026-08-29:
     the examiner feedback body reads at PURE black on paper and PURE white
     at night, so the machine's note is unmistakably the thing to read. The
     palette holds no pure value anywhere else — --nb-ink is #111C34 /
     #F0EFEC — which is exactly why this is a token rather than a literal:
     notebook-grader.css is in ZERO_RAW_COLOR_FILES and must stay at zero
     hex literals. Declared as literal hex, not a var() alias, so
     tools/audit/contrast_check.py's recursive resolver cannot raise
     "token alias target missing". NEVER use it as a surface. ─ */
  --nb-feedback-ink: #000000;
  /* ─ Callout admonition palette (SEMANTIC — see DESIGN.md §2). Each accent
     maps to ONE callout purpose; muted, AA-tuned (each clears 4.5:1 on
     --nb-paper AND on its own tint). The washes are the accent at 5% over
     paper. A deliberate, documented relaxation of the three-ink rule FOR
     CALLOUTS ONLY — never reuse these hues decoratively (still banned candy). ─ */
  --nb-adm-warn: #A33B35;        /* misconception — common error / warning */
  --nb-adm-tip: #176B57;         /* exam-tip — helpful tip */
  --nb-adm-insight: #805914;     /* examiner-insight — examiner's deeper note */
  --nb-adm-key: #175BE8;         /* key-point / key-idea — core concept */
  --nb-adm-def: #21665F;         /* definition — defined term */
  --nb-adm-example: #355A74;     /* illustrative-example — worked illustration */
  --nb-adm-scope: #55635E;       /* out-of-scope — not needed for your tier */
  --nb-adm-mnemonic: #8A4452;    /* mnemonic — memory aid (rose, non-purple h≈344) */
  --nb-adm-mathskill: #236077;   /* math-skill — technique (cyan-blue, non-purple h≈196) */
  --nb-adm-derivation: #31567C;  /* derivation — proof (steel navy, non-purple h≈213) */
  --nb-adm-result: #176B57;      /* WE answer/result — the computed value (emerald h≈153) */
  --nb-adm-interp: #2C607B;      /* WE interpretation — the reading (slate-cyan h≈200) */
  --nb-adm-scenario: #53645E;    /* WE scenario — the problem statement (neutral slate h≈224, 5.5:1 on paper) */
  --nb-adm-proportion: #805914;  /* proportionality — relationship note (bronze h≈41, insight family; 4.9:1 paper / 4.5:1 tint) */
  --nb-adm-tint: 5%;             /* wash strength: accent over paper */
  /* ─ The correction voice ──────────────────────────────────
     The MCQ response column's third block: the second-person note that names
     what the student was actually thinking before it explains anything. It is
     neither verdict nor explanation, and the two verdict inks on that card are
     already spoken for (--nb-adm-warn red = the wrong pick, --nb-adm-tip green
     = the answer), so it needs an ink of its own.

     ⚑ DELIBERATELY EQUAL TO --nb-adm-mathskill TODAY, AND OWNED SEPARATELY.
     Not an alias: `var(--nb-adm-mathskill)` would make the two one value with
     one owner, and DESIGN.md's callout rule is that each admonition accent maps
     to exactly ONE callout purpose. A correction on the MCQ card is not a
     math-skill callout, so this is a second MEANING, not a second surface for
     the same meaning (which is what --nb-adm-insight's documented reuse at
     notebook-grader.css is). Sharing the literal rather than the token lets the
     two diverge the day either one needs to move, without the other silently
     following.

     Chosen by measurement, not from a list. Against every non-verdict token in
     the palette this cyan is the FURTHEST from the red it must not be mistaken
     for, in both themes: dE2000 45.2 light / 55.3 dark to --nb-adm-warn, and
     47.0 / 58.9 to the picked option's border (adm-warn at 55 percent). It
     still sits 38.0 / 46.2 from the green answer box's border and 15.4 / 18.8
     from --nb-blue, so it reads as neither a verdict nor a link. The rejected
     bronze sat at 25.1 / 28.9 from that same red.
     Contrast, measured on the grounds it lands on:
       light  6.21:1 on --nb-paper, 6.55:1 on --nb-paper-raised
       dark   9.23:1 on --nb-paper, 8.36:1 on --nb-paper-raised
     The legacy twin carries the same pair as --mcq-correction (mcq.css). ─ */
  --nb-correction: #236077;
  /* ─ The desk (dashboard) ─────────────────────────────────────────────
     Four accents and two text tints for the desk's two surfaces only,
     /dashboard/ and the profile (/accounts/profile/edit/). Teal = a strong
     figure, blue = a fair one, amber = a weak one; the tutor keeps the student's blue (the owner ruled out purple, 2026-09-22). The
     text tints were the hub's lead line and card arrows; they read as the
     bluish grey the owner named (2026-09-26), so both are the full ink. */
  --nb-desk-teal: #0C7078;
  --nb-desk-teal-wash: #DCF2F1;
  --nb-desk-amber: #9A520A;
  --nb-desk-amber-wash: #FBEBD6;
  --nb-desk-text-2: var(--nb-ink);
  --nb-desk-text-3: var(--nb-ink);
  /* THE MINIMAL DESK (2026-09-24, the team's brief, owner approved the
     mockup "1:1"): the dashboard and the profile. Ink on paper; blue is
     actions and where you are; the mastery tiers are green, yellow and red
     (below); amber is warnings and errors; a subject's colour is only its
     dot. Values copied from the approved mockup. */
  /* The craft pass (2026-09-24, owner: "buttons and dropdowns are plain
     html; the blocks blend into the background"): the page is now the site's
     own paper, and every block the student acts on is a raised sheet with an
     edge that out-reads the dots. Edge ladder: a container draws --nb-m-edge
     (1.6:1 on paper), a control --nb-m-edge-strong (2.2:1), a field
     --nb-m-control (3.4:1 and up). */
  --nb-m-paper: #F1F2EF;
  --nb-m-surface: #FCFCFA;
  --nb-m-ink: #111C34;
  /* one ink on the desk too (committed first on the dashboard and the
     profile, owner 2026-09-26: "i see a lot of that color in the dashboard.
     i want that replaced with bright white and dark black"); the desk keeps
     no quiet ink, its disabled states are drawn by fill and opacity */
  --nb-m-ink-2: var(--nb-m-ink);
  --nb-m-hairline: #E1E4E8;
  --nb-m-edge: #BAC1CA;
  --nb-m-edge-strong: #A2AAB9;
  --nb-m-blue: #175BE8;
  --nb-m-blue-strong: #0B43C7;
  --nb-m-blue-wash: #EDF3FF;
  --nb-m-tint: #DFE8FC;
  --nb-m-green: #0C7A5B;
  /* The warning and error ink (field errors, the over-length counter,
     notices, the tutor's failed turn). Never a mastery tier. */
  --nb-m-amber: #A64B06;
  /* THE MASTERY TIERS (owner, 2026-09-24: "green is for good and yellow for
     medium", then the red set of the tier lab, "Traffic light"). Strong 70%
     and up is --nb-m-green, fair 40 to 69% the yellow, needs work under 40%
     the red. A tier paints marks (map points, legend keys, bar fills) with
     its fill and a row's figure with its -ink. The yellow is a clean fill
     in both themes, no rim (owner, 2026-09-24: "a slight outline, i dont
     want that"): by day it is 1.6:1 on the surface, a documented exception
     to the 3:1 mark tier (contrast_check.py), because the figure beside
     every bar and in every map label carries the tier. Its figures take
     the -ink shade (5.1:1 surface, 4.5 the row hover). */
  --nb-m-fair: #F0C700;
  --nb-m-weak: #D21D32;
  --nb-m-strong-ink: var(--nb-m-green);
  --nb-m-fair-ink: #826A00;
  --nb-m-weak-ink: var(--nb-m-weak);
  --nb-m-track: #E1E5EA;
  --nb-m-control: #78829A;
  --nb-m-hover: rgba(17, 28, 52, 0.06);
  --nb-m-press: rgba(17, 28, 52, 0.10);
  --nb-m-on-blue: #FAFAF7;  /* never pure white (the low-glare rule); 5.4:1 on the blue */
  --nb-m-shape-a: 0.10;
  --nb-m-dot-teal: #0C7078;
  --nb-m-dot-blue: #175BE8;
  --nb-m-dot-amber: #B45309;
  --nb-m-logo-filter: brightness(0);
  --nb-m-toast: #111C34;
  --nb-m-toast-ink: #F1F2EF;
  --nb-m-toast-edge: transparent;
  /* The floating layer (an open option list, the add-board menu): what
     sits OVER a panel. By day it is the surface, lifted by the second
     shadow; by night (a shadow on near-black barely reads) it is a step
     lighter than the panel and takes the control edge. */
  --nb-m-raised: var(--nb-m-surface);
  --nb-m-raised-edge: var(--nb-m-edge);
  /* THE PROFILE IN COLOUR (owner, 2026-09-26): the state washes, the exit
     red and the action edge. Profile only (notebook-profile-desk.css). */
  --nb-m-ok-ink: #0B7054;       /* verified, met, active: words and glyphs; 5.21:1 on the ok wash, 5.91:1 surface */
  --nb-m-ok-wash: #E6F0EC;      /* ground of an ok chip, note and disc */
  --nb-m-ok-edge: #90C2B2;      /* edge of an ok chip (container tier, 1.94:1 surface) */
  --nb-m-warn-wash: #F3EAE2;    /* ground of a warn chip, notice, disc and the stop question; amber 4.87:1 on it */
  --nb-m-warn-edge: #D5AC8C;    /* edge of a warn chip and notice (container tier, 2.02:1 surface) */
  --nb-m-danger: #B42318;       /* exits and danger: Sign out, Email us, Stop studying, the Yes fill; 6.40:1 surface */
  --nb-m-flame: #D92D20;        /* the dashboard streak's flame tile (owner, 2026-10-06: "for streak make it red"); a glyph, never text */
  --nb-m-danger-strong: #961C13;/* their hover and press; 7.00:1 on the danger wash */
  --nb-m-danger-wash: #F5E6E3;  /* the exit discs and a red button's hover ground; danger 5.42:1 on it */
  --nb-m-danger-press: #F0D9D6; /* a red button's press ground; danger-strong 6.31:1 on it */
  --nb-m-danger-edge: #CE7169;  /* a red button's edge: 3.30:1 surface, 3.02:1 paper */
  --nb-m-on-danger: #FAFAF7;    /* words on the red fill: 6.29:1, 8.12:1 on the strong red */
  --nb-m-blue-edge: #5788ED;    /* an action button's edge: 3.32:1 surface, 3.04:1 paper */
  --nb-m-toast-ok: #4CC99A;     /* the tick on the ink toast slip: 8.17:1 */
  --nb-m-toast-warn: #F0A45B;   /* the warning glyph on the ink toast slip: 8.20:1 */
  /* Premium/locked navigation marker — brand blue, worn quietly (owner
     de-yellowed the site 2026-07-13; nav is not a judgment moment). */
  --nb-premium: var(--nb-blue);
  --nb-premium-wash: color-mix(in srgb, var(--nb-premium) 12%, transparent);
  /* Subject identity is limited to actual picker icon plates only. It never
     creates a contextual colour for resources, lesson objectives, or study
     content. */
  --nb-subject-biology: #216747;
  --nb-subject-chemistry: #21665F;
  --nb-subject-physics: #175BE8;
  --nb-subject-mathematics: #355A74;
  --nb-subject-english: #8A4452;
  --nb-subject-economics: #6E553D;
  --nb-subject-icon-wash: 8%;
  --nb-subject-icon-line: 28%;
  /* Resource-type identity is separate from subject identity: decorative
     resource-hub icon plates only, plus the Notes featured wash. It never
     changes a card, control, action, or study surface from semantic blue. */
  --nb-resource-notes: #175BE8;
  --nb-resource-flashcards: #355A74;
  --nb-resource-questions: #8C4A32;
  --nb-resource-summaries: #21665F;
  --nb-resource-videos: #8A4452;
  --nb-resource-pastpapers: #31567C;
  --nb-resource-mocks: #216747;
  --nb-resource-icon-wash: 8%;
  --nb-resource-icon-line: 28%;
  /* 12% -> 8% (2026-08-16): at 12% the Notes card's kicker AND its "Open
     notes" CTA both measured 4.48:1 against this wash, under the 4.5 floor.
     Light only — dark passes at 16% and is left alone. Cost, accepted
     knowingly: the wash's separation from a plain card falls 1.190 -> 1.124. */
  --nb-resource-featured-wash: 8%;
  /* Homepage roles alias canonical resource hues. They are decorative only,
     limited to the surfaces documented in DESIGN.md. */
  --nb-home-recall: var(--nb-resource-flashcards);
  --nb-home-depth: var(--nb-resource-questions);
  --nb-home-check: var(--nb-resource-videos);
  --nb-home-system: var(--nb-resource-summaries);
  --nb-home-card-wash: 5%;
  --nb-home-card-line: 24%;
  --nb-home-icon-wash: 8%;
  --nb-home-icon-line: 28%;
  /* Programme and board identity alias canonical resource hues. Decorative
     only: the picker gateway and board-picker card icon tiles documented in
     DESIGN.md — never a card, chip, control, or interaction colour. */
  --nb-programme-igcse: var(--nb-resource-mocks);
  --nb-programme-alevel: var(--nb-resource-notes);
  --nb-programme-ap: var(--nb-resource-questions);
  --nb-programme-sat: var(--nb-resource-summaries);
  --nb-board-edexcel: var(--nb-resource-notes);
  --nb-board-cie: var(--nb-resource-mocks);
  --nb-programme-icon-wash: 8%;
  --nb-programme-icon-line: 28%;
  /* elevation */
  --nb-shadow-1: 0 1px 3px rgba(17, 28, 52, 0.09);
  --nb-shadow-2: 0 4px 14px rgba(17, 28, 52, 0.12);
  --nb-shadow-3: 0 12px 32px rgba(17, 28, 52, 0.18);
  /* ─ The tutor sheet ───────────────────────────────────────
     A SCOPED EXCEPTION, in the shape of --nb-correction above: a small palette
     owned by ONE component and named so it cannot be mistaken for the general
     system. It paints the notes tutor margin (notebook-tutor.css) and nothing
     else. Do not reach for these anywhere but .nb-tutor-*.

     THE SHEET IS A SEPARATE OBJECT. The design is that the tutor is a physical
     sheet of cream paper lying on the desk, bound at its left edge, and that
     the page and the sheet share a screen but not a language. The note speaks
     in the site's voice: blue ink, serif italic margin notes, cards. The sheet
     speaks only in ink, pencil and one drop of sepia, and carries NO blue, NO
     red, NO italic and NO serif. Those four absences are the design, not a
     side effect of it.

     ⚑ THE PAPER VALUE IS IDENTICAL IN BOTH THEMES, ON PURPOSE. Paper does not
     change colour when the lamp changes. An identical light/dark pair reads
     like a copy-paste slip everywhere else in this file, so it is written down
     here: on the night desk the sheet separates by contrast alone, on the day
     desk by being one warm step off the page plus its shadow. --nb-tutor-shadow
     is the ONLY member of this group that differs between the two scopes.

     Contrast, measured on --nb-tutor-paper and identical in both themes:
       ink 14.03:1   pencil 5.44:1   accent 6.27:1
       chip lettering on solid accent 6.33:1
     Every text pair clears AA for small text. The placeholder deliberately uses
     --nb-tutor-pencil rather than a lighter grey for the same reason. ─ */
  --nb-tutor-paper: #F4F1EA;      /* the sheet. never pure white */
  --nb-tutor-ink: #20242F;        /* question, kickers, Send, the header. 13.74:1 on paper */
  --nb-tutor-pencil: #66624F;     /* the answer, the sources, the placeholder */
  --nb-tutor-accent: #7C4E20;     /* EXACTLY four: Premium chip, topic track fill and its tip dot, input nib, folded tab nib when an answer waits */
  --nb-tutor-edge: #DFD9C8;       /* the sheet's own 1px border, and nothing else */
  --nb-tutor-chip-ink: #F7F2E5;   /* the Premium chip's lettering, on solid accent, and nothing else */
  --nb-tutor-shadow: 0 24px 48px rgba(64, 52, 28, 0.17), 0 3px 8px rgba(64, 52, 28, 0.09);  /* the sheet resting on the day desk */
  --nb-tutor-edge-shadow: -14px 0 30px rgba(40, 36, 26, 0.18);  /* the folded edge, throwing left onto the day desk */
}

/* Legacy-chrome pages (pages/base.html) only toggle .theme-light — dark is the
   ABSENCE of the class there, so the night-desk palette must also bind to
   html:not(.theme-light) for skins layered over legacy surfaces (e.g. the
   subject-resources hub). Equal specificity (0,1,1); nb pages set .theme-dark
   explicitly and resolve identically. */
html.theme-dark,
html:not(.theme-light) {
  /* night desk */
  color-scheme: dark;
  --nb-paper: #0F1013;
  --nb-paper-raised: #191B20;
  --nb-paper-sunken: #0A0B0E;
  --nb-chrome: var(--nb-paper-raised);
  /* Deliberately BELOW the light scope, which stays at 0.18. Light ink on dark
     paper reads hotter than dark ink on light paper at equal alpha, so the two
     scopes were dialled apart on purpose (owner call, 2026-08-20): 0.12 lands
     a ~26/255 channel step here against light's ~39/255, down from the ~38/255
     the matched 0.18 gave. Radius and pitch are unchanged, so this is still
     texture rather than pattern -- and still well clear of the old 0.07, which
     sat at 15/255 and left the paper essentially blank. */
  --nb-grid-dot: rgba(223, 227, 234, 0.025);
  /* the reading sheet by night (see the light scope): a dark grey sheet
     (L* 9) lifted off the night desk, and an off-white ink at APCA Lc -89,
     inside the dark-mode ceiling, where #F0EFEC on #0F1013 measured Lc -97.
     The desk dots drop to 2.5%: at 12% a light dot on near-black paper is a
     plainly visible lattice behind every line. Large white-ground diagrams
     are dimmed a little, as Apple's and Firefox's readers do. */
  --nb-read-desk: var(--nb-paper);
  --nb-read-dot: rgba(223, 227, 234, 0.025);
  --nb-read-sheet: #17191E;
  --nb-read-edge: #262931;
  --nb-read-ink: #E6E4DE;
  --nb-read-figure: brightness(0.88) contrast(1.04);
  --nb-ink: #F0EFEC;
  /* one ink, and the quiet and footer inks: see the light scope */
  --nb-ink-2: var(--nb-ink);
  --nb-ink-3: var(--nb-ink);
  --nb-quiet-2: #B3B0A6;
  --nb-quiet-3: #89867D;
  --nb-footer-ink-2: #B3B0A6;
  --nb-footer-ink-3: #89867D;
  /* the soft ink, night (see the day scope): the footer's grey lifted a step
     (owner, 2026-10-08: "the grey looks good in the light mode but in
     darkmode its too dark"), 7.9:1 on the night surface, still a clear step
     under the ink */
  --nb-soft: #B4B4BB;
  --nb-border: #2E3036;
  --nb-border-strong: #3A404D;
  --nb-control-border: var(--nb-border);
  /* figure/image frames: the night-desk hairline already reads clearly on the
     raised card, so frames keep the global border value here. */
  --nb-border-figure: var(--nb-border);
  --nb-blue: #789FF2;
  --nb-blue-strong: #A9C1EE;
  --nb-on-blue: #0F1013;
  --nb-blue-wash: rgba(120, 159, 242, 0.10);
  --nb-red: #FA5B40;
  --nb-red-wash: rgba(250, 91, 64, 0.09);
  --nb-hl: rgba(209, 169, 249, 0.34);
  /* Summary-leaf callout accent — see the light block. On the night desk the
     source orange is legible as text on its own, so ink and stripe share it. */
  --nb-summary: #E8913A;
  --nb-summary-ink: #E8913A;
  --nb-selection-fill: var(--nb-blue);
  --nb-selection-fill-hover: var(--nb-blue-strong);
  --nb-selection-ink: var(--nb-on-blue);
  --nb-selection-border: var(--nb-blue);
  --nb-selection-marker: transparent;
  --nb-selection-wash: var(--nb-blue-wash);
  /* By night the strong blue is a pale periwinkle (#A9C1EE) that reads as
     the bluish grey the owner ruled out (one ink, 2026-09-26), so the soft
     selection (the active practice mode tab) speaks the link blue. */
  --nb-selection-soft-ink: var(--nb-blue);
  --nb-selection-soft-border: color-mix(in srgb, var(--nb-blue) 28%, transparent);
  --nb-error: #E0655A;
  --nb-success: #6FBF8F;
  /* see the light scope: the examiner comment's pure ink, text only */
  --nb-feedback-ink: #FFFFFF;
  /* ─ Callout admonition palette (night desk) — designed, not inverted; each
     AA-tuned on --nb-paper and on its own tint. Semantic, not decorative. ─ */
  --nb-adm-warn: #E86A5A;        /* misconception */
  --nb-adm-tip: #6FBF8F;         /* exam-tip */
  --nb-adm-insight: #D2A24E;     /* examiner-insight */
  --nb-adm-key: var(--nb-blue);  /* key-point / key-idea */
  --nb-adm-def: #6FB3AE;         /* definition */
  --nb-adm-example: #9AA6D0;     /* illustrative-example */
  --nb-adm-scope: #8A919E;       /* out-of-scope */
  --nb-adm-mnemonic: #E39BB0;    /* mnemonic — memory aid (rose, non-purple h≈342) */
  --nb-adm-mathskill: #6FC0D6;   /* math-skill — technique (cyan-blue, non-purple h≈193) */
  --nb-adm-derivation: #8AA2CC;  /* derivation — proof (steel navy, non-purple h≈216) */
  --nb-adm-result: #63C694;      /* WE answer/result — the computed value (emerald h≈152) */
  --nb-adm-interp: #7CBFD9;      /* WE interpretation — the reading (slate-cyan h≈197) */
  --nb-adm-scenario: #9AA6C0;    /* WE scenario — the problem statement (neutral slate h≈221, 7.3:1 on paper) */
  --nb-adm-proportion: #DDB05C;  /* proportionality — relationship note (bronze h≈39; 8.9:1 paper / 7.9:1 tint) */
  --nb-adm-tint: 10%;            /* wash strength on the darker night paper */
  /* The correction voice — see the light scope for the full note. Designed
     against the night desk, not derived from the light value. */
  --nb-correction: #6FC0D6;
  --nb-premium: var(--nb-blue);  /* premium/locked marker — brand blue (de-yellowed 2026-07-13) */
  --nb-premium-wash: color-mix(in srgb, var(--nb-premium) 16%, transparent);
  /* the desk, night: lighter accents on the dark paper; the text tints are the ink */
  --nb-desk-teal: #4FD3D8;
  --nb-desk-teal-wash: rgba(79, 211, 216, 0.14);
  --nb-desk-amber: #F2B65E;
  --nb-desk-amber-wash: rgba(242, 182, 94, 0.16);
  --nb-desk-text-2: var(--nb-ink);
  --nb-desk-text-3: var(--nb-ink);
  /* the minimal desk, night (see the day block) */
  --nb-m-paper: #0F1013;
  --nb-m-surface: #1A1C22;
  --nb-m-ink: #F0EFEC;
  --nb-m-ink-2: var(--nb-m-ink);
  --nb-m-hairline: #2A2D34;
  --nb-m-edge: #353841;
  --nb-m-edge-strong: #4D5360;
  --nb-m-blue: #7AA2F7;
  --nb-m-blue-strong: #A3BEFA;
  --nb-m-blue-wash: rgba(122, 162, 247, 0.12);
  --nb-m-tint: #293144;  /* opaque: the 16% blue over the surface, written out so no dot shows through a selection */
  --nb-m-green: #4CC99A;
  --nb-m-amber: #F0A45B;  /* warnings and errors, never a tier */
  /* The tiers by night: every fill clears 3:1 on its own, and each figure
     is its bar's colour. */
  --nb-m-fair: #FFD400;
  --nb-m-weak: #FB5760;
  --nb-m-strong-ink: var(--nb-m-green);
  --nb-m-fair-ink: var(--nb-m-fair);
  --nb-m-weak-ink: var(--nb-m-weak);
  --nb-m-track: #2E323C;
  --nb-m-control: #6B7386;
  --nb-m-hover: rgba(240, 239, 236, 0.05);
  --nb-m-press: rgba(240, 239, 236, 0.09);
  --nb-m-on-blue: #0F1013;
  --nb-m-shape-a: 0.16;
  --nb-m-dot-teal: #4FD3D8;
  --nb-m-dot-blue: #789FF2;
  --nb-m-dot-amber: #F0A45B;
  --nb-m-logo-filter: none;
  --nb-m-toast: #23262D;  /* a lit slip at night, never a cream flash */
  --nb-m-toast-ink: #F0EFEC;
  --nb-m-toast-edge: #3B3F48;
  --nb-m-raised: #22252C;  /* a step over the #1A1C22 panel it floats above */
  --nb-m-raised-edge: var(--nb-m-edge-strong);
  /* the profile in colour, night (see the day block) */
  --nb-m-ok-ink: var(--nb-m-green);  /* 6.35:1 on the ok wash, 8.21:1 surface */
  --nb-m-ok-wash: #203430;
  --nb-m-ok-edge: #306A58;      /* 2.70:1 surface, 3.02:1 paper */
  --nb-m-warn-wash: #382E29;    /* amber 6.39:1 on it */
  --nb-m-warn-edge: #7A593C;    /* 2.69:1 surface, 3.01:1 paper */
  --nb-m-danger: #FF7B72;       /* 6.75:1 surface, 7.54:1 paper */
  --nb-m-flame: #FF6B5E;        /* the streak's flame tile, night */
  --nb-m-danger-strong: #FF9A93;/* 6.97:1 on the danger wash */
  --nb-m-danger-wash: #35272B;  /* danger 5.64:1 on it */
  --nb-m-danger-press: #402C30; /* danger-strong 6.35:1 on it */
  --nb-m-danger-edge: #A35552;  /* 3.23:1 surface, 3.60:1 paper */
  --nb-m-on-danger: #0F1013;    /* 7.54:1 on the red fill, 9.33:1 on the strong red */
  --nb-m-blue-edge: #546CA2;    /* 3.28:1 surface, 3.66:1 paper */
  --nb-m-toast-ok: #4CC99A;     /* 7.30:1 on the lit slip */
  --nb-m-toast-warn: #F0A45B;   /* 7.33:1 on the lit slip */
  /* Independently tuned for the night desk; actual picker icon plates only. */
  --nb-subject-biology: #70BD91;
  --nb-subject-chemistry: #70BEC1;
  --nb-subject-physics: #8DAFE6;
  --nb-subject-mathematics: #9AA3E0;
  --nb-subject-english: #E09AA6;
  --nb-subject-economics: #C09A80;
  --nb-subject-icon-wash: 10%;
  --nb-subject-icon-line: 34%;
  /* Resource-type identity is separate from subject identity: decorative
     resource-hub icon plates only, plus the Notes featured wash. It never
     changes a card, control, action, or study surface from semantic blue. */
  --nb-resource-notes: var(--nb-blue);
  --nb-resource-flashcards: #95A5DF;
  --nb-resource-questions: #E8864F;
  --nb-resource-summaries: #5DC5BC;
  --nb-resource-videos: #F08AA6;
  --nb-resource-pastpapers: #7FA0E0;
  --nb-resource-mocks: #5FCB88;
  --nb-resource-icon-wash: 10%;
  --nb-resource-icon-line: 34%;
  --nb-resource-featured-wash: 16%;
  /* Homepage roles alias canonical resource hues. They are decorative only,
     limited to the surfaces documented in DESIGN.md. */
  --nb-home-recall: var(--nb-resource-flashcards);
  --nb-home-depth: var(--nb-resource-questions);
  --nb-home-check: var(--nb-resource-videos);
  --nb-home-system: var(--nb-resource-summaries);
  --nb-home-card-wash: 14%;
  --nb-home-card-line: 30%;
  --nb-home-icon-wash: 10%;
  --nb-home-icon-line: 34%;
  /* Programme and board identity alias canonical resource hues. Decorative
     only: the picker gateway and board-picker card icon tiles documented in
     DESIGN.md — never a card, chip, control, or interaction colour. */
  --nb-programme-igcse: var(--nb-resource-mocks);
  --nb-programme-alevel: var(--nb-resource-notes);
  --nb-programme-ap: var(--nb-resource-questions);
  --nb-programme-sat: var(--nb-resource-summaries);
  --nb-board-edexcel: var(--nb-resource-notes);
  --nb-board-cie: var(--nb-resource-mocks);
  --nb-programme-icon-wash: 10%;
  --nb-programme-icon-line: 34%;
  --nb-shadow-1: 0 1px 3px rgba(0, 0, 0, 0.35);
  --nb-shadow-2: 0 4px 14px rgba(0, 0, 0, 0.40);
  --nb-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.50);
  /* The tutor sheet — see the light scope for the full note. The six colour
     values below are DELIBERATELY IDENTICAL to their light-scope twins: the
     sheet keeps its own paper whether the lamp is on or off. Only the shadow
     is designed against the night desk. */
  --nb-tutor-paper: #F4F1EA;
  --nb-tutor-ink: #20242F;
  --nb-tutor-pencil: #66624F;
  --nb-tutor-accent: #7C4E20;
  --nb-tutor-edge: #DFD9C8;
  --nb-tutor-chip-ink: #F7F2E5;
  --nb-tutor-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.32);  /* deeper and darker: the night desk gives no help */
  --nb-tutor-edge-shadow: -16px 0 34px rgba(0, 0, 0, 0.5);  /* the folded edge, deeper on the night desk */
}

/* theme-independent */
:root {
  --nb-chrome-h: 72px;
  /* A picture-answer MCQ's pictures sit on a white card in both themes (owner's
     MCQ picture guide, 2026-09-29; plan P4b defines the rest of its tokens). */
  --nb-pset-card-bg: #FFFFFF;
  /* The bookmark tab's width, and the width the page reserves for it while the
     sheet is folded. One number in two places -- the tab's own rule and the
     grid track that keeps note text out from under it.
     ⚑ IT LIVES IN :root, NOT IN A THEME BLOCK. It was first written into
     html.theme-light beside the tutor colours, which left it undefined in dark;
     the grid-template-columns that referenced it then became invalid at
     computed-value time and the whole three-track layout silently collapsed to
     one column. A measurement is not a colour and does not belong beside them. */
  --nb-tutor-tab-w: 44px;
  --nb-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nb-serif: "Vollkorn", Georgia, "Times New Roman", serif;
  /* type scale (9 sizes) */
  --nb-text-xs: 0.75rem;
  --nb-text-sm: 0.8125rem;
  --nb-text-base: 0.9375rem;
  --nb-text-md: 1.0625rem;
  --nb-text-lg: 1.25rem;
  --nb-text-xl: 1.5rem;
  --nb-text-2xl: 1.875rem;
  --nb-text-3xl: 2.375rem;
  --nb-text-hero: clamp(2.75rem, 6vw, 5.25rem);
  /* semantic typography roles — consumed during the controlled migration */
  --nb-type-ui: 400 var(--nb-text-base)/1.5 var(--nb-sans);
  --nb-type-prose: 400 var(--nb-text-md)/1.65 var(--nb-sans);
  --nb-type-control: 600 var(--nb-text-base)/1.2 var(--nb-sans);
  --nb-type-label: 600 var(--nb-text-sm)/1.2 var(--nb-sans);
  --nb-type-title: 600 var(--nb-text-lg)/1.3 var(--nb-sans);
  --nb-type-headline: 700 var(--nb-text-2xl)/1.2 var(--nb-sans);
  --nb-type-display: 700 var(--nb-text-hero)/1.05 var(--nb-sans);
  --nb-type-examiner: italic 400 var(--nb-text-md)/1.5 var(--nb-serif);
  --nb-type-editorial: 600 var(--nb-text-xl)/1.25 var(--nb-serif);
  /* Display math inside the working boxes at phone width. KaTeX's own sheet
     sets .katex to 1.21em; this is that value stepped down so a substituted
     fraction stops scrolling in a 308px box. em-relative on purpose — it
     resolves against the block that uses it, exactly like KaTeX's own value.

     0.85 is measured: it clears 23 of the 28 in-box blocks that still overflow
     at 390px and leaves the math at 17.48px — above the 16px floor and still
     at/above the 17px prose size, so a formula never reads as smaller than the
     sentence around it. 0.78 clears 27 but lands at 16.04px. */
  --nb-we-math-size: calc(1.21em * 0.85);
  /* spacing (4px base) */
  --nb-s1: 4px;  --nb-s2: 8px;   --nb-s3: 12px; --nb-s4: 16px; --nb-s5: 20px;
  --nb-s6: 24px; --nb-s7: 32px;  --nb-s8: 40px; --nb-s9: 48px; --nb-s10: 64px;
  /* radii (4 steps) */
  --nb-r-sm: 4px; --nb-r-md: 8px; --nb-r-lg: 12px; --nb-r-pill: 999px;
  /* section rhythm (fluid; above the 4px component ladder) */
  --nb-section-sm: clamp(56px, 7vh, 80px);
  --nb-section-md: clamp(80px, 10vh, 120px);
  --nb-section-lg: clamp(112px, 14vh, 176px);
  /* motion (carried from the motion-token foundation; duration-only
     reduced-motion guard stays the site rule) */
  /* the desk's display voice (the dashboard and the profile only) */
  --nb-display: "Sora", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --nb-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nb-dur-1: 120ms; --nb-dur-2: 240ms; --nb-dur-3: 420ms;
  /* the minimal desk's two steps: colour changes, then lift and press.
     ⚑ HERE, NEVER IN A THEME BLOCK: html.theme-light (0,1,1) outranks :root
     (0,1,0) and would beat the reduced-motion zero below. */
  --nb-m-dur-1: 160ms; --nb-m-dur-2: 220ms;
  /* paper texture */
  --nb-grid-size: 18px;
}

@media (max-width: 767px) {
  :root { --nb-chrome-h: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --nb-dur-1: 0ms; --nb-dur-2: 0ms; --nb-dur-3: 0ms; --nb-m-dur-1: 0ms; --nb-m-dur-2: 0ms; }
}
