/* styles.css — minimal, mobile-first, accessible. Motion stays light and
   optional: short fades and reveals that never move a box, all of it behind
   prefers-reduced-motion (see MOTION-1, with the subjects screen's cards). */

/* ===========================================================================
   DRAGON GATE — DESIGN TOKEN AUTHORITY (FE-0, re-palette DRAGON-GATE-PALETTE-1)
   ===========================================================================

   THIS FILE IS THE SINGLE TOKEN AUTHORITY for the whole frontend, legacy and
   React alike. index.html loads it once, above both #app-root and #react-root,
   so a CSS custom property declared here is visible to every rule in either
   subtree. React consumes these tokens through ordinary class names (see
   frontend/src/react/SubjectSelection.tsx, which deliberately reuses the same
   .subject-card rules the legacy screen uses) -- there is deliberately NO
   TypeScript/JavaScript token module, because a second source would have to be
   kept in sync with this one by hand and nothing would detect the drift.

   THREE TIERS, and the indirection between them is the point:

     Tier 1  BRAND PRIMITIVES   the literal Dragon Gate palette. Immutable
                                colour facts. Never referenced by a component.
     Tier 2  PRODUCT MAPPING    which primitive plays which role FOR THE
                                CURRENT PRODUCT. This is the seam.
     Tier 3  SEMANTIC TOKENS    what components actually consume.

   WHY TIER 2 EXISTS, in two variables rather than a framework. Dragon Gate is
   the umbrella brand; CSCA Prep is the product inside it, and it is
   Green-dominant with Cinnabar secondary. A future sibling product may invert
   that. Components therefore must never say "primary means Green" -- they say
   --color-primary, which resolves through --product-primary. Re-pointing two
   declarations re-skins the product without a second design system and without
   touching a single component. Nothing beyond those two variables is built for
   that future, and no other product exists yet.

   Custom properties resolve at computed-value time, so overriding a Tier 2
   variable automatically updates every Tier 3 token defined in terms of it.
   That is how the dark block at the END of this file re-points the palette
   without restating the architecture.

   CONTRAST RATIOS BELOW ARE MEASURED, not estimated: computed with the WCAG
   relative-luminance formula against these exact hex pairs. They are also
   ENFORCED -- tests/dom/tests/62_brand_tokens.test.js parses this file and
   recomputes them, so a future edit that degrades a documented ratio fails the
   DOM suite instead of quietly making this comment fiction.

   ===========================================================================
   DRAGON-GATE-PALETTE-1: a deliberate, whole-palette replacement, not a hue
   nudge. Every Tier 1 primitive changed. This is the FE-0/FE-1 token
   architecture doing exactly the job it was built for: every Tier 3 token
   below still has the SAME NAME it had before this batch, so every consumer
   (the FE-1 question card, the brand lockup, the renderer widgets) inherited
   the new palette by definition change alone. Nothing outside this file's two
   token blocks needed to change -- verified by diff.

   OLD -> NEW, for the record:
     Ivory   #F7F5EF -> Warm Mist  #FAF4E8   (the light canvas)
     Jade    #126B5B -> Imperial Green #0E4F43  (deeper, more sophisticated)
     Cinnabar #C53D35 -> #B83220              (darker, more earthy)
     Gold    #C99A3D -> #C9912D               (warmer)
     Ink     #17201E -> Deep Ink/Stone #241C16 (warm near-black, was cool)
     Mist(border) #E7ECE8 -> retired as a primitive; --color-border below is
       now a direct Tier 3 literal (#EAE0CC) instead of aliasing a Tier 1
       neutral, matching how --color-border-strong and --color-disabled-bg
       were ALREADY direct literals -- one fewer primitive, not a new pattern.

   SURFACE: --color-surface stays #FFFFFF, chosen over a warm parchment
   candidate after a real side-by-side (see the git history for this batch --
   #FEFCF7 and #FDFBF4 were built and screenshotted). Pure white measured the
   strongest, cleanest separation from Warm Mist (CIEDE2000 6.05 vs 3.57/2.83
   for the parchment candidates) while staying unmistakably "clean and
   modern" rather than drifting toward a beige card system -- exactly the
   failure mode the brief warned against. The near-white candidates read as
   MORE elevated on screen, not less, which is not the direction "premium and
   calm" was asking for here.

   DEEP INK / STONE: #241C16, not a re-hued copy of the old #17201E. Warm
   brown-black (R>G>B, unlike the old value's cooler balance), chosen to keep
   near-identical text contrast (15.30:1 on Mist vs the old 15.27:1) while
   reading as warm and "serious academic," not clinical.

   TONE SEPARATION, preserved and still load-bearing: --color-primary must
   stay distinct in TONE (not merely hue) from --color-correct-*, so a
   selected-but-unsubmitted option is never visually confusable with a
   confirmed-correct answer. Imperial Green #0E4F43 is a deep blue-green;
   correct #1B6B36 is a pure green -- kept apart deliberately, as before.

   CINNABAR / ERROR COLLISION, found and fixed in this batch. The new
   Cinnabar (#B83220) sits far closer to the pre-existing error red
   (#B3261E) than the old Cinnabar (#C53D35) ever did -- CIEDE2000 2.68,
   below the ~2.3 just-noticeable-difference margin FE-0 protected. Per this
   batch's own instruction ("do not distort the brand Cinnabar merely to
   preserve an old error colour"), the SEMANTIC error token moved instead:
   --color-incorrect-text is now #A61F30, a crimson-leaning red (hue 352°,
   vs Cinnabar's warmer 7° and the old error's 3°) rather than another shade
   of the same brick-red family. CIEDE2000 from brand Cinnabar is now 9.76 --
   comfortably apart -- and --color-accent-text can simply BE the brand
   primitive again (no separate deepened value needed, unlike FE-0's old
   #BE4239 workaround). --color-incorrect-bg is untouched (#F7E2E1, warmed
   slightly to sit on the new canvas) since it was never close to Cinnabar
   (CIEDE2000 ~47 either way) -- only the text pairing collided.

   ===========================================================================
   DRAGON-GATE-LACA-1 (2026-10-20): "LACA Y TINTA" -- lacquer and ink. The
   product owner compared five palettes on the live screens and chose this
   one: the three colours of Chinese lacquerware. Red lacquer #B3261E is the
   primary (every action), an ink-black band #1C1A22 replaces the deep Jade
   hero, and deep Gold #7A5B12 replaces Jade as the secondary (the product
   label, secondary marks, the academic figures). Bright Gold #D4AF37 stays
   the achievement colour, exactly as before. Mist, Stone and Ink -- the
   neutral ladder -- and every semantic state are unchanged.

   Measured against the rules this file already enforces: the lacquer red is
   CIEDE2000 7.61 from the semantic error red #A61F30 (the gate asks 5), so
   the CINNABAR / ERROR COLLISION above does not come back even though
   #B3261E was once the error red itself. The pink tint the comparison first
   showed behind "Key idea" (#FBE8E6) did collide -- CIEDE2000 1.53 from the
   error tint, under the 2.3 just-noticeable difference -- so the peach
   #FCEEE4 stays the primary tint (6.29 from the error tint).

   READING THE OLDER RULE COMMENTS: written before LACA-1, they say
   "Cinnabar" for the primary (now the lacquer red), "the Jade band" for the
   hero band (now ink) and "Jade" for the secondary (now deep Gold). Ratios
   they quote were measured on the Nube palette; the token comments in the
   blocks below hold the current measurements, and test 62 recomputes them.
   The mock exam's sitting keeps the real exam's green through tokens of its
   own (--mock-go, below), because it copies the real computer-based test,
   not the brand. */

:root {
  /* --- Tier 1: BRAND PRIMITIVES (Dragon Gate) -------------------------------
     Literal palette values. A component must never reference these directly;
     go through Tier 2 or Tier 3 so the product mapping stays meaningful.

     DRAGON-GATE-NUBE-1 (2026-10-08): the primitives ARE the official brand
     board now -- the six swatches it labels "DRAGON GATE PALETTE (USE THESE
     COLORS)": CINNABAR #C23B22, JADE #2E8B6E, GOLD #D4AF37, INK #1F1F1F,
     MIST #F6F4F1, STONE #E6E1D9. The product owner chose the board over the
     previous "locked" Dragon Orange #C94A24 together with the "Nube" redesign,
     so that lock was lifted by an explicit product decision, not to satisfy a
     calculation. The two *-deep members are the only derived values: each
     exists because the board colour itself cannot carry the job named next
     to it.

     DRAGON-GATE-LACA-1 (2026-10-20) replaced the board's Cinnabar and Jade
     with "Laca y tinta" (see the header): the red lacquer, the ink of the
     band and a deep Gold; the board's Gold, Ink, Mist and Stone stay. */
  --brand-lacquer: #B3261E;            /* white on it 6.54:1; as text 6.54:1 on surface, 5.95:1 on bg */
  --brand-lacquer-deep: #6E1813;       /* pressed fill and the countdown's day chip; white on it 11.65:1 */
  --brand-ink: #1C1A22;                /* the band's ink (a violet-leaning black, not --neutral-ink,
                                           which is the text colour); white on it 17.21:1 */
  --brand-gold: #D4AF37;               /* a FILL in light mode: ink on it 7.84:1, 1.92:1 as text */
  --brand-gold-deep: #7A5B12;          /* gold that carries text: 6.30:1 on surface, 5.74:1 on bg;
                                           white on it 6.30:1 */

  --neutral-mist: #F6F4F1;
  --neutral-stone: #E6E1D9;
  --neutral-ink: #1F1F1F;

  /* Dark-context brand variants. NOT arbitrary lightenings -- each was chosen
     by contrast analysis against the dark surfaces at the end of this file,
     because the light values cannot be READ there: the lacquer red as text
     on the dark surface measures 2.46:1 and deep Gold 2.55:1. (A lacquer
     FILL is a different matter -- white on it is 6.54:1 in either scheme,
     which is why the night keeps the lacquer red for primary controls.)
     Named separately rather than overriding the primitives above: a
     light-mode token holding a bright-on-dark value would be a lie, and a
     regex-based tool would read the override as the definition. */
  --brand-lacquer-on-dark: #F08A80;    /* 6.62:1 as text on dark --color-surface; the night progress fill */
  --brand-gold-on-dark: #E2C25A;       /* 9.25:1 as text on dark --color-surface; ink on it 9.50:1 */

  /* --- Tier 2: PRODUCT MAPPING (current product: CSCA Prep) -----------------
     LACA-1: CSCA Prep is lacquer-red dominant, with deep Gold secondary. The
     lacquer red is the one interaction colour: the primary buttons, the
     focus of a filled control, the brand word. Deep Gold carries the product
     label, secondary marks and the academic figures. Bright Gold stays the
     achievement/"free" accent and is never a control colour; the deep Gold
     that fills a secondary control is its darker, text-strength member. */
  --product-primary: var(--brand-lacquer);
  --product-primary-deep: var(--brand-lacquer-deep);
  --product-secondary: var(--brand-gold-deep);
  --product-secondary-deep: #5E460E;   /* white on it 8.90:1 */

  /* --- Tier 3: SEMANTIC TOKENS (what components consume) -------------------- */
  --color-bg: var(--neutral-mist);     /* --color-text on it: 15.01:1 */
  --color-surface: #FFFFFF;            /* --color-text on it: 16.48:1 -- see the
                                           Parchment decision in the header comment */
  --color-surface-elevated: #FFFFFF;

  /* --- PRIMARY: the lacquer interaction family ------------------------------
     base -> hover -> pressed is a genuine downward lightness ramp, so the
     three states are ordered rather than merely different, and white stays
     the correct label on all three. (NUBE-1's tactile "lip" under a filled
     button, which the pressed value used to paint, gave way to PREPPALS-1's
     soft shadows -- see ELEVATION.) */
  --color-primary: var(--product-primary);        /* white on it: 6.54:1 */
  --color-primary-hover: #94201A;                 /* white on it: 8.47:1; CIEDE2000 6.43 from the base */
  --color-primary-active: var(--product-primary-deep); /* white on it: 11.65:1 */
  --color-primary-subtle-bg: #FCEEE4;             /* a warm PEACH, not a pink: CIEDE2000 6.29 from
                                                      --color-incorrect-bg and 5.49 from the Mist
                                                      canvas, so it reads neither as an error tint
                                                      nor as "the page". ink on it 14.51:1,
                                                      primary-text on it 5.75:1 */
  /* The lacquer red clears 4.5:1 as text on both surfaces, so text can
     simply BE the brand colour -- no deepened text member is needed in
     light mode. */
  --color-primary-text: var(--brand-lacquer);     /* on surface 6.54:1, on bg 5.95:1 */

  /* --- SECONDARY: deep Gold (LACA-1; Jade before it) ----------------------
     Visibly Dragon Gate, never the functional default. It carries the CSCA
     Prep product label, secondary marks and supporting metadata. The token
     family keeps the name --color-accent-* that components already consume,
     so the secondary role changes colour without touching a component rule --
     the same indirection Tier 2 exists for, one tier down. */
  --color-accent: var(--product-secondary);       /* white on it: 6.30:1 */
  --color-accent-hover: #5E460E;                  /* white on it: 8.90:1 */
  --color-accent-text: var(--product-secondary);  /* on surface 6.30:1, on bg 5.74:1 */

  /* --- ACADEMIC FIGURE ACCENT ---------------------------------------------
     THE RENDERER WIDGETS ARE NOT UI CHROME, and this batch is where that
     distinction finally has to be made explicit. A plotted point, a function
     curve, a force vector and an interference fringe were all painted from
     --color-primary, which was harmless while primary meant Imperial Green
     and became wrong the moment primary meant Dragon Orange: it would have
     turned every mathematics and physics diagram in the product orange, which
     is neither "premium academic" nor semantically true -- a plotted curve is
     not an interaction affordance, and a page of orange curves would also sit
     far too close to the error/warning vocabulary for a diagram a student has
     to read carefully.

     So academic figures keep the secondary colour, addressed through their
     own tokens. NUBE-1 moved that secondary from Imperial Green #0E4F43 to
     the board's Jade (its text-strength member, #1E6B53): a small lightness
     and hue shift in every renderer's accent strokes and fills, made through
     these three tokens alone -- no widget rule and no SVG structure changed,
     so the structural DOM snapshots are untouched. LACA-1 moved it again,
     to deep Gold, the same way: an ink-and-gold diagram, as in a printed
     textbook, and still never the red of an action. */
  --color-figure-accent: var(--product-secondary);       /* was --color-primary in figures */
  --color-figure-accent-deep: #5E460E;                   /* was --color-primary-hover in figures */
  --color-figure-accent-subtle: #F7F0DC;                 /* was --color-primary-subtle-bg in figures;
                                                             gold-deep text on it 5.54:1 */

  /* THERE IS DELIBERATELY NO --color-accent-subtle-bg. A large tinted
     secondary surface is the one thing the brand rule asks us not to build
     (the primary and the secondary must not confront each other as areas),
     and the explanation surfaces already have their own semantic tints. */

  /* TEXT ON A SATURATED BRAND FILL. These exist because the correct answer
     can INVERT between schemes and a component cannot know which scheme it is
     in: white on the light-mode deep Gold fill is 6.30:1, but the dark-mode
     secondary fill is the brighter --brand-gold-on-dark, where white would
     fail and Ink measures 9.50:1. A button that hardcoded `color: #fff` would
     therefore be correct in light mode and fail WCAG 1.4.3 in dark mode.
     Naming the foreground as its own token is what makes the fill and its
     label change together. The night keeps the lacquer red as the PRIMARY
     fill in both schemes, so --color-on-primary happens to be white in both;
     it stays a token for the same reason. */
  --color-on-primary: #FFFFFF;                    /* on --color-primary: 6.54:1 */
  --color-on-accent: #FFFFFF;                     /* on --color-accent: 6.30:1 */
  --color-on-achievement: var(--neutral-ink);     /* on --color-achievement: 7.84:1 */

  /* Gold = achievement / distinction, never "warning". NOTE the two are not
     interchangeable: --color-achievement is a FILL (Ink on it, 7.84:1) and
     fails badly as text (1.92:1 on --color-bg), which is exactly why
     --color-achievement-text exists as a separate, deepened token. NUBE-1
     gives Gold one more job, the "N free" preview badge, still as a fill
     with Ink on it; it stays a fill/accent colour, never a primary control.
     LACA-1 made that deepened member the secondary too (--brand-gold-deep):
     the bright fill keeps meaning "achieved", the deep one is the brand's
     second colour. */
  --color-achievement: var(--brand-gold);         /* fill only; ink on it 7.84:1 */
  --color-achievement-text: var(--brand-gold-deep); /* on surface 6.30:1, on bg 5.74:1 */

  /* --- STRUCTURAL NEUTRALS -------------------------------------------------
     DRAGON-GATE-VISUAL-QUALITY-1 re-derived this whole family. Manual product
     review found Light mode reading as "cream + white + brown/stone + black",
     and this ladder was the reason: every value below sat at 14-42%
     saturation on a warm hue, which at these lightnesses is literally taupe.
     Structural neutrals are supposed to DISAPPEAR into the composition, not
     become a second brand colour competing with the primary.

     The fix holds each token's LIGHTNESS and keeps saturation low, with just
     enough warmth to belong on the Mist canvas. NUBE-1 re-measured every
     ratio below against the board's MIST/INK pair. */
  --color-text: var(--neutral-ink);
  --color-text-muted: #5E5850;         /* on --color-bg 6.40:1, on surface 7.03:1 */

  --color-border: var(--neutral-stone); /* board STONE. Decorative dividers and the
                                           edges of cards that are not controls only
                                           -- 1.30:1 on surface, NOT a control
                                           boundary (that is --color-border-strong) */

  /* A LINE THAT CARRIES INFORMATION, as opposed to one that merely separates.
     A coordinate grid and a progress track are read, not just felt: the grid
     is how a student locates a plotted point between labelled ticks. This
     value is re-derived for the new warm canvas rather than reusing the old
     grey-green: 2.42:1 on bg / 2.65:1 on surface, an improvement on the
     FE-1 value (1.59:1 / 1.74:1) achieved for free because the new palette's
     structural neutral has more room between the warm canvas and the warm
     text than the old cool one did.

     The PROGRESS TRACK does not lean on this value for its own visibility --
     .progress-bar-track carries a real border (var(--color-border-strong))
     specifically because darkening a single shared token enough to separate
     it from EVERY fill colour (including Gold, the lightest) was tried in
     FE-1 and rejected: it collides with the palest fills long before it
     helps. That reasoning is unchanged by this repalette and re-verified
     below for the new Gold value.

     NUBE-1: the same #948C80 now clears the 3:1 WCAG 1.4.11 asks of a
     graphical object required to understand content (3.32:1 on surface,
     3.03:1 on bg), because the board's MIST canvas is cooler and lighter in
     the relevant channel than the old Warm Mist was. The value itself did not
     move, so no renderer output changed. */
  --color-structure: #948C80;          /* coordinate grid: 3.32:1 on surface, 3.03:1 on bg */

  /* THE PROGRESS TRACK GETS ITS OWN TOKEN (VISUAL-QUALITY-1), and that split
     is what finally resolves the tension FE-1 documented and worked around.
     FE-1 had the grid and the track sharing --color-structure, then found no
     single value could serve both: dark enough for the track's extent to read
     against the PAGE, and it collided with the palest fill. It settled for a
     heavy --color-border-strong border around the track.

     Two tokens dissolve the conflict, and measuring the RIGHT pair shows the
     old arrangement was not merely heavy but genuinely worse. What a reader
     actually decodes on a progress bar is FILL against TRACK, not track
     against page -- and the dark shared track gave the Orange fill only
     1.66:1. A light track gives 3.10:1, clears WCAG 1.4.11 for the pair that
     carries the meaning, and recedes to 1.51:1 against the card so the empty
     rail stops being the loudest thing in a subject card.

     The track's own extent is not the sole carrier of anything: every bar is
     always paired with .progress-text ("0/57 - Not started"), the same
     "colour is never the only signal" rule the semantic states follow. The
     coordinate grid, which IS the sole carrier of position between labelled
     ticks, keeps --color-structure and is unaffected by this.

     NUBE-1 re-derived the value for the chunkier Nube bars and the subject
     colours that now fill them: every fill clears 3:1 against it (Cinnabar
     3.94, Jade 4.73, the four other subject fills 4.36-4.55), Gold keeps its
     documented 1.5:1 floor, and the empty rail still recedes against the
     card (1.35:1). LACA-1's lacquer fill measures 4.83:1 on it, its hover
     member 6.26:1. */
  --color-track: #E2DDD4;              /* 1.35:1 on surface (quiet); lacquer fill on it 4.83:1 */

  /* THE PROGRESS FILL is its own pair of tokens (NUBE-1). In light it IS the
     primary family. In dark the primary FILL stays the lacquer red (a white
     label on it), which reads only about 2 to 1 against a dark track -- so
     a bar brightens to the on-dark lacquer there, as the Nube board
     brightened its bars at night. */
  --color-progress-fill: var(--color-primary);
  --color-progress-fill-strong: var(--color-primary-hover);

  /* A muted figure element that needs MORE separation from its own
     counterpart than plain --color-text-muted gives it once the surface goes
     dark. Aliased to --color-text-muted here (identical in light mode --
     nothing about light mode changes), with its own value in the dark block
     below. See .solid-geometry-widget-edge-hidden for the one consumer this
     exists for. */
  --color-figure-muted: var(--color-text-muted);
  --color-border-strong: #8C847A;      /* interactive boundaries: 3.69:1 on surface,
                                           3.36:1 on bg -- meets WCAG 1.4.11 (3:1). NUBE-1
                                           lightened it from #716B61; PREPPALS-1 draws it
                                           1px wide, so it reads as an edge, not a frame */
  /* Focus is INK (NUBE-1), not a member of the primary family: Nube's hover
     is a lift and a deeper fill, so an ink ring is the one state no pointer
     interaction can produce -- a keyboard user can always tell a focused
     control from one the mouse happens to be over. 15.01:1 on bg. */
  --color-focus-ring: var(--neutral-ink);

  /* --- Semantic states -----------------------------------------------------
     INDEPENDENT OF THE BRAND, on purpose. Colour is never the only signal
     either: the feedback surface renders the words "Correct"/"Incorrect"
     (see Feedback.tsx) and the explanation sections carry a left-border
     accent as well as a tint. */
  --color-correct-bg: #DCEEDF;
  --color-correct-text: #1B6B36;       /* on correct-bg 5.41:1, on bg 5.97:1 */
  /* Shifted from the previous #B3261E -- see the header comment on the
     Cinnabar/error collision this batch found and fixed. Still unmistakably
     "error red," now a crimson lean rather than another brick-red; CIEDE2000
     12.42 from the board Cinnabar that NUBE-1 made the primary, and 7.61
     from LACA-1's lacquer red (the gate in test 62 asks 5). */
  --color-incorrect-bg: #F7E2E1;
  --color-incorrect-text: #A61F30;     /* on incorrect-bg 5.92:1, on bg 6.69:1 */
  --color-warning-bg: #F6E9CC;
  --color-warning-text: #6B4E12;       /* on warning-bg 6.41:1 */
  --color-info-bg: #DFE9F5;            /* structured-explanation "calculation" accent (EXPLANATION-UX-1) */
  --color-info-text: #1D5A9C;          /* on info-bg 5.71:1 -- unchanged; blue was
                                           never part of the brand palette and
                                           collides with nothing here */
  /* READING_CONTENT_CONTRACT.md SS7 keyword highlight -- a literal highlighter-
     pen yellow, not a re-hued semantic pair. DELIBERATELY NOT restated in
     either dark-mode block below: every other semantic token here gets its
     own dark-tuned bg/text pair, but a highlighter mark's whole identity is
     that it looks the same regardless of the light it's read under, the same
     way real highlighter ink doesn't re-tint for a dark room. Both dark
     blocks inherit this exact value unchanged -- the documented mechanism
     this file's own comment on Tier 2 indirection describes ("a dark token
     that is not restated inherits its light declaration"), used here on
     purpose rather than by omission. */
  --color-keyword-highlight-bg: #FFEB3B;
  --color-keyword-highlight-text: #241C00;  /* on keyword-highlight-bg 13.86:1 */
  --color-disabled-bg: #E1E0DD;
  --color-disabled-text: #8B8479;      /* 2.80:1 -- below 4.5:1 BY DESIGN; WCAG exempts inactive controls */

  --color-overlay: rgba(31, 31, 31, 0.45);
  --color-shadow: rgba(31, 31, 31, 0.08);
  /* PREPPALS-1: the deeper, wider half of a soft drop shadow. Decoration
     only (no shadow carries information, so none is held to a ratio). */
  --color-shadow-strong: rgba(31, 31, 31, 0.14);
  /* PREPPALS-1: the ground a bare header control (a text link, an icon key)
     takes on hover -- a whisper of Ink. Decoration of a state the pointer
     already shows, so not held to a ratio. */
  --color-control-hover: rgba(31, 31, 31, 0.06);
  /* The coloured glow under a primary pill: the lacquer red, as the
     reference's coral CTA glows coral. */
  --color-primary-glow: rgba(179, 38, 30, 0.38);

  /* PREPPALS-1 radius ladder (2026-10-16): inputs, options, chips and small
     panels --radius (12); cards --radius-lg (20); the large surfaces -- the
     hero, a screen's main card -- --radius-xl (28); badges --radius-sm;
     every button, header control, tag and progress bar --radius-pill. */
  --radius: 12px;

  /* -----------------------------------------------------------------------
     TIER 3b -- SPACE, TYPE, RADIUS, ELEVATION (DRAGON-GATE-VISUAL-PRODUCT-2)

     WHY THESE EXIST. Colour was the only part of this file with an
     architecture. Everything else was literals: an audit counted 21 distinct
     font-size values, 20 distinct padding sets, 31 distinct margin sets and 8
     gap values across ~80 declarations, with no scale to extend -- which is
     precisely why the product read as "assembled" rather than designed. Two
     rules 4px apart look like a mistake; two rules one STEP apart look like a
     decision. These tokens are that decision, written down once.

     They are ADDITIVE. Nothing below is forced onto the academic renderer
     widget classes (.cartesian-widget*, .optics-widget*, .ds-widget*,
     .number-line-widget*, .solid-geometry-widget*, .circuit-widget*): those
     draw frozen figure output and are deliberately left exactly as they were.
     ----------------------------------------------------------------------- */

  /* SPACING -- a 4px base, geometric-ish rather than linear so adjacent steps
     are visibly different. Using a step you can name beats inventing 13px. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* TYPE SCALE. Six steps, because a study interface has six jobs:
     page title, section title, body, control label, caption, micro-label.
     Anything that wants a seventh size is usually asking for a different
     WEIGHT or COLOUR instead -- both are cheaper and quieter than a new size.
     The one exception is --text-display (PREPPALS-1): the hero's headline,
     the reference's "very large, very tight" display line, fluid so a 320px
     phone still fits "Choose a subject" on two lines. */
  --text-display: clamp(2.5rem, 1.55rem + 3.1vw, 4.125rem);
  --text-2xl: clamp(1.875rem, 1.55rem + 1.1vw, 2.375rem);   /* screen title (h1) */
  --text-xl: 1.375rem;   /* section title (h2) */
  --text-lg: 1.0625rem;  /* emphasised body / card title */
  --text-md: 1rem;       /* body, controls */
  --text-sm: 0.875rem;   /* secondary text, chip labels */
  --text-xs: 0.75rem;    /* captions, counts */
  --text-2xs: 0.6875rem; /* eyebrow / micro-label only */
  /* TEXT-SIZE-1: the reader's A− / A+ choice, as a share of the sizes above.
     1 here; a practice, reading or mock screen sets its own on its root
     element (textSize.tsx), and only the question, its options, the
     explanation, the reading and the mock question multiply by it. */
  --text-scale: 1;

  /* LINE HEIGHT. Tight for headings so they read as one object; open for body
     because this product is read for hours at a time, often in a second
     language. */
  --leading-display: 0.98;   /* PREPPALS-1: display lines sit on top of each other */
  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.55;

  /* WEIGHT. Replaces the hand-tuned 550/650 one-offs that existed only
     because there was no scale to reach for. */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-display: 700;   /* PREPPALS-1: headings, the reference's 610-730 band */

  /* TRACKING. Uppercase micro-labels need air; large text needs the opposite.
     PREPPALS-1 tightens headings hard, as the reference does (about -0.05em
     at display size): a heavy sans set loose reads as a poster, set tight it
     reads as one shape. */
  --tracking-display: -0.045em;
  --tracking-heading: -0.03em;
  --tracking-tight: -0.015em;
  --tracking-wide: 0.08em;

  /* RADIUS: the PREPPALS-1 ladder, see the note beside --radius. */
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* TYPE FAMILIES (PREPPALS-1, 2026-10-16). The product owner asked for the
     reference's type: one heavy, tightly tracked sans for every heading and a
     system UI sans for everything else -- read text included. This replaces
     NUBE-1's "Pergamino" serif (EB Garamond for headings, the stem, options
     and explanations) and its Source Sans 3 interface face.
       --font-display  headings, subject names, the brand wordmark, numbers
                       that are the point of a card (a streak, a day count).
       --font-sans     everything else: the stem, options, explanations,
                       readings, buttons, labels, counts.
       --font-cjk      the seal glyphs (数 物 化 理 文 科 模 复 语 考 连) only.
     Every stack is fonts the reader's system already has, so nothing is
     downloaded: Avenir Next (macOS, Cyrillic included) or Segoe UI (Windows)
     for display, the platform UI face for text, PingFang / YaHei for Chinese
     in both. LXGW WenKai stays NAMED first for the seals, as before; it is
     not loaded either, so the seals fall through to Songti.
     Both Latin stacks end with Arabic-capable system faces (Noto Sans
     Arabic, Geeza Pro, Tahoma) before the generic family, as main's
     I18N-FOUNDATION-4 ended its own: only glyphs no earlier font has ever
     reach them, so every published language renders as before. */
  --font-display: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
  --font-cjk: "LXGW WenKai", "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  /* MOCK-UI-1: the mock exam's clock, whose digits must not shift as they tick. */
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* BRAND GRADIENTS (PREPPALS-1). Each is painted OVER a solid
     background-color of its own family -- never instead of one -- because a
     gradient has no single colour to measure: the solid colour underneath is
     what every contrast check (and a forced-colours or print engine) sees.
       --gradient-primary  the primary pill: white on its lighter end 5.88:1,
                           6.54:1 on the solid lacquer under it, 7.50:1 at
                           its deeper end.
       --gradient-hero     the ink hero band (LACA-1; deep Jade before it):
                           white on it 14.65:1 or more, everywhere. */
  --gradient-primary: linear-gradient(180deg, #BE2C22 0%, #A3221A 100%);
  --gradient-primary-hover: linear-gradient(180deg, #9E2219 0%, #8A1E17 100%);   /* white 7.79:1 to 9.22:1 */
  --gradient-hero: linear-gradient(180deg, #121116 0%, #1C1A22 55%, #2A2731 100%);
  /* The countdown bar (ExamCountdown): white on it 5.88:1 at its lighter
     top, 7.50:1 at the bottom, 6.54:1 on the solid lacquer under it. Both
     run top to bottom on purpose: they are stretched sideways to the page's
     full width (see the subjects screen's hero). */
  --gradient-countdown: linear-gradient(180deg, #BE2C22 0%, #A3221A 100%);

  /* THE HERO BAND (PREPPALS-1): the reference's dark brand ground -- the
     band's ink since LACA-1, deep Jade before it -- the SAME in both
     schemes: a band of brand colour, not a surface that follows the light.
     So none of these is restated at night. */
  --hero-ground: var(--brand-ink);      /* the solid under --gradient-hero */
  --color-on-hero: #FFFFFF;             /* 14.65:1 at the band's lightest */
  --color-on-hero-muted: #E3DFD8;       /* 11.03:1 at the band's lightest */
  --color-on-hero-accent: var(--brand-gold-on-dark); /* Gold text on the band (BRAND-CHIP-1): 8.44:1 at its lightest */
  /* INK-GOLD-1 (product owner, 2026-10-23: "Tinta y oro"). The subjects
     screen's two FEATURE panels ("Your progress", "The CSCA in brief") are
     set in the band's ink with a Gold rim and a Gold light in one corner,
     and read with the band's own text tokens above: white 17.21:1, the muted
     text 12.96:1, the Gold 9.91:1. The same ink at night, where the Gold rim
     alone sets the panels off the dark ground: a lighter night ink read as
     "brighter" and the product owner turned it down. The hero's two cards
     are dark glass over the
     photograph, 84% opaque: white 11.56:1, muted 8.70:1, Gold 6.66:1 even
     composited over white. */
  --color-feature-ground: var(--brand-ink);
  --color-feature-rim: rgba(212, 175, 55, 0.34);
  --color-feature-glow: rgba(212, 175, 55, 0.13);
  --color-feature-divider: rgba(255, 255, 255, 0.12);
  /* INK-POUR-1 (product owner, 2026-10-25): the ink the closing band pours
     out of the gate. By day the band's own ink (white 17.21:1, the muted
     text 12.96:1); at night a deep lacquer, restated in both dark blocks,
     since the night ground is itself close to the ink. */
  --color-closing-flood: var(--color-feature-ground);
  --color-closing-glow: var(--color-feature-glow);
  --color-glass-ground: rgba(20, 18, 26, 0.84);
  --color-glass-rim: rgba(255, 255, 255, 0.16);
  --hero-chip: #26232D;                 /* a raised ink panel on the band; white on it 15.43:1 */
  --hero-blob: radial-gradient(circle at 38% 30%, #4A4652 0%, #38343F 55%, #2E2B34 100%);
  --color-hero-line: rgba(255, 255, 255, 0.18);   /* decorative edges on the band */
  --color-hero-halo: rgba(255, 255, 255, 0.06);

  /* THE EXAM ROOM'S GREEN (LACA-1). The mock exam's sitting copies the real
     CSCA computer-based test, whose Submit button and current-question chip
     are green, so they keep the green they had under Nube instead of
     following the brand's secondary. Not a brand colour: only the sitting's
     rules (.mock-exam-*) use these. */
  --mock-go: #1E6B53;                   /* white on it 6.40:1 */
  --mock-go-hover: #164F3D;             /* white on it 9.46:1 */
  --color-on-mock-go: #FFFFFF;

  /* SUBJECT COLOURS (NUBE-1), taken from the subjects board: each subject
     keeps one hue, used ONLY on that subject's own card and badge (never as
     a second interaction colour). Four roles per subject:
       --subject-*        badge FILL; white on it >= 4.5:1 in both schemes
       --subject-*-text   the hue as text; >= 4.5:1 on surface and on its tint
       --subject-*-mark   progress fill; >= 3:1 against --color-track
       --subject-*-tint   a quiet panel behind the badge
     Light values below; the dark blocks restate -text, -mark and -tint. */
  --color-on-subject: #FFFFFF;             /* the label on every subject fill below, both schemes */
  --subject-mathematics: #237A60;          /* white on it 5.22:1 */
  --subject-mathematics-text: #1E6B53;     /* 6.40:1 on surface, 5.57:1 on tint */
  --subject-mathematics-mark: #237A60;     /* 3.86:1 on track */
  --subject-mathematics-tint: #E6F2EC;
  --subject-physics: #2A63A8;              /* white on it 6.09:1 */
  --subject-physics-text: #2A63A8;         /* 6.09:1 on surface, 5.25:1 on tint */
  --subject-physics-mark: #2A63A8;         /* 4.50:1 on track */
  --subject-physics-tint: #E7EFF9;
  --subject-chemistry: #7A4E9E;            /* white on it 6.16:1 */
  --subject-chemistry-text: #7A4E9E;       /* 6.16:1 on surface, 5.23:1 on tint */
  --subject-chemistry-mark: #7A4E9E;       /* 4.55:1 on track */
  --subject-chemistry-tint: #F1EAF6;
  --subject-science-chinese: #9A5110;      /* white on it 5.90:1 */
  --subject-science-chinese-text: #9A5110; /* 5.90:1 on surface, 5.11:1 on tint */
  --subject-science-chinese-mark: #9A5110; /* 4.36:1 on track */
  --subject-science-chinese-tint: #F7EDE2;
  --subject-humanities-chinese: #C23B22;   /* white on it 5.33:1 */
  --subject-humanities-chinese-text: #A8321C; /* 6.69:1 on surface, 5.82:1 on tint */
  --subject-humanities-chinese-mark: #C23B22; /* 3.94:1 on track */
  --subject-humanities-chinese-tint: #FBECE8;

  /* ELEVATION. Composed once, so depth is chosen from a set rather than
     hand-authored per rule. PREPPALS-1 replaced NUBE-1's tactile "lip" (a
     solid band under every pressable surface, which the press dropped onto)
     with the reference's soft, wide, low-opacity shadows: a tight contact
     shadow plus a diffuse one offset downwards. Still quiet -- shadow-heavy
     UI competes with academic content.
       --shadow-sm       resting controls: pills, options, small keys
       --shadow-md       resting cards
       --shadow-lg       a lifted card (hover), floating panels and menus
       --shadow-primary  the primary pill's lacquer glow */
  --shadow-sm: 0 1px 2px var(--color-shadow);
  --shadow-md: 0 1px 2px var(--color-shadow), 0 10px 28px -14px var(--color-shadow-strong);
  --shadow-lg: 0 2px 6px var(--color-shadow), 0 22px 48px -18px var(--color-shadow-strong);
  --shadow-primary: 0 10px 26px -8px var(--color-primary-glow);
  --shadow-rail: inset 3px 0 0 var(--color-primary);

  /* READING MEASURE. The content column, named once instead of the literal
     640px that was repeated in four unrelated rules. */
  --measure: 640px;

  /* Tells the browser which schemes this page supports, so UA-painted chrome --
     scrollbars, the default form-control text colour, spellcheck underlines --
     is drawn for the right scheme. Without it a <button> that does not set
     `color` inherits the UA's `buttontext`, which stays BLACK under a dark
     palette: measured 1.23:1 on .language-option-btn and 1.13:1 on .nav-link
     before this line existed. The explicit `color` declarations added to those
     rules are the belt to this braces -- either alone would fix the buttons,
     and neither alone covers scrollbars AND guarantees the text. */
  color-scheme: light;
}

/* Legacy aliases: kept only so nothing below silently breaks if a future
   diff still references the old variable names. New rules should use the
   tokens above directly. */
:root {
  --color-primary-dark: var(--color-primary-hover);
  --color-banner-bg: var(--color-warning-bg);
  --color-banner-text: var(--color-warning-text);
}

* { box-sizing: border-box; }

/* PREPPALS-1: the reference's text is 16/24; grayscale smoothing keeps the
   heavy display weights from blooming on macOS. */
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* NUBE-1: form controls do not inherit the page's font family by default,
   so before this rule every <button> (.next-btn, .nav-link, .subject-card,
   ...) rendered in the browser's own button face -- wrong the moment the page
   face is not the browser's button face. Only the FAMILY is inherited: size
   and line-height stay with each component, so no control's measured height
   moves. */
button,
input,
select,
textarea {
  font-family: inherit;
}

/* NUBE-1: the build disclosure keeps its job (a truthfulness statement about
   this build, not branding) as a slim strip instead of a full banner. */
.internal-banner {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.01em;
  padding: var(--space-1) var(--space-3);
}

/* ---------------------------------------------------------------------------
   HEADER (PREPPALS-1, after DRAGON-GATE-NUBE-1 and NAV-SHELL-1)

   From 1280px up, one row: Back, the brand lockup, the app's SECTIONS
   (Subjects, Mock exams, Review) centred in the free space as the
   reference centres its text navigation, then the TOOLS (both languages,
   the account), the streak and the theme toggle. Below 1280px the sections
   and tools fold into a menu under a ☰ button -- the product owner chose
   that on 2026-10-08 (phase 0 of .claude/interfaces/PLAN.md), because the
   sections still to come (the exam guide, the study plan) cannot all sit in
   a phone's header.

   PREPPALS-1 (2026-10-16) took the reference's header: a 72px white bar, a
   sans wordmark, 15px navigation with the section on show underlined in
   colour, a compact language control and one filled pill on the right ("Log
   in" for a guest). The links are TEXT links, with no outline (product
   owner, 2026-10-16): WCAG 1.4.11 asks a text link for no boundary, its text
   is what identifies it, so a11y section D holds that text to 4.5:1 and the
   current section's underline to 3:1. The theme toggle, the menu button and
   Back are bare icon keys the same way; each keeps a 44px target and gets a
   tinted ground on hover.

   WHAT THE SPECS HOLD THIS TO, so the next edit does not have to rediscover
   it: at 375px, in all four languages, the closed header is ONE row of 44px
   controls inside the viewport, and the open menu shows every .app-nav
   .nav-link at 44px or more, inside the viewport, with no sideways scroll
   (dragon_gate_a11y_polish_responsive section C); the toggle never overlaps
   the brand or #app-nav; the header rule is Gold and at most 3px; the
   separator is a Gold hairline (BRAND-CHIP-1: at most 2px thick and 24px
   long, never a surface); there is exactly one .app-brand, and no <h1> in
   the header.
   --------------------------------------------------------------------------- */
.app-header {
  position: relative;            /* anchors the menu panel (NAV-SHELL-1) */
  z-index: 30;                   /* its soft shadow falls on the page below */
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-2) var(--space-3);
  min-height: 72px;
  padding: var(--space-3) var(--space-6);
  background: var(--color-surface-elevated);
  /* Gold hairline: decoration, not information, so Gold's 1.92:1 on the page
     is not a text-contrast question (--color-achievement is a fill token).
     PREPPALS-1 thinned it to 1px and added the reference's faint drop
     shadow, so the bar separates from the page by depth, not by a band. */
  border-bottom: 1px solid var(--color-achievement);
  box-shadow: 0 8px 24px -20px var(--color-shadow-strong);
}

.app-title {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  min-width: 0;
  font-size: var(--text-lg);
}

/* The lockup is a link home (see index.html and app.js's
   handleBrandHomeClick): as wide as its contents, 44px tall, no underline.
   Hover warms the wordmark to the lacquer red; focus gets the standard Ink ring. */
.app-brand {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.app-brand:hover .app-brand-name { color: var(--color-primary-text); }
.app-brand:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* THE SEAL (BRAND-CHIP-1, product owner 2026-10-20): the 龙门 gate drawn as
   a vector (index.html inlines the paths of GateMark.tsx, which the
   subjects hero's chip uses) in white on a lacquer square, like the
   product's other seals (考 连 时) -- it replaced the provisional raster
   crop of the brand board, brand/gate-mark.webp. A soft lacquer glow under
   it, no rim (product owner: "sin el contorno"). Decorative -- aria-hidden
   in the markup -- because the words beside it already name the brand. */
.app-brand-mark,
.subject-hero-chip-seal {
  display: grid;
  place-items: center;
  flex: none;
  background-color: var(--color-primary);
  background-image: var(--gradient-primary);
  color: var(--color-on-primary);
  box-shadow: 0 8px 18px -8px var(--color-primary-glow);
}
.app-brand-mark { width: 34px; height: 34px; border-radius: 9px; }
.app-brand-mark svg { display: block; width: 20px; height: 19px; }

/* Ink wordmark, then the product in Gold small capitals after a Gold
   hairline: the umbrella brand reads first and loudest, the product sits
   inside it as a tag -- the same parent/child relationship the markup
   states. The lacquer red is left to the seal and the actions.
   PREPPALS-1: the wordmark is the display sans, tight, as the reference
   sets its own name; BRAND-CHIP-1 set it semibold, as on the hero's chip. */
.app-brand-name {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--color-text);
  white-space: nowrap;   /* "Dragon Gate" never splits into "Dragon" / "Gate" */
}

/* The Gold hairline (decoration, aria-hidden in the markup), as on the
   hero's chip: a line, never a surface. */
.app-brand-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--color-achievement);
  flex: none;
}

.app-brand-product {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--color-accent-text);   /* deep Gold: 6.30:1 on surface, 5.74:1 on bg; 9.25:1 at night */
  white-space: nowrap;
}

/* Landing-screen lockup (the first, interface-language screen). */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-weight: var(--weight-display);
}
.brand-lockup-name {
  color: var(--color-text);
  letter-spacing: var(--tracking-heading);
}
.brand-lockup-product {
  font-family: var(--font-sans);
  font-size: 0.45em;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  background: var(--color-figure-accent-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}
.brand-tagline {
  margin: 0 0 var(--space-5);
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: var(--text-lg);
}

/* :not([hidden]) IS LOAD-BEARING: app.js hides the whole nav with [hidden]
   before onboarding, and a bare author `display` would beat the UA's
   `[hidden] { display: none }` at equal specificity. */
.app-nav:not([hidden]) {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

/* PREPPALS-1 header control: the reference's 15px navigation label as a
   text link (Ink on the header, 16.48:1 -- a11y section D measures it), with
   a transparent 1px edge so a filled variant (the guest's "Log in") keeps the
   same box. Hover lays a tinted ground under it. */
.app-nav .nav-link {
  color: var(--color-text);   /* explicit: a <button> does not inherit color */
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  flex-shrink: 0;             /* only the signed-in identity pill may shrink */
  padding: 0 var(--space-4);
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  line-height: 1.2;           /* one baseline for the <a> and <button> pills */
  letter-spacing: -0.005em;
  cursor: pointer;
  min-height: 44px;           /* touch target */
  transition: border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.app-nav .nav-link:not([hidden]) {
  display: inline-flex;
  align-items: center;
}
.app-nav .nav-link:hover { background: var(--color-control-hover); }
.app-nav .nav-link:active { transform: translateY(1px); }
.app-nav .nav-link:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .app-nav .nav-link { transition: none; }
  .app-nav .nav-link:active { transform: none; }
}

/* SEAL GLYPHS (NUBE-1). Nube's iconography is the same CJK "seal" device the
   subject badges use (数 物 化 理 文) rather than a drawn icon set: 语 for the
   interface language (语言), 考 for the exam language (考试). Generated
   content with EMPTY alternative text ("" after the slash), so the glyph is
   pure decoration: it is not in textContent (the jsdom suite reads exact
   labels) and assistive technology announces the label alone. The first
   declaration is the fallback for engines without the alt syntax.
   PREPPALS-1: only the two language controls keep a glyph -- it stands where
   the reference puts its globe; the SECTIONS are plain words, as the
   reference's navigation is. */
#nav-language-btn::before,
#nav-exam-language-btn::before {
  font-family: var(--font-cjk);
  font-weight: var(--weight-semibold);
  font-size: 1rem;
  line-height: 1;
  color: var(--color-accent-text);
  margin-inline-end: var(--space-2);
}
#nav-language-btn::before { content: "语"; content: "语" / ""; }
#nav-exam-language-btn::before { content: "考"; content: "考" / ""; }

/* AUTH-1D. The signed-in email is arbitrary-length data, so this one pill may
   shrink and truncate; an action verb ("Log in", "Iniciar sesión") never is.
   The full address stays the button's text and accessible name. */
#nav-account-btn.nav-account-btn--identity {
  max-width: 220px;
  min-width: 0;
  flex-shrink: 1;
}
/* PREPPALS-1: a guest's "Log in" is the header's one filled pill, where the
   reference puts its call to action -- the same Cinnabar gradient over the
   solid board Cinnabar as every primary button (see --gradient-primary). A
   signed-in account is a quiet identity pill instead (the rule above). */
.app-nav #nav-account-btn:not(.nav-account-btn--identity) {
  background-color: var(--color-primary);
  background-image: var(--gradient-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--weight-bold);
  padding: 0 var(--space-5);
  box-shadow: var(--shadow-primary);
}
.app-nav #nav-account-btn:not(.nav-account-btn--identity):hover {
  background-color: var(--color-primary-hover);
  background-image: var(--gradient-primary-hover);
  border-color: var(--color-primary-hover);
}
/* Ellipsis lives on the nested span: text-overflow has no effect on a flex
   container's own text. */
#nav-account-btn.nav-account-btn--identity .nav-account-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* TRIAL-1. Plain text, not a pill: nothing to click. */
.nav-trial-status {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  flex-shrink: 0;
}
/* Secondary information drops rather than risk the header's overflow
   contract (its natural row is ~630px with a signed-in account). */
@media (max-width: 700px) {
  .nav-trial-status { display: none; }
}

/* STREAK-1 (phase 2 of .claude/interfaces/PLAN.md): the daily streak, 连 N,
   the last of the header's controls -- at the end of the row from 1280px up,
   a row of its own in the menu below that (see the 1279px block). Gold is
   achievement: a Gold pill with an Ink number (7.84:1) once today has an
   answer; before that, a white pill on a Gold rim, its 连 seal still Gold,
   because the streak is alive until the day ends. Not a control: 32px tall,
   no hover or focus state. Its sentence (app.js's renderStreak) is for
   assistive technology in the row and shows beside the number in the menu. */
.nav-streak:not([hidden]) {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.nav-streak-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.nav-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding-block: 0;
  padding-inline: 4px var(--space-3);
  border: 2px solid var(--color-achievement);
  border-radius: var(--radius-pill);
  background: var(--color-achievement);
  color: var(--color-on-achievement);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
}
.nav-streak-badge::before {
  content: "连";
  content: "连" / "";
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-surface-elevated);
  color: var(--color-achievement-text);   /* 6.30:1 on white, 9.25:1 at night */
  font-family: var(--font-cjk);
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
}
.nav-streak[data-active-today="false"] .nav-streak-badge {
  background: var(--color-surface-elevated);
  color: var(--color-text);
}
.nav-streak[data-active-today="false"] .nav-streak-badge::before {
  background: var(--color-achievement);
  color: var(--color-on-achievement);     /* 7.84:1 on Gold, 9.50:1 at night */
}

/* ---------------------------------------------------------------------------
   NAV-LANG-DROPDOWN-1 -- #nav-language-btn/#nav-exam-language-btn open a
   popover anchored to themselves (see app.js's own section). The panel stays
   absolutely positioned glass: the dropdown spec measures exactly that.
   --------------------------------------------------------------------------- */
.nav-lang-wrap {
  position: relative;
  display: inline-flex;
  min-width: 0;
}
/* :not([hidden]), for the same reason as .app-nav above. */
.nav-lang-dropdown:not([hidden]) {
  position: absolute;
  top: calc(100% + var(--space-2));
  inset-inline-start: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  /* GLASS, deliberately unlike every other panel: a transient control
     floating above the content, not another card in the stack. */
  background: color-mix(in srgb, var(--color-surface-elevated) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  animation: nav-lang-dropdown-in 140ms ease-out;
}
@keyframes nav-lang-dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Matches the :not([hidden]) selector above: the plain-class version of this
   rule lost to it on specificity, so the animation used to play anyway. */
@media (prefers-reduced-motion: reduce) {
  .nav-lang-dropdown:not([hidden]) { animation: none; }
}
.nav-lang-dropdown-option {
  color: var(--color-text);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  text-align: start;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 120ms ease;
}
.nav-lang-dropdown-option:hover {
  background: var(--color-primary-subtle-bg);
  border-color: var(--color-primary);
}
.nav-lang-dropdown-option:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .nav-lang-dropdown-option { transition: none; }
}
/* The rotating chevron is state, not decoration: it is the one signal that
   these two pills open a popover instead of navigating away. */
.nav-link[aria-haspopup="true"] {
  gap: var(--space-1);
}
.nav-lang-chevron {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  margin-inline-start: 2px;
  transition: transform 120ms ease;
}
.nav-link[aria-expanded="true"] .nav-lang-chevron {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  .nav-lang-chevron { transition: none; }
}

/* NAV-SHELL-1: the controls fill the row after the brand -- the SECTIONS
   (where a student goes), the TOOLS (settings, the account) pushed to the
   right, then the theme toggle. PREPPALS-1 centres the sections in the free
   space between the brand and the tools, as the reference centres its
   navigation. Below 1280px all of it folds into the menu panel (see the end
   of this section). */
.app-header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-width: 0;
}
.app-nav:not([hidden]) { flex: 1 1 auto; }
.app-nav-sections,
.app-nav-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.app-nav-sections { margin: 0 auto; padding: 0 var(--space-2); gap: 6px; }
.app-nav-tools { margin-inline-start: 0; }
/* In the header row only ONE thing may give way when space runs short: the
   signed-in email, which truncates with an ellipsis. The sections and the
   language pills keep their full size -- a wrapper that shrank under a pill
   that cannot would let the pills overlap their neighbours. */
@media (min-width: 1280px) {
  .app-title,
  .app-nav-sections,
  .nav-lang-wrap,
  .nav-trial-status { flex-shrink: 0; }
  .nav-account-wrap { flex-shrink: 1; }
  /* The reference's compact language control ("🌐 中文"): in the row a
     language pill shows its seal and its value only ("语 EN ▾"). The
     "Language:" prefix leaves the screen, not the page -- it stays in the
     button's text and accessible name (the jsdom suite reads the full
     label), and the menu below 1280px shows it again. This is what gives the
     signed-in identity pill its room at 1280px. */
  .app-nav-tools .nav-link-prefix {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .app-nav-tools .nav-link[aria-haspopup="true"] { padding: 0 var(--space-3); }
  /* Four sections (STUDY-PLAN-1 added "My plan") and the tools share one
     row: text links need no gutter between them beyond their own padding,
     so the row runs tighter than the menu below 1280px does. */
  .app-header { column-gap: var(--space-2); }
  .app-brand { gap: var(--space-2); }
  .app-nav-sections { gap: 0; padding: 0 var(--space-1); }
  /* 10px, not 12px: EXAM-GUIDE-1's "CSCA exam ▾" is a little wider than the
     "Mock exams" link it replaced, and the identity pill keeps its room. */
  .app-nav .app-nav-sections .nav-link { padding: 0 10px; }
  .app-nav-sections .nav-group-btn .nav-lang-chevron { margin-inline-start: 0; }
  .app-nav-tools { gap: var(--space-1); }
  .app-nav-tools .nav-link[aria-haspopup="true"] { padding: 0 10px; }
}
/* The fullest row there is -- Back, a signed-in account, the trial days and
   the streak -- leaves the account's name too little room below 1440px, so
   there Back shows its arrow only, as it does on a phone. Its accessible name
   is its aria-label (app.js), so nothing is lost to assistive technology. */
@media (min-width: 1280px) and (max-width: 1439px) {
  .app-header:has(.nav-account-btn--identity) .nav-back-btn { padding: 0; }
  .app-header:has(.nav-account-btn--identity) .nav-back-btn-label { display: none; }
}

/* The section on show (PREPPALS-1): its label in the primary, underlined in
   the primary, as the reference underlines its current page in its own
   action colour. The underline is a shape as well as a colour, and
   aria-current="page" says it to assistive technology. LACA-1 draws it with
   the primary's TEXT member: the lacquer red by day (6.54:1 on the white
   header), its on-dark member at night (6.62:1) -- the lacquer FILL measures
   only 2.46:1 on the dark header, under the 3:1 a state indicator needs. */
/* (0,2,1): low enough that the current-section rule below can underline. */
.app-nav a.nav-link { text-decoration: none; }
.app-nav .nav-section[data-current="true"] {
  color: var(--color-primary-text);
  text-decoration: underline;
  text-decoration-color: var(--color-primary-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

/* THE "CSCA exam" GROUP (EXAM-GUIDE-1, product owner 2026-10-19): Mock exams
   and the exam guide under one entry, so the row keeps its width. From
   1280px the button opens a small panel of the two links, the account
   menu's kind of panel; below 1280px (the menu panel, further down) the
   button is not shown and the two links are rows like every other section.
   The current page in the panel is tinted rather than underlined. */
.nav-group-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.nav-group-menu { display: none; }
.nav-group-wrap[data-open] .nav-group-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 200px;
  padding: var(--space-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}
.nav-group-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.nav-group-item:hover { background: var(--color-control-hover); }
.nav-group-item:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: -3px; }
.app-nav .nav-group-wrap[data-open] .nav-group-item[data-current="true"] {
  text-decoration: none;
  background: var(--color-primary-subtle-bg);
}

/* The menu button: a round key like the theme toggle, shown below 1280px only,
   and never while #app-nav is hidden (onboarding has nothing to put in it). */
.nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 140ms ease;
}
.nav-menu-btn svg { display: block; }
.nav-menu-btn:hover { color: var(--color-primary-text); background: var(--color-control-hover); }
.nav-menu-btn:active { transform: translateY(1px); }
.nav-menu-btn:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.nav-menu-btn[aria-expanded="true"] { background: var(--color-control-hover); }
@media (prefers-reduced-motion: reduce) {
  .nav-menu-btn { transition: none; }
  .nav-menu-btn:active { transform: none; }
}

/* THE ACCOUNT MENU (signed in). The avatar is the email's first character,
   drawn from data-initial as generated content with empty alt text. */
.nav-account-wrap {
  position: relative;
  display: inline-flex;
  min-width: 0;
}
#nav-account-btn[data-initial]::before {
  content: attr(data-initial);
  content: attr(data-initial) / "";
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  margin-block: 0;
  margin-inline: calc(-1 * var(--space-2) - 2px) var(--space-2);
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1;
}
#nav-account-btn .nav-lang-chevron { margin-inline-start: var(--space-1); flex: none; }
.nav-account-menu:not([hidden]) {
  position: absolute;
  top: calc(100% + var(--space-2));
  inset-inline-end: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 220px;
  max-width: min(320px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-lg);
}
.nav-account-menu-email {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.nav-account-menu-item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-primary-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-align: start;
  cursor: pointer;
}
.nav-account-menu-item:hover { background: var(--color-primary-subtle-bg); }
a.nav-account-menu-item { text-decoration: none; }
.nav-account-menu-item:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: -3px; }

/* Manual Light/Dark control (PALETTE-1A): a round white key, same family as
   the pills, holding the sun/moon SVG app.js draws on currentColor. */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 140ms ease;
}
.theme-toggle-btn svg { display: block; }
.theme-toggle-btn:hover {
  color: var(--color-primary-text);
  background: var(--color-control-hover);
}
.theme-toggle-btn:active { transform: translateY(1px); }
.theme-toggle-btn:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle-btn { transition: none; }
  .theme-toggle-btn:active { transform: none; }
}

/* Back: a round key with an arrow; the label shows from 600px up. */
.nav-back-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: none;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  padding-block: 0;
  padding-inline: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  cursor: pointer;
  transition: transform 140ms ease;
}
.nav-back-btn:hover {
  color: var(--color-primary-text);
  background: var(--color-control-hover);
}
.nav-back-btn:active { transform: translateY(1px); }
.nav-back-btn:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.nav-back-btn[hidden] { display: none; }
.nav-back-btn-arrow { font-size: 1.1rem; line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  .nav-back-btn { transition: none; }
  .nav-back-btn:active { transform: none; }
}


/* BELOW 1280px: THE MENU (NAV-SHELL-1, approved 2026-10-08). The header is
   one row -- Back, the brand, the theme toggle and the menu button -- and the
   sections and tools fold into a panel under it, one full-width row each, so
   every label is shown in full in every language (the compact seal-only
   pills and the hidden "Idioma:" prefix this replaces are gone). The panel
   overlays the page rather than pushing it down, and closes on Escape, on a
   click outside the header and on every navigation (app.js). */
@media (max-width: 1279px) {
  .app-title { flex: 1 1 auto; }
  .theme-toggle-btn { order: 1; }
  .nav-menu-btn { display: flex; order: 2; }
  .app-header:has(#app-nav[hidden]) .nav-menu-btn { display: none; }
  .app-header-controls { display: none; }
  .app-header[data-menu-open] .app-header-controls {
    display: block;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    inset-inline-end: 0;
    z-index: 40;
    max-height: calc(100dvh - 7rem);
    overflow-y: auto;
    padding: var(--space-3) var(--space-6) var(--space-5);
    background: var(--color-surface-elevated);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-achievement);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    box-shadow: var(--shadow-lg);
  }
  .app-nav:not([hidden]) {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  .app-nav-sections,
  .app-nav-tools {
    flex-direction: column;
    align-items: stretch;
    margin: 0;
  }
  .app-nav-sections {
    gap: var(--space-2);
    padding: 0 0 var(--space-3);
    border-bottom: 1px solid var(--color-border);
  }
  .app-nav .nav-link { width: 100%; min-height: 48px; border-radius: var(--radius); }
  /* EXAM-GUIDE-1: no "CSCA exam" button in the menu -- its two links are
     sections like the others, in the same order. */
  .app-nav #nav-exam-group-btn { display: none; }
  .nav-group-wrap,
  .nav-group-menu,
  .nav-group-wrap[data-open] .nav-group-menu {
    position: static;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    transform: none;
  }
  .nav-group-item {
    min-height: 48px;
    padding: 0 var(--space-4);
    border-radius: var(--radius);
    white-space: normal;
  }
  .nav-lang-wrap,
  .nav-account-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  /* Choices open IN the panel, under their own row, not as floating glass. */
  .nav-lang-dropdown:not([hidden]),
  .nav-account-menu:not([hidden]) {
    position: static;
    max-width: none;
    margin-top: var(--space-2);
    box-shadow: none;
    animation: none;
  }
  #nav-account-btn.nav-account-btn--identity { max-width: none; }
  .nav-trial-status { display: block; padding: 0 var(--space-2); }
  /* STREAK-1: under the tools, a row of its own, the sentence shown beside
     the number -- the menu has the room the one-row header lacks. */
  .nav-streak:not([hidden]) {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-2) 0;
    border-top: 1px solid var(--color-border);
  }
  .nav-streak-text {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
  }
}

/* BELOW 600px: a smaller brand and an icon-only Back, so the one header row
   fits a 320px phone. */
/* PREPPALS-1: the lockup STACKS on a phone -- the wordmark on top, the Gold
   separator and the product under it as a small caption -- so the row keeps
   room for Back, the theme toggle and the menu button at 320px (the inline
   lockup used to slide under the theme toggle there). Same elements, same
   order, same text: only the grid places them. BRAND-CHIP-1: stacked, the
   hairline lies down -- a short Gold rule leading into "CSCA PREP". */
@media (max-width: 599px) {
  .app-header { min-height: 60px; padding: var(--space-2) var(--space-3); }
  .internal-banner { font-size: var(--text-2xs); padding: 3px var(--space-2); }
  .app-brand {
    display: inline-grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 5px;
    row-gap: 3px;
  }
  .app-brand-mark { grid-row: 1 / 3; width: 32px; height: 32px; margin-inline-end: 4px; }
  .app-brand-mark svg { width: 19px; height: 18px; }
  .app-brand-name { grid-column: 2 / 4; grid-row: 1; font-size: 1.0625rem; }
  .app-brand-sep { grid-column: 2; grid-row: 2; width: 10px; height: 1px; }
  .app-brand-product {
    grid-column: 3;
    grid-row: 2;
    justify-self: start;
    font-size: var(--text-2xs);
    letter-spacing: 0.14em;
  }
  .app-header[data-menu-open] .app-header-controls { padding: var(--space-3) var(--space-3) var(--space-4); }
  .nav-back-btn { padding: 0; }
  .nav-back-btn-label { display: none; }
}

main#app-root {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.view { animation: fade-in 150ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  /* The option/button state transitions added in VISUAL-PRODUCT-4 are
     functional feedback, not decoration, but they are still motion. The
     PREPPALS-1 lift and press (a small translateY) are motion too; they are
     kept as a colour/shadow change only, see the reduced-motion block after
     the button rules. */
  .next-btn, .back-btn, .retry-btn, .btn-secondary,
  .auth-quiet-link { transition: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* HEADINGS. h1 and h2 used to sit 0.3rem apart, which reads as an accident
   rather than a level change -- on the module screen the subject name and the
   module names looked like the same kind of thing. The scale separates them
   properly and gives the h1 tighter leading so a two-line subject name still
   reads as one object. PREPPALS-1: both are the display sans, heavy and
   tightly tracked, as every heading on the reference is. */
h1 {
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-heading);
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  margin-bottom: var(--space-3);
}
h2 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  margin: var(--space-5) 0 var(--space-2);
}

/* Navigation context above a screen's own <h1> (DRAGON-GATE-PRODUCT-SHELL-1).
   The h1 says WHERE YOU ARE; this says what contains it, or what you can do
   here. Deliberately typographic rather than a breadcrumb component -- no
   separators, no chevrons, no bar -- because the hierarchy is three shallow
   levels with a working Back control at every one, and a breadcrumb row would
   add chrome to restate what the heading pair already says.

   Imperial Green, the SECONDARY colour: this is supporting context, and it
   must not compete with the Dragon Orange interaction affordances on the same
   screen ("Practice all topics" sits directly below it). Uppercase with open
   tracking at small size is the same treatment .brand-lockup-product uses for
   the product label, which is the other place the interface names a container
   rather than a thing you act on. */
.view-eyebrow {
  margin: 0 0 var(--space-1);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent-text);
}
/* The h1 sits tight under its eyebrow so the two read as ONE heading block
   rather than two stacked paragraphs.
   `margin-top: 0` DID NOT DO THIS AND COULD NOT. Both browse containers are
   flex columns with `gap: var(--space-6)`, and a flex gap is not a margin --
   nothing a child declares can cancel it. Measured, the eyebrow floated a full
   36px above the heading it labels (32px gap plus its own 4px margin-bottom):
   the exact opposite of what this comment claimed, on every navigation screen,
   in both implementations. The negative margin cancels the gap for this one
   pair, written against the same custom property the containers set so the two
   cannot drift. Outside those containers the property is undefined, the
   declaration is dropped, and nothing else on the page is affected. */
.view-eyebrow + h1 { margin-top: calc(-1 * var(--nav-stack-gap)); }

/* ---------------------------------------------------------------------------
   PROGRAMMATICALLY FOCUSED SCREEN HEADINGS (DRAGON-GATE-VISUAL-PRODUCT-3)

   Every screen moves focus to its own <h1> after rendering, so a keyboard or
   screen-reader user is placed at the top of the new screen instead of being
   dropped to <body> (or, after Back, left on a header button while everything
   beneath it changed).

   NO VISIBLE RING HERE, deliberately, and this is not a removed focus
   indicator. WCAG 2.4.7 governs user-interface COMPONENTS that receive
   keyboard focus; a heading carrying tabindex="-1" is not a component and is
   not in the tab order -- it can only be reached by this script, never by
   tabbing. Its job is to move the assistive-technology reading cursor, which
   happens whether or not anything is painted. Drawing a ring around a heading
   on every navigation would put a box on screen for mouse users who never
   asked for one, which reads as a rendering bug.

   :focus, not :focus-visible: Chromium's :focus-visible heuristic keys off
   input MODALITY and does not reliably arm for a script-driven .focus() -- a
   fact this repository already established while testing option buttons. Every
   genuinely interactive control keeps its own :focus-visible ring, untouched.

   .result-banner joins the same selector for the same reason, not a different
   one. Feedback.tsx focuses it after submit because disabling the Submit
   button orphans focus on <body> (see that component's own bannerRef
   effect). It is a <div>, never in the tab order, and reachable only
   by that script -- so it is a reading-cursor target exactly like a heading,
   not a component, and WCAG 2.4.7 does not ask for a ring on it. Leaving it to
   the user agent would be worse than either choice made deliberately: the ring
   would appear or not appear depending on how the student happened to press
   Submit, and when it did appear it would be an unbranded UA outline around a
   coloured banner. Nothing is lost by omitting it -- the banner is not a stop
   a keyboard student needs to see, and their next Tab lands on Next, which
   does draw its ring.
   --------------------------------------------------------------------------- */
h1[tabindex="-1"]:focus,
.result-banner[tabindex="-1"]:focus {
  outline: none;
}

/* THE END OF A SUBJECT IS A PRODUCT MOMENT, and it was the only terminal screen
   in the product with no container at all: two bare elements on the page ground,
   left-aligned under a header, with the rest of the viewport empty. It now sits
   on the same elevated card every other terminal surface uses, so finishing a
   subject looks like an outcome rather than a screen that failed to render. */
.view-complete {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-md);
  text-align: center;
}
/* The message stays the quiet sentence it has always been -- it is an <h1> so
   the screen has a heading and focus has somewhere to land, not because it
   wants to be a banner. Only its alignment and the space around it changed. */
.view-complete h1.complete-message {
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  letter-spacing: 0;
  margin: 0 0 var(--space-5);
  color: var(--color-text);
}
/* The only control on the final screen, and the only way off it (the header
   Back is deliberately hidden here), so it carries the forward-action weight
   Submit and Next carry rather than the base tier it shared with Retry. */
.view-complete .back-btn {
  min-width: 9.5rem;
}

/* Language select */
/* A 2-column grid of short, content-free labels (VISUAL-PRODUCT-8) --
   deliberately NOT the full-width vertical stack this used to share with
   .subject-card. Language/exam-language are arbitrary, one-time, data-free
   picks (four or two short words, no badge, no progress), the lightest
   decision in the product; Subject Select one screen later is the actual
   data-bearing hub (title + coverage + a "free" badge per real subject) and
   is the one screen that should look like the heaviest choice on offer.
   Both sharing one full-width-card silhouette made the hub read as just
   the fourth in a row of identical screens instead of the destination. */
.language-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-5);
}
@media (max-width: 480px) {
  .language-options { grid-template-columns: 1fr; }
}
/* .topic-chip's own box model (styles.css's own VISUAL-PRODUCT-2/-4 chip
   treatment), reused verbatim rather than re-derived: no resting shadow, a
   hover-only lift via border-color + --shadow-sm, and the smaller --radius
   (not --radius-lg) .subject-card's own comment reserves for a heavier,
   data-bearing card. This is the SAME "compact grid of short choices"
   language ContentNavigation.tsx's topic chips already speak -- reused
   because language/exam-language selection is that same kind of choice,
   not because it needed a color or shape no other screen has. */
.language-option-btn {
  color: var(--color-text);   /* explicit: a <button> does not inherit color from body */
  min-width: 0;               /* the grid track owns the width; see .topic-chip's own note */
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-md);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  text-align: start;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.language-option-btn:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.language-option-btn:focus-visible {
  border-color: var(--color-primary);
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Account Gateway, Login, Signup (AUTH-1C)

   No dedicated card/container tier: like .view-language-select and
   .view-exam-language-select, these screens sit directly in
   main#app-root's own content column and need no layout rules of their
   own -- only the new controls below (gateway actions, form fields) get
   rules. Every color here is a semantic token already re-pointed by both
   dark-mode blocks, so nothing in this section needs a dark-mode override.
   --------------------------------------------------------------------------- */
.auth-gateway-subtitle {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}
.auth-gateway-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.auth-gateway-actions .btn-secondary,
.auth-gateway-actions .next-btn {
  width: 100%;
  min-width: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: 20px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.auth-field-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.auth-field-input-row {
  position: relative;
  display: flex;
}
.auth-field-input {
  flex: 1;
  min-width: 0;
  min-height: 52px;           /* PREPPALS-1: the reference's roomier field */
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-size: var(--text-md);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
}
.auth-field-input:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
  border-color: var(--color-primary);
}
.auth-field-input[aria-invalid="true"] {
  border-color: var(--color-incorrect-text);
}
.auth-field-input-row--password .auth-field-input {
  padding-inline-end: 44px; /* room for .auth-field-toggle, absolutely positioned over this edge */
}
.auth-field-toggle {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  bottom: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
}
.auth-field-toggle:hover {
  color: var(--color-text);
}
.auth-field-toggle:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: -3px; /* inset: sits inside the input's own box visually */
}
.auth-field-hint {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.auth-field-error {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-incorrect-text);
  font-weight: var(--weight-medium);
}
.auth-submit-btn {
  width: 100%;
  min-width: 0;
}

.auth-switch-prompt {
  margin-top: var(--space-5);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.auth-switch-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: var(--weight-medium);
  color: var(--color-primary-text);
  text-decoration: underline;
  cursor: pointer;
  /* Inline text link within a sentence, not an isolated tap target -- WCAG
     2.5.5/2.5.8's own exception for inline links inside a run of text, so
     this deliberately does not carry the 44px min-height every OTHER
     control on this page does. */
}
.auth-switch-link:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* The de-emphasized escape hatch on any of the three auth screens: "Log in"
   on the gateway (Guest is that screen's primary action -- see
   renderAuthGateway in app.js), "Continue without an account" on the Login
   and Signup forms. Same quiet treatment either way -- a real, focusable
   button, just never competing with the screen's own primary action. */
.auth-quiet-link {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: var(--space-4);
  padding: var(--space-2);
  background: none;
  border: none;
  font: inherit;
  color: var(--color-text-muted);
  text-align: center;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
.auth-quiet-link:hover {
  color: var(--color-primary-text);
  text-decoration-color: currentColor;
}
.auth-quiet-link:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Subject select (PREPPALS-1, 2026-10-16; after DRAGON-GATE-NUBE-1)

   THE SCREEN'S TOP: the HERO, flush under the header -- the reference's dark
   brand band, in
   deep Jade: on the left a chip with the brand, the screen's very large
   heading with a Gold stroke under it, the subtitle, and the two stat cards
   (HeroStats.tsx: the streak, the days to the exam -- the screen's only
   countdown, product owner 2026-10-16) under them; a student's photo is the
   band's whole background (HERO-PHOTO-1, product owner 2026-10-20; see
   SubjectSelection.tsx for its source and licence). The band ends in
   a wave and the subject cards sit on the page ground under it.

   FULL WIDTH WITHOUT A WIDER BOX. .react-subject-select stays the 1120px
   column (react_subject_selection_responsive pins it) and the page must
   never scroll sideways, so the band (and the mock-exam hub's countdown bar)
   is NOT a wider box: it paints its ground outside its own box with
   border-image-outset,
   which is ink overflow -- it never adds to the page's scrollable width.
   The ground's gradient runs top to bottom, so stretching it sideways over
   the outset changes nothing. Under it, a solid background-color of the same
   family is what a contrast check reads (and what a forced-colours engine
   keeps). The hero's wave is a clip-path over the same outset area.

   The copy is left-aligned, as on the reference: NUBE-1's
   centred 36rem hero column (product owner, 2026-10-08) gave way to the
   reference's two-column hero with this redesign. */

/* THE BAND: shared by this hero, the mock-exam hub's (.mock-hub-hero), the
   study plan's (.study-plan-hero), the exam guide's (.exam-guide-hero), the
   homepage's (.landing-hero), the city guide's (.city-guide-hero) and About
   us's (.about-hero). */
.subject-hero,
.mock-hub-hero,
.study-plan-hero,
.exam-guide-hero,
.landing-hero,
.city-guide-hero,
.about-hero {
  /* The wave: --wave-base lifts the edge off the band's bottom, --wave-amp
     is how far it swings either way. */
  --wave-base: 26px;
  --wave-amp: 14px;
  position: relative;
  background-color: var(--hero-ground);
  border-image-source: var(--gradient-hero);
  border-image-slice: 0 fill;
  border-image-outset: 0 100vw;
  color: var(--color-on-hero);
  clip-path: polygon(
    calc(50% - 100vw) 0,
    calc(50% + 100vw) 0,
    calc(50% + 100vw) calc(100% - var(--wave-base)),
    calc(50% + 60vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.999),
    calc(50% + 57vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.973),
    calc(50% + 54vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.913),
    calc(50% + 51vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.821),
    calc(50% + 48vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.699),
    calc(50% + 45vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.553),
    calc(50% + 42vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.387),
    calc(50% + 39vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.207),
    calc(50% + 36vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.020),
    calc(50% + 33vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.167),
    calc(50% + 30vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.349),
    calc(50% + 27vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.519),
    calc(50% + 24vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.670),
    calc(50% + 21vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.797),
    calc(50% + 18vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.896),
    calc(50% + 15vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.963),
    calc(50% + 12vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.997),
    calc(50% + 9vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.994),
    calc(50% + 6vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.957),
    calc(50% + 3vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.886),
    calc(50% + 0vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.783),
    calc(50% - 3vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.653),
    calc(50% - 6vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.499),
    calc(50% - 9vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.328),
    calc(50% - 12vw) calc(100% - var(--wave-base) - var(--wave-amp) * 0.145),
    calc(50% - 15vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.042),
    calc(50% - 18vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.229),
    calc(50% - 21vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.407),
    calc(50% - 24vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.571),
    calc(50% - 27vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.715),
    calc(50% - 30vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.833),
    calc(50% - 33vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.922),
    calc(50% - 36vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.978),
    calc(50% - 39vw) calc(100% - var(--wave-base) - var(--wave-amp) * -1.000),
    calc(50% - 42vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.986),
    calc(50% - 45vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.937),
    calc(50% - 48vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.855),
    calc(50% - 51vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.743),
    calc(50% - 54vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.604),
    calc(50% - 57vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.444),
    calc(50% - 60vw) calc(100% - var(--wave-base) - var(--wave-amp) * -0.268),
    calc(50% - 100vw) calc(100% - var(--wave-base))
  );
}
.subject-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-6);
  margin: 0 0 var(--space-6);
  padding: var(--space-7) 0 calc(var(--space-7) + 2 * var(--wave-amp) + var(--wave-base));
}
@media (min-width: 900px) {
  .subject-hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--space-5);
    min-height: clamp(480px, 40vw, 600px);
    padding-top: var(--space-8);
  }
}

/* THE PHOTO BEHIND THE BAND (HERO-PHOTO-1, product owner 2026-10-20): the
   whole width of the window, as the reference's photo is -- a student
   writing in a library, the photo widened on the left with a blurred
   continuation of its own shelves, so the copy sits on soft colour and the
   student on the right. It is a layer under the copy (the band isolates its
   own stacking), clipped to the band's wave by the band's own clip-path,
   under a LIGHT Jade veil (product owner: no heavy fade): the photo's own
   shadows carry the copy's contrast, measured against the real pixels
   behind each line (every line clears 4.5:1 at 375-1920px, both schemes).
   The solid --hero-ground stays under it for engines without the photo.
   A 100vw layer would add half a scrollbar's width to the page's scrollable
   width (the band's own ground avoids that as ink overflow); the subjects
   screen's root therefore clips sideways overflow -- nothing else on that
   screen may reach past the window anyway. */
html[data-csca-subject-selection] #react-root { overflow-x: clip; }
.subject-hero { isolation: isolate; }
.subject-hero::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: 100vw;
  transform: translateX(-50%);
  background:
    /* A soft shade around the copy only -- not a wall down the left. */
    radial-gradient(ellipse 46% 62% at 24% 52%,
      color-mix(in srgb, var(--hero-ground) 62%, transparent) 0%,
      color-mix(in srgb, var(--hero-ground) 40%, transparent) 55%,
      transparent 100%),
    /* An even, light veil over the whole photo. */
    linear-gradient(color-mix(in srgb, var(--hero-ground) 30%, transparent), color-mix(in srgb, var(--hero-ground) 30%, transparent)),
    url("brand/hero-library.webp") right 40% / cover no-repeat,
    var(--hero-ground);
  filter: brightness(0.82);
  pointer-events: none;
}
/* On the photo the copy carries a faint shadow of its own, and the
   subtitle is the band's full white rather than its muted tint. */
.subject-hero h1,
.subject-hero-subtitle,
.subject-hero-chip {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 22px rgba(0, 0, 0, 0.35);
}
.subject-hero-subtitle { color: var(--color-on-hero); }
@media (max-width: 899px) {
  .subject-hero::before {
    background:
      linear-gradient(180deg,
        color-mix(in srgb, var(--hero-ground) 62%, transparent) 0%,
        color-mix(in srgb, var(--hero-ground) 50%, transparent) 55%,
        color-mix(in srgb, var(--hero-ground) 30%, transparent) 100%),
      url("brand/hero-library.webp") 78% 40% / cover no-repeat,
      var(--hero-ground);
  }
}
@media (max-width: 599px) {
  .subject-hero,
  .mock-hub-hero,
  .study-plan-hero,
  .exam-guide-hero,
  .landing-hero,
  .city-guide-hero,
  .about-hero { --wave-base: 18px; --wave-amp: 9px; }
  .subject-hero { padding-top: var(--space-6); gap: var(--space-5); }
}
.subject-hero-copy { min-width: 0; }

/* THE CHIP: the brand, small, where the reference puts its badge.
   BRAND-CHIP-1 (product owner, 2026-10-20: the old one "looked cheap") took
   it off its pill. The old chip -- a white disc around a scaled-down raster
   gate, a bold name and a dot on a translucent pill -- read as a sticker.
   Now: a lacquer seal like the product's other seals (考 连 时), with the
   vector gate (GateMark.tsx) in white; the wordmark; a Gold hairline; and
   the product in tracked small capitals, in Gold. Every line is read
   against the band (white on it 14.65:1 or more, the Gold product 8.44:1). */
.subject-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 100%;
  margin: 0;
  color: var(--color-on-hero);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
/* The seal's look is shared with the header's (.app-brand-mark, above). */
.subject-hero-chip-seal { width: 36px; height: 36px; border-radius: 10px; }
.subject-hero-chip-mark { display: block; width: 21px; height: 20px; }
.subject-hero-chip-name { white-space: nowrap; }
/* The hairline: decoration (aria-hidden in the markup), so not a text pair. */
.subject-hero-chip-sep {
  width: 1px;
  height: 18px;
  flex: none;
  background: var(--brand-gold);
  opacity: 0.7;
}
.subject-hero-chip-product {
  color: var(--color-on-hero-accent);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* THE HEADING at display size, and the Gold stroke under it (the
   reference's accent underline): decoration, drawn as generated content, so
   the heading's text stays exactly the translated string. */
.subject-hero h1 {
  margin: var(--space-5) 0 var(--space-4);
  font-size: var(--text-display);
  font-weight: var(--weight-display);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  color: var(--color-on-hero);
  overflow-wrap: break-word;
}
.subject-hero h1::after {
  content: "";
  display: block;
  width: min(13rem, 70%);
  height: 12px;
  margin-top: var(--space-4);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 208 12' preserveAspectRatio='none'%3E%3Cpath d='M3 8.5C52 3 120 2 205 5.5' fill='none' stroke='%23D4AF37' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}
.subject-hero-subtitle {
  max-width: 32em;
  margin: 0;
  font-size: 1.1875rem;
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
}

/* THE STAT CARDS, under the subtitle: side by side while they fit, each on
   its own line on a narrow phone. */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  min-width: 0;
  margin: var(--space-6) 0 0;
}
.hero-stats > * { flex: 0 1 auto; min-width: 0; }
@media (max-width: 599px) {
  .hero-stats { margin-top: var(--space-5); gap: var(--space-2); }
  .hero-stats > * { flex: 1 1 100%; }
}

/* A STAT CARD: the card surface of the scheme on the Jade ground, a seal,
   one large number with its unit, and a caption. */
.hero-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding-block: var(--space-3);
  padding-inline: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-lg);
  color: var(--color-text);
  pointer-events: auto;
}
.hero-stat-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-family: var(--font-cjk);
  font-size: 1.25rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.hero-stat--streak .hero-stat-seal {
  background: var(--color-achievement);
  color: var(--color-on-achievement);      /* 7.84:1 on Gold, 9.50:1 at night */
}
.hero-stat--exam .hero-stat-seal {
  background: var(--color-primary-subtle-bg);
  color: var(--color-primary-text);        /* 4.88:1 or more in both schemes */
}
.hero-stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hero-stat-value {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--weight-display);
  line-height: 1.05;
  letter-spacing: var(--tracking-heading);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.hero-stat-value--words { font-size: var(--text-lg); white-space: normal; }
.hero-stat-unit {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  color: var(--color-text-muted);
}
.hero-stat-caption {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}
@media (max-width: 899px) {
  .hero-stat { padding-block: var(--space-2); padding-inline: var(--space-2) var(--space-3); gap: var(--space-2); }
  .hero-stat-seal { width: 34px; height: 34px; font-size: 1.0625rem; }
  .hero-stat-value { font-size: 1.3125rem; }
}

/* THE CARD GRID. Five tall cards in one row from 1100px (the subjects board's
   own arrangement), as many 200px+ columns as fit between 720 and 1099px,
   and one column of horizontal cards on phones. */
.subject-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}
@media (min-width: 720px) {
  .subject-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); }
}
/* Tablets fit three cards a row, so five leave two on the last row: a
   wrapping row centres them under the three instead of leaving a hole at
   the right. DOM order -- and so tab order -- is unchanged. */
@media (min-width: 720px) and (max-width: 1099px) {
  .subject-list { display: flex; flex-wrap: wrap; justify-content: center; }
  .subject-list > * { flex: 0 1 calc((100% - 2 * var(--space-4)) / 3); min-width: 0; }
}
@media (min-width: 1100px) {
  .subject-list { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* SUBJECT TONE. A subject card row and the practice column carry
   data-subject-tone; these custom properties are the only way a subject's hue
   reaches the screen (seal, progress mark, tint, and the seal glyph itself).
   The first rule is the fallback for an id with no entry. */
[data-subject-tone] {
  --subject: var(--color-accent);
  --subject-text: var(--color-accent-text);
  --subject-mark: var(--color-progress-fill);
  --subject-tint: var(--color-figure-accent-subtle);
  --subject-seal: "";
}
[data-subject-tone="mathematics"] {
  --subject-seal: "数";
  --subject: var(--subject-mathematics);
  --subject-text: var(--subject-mathematics-text);
  --subject-mark: var(--subject-mathematics-mark);
  --subject-tint: var(--subject-mathematics-tint);
}
[data-subject-tone="physics"] {
  --subject-seal: "物";
  --subject: var(--subject-physics);
  --subject-text: var(--subject-physics-text);
  --subject-mark: var(--subject-physics-mark);
  --subject-tint: var(--subject-physics-tint);
}
[data-subject-tone="chemistry"] {
  --subject-seal: "化";
  --subject: var(--subject-chemistry);
  --subject-text: var(--subject-chemistry-text);
  --subject-mark: var(--subject-chemistry-mark);
  --subject-tint: var(--subject-chemistry-tint);
}
[data-subject-tone="science_chinese"] {
  --subject-seal: "理";
  --subject: var(--subject-science-chinese);
  --subject-text: var(--subject-science-chinese-text);
  --subject-mark: var(--subject-science-chinese-mark);
  --subject-tint: var(--subject-science-chinese-tint);
}
[data-subject-tone="humanities_chinese"] {
  --subject-seal: "文";
  --subject: var(--subject-humanities-chinese);
  --subject-text: var(--subject-humanities-chinese-text);
  --subject-mark: var(--subject-humanities-chinese-mark);
  --subject-tint: var(--subject-humanities-chinese-tint);
}

/* THE CARD: a white card. Its boundary is --color-border-strong (3:1, WCAG
   1.4.11 -- a11y section D measures it at rest, so it cannot be the
   reference's near-invisible hairline); depth is a soft PREPPALS-1 shadow,
   and hover lifts the card onto a wider one. display:flex is pinned by
   react_subject_selection_responsive. */
.subject-card {
  color: var(--color-text);   /* explicit: a <button> does not inherit color */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-5) var(--space-4) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  /* The card colour of both schemes (white; the board's #23211E at night),
     named as the elevated surface it is. */
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  text-align: start;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.subject-card:hover {
  border-color: var(--subject-text, var(--color-text));
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.subject-card:active {
  box-shadow: var(--shadow-sm);
  transform: translateY(0);
}
.subject-card:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .subject-card { transition: none; }
  .subject-card:hover, .subject-card:active { transform: none; }
}

/* THE SEAL (decorative, aria-hidden): the subject's glyph in its own hue on
   a square of its own tint (subject text on tint 5.07:1 or more in both
   schemes) -- PREPPALS-1's clean card in place of NUBE-1's panel of ruled
   paper with a hexagon seal on its edge. No mascot on the cards: the
   product owner keeps the dragon to the hero (2026-10-08). */
.subject-card-media {
  display: block;
  margin-bottom: var(--space-3);
}
.subject-card-seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--subject-tint);
  color: var(--subject-text);
  font-family: var(--font-cjk);
  font-size: 1.5rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.subject-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  color: var(--color-text);
}
.subject-card-zh {
  font-family: var(--font-cjk);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
/* margin-top: auto parks the count, badge and meter at the bottom of every
   card, so they line up across a row even when one title wraps to two lines
   ("Humanities Chinese", or any Russian title). Count left, badge right; a
   long count wraps the badge onto its own line instead of squeezing it. */
.subject-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-2);
  align-self: stretch;
  margin-top: auto;
  padding-top: var(--space-3);
}
.subject-card-total {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.subject-card-count { font-size: var(--text-sm); color: var(--color-text-muted); }
.subject-card-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
}
/* TRIAL-1 (TRIAL_AND_FREE_TIER_CONTRACT.md §4/§9) "N free" badge. NUBE-1
   gives it Gold, the "free / reward" fill, with Ink on it (7.84:1): still
   informational, never an alert colour and never Cinnabar. */
.subject-card-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-on-achievement);
  background: var(--color-achievement);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  width: fit-content;
}

/* Subject select: disabled "coming later" cards. Never clickable; not a
   <button>, so it is naturally out of the tab order. Unfilled and dashed on
   the page ground, no shadow: scope, not a key. */
.subject-card--disabled {
  cursor: not-allowed;
  background: transparent;
  border-style: dashed;
  border-color: var(--color-border-strong);
  box-shadow: none;
}
.subject-card--disabled .subject-card-title { color: var(--color-disabled-text); }
.subject-card--disabled .subject-card-count {
  color: var(--color-disabled-text);
  font-style: italic;
}
/* A card you cannot click must not answer the pointer. */
.subject-card--disabled:hover,
.subject-card--disabled:active {
  border-color: var(--color-border-strong);
  box-shadow: none;
  transform: none;
}

/* THE READ ZONE. The user asked (2026-09-02) for the Read affordance to be
   its own full zone of the card, divided from the content by a hairline, not
   a small corner circle -- and icon-only. On the tall cards the zone is the
   card's bottom strip; on the phone row it is the right-hand column. It is a
   SIBLING of the card button (a <button> cannot contain a <button>),
   positioned over the card's reserved space. */
.subject-card-row {
  position: relative;
  display: flex;
}
.subject-card-row .subject-card {
  width: 100%;
  padding-bottom: calc(56px + var(--space-3));
}
.subject-card-read {
  position: absolute;
  inset-inline-start: 1px;
  inset-inline-end: 1px;
  bottom: 1px;
  z-index: 1;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px);
  background: transparent;
  color: var(--subject-text, var(--color-primary-text));
  cursor: pointer;
}
.subject-card-read-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--subject-tint);
  color: var(--subject-text, var(--color-primary-text));
}
.subject-card-read:hover .subject-card-read-icon-box {
  box-shadow: 0 0 0 2px var(--subject-text, var(--color-primary-text));
}
.subject-card-read svg {
  width: 20px;
  height: 20px;
}
.subject-card-read:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: -3px;
}
/* The read zone sits on top of the card's lower edge, so it follows the
   card when the card lifts or presses. */
.subject-card-row:has(.subject-card:hover) .subject-card-read { transform: translateY(-3px); }
.subject-card-row:has(.subject-card:active) .subject-card-read { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .subject-card-row:has(.subject-card:hover) .subject-card-read,
  .subject-card-row:has(.subject-card:active) .subject-card-read { transform: none; }
}

/* PHONES: one column of horizontal cards -- seal, text, read column.
   The card stays display:flex (react_subject_selection_responsive pins it);
   the seal is lifted out of the flow to the card's top-left corner and the
   padding reserves its column, so no wrapper element is needed. */
@media (max-width: 719px) {
  .subject-card-row .subject-card {
    position: relative;
    padding-block: var(--space-4);
    padding-inline: calc(48px + 2 * var(--space-4)) calc(56px + var(--space-3));
  }
  .subject-card-media {
    position: absolute;
    inset-inline-start: var(--space-4);
    top: var(--space-4);
    margin: 0;
  }
  .subject-card-seal { width: 48px; height: 48px; border-radius: 14px; font-size: 1.375rem; }
  .subject-card-meta { padding-top: var(--space-2); }
  .subject-card-read {
    top: 1px;
    bottom: 1px;
    inset-inline-start: auto;
    inset-inline-end: 1px;
    width: 56px;
    height: auto;
    border-top: none;
    border-inline-start: 1px solid var(--color-border);
    border-radius: 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0;
  }
}

/* Module/topic browse (Phase D3 taxonomy) */
/* THE SECTION GAP IS NAMED, because the eyebrow/h1 pairing has to cancel it
   exactly -- see .view-eyebrow + h1 above. */
.view-module-browse {
  --nav-stack-gap: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--nav-stack-gap);
}
.module-section { display: flex; flex-direction: column; gap: var(--space-3); }

/* MODULE HEADING ROW (DRAGON-GATE-VISUAL-PRODUCT-2).
   The heading and its coverage now share one row. Before, the heading carried
   a border-bottom AND a full-width coverage bar was stacked directly beneath
   it -- two horizontal rules a few pixels apart, which read as a section
   divider rather than as progress, and put the measurement further from the
   thing it measures than from the thing below it. Screenshots at 375px made
   this unmistakable. One row, heading left, coverage right: the bar now sits
   beside what it describes and there is only one horizontal line in the
   composition. */
.module-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-2);
}
.module-heading {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-text);
  margin: 0;
  /* No border-bottom: the row owns the rule -- WHERE THERE IS A ROW. */
}
/* A REAL GRID, NOT A RAGGED WRAP. As a content-sized flex wrap the chips came
   out anywhere between 150px and 256px wide, so columns never aligned across
   rows, one long topic name pushed the next chip onto a new line and left a
   hole, and a syllabus of 30+ targets had no scan line anywhere. Equal tracks
   give the eye one edge to run down.
   The chips themselves stay `display: flex` -- that is asserted -- so only the
   container changes. */
.topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
}
.topic-chip {
  color: var(--color-text);   /* explicit: a <button> does not inherit color from body */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  /* The grid track owns the width now; a min-width here would fight it and
     reintroduce overflow at the narrow end. */
  min-width: 0;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  /* Same elevation reasoning as .subject-card above: in dark, --color-surface
     left every chip as a single 1px hairline on an identical ground, repeated
     across a wall of thirty. */
  background: var(--color-surface-elevated);
  cursor: pointer;
  text-align: start;
  font: inherit;
  /* Border and shadow only -- deliberately NOT background-color. Animating a
     control's fill makes its computed colour a function of TIME, which
     VISUAL-PRODUCT-4 established is both a real defect and a measurement trap. */
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
/* The chip is the most numerous control in the product and had the least
   feedback of any: one border colour, snapping, with no elevation change. This
   is the lift .react-option-btn already got in VISUAL-PRODUCT-4. */
.topic-chip:hover:not(.topic-chip--disabled) {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.topic-chip:focus-visible { border-color: var(--color-primary); }
.topic-chip:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
/* The primary tappable label on the browse screens was set at --text-sm, the
   token whose own note calls it "secondary text". The same class of control on
   the Practice screen (.react-option-btn, a full-width choice row at narrow
   widths -- which is exactly what a chip becomes at <= 480px) is --text-md. */
.topic-chip-name {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
}
/* The chip's second line. It carries the coverage fraction on an available
   chip and "Coming later" on an unavailable one, so both kinds of chip have
   the same two-line structure and the list keeps a single baseline rhythm
   instead of some chips being visibly taller than others. */
.topic-chip-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
/* PART OF THE CURRICULUM, NOT CURRENTLY AVAILABLE -- and quieter than the
   things you CAN open, which it was not. Measured against the page, the filled
   disabled chip scored 1.21:1 while a live chip scored 1.10:1: the unavailable
   state was literally the more prominent of the two, a wall of solid grey
   blocks out-shouting the outlined chips a student is meant to choose from.
   It now sits UNFILLED on the page ground, so it recedes behind every raised
   chip, and carries a dashed edge -- an outline of something not yet built.
   Style, not hue, so it survives greyscale; the word "Coming later" remains the
   primary carrier either way. */
.topic-chip--disabled {
  cursor: not-allowed;
  background: transparent;
  border-style: dashed;
  border-color: var(--color-border-strong);
  box-shadow: none;
}
.topic-chip--disabled .topic-chip-name,
.topic-chip--disabled .topic-chip-count { color: var(--color-disabled-text); }
.topic-chip--disabled:hover { border-color: var(--color-border); }

/* Narrow mobile: one full-width chip per row instead of a grid of small ones.
   `flex-direction: column` no longer applies now that .topic-list is a grid --
   the single-column track is what replaces it. */
@media (max-width: 480px) {
  .topic-list { grid-template-columns: 1fr; }
  .topic-chip { width: 100%; min-width: 0; }
}

/* Progress indicators (compact, server-authoritative) */
.progress-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-1);
}

/* Inside the module heading row the bar is a compact companion to the heading,
   not a full-bleed rule spanning the reading column. Capped so it cannot grow
   back into the divider it used to be mistaken for. */
/* The ready-state wrapper React renders between .react-content-nav and the
   module sections. Without this the sections had NO separation at all -- the
   column gap lives on the outer element and stopped at this div. Measured 0px
   between every section before the fix. */
.content-nav-body {
  --nav-stack-gap: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--nav-stack-gap);
}
/* Inside a section the heading and its chips belong together, so the internal
   gap must stay clearly SMALLER than the gap between sections. That ratio is
   what makes a wall of chips parse as groups instead of one long list. */
.content-nav-body .module-section { gap: var(--space-3); }

/* ProgressOverview.tsx -- the aggregated, read-only per-subject module
   breakdown reached from a toggle on Subject Select. Reuses
   .module-heading-row/.progress-indicator--module verbatim (the rules
   above), so a module row here looks identical to a module's own heading
   row on the browse screens; only the container layout below is new. */
/* NUBE-1: the toggle sits centred under the card row, as on the subjects
   board; the breakdown it opens still spans the full column. */
.progress-overview-toggle-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: var(--space-6);
}
.progress-overview-toggle-row > .progress-overview { align-self: stretch; }
.progress-overview-toggle-row > [data-react-progress-overview-toggle] {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
/* A chevron drawn with borders (the reading sections' own device): down
   while closed, up while open. */
.progress-overview-toggle-row > [data-react-progress-overview-toggle]::after {
  content: "";
  width: 7px;
  height: 7px;
  border-style: solid;
  border-color: currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.progress-overview-toggle-row > [data-react-progress-overview-toggle][aria-expanded="true"]::after {
  transform: translateY(2px) rotate(-135deg);
}
@media (max-width: 480px) {
  .progress-overview-toggle-row > [data-react-progress-overview-toggle] {
    align-self: stretch;
    justify-content: center;
  }
}
.progress-overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: var(--space-4);
}
.progress-overview-subject {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Subject heading and its own "show modules" toggle share one line -- the
   two are separate controls (heading navigates to the subject, toggle
   expands/collapses that subject's module rows below), not a single
   click target, so they need to sit side by side rather than stacked. */
.progress-overview-subject-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
/* Same quiet outline tier .btn-secondary already is (Dragon Orange text, no
   fill), sized down: five of these sit next to five subject headings, and
   at .btn-secondary's own 44px control height the toggle would out-rank the
   heading text it sits beside instead of reading as its minor companion. */
.progress-overview-subject-toggle {
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  flex: 0 0 auto;
  white-space: nowrap;
}

/* The subject heading is a real <button> inside its <h2> (heading semantics
   stay for screen-reader navigation-by-heading; the clickable target is the
   button inside it), styled to read as plain heading text until interacted
   with. */
.progress-overview-subject-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: start;
}
.progress-overview-subject-link:hover,
.progress-overview-subject-link:focus-visible {
  color: var(--color-primary-text);
  text-decoration: underline;
}
.progress-overview-subject-link:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Each module row is also a real <button> now (both it and the subject
   heading above call the same startSubject capability -- see
   ProgressOverview.tsx's own comment on why no finer-grained destination
   exists). border:none then re-declaring border-bottom resets the browser's
   default all-sides <button> border while keeping .module-heading-row's own
   single bottom rule intact. */
.progress-overview-module-row {
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: none;
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: start;
}
.progress-overview-module-row:hover,
.progress-overview-module-row:focus-visible {
  border-color: var(--color-primary);
}
.progress-overview-module-row:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* NUBE-1: each subject in the breakdown is its own card, in the same order
   and the same colours as the cards above it -- the subject's seal (since
   PREPPALS-1 the cards' tinted square) and its name in the subject's
   colour, the module toggle on the right, the module rows inside the card
   with their bars in the subject's mark. */
.progress-overview { gap: var(--space-3); }
.progress-overview-subject {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.progress-overview-subject .module-heading { font-size: 1.25rem; }
/* Inside the card there is less room than the bare row had: a toggle that
   no longer fits beside a long name ("Humanities Chinese", any Russian name)
   drops under it, still right-aligned, instead of pushing out of the card. */
.progress-overview-subject .progress-overview-subject-header { flex-wrap: wrap; }
.progress-overview-subject .progress-overview-subject-toggle { margin-inline-start: auto; }
@media (max-width: 480px) {
  .progress-overview-subject { padding: var(--space-3); }
}
.progress-overview-subject-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--subject-text, var(--color-text));
}
.progress-overview-subject-link:hover,
.progress-overview-subject-link:focus-visible { color: var(--subject-text, var(--color-primary-text)); }
.progress-overview-subject-link::before {
  content: var(--subject-seal) / "";
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--subject-tint);
  color: var(--subject-text);
  font-family: var(--font-cjk);
  font-size: 1rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.progress-overview-subject .progress-overview-module-row:last-child { border-bottom: none; }
.progress-overview-subject .progress-bar-fill--in_progress,
.progress-overview-subject .progress-bar-fill--complete { background: var(--subject-mark); }

/* A started bar always shows a nub. One answer in 187 is a real start but a
   sub-pixel fill, which read as "nothing yet" -- the text beside every bar
   still states the exact count. Only on the subject cards and this
   breakdown, where bars sit in a subject's colour on a card. */
.subject-card-row .progress-bar-fill--in_progress,
.progress-overview-subject .progress-bar-fill--in_progress { min-width: 8px; }

/* The module's coverage, as a number beside its heading. */
.module-coverage {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.module-heading-row .progress-indicator {
  width: auto;
  flex: 0 1 200px;
  margin-top: 0;
}
.progress-bar-track {
  flex: 1 1 auto;
  min-width: 40px;
  background: var(--color-track);   /* dedicated quiet track -- see --color-track */
  /* FE-1's --color-border-strong border is RETIRED here (VISUAL-QUALITY-1).
     It existed to rescue the extent of a track that shared --color-structure
     with the coordinate grid and so could not be tuned for its own job; the
     dedicated --color-track above does that job directly, at a value chosen
     for the pair a reader actually decodes (fill against track). Keeping the
     heavy border on top of it made the empty rail the loudest element in a
     subject card -- the "generic, unfinished" impression this batch exists to
     remove. FE-1's underlying finding is untouched and still recorded on
     --color-structure: one shared token could not serve both surfaces, which
     is exactly why there are now two. */
  border-radius: 999px;
  overflow: hidden;
}
/* display:block because a subject card's fill is a <span> (a <button> may
   only hold phrasing content), and an empty inline span takes no width or
   height at all -- the subject cards' fills never painted until NUBE-1
   caught it. The module screens' <div> fills are unaffected. */
.progress-bar-fill {
  display: block;
  height: 100%;
  background: var(--color-progress-fill);
  border-radius: 999px;
  transition: width 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .progress-bar-fill { transition: none; }
}
/* COVERAGE STATES (PROGRESS-ENDPOINT-HARDENING-1) -- the only fills a
   pre-submit surface may use.

   Colour was itself a leak channel here. The evidence-tier fills below encode
   accuracy, so a bar turning red (needs_review) or Gold (mastered) right after
   a submission announced how that submission went, without any correctness
   field being rendered as text. §14 of this batch's brief calls that out
   directly: a visible label can be dangerous even when the raw field is gone.

   Coverage states cannot do that. They depend only on how many distinct items
   have been attempted, so an in-progress bar looks identical whether every
   answer was right or every answer was wrong. Both use Dragon Orange -- the
   primary interaction colour -- because progress is progress; the bar's WIDTH
   carries how far along the student is, which is the only thing that is safe
   to say. */
.progress-bar-fill--in_progress { background: var(--color-progress-fill); }
.progress-bar-fill--complete { background: var(--color-progress-fill); }

/* Color is never the only signal -- every bar is always paired with
   .progress-text (fraction and/or status word). These status colors are a
   restrained accent on top of that, not a replacement for it.

   THE FIVE EVIDENCE-TIER FILLS BELOW ARE NO LONGER EMITTED BY ANY PRE-SUBMIT
   SCREEN. They are retained, not dead: they remain the correct visual language
   for an evidence tier, and a future post-submit surface with real server-side
   authorisation is the right consumer. tests/playwright/specs/
   dragon_gate_study_surface_responsive.spec.js exercises them on synthetic
   elements, so their contrast contract stays enforced meanwhile. */
.progress-bar-fill--not_started { background: var(--color-disabled-text); }
.progress-bar-fill--insufficient_data { background: var(--color-text-muted); }
.progress-bar-fill--developing { background: var(--color-progress-fill); }
.progress-bar-fill--needs_review { background: var(--color-incorrect-text); }
.progress-bar-fill--strong { background: var(--color-progress-fill-strong); }
/* DRAGON-GATE-FE-1: "mastered" is the one existing state that already MEANS
   an achievement -- Gold's reserved role from FE-0, not invented for this
   batch. Naturally rare (a student reaches it only after strong, sustained
   performance), so this does not make Gold common. */
.progress-bar-fill--mastered { background: var(--color-achievement); }

.progress-text {
  flex: 0 0 auto;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Per-level sizing, per the compact-by-level spec: subject gets the most
   detail, module the least, none ever a large card or chart. The topic/
   subtopic tiers this once also styled were legacy-only (only
   frontend/app.js's own progressMarkup() ever produced them, nested inside
   a .topic-chip) and were removed along with that renderer in Legacy
   Removal Phase 2 -- React's CoverageBar has never had a call site using
   either size. What's left is a two-level nudge, not the four-level
   micro-ramp this comment used to describe: levels are distinguished by
   the bar's own height (set inline per level) and by context, not by
   near-identical font sizes a reader cannot tell apart. */
.progress-indicator--subject { margin-top: var(--space-1); }
.progress-indicator--module { margin-top: var(--space-1); }

/* A MEASUREMENT, NOT A RULE ACROSS THE SCREEN. These bars ran the full width of
   whatever held them -- 577px x 4px on the subtopic screen, 454px x 5px inside a
   subject card -- which made them physically the largest elements on their
   screens while carrying the least information, and close enough to a horizontal
   divider (or an input underline) to be read as one. Capped, each becomes a
   compact meter sitting beside its own fraction.
   The cap is on the INDICATOR, not the fill: .progress-bar-fill keeps its
   inline percentage width, so React/legacy parity on style.width is untouched,
   and the bar stays well inside its card's bounds. */
.progress-indicator--module { max-width: 260px; }
.progress-indicator--subject { max-width: 320px; }

/* NUBE-1: inside a subject card the meter spans the card, is an 8px rail
   (NUBE-1's chunky 10px, thinned by PREPPALS-1), and fills in the subject's own mark colour (each >= 3:1 against
   --color-track, see the subject tokens). Coverage states only -- the label
   beside it still carries the state in words. */
.subject-card-row .progress-indicator--subject {
  align-self: stretch;
  max-width: none;
  margin-top: var(--space-2);
  /* The status line reads first and the rail runs beneath it, as on the
     subjects board. column-reverse, because the DOM keeps the rail first
     (the same markup the module screens use); neither part is focusable,
     so no tab or reading order depends on the swap. */
  flex-direction: column-reverse;
  align-items: stretch;
  gap: var(--space-2);
}
.subject-card-row .progress-indicator--subject .progress-bar-track { height: 8px; }
.subject-card-row .progress-indicator--subject .progress-text {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: normal;
  font-weight: var(--weight-semibold);
}
/* A status dot in the subject's mark colour; hollow until work starts. */
.subject-card-row .progress-indicator--subject .progress-text::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--subject-mark);
}
.subject-card-row .progress-indicator--subject:has(.progress-bar-fill--not_started) .progress-text::before {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--color-border-strong);
}
/* Only the COVERAGE fills take the subject's hue. Any other fill state keeps
   its own colour -- Gold for the achievement tier in particular must stay
   distinct from ordinary progress (study-surface spec, dE2000 >= 10). */
.subject-card-row .progress-bar-fill--in_progress,
.subject-card-row .progress-bar-fill--complete { background: var(--subject-mark); }

/* Keyboard/focus: progress bars are decorative (role=progressbar, not
   focusable), so no separate focus style is needed here -- the parent
   .subject-card / .topic-chip already carries its own visible focus ring,
   confirmed elsewhere in this file. */

/* Question */

/* DRAGON-GATE-FE-1: the question surface now reads as a distinct card,
   reusing the exact border/background pattern the renderer widgets already
   use (.ds-widget, .cartesian-widget, etc. -- border: 1px solid
   --color-border; background: --color-surface) so a figure-bearing question
   composes visually with its own figure rather than introducing a second
   container language. --color-shadow was declared by FE-0 and had no
   consumer; this is its first real use, and the only one in this batch --
   one flat elevation, not a shadow system. */
.view-question {
  /* THE CARD'S OWN PADDING IS NOW A TOKEN, because .item-figure's bleed is
     derived from it (see .item-figure below). They were two hand-kept-in-sync
     literals; the figure's width contract with backend/static_assets.py's
     MOBILE_ASSET_WIDTH_PX depends on them never drifting apart, so the
     coupling is now expressed rather than commented. */
  --question-pad: var(--space-5);

  /* SURFACE-ELEVATED, NOT SURFACE (DRAGON-GATE-VISUAL-PRODUCT-4).
     Identical to --color-surface in light (both #FFFFFF), so nothing changes
     there. In DARK it is the difference between a card and no card at all:
     --color-surface #19201D on --color-bg #141A18 is 1.06:1, its --color-border
     is 1.18:1 on top of that, and --color-shadow is alpha-black painting onto a
     near-black page -- all three carriers of "this is a raised surface" collapse
     at once, and the question card simply stopped existing in dark mode.
     --color-surface-elevated was declared and contrast-verified for exactly this
     job (see the token block) and had no consumer. */
  background: var(--color-surface-elevated);
  /* PREPPALS-1: a 1px card edge and a soft shadow, the reference's card.
     The figure contract still holds: at 375px the static figure is 375 -
     2x16 column - 2x1 border = 341px, inside MOBILE_ASSET_WIDTH_PX's 343 +/-
     8px band. */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--question-pad);
  box-shadow: var(--shadow-md);

  /* ONE ROW FOR "WHERE AM I", then the question. The subject and the
     position counter are both context, and stacking them cost two lines of
     small type above the stem -- metadata out-ranking the thing it labels.
     Grid rather than a new wrapper element: the child ORDER of .view-question
     is asserted by the jsdom suite (figure before .react-result-section) and
     is Question.tsx/Feedback.tsx's own sibling render order (Practice.tsx),
     so the DOM stays in the same shape this rule was written for. */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: var(--space-2);
  align-items: baseline;
}
/* Everything except the context labels spans the whole card. DIFFICULTY-1
   added the third: the subject, the question's level, the counter. */
.view-question > * { grid-column: 1 / -1; }

/* A small, deliberate, RECURRING Cinnabar touchpoint -- text only, no fill,
   no border-as-surface. Every FE-0 pale Cinnabar tint measured
   perceptually identical to the error tint (see 62_brand_tokens.test.js),
   so brand Cinnabar in this batch is only ever a line or text colour, never
   an area. This is the first thing a student reads on every question. */
/* Structurally the page's h1 so the heading outline starts at level 1 on the
   most-used screen; visually a quiet label, because the stem is the hero here
   and a banner-sized subject name would compete with it. */
.question-subject {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);       /* a label, though structurally the page's h1 */
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: 0;
  color: var(--color-text);
  margin: 0;
}
/* NUBE-1: the subject's seal before its name, from the column's
   data-subject-tone (Practice.tsx) -- since PREPPALS-1 the subject cards'
   tinted square. Generated content with empty alternative text: decoration,
   never part of the heading's text or accessible name. */
.question-subject::before {
  content: var(--subject-seal);
  content: var(--subject-seal) / "";
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--subject-tint);
  color: var(--subject-text);
  font-family: var(--font-cjk);
  font-size: 0.875rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}

/* POSITION, NOT PERFORMANCE. This is the only progress signal on the screen a
   student spends the session in, and it is deliberately coverage-only: an
   index over a total, never accuracy, never mastery (see the pre-submit
   secrecy boundary in backend/db.py). It used to be uppercase bold Imperial
   Green -- the loudest text in the context block and louder than the h1 it sat
   under. It now reads as what it is: a quiet, tabular counter, aligned to the
   opposite end of the same line as the subject. */
.question-meta {
  grid-column: 3;
  justify-self: end;
  align-self: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  margin: 0;
  padding: 2px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}
/* DIFFICULTY-1: the question's level, as quiet as the counter beside it --
   its name, and one to three dots for a glance. On a phone it takes its own
   line under the subject, so the subject's name is never squeezed. */
.question-difficulty {
  grid-column: 2;
  justify-self: end;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.question-difficulty-dots { display: inline-flex; gap: 3px; }
.question-difficulty-dots > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border-strong);
}
.question-difficulty-dots > span[data-on="true"] { background: var(--color-accent-text); }
@media (max-width: 479px) {
  .question-difficulty {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    margin-top: var(--space-2);
  }
}

/* THE STEM IS THE HERO OF THIS SCREEN AND NOW OUT-RANKS EVERYTHING ON IT.
   At 1.1rem/400 it was the THIRD loudest text on the card, beaten by the
   "Explanation" h2 (1.25rem/600) and the result banner (1.15rem/700) -- the
   question ranked below its own feedback. */
.question-stem {
  font-family: var(--font-sans);
  font-size: calc(1.3125rem * var(--text-scale, 1));
  font-weight: var(--weight-regular);
  line-height: 1.5;
  color: var(--color-text);
  margin: var(--space-4) 0 var(--space-5);
  /* authored paragraph/line breaks in stems (reading passages, frequency tables) must survive */
  white-space: pre-line;
}

.options-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
/* Two columns, not one wrapping run: the label ("A."/"B."/...) sits in its
   own fixed-width column so a wrapped second line of prose aligns under the
   FIRST WORD of the answer, never back under the letter -- a hanging
   indent, not inline text that happens to start with a bold letter.
   align-items: center (not flex-start) centers the letter on the FULL
   height of the wrapped prose beside it, not just its own first line.
   flex: 1 on .option-text is what leaves .option-radio a fixed-width slot
   on the right instead of being pushed off by long option text. */
.option-text {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
/* NUBE-1: the positional letter sits in a round "bubble"; selecting and
   grading fill the bubble (see the .react-option-btn states below). */
.option-label {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-strong);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  background: var(--color-surface-elevated);
}
/* overflow-x: auto lives here, not on .option-text -- a long KaTeX formula
   must scroll only the PROSE column, not drag the letter or the radio
   indicator sideways with it.

   overflow-y: hidden IS REQUIRED HERE, not decorative -- per the CSS
   Overflow spec, a non-visible overflow-x with an unset (default: visible)
   overflow-y computes overflow-y to auto too. KaTeX's own fraction/exponent
   markup routinely renders 4-6px taller than the row's line-height even
   when nothing actually needs to scroll, so without this every option on
   every math question showed a permanent, unnecessary vertical scrollbar
   (measured: scrollHeight 30px vs. clientHeight 25px on a plain \frac{1}{4}).
   Vertical clipping from this is a non-issue in practice -- KaTeX's own
   rendered glyphs sit well inside that few-px margin. */
.option-body {
  flex: 1;
  min-width: 0;
  font-family: var(--font-sans);
  font-size: calc(1.125rem * var(--text-scale, 1));
  overflow-x: auto;
  overflow-y: hidden;
}
/* A radio LOOK, not radio semantics -- this list is still role="group" with
   aria-pressed per button (Question.tsx): choosing is provisional and
   freely revisable, committed only by a separate Submit, which real
   radio-group semantics do not model. Purely decorative
   (aria-hidden), so it carries no text of its own -- the existing
   aria-pressed/aria-label pair, unchanged by this batch, is what a screen
   reader actually uses to know which option is selected. */
/* The radio LOOK is retired by NUBE-1: the letter bubble now carries the
   selection (it fills), so a second indicator on the right only repeated it.
   The element stays (decorative, aria-hidden) and is simply not painted. */
.option-radio { display: none; }

/* Post-submission text markers. Colour is never the only signal: the chosen
   option also gets a glyph here and an aria-label in Question.tsx. The state
   COLOURS live with .react-option-btn below, compounded with it -- written
   up here as bare classes they lost to .react-option-btn's own later
   background/border on the same element and never painted. */
.option-was-correct .option-body::after,
.option-is-correct:not(.option-was-correct) .option-body::after {
  content: " ✓";
  font-weight: var(--weight-bold);
}
.option-was-incorrect .option-body::after {
  content: " ✗";
  font-weight: var(--weight-bold);
}

/* Visual resources (figure/graph/table/widget) attached to an item. Sits
   between the stem and the options, per the approved layout order. */
.item-figure {
  /* DRAGON-GATE-FE-1: bleeds to the card's edges rather than sitting inset
     with the card's own padding. NOT cosmetic -- .view-question's 20px
     padding would otherwise shrink every figure's available width by 40px,
     silently invalidating backend/static_assets.py's MOBILE_ASSET_WIDTH_PX
     (343, derived from the width a figure had BEFORE this card existed --
     see the derivation comment in
     tests/playwright/specs/responsive_visual_contract.spec.js, which reads
     that constant out of the backend specifically to catch exactly this).
     -20px cancels the card's own padding value; the two are coupled on
     purpose and must change together if either does. */
  margin: 0 calc(-1 * var(--question-pad)) var(--space-5);
  /* VERTICAL PADDING ONLY. Horizontal padding here narrows the figure itself,
     which is the one dimension this element exists to protect: 12px a side took
     the mobile static asset from 341px to 317px and broke
     backend/static_assets.py's MOBILE_ASSET_WIDTH_PX = 343 contract (asserted
     within +/-8px by specs/responsive_visual_contract.spec.js). The plate is
     full-bleed by design; only its top and bottom are chrome. */
  padding: var(--space-4) 0;
  text-align: center;

  /* A RECESSED PLATE, NOT A FLOATING WIDGET (VISUAL-PRODUCT-4). Each renderer
     shell already draws its own surface + border + radius, and those are the
     SAME tokens the question card uses -- so a figure rendered as a white card
     sitting on a white card, told apart only by a 1.25:1 hairline (1.18:1 in
     dark). Recessing the full-bleed band instead, and flattening the shell
     into it just below, gives the diagram ONE surface that reads as part of
     the question rather than an embedded third-party widget.
     RENDERER OUTPUT IS UNTOUCHED: this is the figure's container, never the
     SVG -- all 82 renderer snapshots stay byte-identical. */
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* Flatten the six renderer shells INSIDE the plate only. Scoped, so a widget
   rendered anywhere else keeps its own container. Declares neither fill nor
   stroke, so backend/verify_step1.py section 72.2's visibility pairing is
   unaffected, and it adds no *-widget-canvas rule, so section 70.2 still reads
   the real canvas definitions. */
.item-figure .ds-widget,
.item-figure .cartesian-widget,
.item-figure .optics-widget,
.item-figure .number-line-widget,
.item-figure .solid-geometry-widget,
.item-figure .circuit-widget {
  background: transparent;
  border-color: transparent;
  padding: 0;
  margin-bottom: 0;
}
.item-figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.item-figure-fallback {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 16px;
}

/* Double-slit interference widget (double_slit_interference_v1). Uses only
   existing design tokens -- no new colors introduced -- to stay consistent
   with the platform's calm, academic visual direction (no decoration,
   no color-only meaning: the SVG fringes are shape+position, not a
   color-coded "correct answer" indicator). */
.ds-widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 16px;
  margin-bottom: 4px;
}
.ds-widget-canvas {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 12px;
}
.ds-widget-plane {
  stroke: var(--color-border-strong);
  stroke-width: 1.5;
}
.ds-widget-ray {
  stroke: var(--color-text-muted);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}
.ds-widget-fringe {
  fill: var(--color-figure-accent);
}
.ds-widget-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ds-widget-slider-row {
  display: grid;
  grid-template-columns: minmax(100px, auto) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-text);
}
.ds-widget-slider {
  width: 100%;
  accent-color: var(--color-figure-accent);
}
.ds-widget-slider-value {
  min-width: 56px;
  text-align: end;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.ds-widget-live-desc {
  /* Content only; visual layout handled by .sr-only in the shared rule. */
}

/* cartesian_plane_v1 -- uses the same existing design tokens as .ds-widget
   above, no new colors introduced. Region shading uses the primary-subtle
   background token (already used elsewhere for non-answer-bearing
   emphasis) at reduced opacity, not a new hue. */
.cartesian-widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 16px;
  margin-bottom: 4px;
}
.cartesian-widget-canvas {
  width: 100%;
  height: auto;
  display: block;
}
.cartesian-widget-grid {
  stroke: var(--color-structure);   /* information-bearing, not a divider -- see the token */
  stroke-width: 0.5;
}
.cartesian-widget-axis {
  stroke: var(--color-border-strong);
  stroke-width: 1.5;
}
.cartesian-widget-point {
  fill: var(--color-figure-accent);
}
.cartesian-widget-line,
.cartesian-widget-function {
  stroke: var(--color-figure-accent);
  stroke-width: 2;
  fill: none;
}
.cartesian-widget-segment {
  stroke: var(--color-text);
  stroke-width: 2;
}
.cartesian-widget-vector {
  stroke: var(--color-figure-accent-deep);
  stroke-width: 2;
}
.cartesian-widget-arrowhead {
  fill: var(--color-figure-accent-deep);
}
.cartesian-widget-circle {
  stroke: var(--color-figure-accent);
  stroke-width: 2;
  fill: none;
}
.cartesian-widget-region,
.cartesian-widget-region-boundary {
  stroke: var(--color-figure-accent);
  stroke-width: 1.5;
}
.cartesian-widget-region {
  fill: var(--color-figure-accent-subtle);
  opacity: 0.7;
  stroke: none;
}
.cartesian-widget-label {
  fill: var(--color-text);
  font-size: 9px;
}
.cartesian-widget-tick-label {
  fill: var(--color-text-muted);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.cartesian-widget-axis-title {
  fill: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.cartesian-widget-dashed {
  stroke-dasharray: 5 4;
}

/* geometrical_optics_v1 -- same existing design tokens as the other two
   widgets above, no new colors introduced. .optics-widget-virtual is the
   one visually distinct addition this renderer needs (a dashed stroke to
   distinguish a real ray's backward extension, used only to construct a
   virtual image, from a real light path) -- achieved via stroke-dasharray
   on the existing ray color token, not a new hue. */
.optics-widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 16px;
  margin-bottom: 4px;
}
.optics-widget-canvas {
  width: 100%;
  height: auto;
  display: block;
}
.optics-widget-axis {
  stroke: var(--color-border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 2;
}
.optics-widget-device {
  stroke: var(--color-text);
  stroke-width: 2;
  fill: none;
}
.optics-widget-device-arrow {
  stroke: var(--color-text);
  stroke-width: 2;
  fill: none;
}
.optics-widget-focus {
  fill: var(--color-figure-accent);
}
.optics-widget-center-of-curvature {
  fill: var(--color-figure-accent-deep);
}
.optics-widget-object {
  stroke: var(--color-figure-accent);
  stroke-width: 2;
}
.optics-widget-object-arrowhead {
  fill: var(--color-figure-accent);
}
.optics-widget-image {
  stroke: var(--color-figure-accent-deep);
  stroke-width: 2;
}
.optics-widget-image-arrowhead {
  fill: var(--color-figure-accent-deep);
}
.optics-widget-ray {
  stroke: var(--color-text-muted);
  stroke-width: 1.25;
}
.optics-widget-virtual {
  stroke-dasharray: 4 3;
}
.optics-widget-label {
  fill: var(--color-text);
  font-size: 9px;
}

/* number_line_v1 -- same existing design tokens as the widgets above, no
   new colors introduced. The solution segment/ray is drawn thicker and in
   the primary-text color, directly on top of the thinner, muted base axis
   line beneath it -- the standard textbook convention (not offset above or
   below the axis). Open vs. closed circles reuse cartesian_plane_v1's own
   filled/hollow-circle convention (fill vs. no-fill) for visual
   consistency across the platform's three-plus-this-one visual families. */
.number-line-widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 16px;
  margin-bottom: 4px;
}
.number-line-widget-canvas {
  width: 100%;
  height: auto;
  display: block;
}
.number-line-widget-axis {
  stroke: var(--color-border-strong);
  stroke-width: 1.5;
}
.number-line-widget-tick {
  stroke: var(--color-border-strong);
  stroke-width: 1;
}
.number-line-widget-tick-label {
  fill: var(--color-text-muted);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.number-line-widget-segment {
  stroke: var(--color-figure-accent);
  stroke-width: 4;
}
.number-line-widget-arrowhead {
  fill: var(--color-figure-accent);
}
.number-line-widget-circle-open {
  stroke: var(--color-figure-accent);
  stroke-width: 2;
  fill: var(--color-surface);
}
.number-line-widget-circle-closed {
  stroke: var(--color-figure-accent);
  stroke-width: 2;
  fill: var(--color-figure-accent);
}
.number-line-widget-label {
  fill: var(--color-text);
  font-size: 9px;
}

/* solid_geometry_v1 (SG-1) -- same existing design tokens as the widgets
   above, no new colors introduced. Hidden edges reuse cartesian_plane_v1's
   own dashed stroke pattern (5 4) for visual consistency across renderers.
   Deliberately plain/academic: no gradient, no shadow, no per-face fill --
   this is a wireframe diagram, not an illustration. */
.solid-geometry-widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 16px;
  margin-bottom: 4px;
}
.solid-geometry-widget-canvas {
  width: 100%;
  height: auto;
  display: block;
}
.solid-geometry-widget-edge-visible {
  stroke: var(--color-text);
  stroke-width: 1.75;
}
.solid-geometry-widget-edge-hidden {
  stroke: var(--color-figure-muted);
  stroke-width: 1.25;
  stroke-dasharray: 5 4;
}
.solid-geometry-widget-vertex {
  fill: var(--color-figure-accent);
}
.solid-geometry-widget-vertex-label {
  fill: var(--color-text);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.solid-geometry-widget-dimension-label {
  fill: var(--color-text-muted);
  font-size: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* SG-2A section_points (added 2026-08-13) -- a SQUARE marker, deliberately
   distinct in shape from the round .solid-geometry-widget-vertex dots, so
   "a given point defining the cutting plane" reads as visually different
   from "a labeled corner of the solid". Uses --color-text (the same
   neutral ink-color token as .solid-geometry-widget-edge-visible), not
   --color-primary or any correct/incorrect token -- a marker for GIVEN
   information must never look like an answer highlight. */
.solid-geometry-widget-section-point {
  fill: var(--color-text);
  stroke: var(--color-surface);
  stroke-width: 1;
}
.solid-geometry-widget-section-point-label {
  fill: var(--color-text);
  font-size: 11px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* SG-2B-2 (added 2026-08-14) -- the RESOLVED cross-section polygon,
   post-submit only. Reuses cartesian_plane_v1's own fill/outline
   convention for a derived region (.cartesian-widget-region /
   -region-boundary): --color-primary-subtle-bg / --color-primary-text.
   The section-point markers above deliberately AVOID these same tokens
   ("a marker for GIVEN information must never look like an answer
   highlight") -- the resolved section IS the answer, so the inverse
   applies here, on purpose. Fill opacity kept low enough that the
   wireframe underneath stays legible through it. */
.solid-geometry-widget-resolved-section-fill {
  fill: var(--color-figure-accent-subtle);
  opacity: 0.7;
  stroke: none;
}
.solid-geometry-widget-resolved-section-outline {
  stroke: var(--color-figure-accent);
  stroke-width: 1.75;
  fill: none;
}
.solid-geometry-widget-resolved-section-vertex {
  fill: var(--color-figure-accent);
}

/* Visually hidden but present for assistive tech — used for figure alt text,
   which is exposed structurally via <figcaption> rather than only a
   color/graphic cue. */
.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;
}

.next-btn, .back-btn, .retry-btn {
  display: inline-block;
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-md);
  border: none;
  /* PREPPALS-1: every primary action is a pill, as on the reference. */
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.next-btn, .back-btn, .retry-btn {
  /* The gradient is painted OVER the solid board Cinnabar, never instead of
     it: the solid colour is what a contrast check, a forced-colours engine or
     a printer sees (see --gradient-primary). */
  background-color: var(--color-primary);
  background-image: var(--gradient-primary);
  /* NOT #fff. See --color-on-primary in the token block: the label follows
     the fill through its own token, whatever a scheme makes of either. */
  color: var(--color-on-primary);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  /* PREPPALS-1: the pill glows in its own colour instead of resting on
     NUBE-1's tactile lip. */
  box-shadow: var(--shadow-primary);
}
/* THE PRIMARY ACTION LOOKED EXACTLY LIKE THE TERTIARY ONES. Submit, Next,
   Back and Retry shared one declaration block, so the single most important
   control on the screen was styled identically to the Retry button in an error
   box. Submit and Next are the forward path and now carry weight and a floor
   width; Back/Retry keep the base treatment. */
.next-btn {
  min-width: 9.5rem;
}
/* transform/box-shadow only, never background-color: the specs sample a
   control's colour and must not catch it mid-transition. */
.next-btn, .back-btn, .retry-btn {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

/* ---------------------------------------------------------------------------
   SECONDARY BUTTON TIER (DRAGON-GATE-VISUAL-PRODUCT-2)

   Until now the system had exactly two states: "Dragon Orange filled" and "not
   a button". So Submit, Next question, Retry and Practice-all-topics were the
   same object visually -- a one-tap acknowledgement, an error recovery, and a
   commitment to a whole subject's worth of study, all shouting equally. With
   only one loud style available, each screen ended up attaching its loudest
   control to whatever happened to be a button rather than to the thing the
   screen is for.

   This tier is the quiet one: same geometry, same tokens, no fill. It carries
   weight through the border and an Orange label, so a screen can have one
   filled action and several real-but-secondary ones without inventing a colour.
   --------------------------------------------------------------------------- */
.btn-secondary {
  display: inline-block;
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  /* PREPPALS-1: a white pill with a 1px boundary at 3:1 and a soft contact
     shadow, instead of an outline with an Orange label. Ink text, so the one
     filled Cinnabar action on a screen is still the only Cinnabar thing to
     press. */
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.btn-secondary:hover {
  border-color: var(--color-text);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn-secondary:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.next-btn:hover,
.back-btn:hover,
.retry-btn:hover {
  background-color: var(--color-primary-hover);
  background-image: var(--gradient-primary-hover);
  transform: translateY(-1px);
}
.next-btn:active,
.back-btn:active,
.retry-btn:active {
  background-color: var(--color-primary-hover);
  background-image: var(--gradient-primary-hover);
  transform: translateY(0);
  box-shadow: 0 4px 10px -6px var(--color-primary-glow);
}
/* Reduced motion keeps the lift and the press as a colour/shadow change
   with no travel. */
@media (prefers-reduced-motion: reduce) {
  .next-btn:hover, .back-btn:hover, .retry-btn:hover,
  .next-btn:active, .back-btn:active, .retry-btn:active,
  .btn-secondary:hover, .btn-secondary:active { transform: none; }
}

/* "Next question" MOVED FROM CINNABAR TO THE PRIMARY FAMILY (VISUAL-QUALITY-1).
   FE-1 made it a deliberate secondary CTA because Cinnabar was then the only
   accent available for it; Cinnabar is now the deep member of the Orange
   family (see Tier 2), so leaving this button on --color-accent would have
   quietly turned the primary forward action GREEN -- the exact inversion this
   batch exists to undo. It is the principal forward affordance on the feedback
   screen and now says so.
   FE-1's actual safety argument is unchanged and still holds: this button
   appears after EVERY graded question, correct or incorrect, and the same
   control on both paths is what keeps it from ever reading as "this means
   wrong". It is now also the same colour as Submit, which never competes with
   it -- Submit is disabled by the time Next exists. */

.next-btn:focus-visible,
.back-btn:focus-visible,
.retry-btn:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* Feedback */
/* Loud enough to answer "did I get it right" at a glance, quiet enough not to
   out-rank the question itself -- it was 1.15rem/700 against a 1.1rem/400 stem.
   The rail is currentColor, so it is the correct/incorrect text colour without
   a new token, and it gives the banner an edge instead of relying on fill
   alone. */
.result-banner {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 84px;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: 1.625rem;
  /* room on the left for the companion's portrait (::before) */
  padding-block: var(--space-3);
  padding-inline: calc(52px + 2 * var(--space-4)) var(--space-4);
  border: 2px solid currentColor;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.result-correct { background: var(--color-correct-bg); color: var(--color-correct-text); }
.result-incorrect { background: var(--color-incorrect-bg); color: var(--color-incorrect-text); }
/* THE VERDICT SEAL (NUBE-1, after the "Pergamino" direction): a square
   stamp in the verdict's own colour, pressed slightly askew -- 错 on a wrong
   answer, 对 on a right one -- the same CJK seal device as the subject badges
   and header pills. Generated content with EMPTY alternative text: the
   banner's text stays exactly "Correct"/"Incorrect" (the jsdom suite reads
   it) and assistive technology announces nothing extra. The mascot is
   deliberately NOT here; the product owner keeps it to the subject screen. */
.result-banner::before {
  position: absolute;
  inset-inline-start: var(--space-4);
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px var(--color-surface-elevated), inset 0 0 0 4px currentColor;
  background: var(--color-surface-elevated);
  font-family: var(--font-cjk);
  font-size: 1.75rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
  transform: rotate(-4deg);
}
.result-correct::before { content: "对"; content: "对" / ""; }
.result-incorrect::before { content: "错"; content: "错" / ""; }
@media (prefers-reduced-motion: no-preference) {
  .result-banner::before { animation: seal-press 220ms cubic-bezier(.34, 1.56, .64, 1); }
}
@keyframes seal-press {
  from { transform: rotate(-4deg) scale(1.25); opacity: 0; }
  to { transform: rotate(-4deg) scale(1); opacity: 1; }
}

/* On a wrong answer the correct-answer line completes the same verdict card:
   the banner's lower corners square off and the line continues its tint and
   edge beneath it. */
.correct-answer-line { font-weight: var(--weight-semibold); margin-bottom: var(--space-3); font-size: calc(1em * var(--text-scale, 1)); }
/* REVIEW-TOPIC-1: the question's topic reading, in a new tab, just above
   Next question. */
.review-topic { margin: 0 0 var(--space-4); }
.review-topic-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  color: var(--color-primary-text);
  font-weight: var(--weight-semibold);
  text-underline-offset: 3px;
}
.review-topic-link::after {
  content: "↗";
  content: "↗" / "";
  text-decoration: none;
  display: inline-block;
}
.review-topic-link:hover { text-decoration-thickness: 2px; }
.review-topic-link:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
.result-banner.result-incorrect:has(+ .correct-answer-line) {
  margin-bottom: 0;
  border-bottom: none;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}
.result-incorrect + .correct-answer-line {
  margin-top: -1px;          /* overlaps the banner by a pixel: no sub-pixel seam between the two tints */
  padding-block: 0 var(--space-4);
  padding-inline: calc(52px + 2 * var(--space-4)) var(--space-4);
  background: var(--color-incorrect-bg);
  color: var(--color-text);
  border: 2px solid var(--color-incorrect-text);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.explanation-language-notice {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}
/* Academic prose, not UI copy: it gets the looser measure-appropriate leading
   the body default (1.5) never gave it. */
.explanation-text {
  margin-bottom: var(--space-5);
  line-height: var(--leading-normal);
  font-family: var(--font-sans);
  font-size: calc(1.0625rem * var(--text-scale, 1));
}

/* Structured explanation sections (EXPLANATION-UX-1, 2026-08-14; restyled by
   DRAGON-GATE-NUBE-1 after the "Pergamino" direction, which the product owner
   picked for this block on 2026-10-08). Presentation only -- Feedback.tsx's
   parseExplanationSections splits the already-resolved explanation; this file
   only styles the result. A block with no content is never rendered, so
   nothing here has to hide an empty section.

   MARGIN NOTES. Each section's label is a small uppercase note in a left
   margin column, right-aligned, beside the first line of its prose; the
   prose runs in the column next to it, like annotations in a well-set study
   book. TEXT, not colour, is the primary signal: every section is named by
   its own visible label (colour only differs per kind -- Gold for the key
   idea, Ink for data and result, muted for the working, the lacquer red for
   the common mistake). Only Common mistake is boxed: a tint and a red rule.
   LACA-1: data and result were Jade, the secondary; the secondary became the
   deep Gold the key idea already wears, so the facts take the palette's ink
   and the four kinds keep four colours.
   Below 600px the label sits above its text. Sections still stack in one
   column (the structured-explanation spec measures that). */
.explanation-section {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  column-gap: 1.75rem;
  row-gap: var(--space-3);
  align-items: start;
  margin-bottom: var(--space-6);
}
.explanation-section:last-child { margin-bottom: 0; }
.explanation-section-heading {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  text-align: end;
  margin: 0;
  padding-top: 0.4em;          /* lines the label up with the prose's first line */
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--color-text-muted);
}
.explanation-section-body {
  grid-column: 2;
  margin: 0;
  line-height: 1.65;
}
.explanation-section--idea .explanation-section-heading { color: var(--color-achievement-text); }
.explanation-section--data .explanation-section-heading,
.explanation-section--result .explanation-section-heading { color: var(--color-text); }
.explanation-section--calc .explanation-section-heading { color: var(--color-text-muted); }
.explanation-section--error .explanation-section-heading { color: var(--color-primary-text); }
/* The one boxed note. Each paragraph of it carries the tint and the rule;
   consecutive paragraphs join into one box. */
.explanation-section--error .explanation-section-body {
  background: var(--color-primary-subtle-bg);
  border-inline-start: 4px solid var(--color-primary);
  padding: var(--space-3) var(--space-4);
}
.explanation-section--error .explanation-section-body:first-of-type {
  border-start-end-radius: var(--radius-sm);
}
.explanation-section--error .explanation-section-body:last-child {
  border-end-end-radius: var(--radius-sm);
}
.explanation-section--error .explanation-section-body + .explanation-section-body {
  margin-top: calc(-1 * var(--space-3));    /* cancels the row gap: one box */
  padding-top: 0;
}
.explanation-section--error .explanation-section-heading { padding-top: calc(var(--space-3) + 0.4em); }
@media (max-width: 599px) {
  .explanation-section {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-2);
  }
  .explanation-section-heading,
  .explanation-section--error .explanation-section-heading {
    justify-self: start;
    text-align: start;
    padding-top: 0;
  }
  .explanation-section-body { grid-column: 1; }
}

/* "Next question" closes the explanation from its right edge, the reading
   direction's end, with an arrow that is decoration only (empty alternative
   text; the button's text stays exactly "Next question"). */
.react-result-section .next-btn {
  display: block;
  margin-block: var(--space-6) 0;
  margin-inline: auto 0;
}
.react-result-section .next-btn::after {
  content: " →";
  content: " →" / "";
}
/* SIMILAR-ITEMS-1: under a wrong answer, "Practise 3 similar questions"
   beside "Next question" -- the quiet tier, so Next stays the one filled
   action and still closes the explanation at the reading direction's end.
   On a phone the two wrap, each whole. */
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.react-result-section .feedback-actions .next-btn { margin: 0; }
.similar-btn { min-height: 48px; max-width: 100%; }
/* The mark on a similar question, on its own line under the subject's row:
   as quiet as the counter, in the accent text colour of the level's dots. */
.question-similar {
  justify-self: start;
  margin: var(--space-2) 0 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  color: var(--color-accent-text);
}

/* PRACTICE AIDS (piece 3f, practiceAids.tsx). ANSWER-KEYS-1: the keys,
   said once under the options -- only where there is a mouse and a
   keyboard to use them. */
.answer-keys-hint {
  margin: calc(-1 * var(--space-3)) 0 var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.mock-exam-question .answer-keys-hint { margin: 0; }
@media (hover: none), (pointer: coarse) {
  .answer-keys-hint { display: none; }
}
/* CLOCK-HIDE-1: "Hide the clock" / "Show the clock", a quiet link-like
   button beside the clock; the clock itself is [hidden] meanwhile. */
.clock-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.clock-toggle:hover { color: var(--color-text); }
.clock-toggle:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.exam-clock-group { margin-inline-start: auto; display: inline-flex; align-items: center; gap: var(--space-2); }
.exam-clock-group .exam-clock { margin-inline-start: 0; }

/* HIGHLIGHT-1, NOTES-1 (piece 3f, annotations.tsx). A highlight is the brand
   gold with the ink on it, as a marker would draw it (7.84:1 light, 9.50:1
   dark, the tokens' own figures), painted by the browser's Custom Highlight
   API over the stem without touching its DOM. Under the stem, three quiet
   44px buttons; the notes' box opens under them. */
::highlight(dg-highlight) {
  background-color: var(--color-achievement);
  color: var(--color-on-achievement);
}
.annotate { margin: calc(-1 * var(--space-3)) 0 var(--space-4); }
.mock-exam-question .annotate { margin: 0; }
.annotate-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.annotate-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
@media (hover: hover) { .annotate-btn:hover { border-color: var(--color-text); } }
.annotate-btn:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.annotate-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--color-text); border-color: var(--color-text); }
.annotate-btn[data-has-note="true"]::after {
  content: "•";
  content: "•" / "";
  color: var(--color-achievement-text);
}
.annotate-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--color-achievement);
}
.annotate-hint { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.notes-panel { margin-top: var(--space-3); }
.notes-panel[hidden] { display: none; }
.notes-label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.notes-text {
  box-sizing: border-box;
  width: 100%;
  min-height: 5.5rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  resize: vertical;
}
.notes-text:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }

/* PREVIEW-1 (piece 3f, mockPreview.tsx): the hub's offer, a card like the
   free diagnostic's with a button per subject; in the sitting, "No time
   limit" where the clock would be; and the end of the preview. */
.mock-preview {
  max-width: 44rem;
  margin: 0 auto var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
}
.mock-preview h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-display);
}
.mock-preview-body { margin: 0 0 var(--space-4); color: var(--color-text-muted); line-height: var(--leading-normal); }
.mock-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: var(--space-2);
}
.mock-preview-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
}
.mock-preview-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-inline-start: var(--space-3);
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.mock-preview-end h1 { margin: 0 0 var(--space-3); font-size: var(--text-2xl); }
.mock-preview-end p { margin: 0 0 var(--space-5); line-height: var(--leading-normal); }

/* KaTeX's own stylesheet sets .katex to 1.21em, tuned to sit with a sans
   body. NUBE-1 brought it to 1.08em of its serif reading text (a smaller
   x-height); PREPPALS-1 sets the reading text in the system sans again,
   whose x-height sits between the two, so math in the stem, options,
   correct-answer line and explanation is 1.15em of the surrounding text.
   Compound selectors on purpose: katex.min.css loads after this file. */
.question-stem .katex,
.option-body .katex,
.correct-answer-line .katex,
.explanation-text .katex {
  font-size: 1.15em;
}
/* In a maths answer "1/8" must read as plainly as it would on an exam
   paper, so every reading surface asks for lining figures (NUBE-1 added this
   for its old-style Garalde serif; a fallback face may still default to
   old-style figures). */
.question-stem,
.option-body,
.correct-answer-line,
.explanation-text {
  font-variant-numeric: lining-nums;
}

/* Mathematical content (KaTeX). Long formulas scroll horizontally within
   their own container rather than overflowing the question card or the
   page — required for usable mobile display. Text remains selectable;
   KaTeX renders selectable markup by default, nothing disables that here.

   overflow-y: hidden IS REQUIRED HERE, not decorative -- same reasoning as
   .option-body's own identical pairing above, and the one .katex-display
   already had below: a non-visible overflow-x with an unset overflow-y
   computes overflow-y to auto too (CSS Overflow spec), and KaTeX content
   routinely renders a few px taller than its line-height even when nothing
   actually needs to scroll. Without this, any of these four containing
   KaTeX shows a permanent, unnecessary vertical scrollbar. */
.question-stem, .correct-answer-line, .explanation-text, .explanation-section-body {
  overflow-x: auto;
  overflow-y: hidden;
}
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0.5em 0;
}

/* GLASS, NOT A SOLID GREY BAR -- shared thin/translucent scrollbar for every
   container above that horizontally scrolls a long KaTeX formula. Only ever
   visible when a formula genuinely needs it; most never trigger it at all,
   and the color-mix() keeps it correctly faint in both light and dark mode
   without a dedicated token of its own. */
.option-body,
.question-stem,
.correct-answer-line,
.explanation-text,
.explanation-section-body,
.katex-display {
  scrollbar-width: thin; /* Firefox: thin, not the default chunky rail */
  scrollbar-color: color-mix(in srgb, var(--color-border-strong) 45%, transparent) transparent;
}
.option-body::-webkit-scrollbar,
.question-stem::-webkit-scrollbar,
.correct-answer-line::-webkit-scrollbar,
.explanation-text::-webkit-scrollbar,
.explanation-section-body::-webkit-scrollbar,
.katex-display::-webkit-scrollbar {
  height: 5px;
}
.option-body::-webkit-scrollbar-track,
.question-stem::-webkit-scrollbar-track,
.correct-answer-line::-webkit-scrollbar-track,
.explanation-text::-webkit-scrollbar-track,
.explanation-section-body::-webkit-scrollbar-track,
.katex-display::-webkit-scrollbar-track {
  background: transparent;
}
.option-body::-webkit-scrollbar-thumb,
.question-stem::-webkit-scrollbar-thumb,
.correct-answer-line::-webkit-scrollbar-thumb,
.explanation-text::-webkit-scrollbar-thumb,
.explanation-section-body::-webkit-scrollbar-thumb,
.katex-display::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--color-border-strong) 45%, transparent);
  border-radius: 3px;
}

/* ===========================================================================
   SYSTEM STATES (DRAGON-GATE-VISUAL-PRODUCT-7)
   ===========================================================================
   Loading, failure and completion were the only surfaces the Practice and
   Navigation batches never reached, so they were still at their FE-0 shipping
   state: a colour declaration, a background tint, and no container rule at all.
   They now use the same vocabulary as the screens around them -- the content
   column, the elevated surface, the token scales, and the inset rail
   .result-banner already uses for the incorrect family. */

/* An error is announced by #error-region (role="alert"), so it does NOT also
   need the enclosing column to be a landmark -- this rule is geometry only.
   THE COLUMN IS THE POINT: #error-region is a body-level sibling of <main>, so
   .error-box was centring its own max-width against the VIEWPORT while
   main#app-root centres the same width WITH 16px of padding. The error sat 16px
   proud of the reading column at every desktop width, and at 375px resolved to
   the full 375px -- flush to both screen edges, the only element in the product
   that bled edge-to-edge. Matching main#app-root's box puts the failure in the
   same column as the thing that failed. */
#error-region {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* RESERVES ITS OWN SPACE. In legacy this paragraph replaces the entire screen,
   so the page collapsed to the shell's padding and then jumped to full content
   -- a layout shift on every navigation and every retry. A min-height sized to
   a screen heading keeps the column from folding while the fetch is in flight. */
.loading-text {
  color: var(--color-text-muted);
  min-height: var(--space-7);
  margin: 0;
  padding: var(--space-3) 0;
}

.error-box {
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect-text);
  /* --radius-lg, not --radius: this is a top-level container on the page
     ground, a peer of .view-question and .subject-card, not an inner surface
     like .result-banner. It carried the chip radius at card size. */
  border-radius: var(--radius-lg);
  /* Fill alone was the entire surface: --color-incorrect-bg on --color-bg is
     1.13:1 in light and 1.08:1 in dark, below the value VISUAL-PRODUCT-5
     declared broken for cards that still had a border AND a shadow. The rail is
     currentColor, exactly as .result-banner does it, so the edge is the
     incorrect-family text colour without introducing a token -- and it survives
     dark mode, where --color-shadow is alpha-black on a near-black page and
     elevation cannot help. */
  border: 1px solid var(--color-incorrect-text);
  box-shadow: inset 4px 0 0 currentColor;
  padding: var(--space-4);
  margin: var(--space-4) 0;
}
/* The message is its own element now (see showError), so message and action can
   finally be separated by real space instead of an inline <br>. */
.error-box-message {
  margin: 0;
  line-height: var(--leading-normal);
}
.error-box .retry-btn { margin-top: var(--space-4); }
/* The box takes focus when it appears; it is a container, not a control, so it
   is announced and scrolled to without advertising itself as interactive. */
.error-box:focus { outline: none; }
.error-box:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* RECOVERY IS NOT THE PRODUCT'S FORWARD ACTION. Retry was a saturated
   --color-primary fill sitting on --color-incorrect-bg: 3.77:1 of separation in
   light, and in dark a salmon button on a maroon ground -- the one control in
   the product with the least hue distance from its own container, in the one
   place the user is already stuck. A neutral raised surface reads as a control
   rather than as a brighter patch of the error, and --color-text on
   --color-surface-elevated is contrast-verified in both schemes. Scoped to the
   error surfaces so .retry-btn keeps its shared-family behaviour anywhere else. */
.error-box .retry-btn,
#react-root .react-subject-error .retry-btn,
#react-root .react-nav-error .retry-btn,
#react-root .react-shell-recovery .retry-btn {
  background: var(--color-surface-elevated);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  font-family: inherit;
  /* The neutral pill, like .btn-secondary. */
  box-shadow: var(--shadow-sm);
  /* Border, transform and shadow, never background-color: the property
     VISUAL-PRODUCT-4 established makes a computed colour a function of time. */
  transition: border-color 120ms ease, transform 80ms ease, box-shadow 80ms ease;
}
.error-box .retry-btn:hover,
#react-root .react-subject-error .retry-btn:hover,
#react-root .react-nav-error .retry-btn:hover,
#react-root .react-shell-recovery .retry-btn:hover {
  background: var(--color-surface-elevated);
  border-color: var(--color-text);
}
.error-box .retry-btn:active,
#react-root .react-subject-error .retry-btn:active,
#react-root .react-nav-error .retry-btn:active,
#react-root .react-shell-recovery .retry-btn:active {
  background: var(--color-surface-elevated);
  border-color: var(--color-text);
  transform: none;
  box-shadow: none;
}

/* Mobile-first: base styles above already target narrow viewports.
   Only widen spacing slightly on larger screens. */
@media (min-width: 720px) {
  main#app-root { padding-top: 32px; }
}

/* THE PRACTICE CARD HAD NO RESPONSIVE TREATMENT AT ALL -- one padding-top at
   720px was the entire story, so the same 20px inset, the same stem size and
   the same option padding shipped from 375px to 4K.
   NOTE the card's inset is changed through --question-pad, never as a literal:
   .item-figure's bleed is derived from it, so the figure keeps reaching exactly
   the card's edge and backend/static_assets.py's MOBILE_ASSET_WIDTH_PX contract
   holds at every width. */
@media (max-width: 480px) {
  /* System states had NO responsive treatment whatsoever -- the only @media
     reaching them was prefers-reduced-motion. The recovery control is a
     thumb-reach action inside a box the user did not ask for, so it gets the
     same full-width treatment the forward actions already get here. */
  .error-box,
  #react-root .react-subject-error,
  #react-root .react-nav-error { padding: var(--space-3); }
  .error-box .retry-btn,
  #react-root .react-subject-error .retry-btn,
  #react-root .react-nav-error .retry-btn,
  #react-root .react-shell-recovery .retry-btn { display: block; width: 100%; }
  .view-complete { padding: var(--space-5) var(--space-4); }
  .view-complete .back-btn { display: block; width: 100%; }

  .view-question { --question-pad: var(--space-4); }
  .question-stem { font-size: calc(var(--text-lg) * var(--text-scale, 1)); }
}

/* T1 cartesian primitives. These use --color-primary-text and stroke-width 2,
   exactly matching .cartesian-widget-function above: a curve authored as a
   polyline must read identically to the same curve authored as a function --
   the authoring format is not supposed to change how the content looks.

   They previously referenced --color-accent, which is not defined anywhere in
   this stylesheet. An undefined var() with no fallback is invalid at
   computed-value time, so `stroke` fell back to its initial value `none`; with
   `fill: none` alongside it, polylines, ellipses and hyperbolas painted
   NOTHING in a real browser. Every jsdom test still passed, because jsdom
   builds a DOM and never paints -- see verify_step1 section 72, which now
   fails on any stroke/fill var() that names an undeclared token. */
.cartesian-widget-polyline {
  fill: none;
  stroke: var(--color-figure-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.cartesian-widget-polyline.cartesian-widget-dashed {
  stroke-dasharray: 5 4;
}

.cartesian-widget-conic {
  fill: none;
  stroke: var(--color-figure-accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* Field markers read as glyphs, so they use the strong foreground colour
   rather than the accent used for plotted curves. */
.cartesian-widget-field-marker {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 1.25;
}

.cartesian-widget-field-marker-dot {
  fill: var(--color-text);
  stroke: none;
}

.cartesian-widget-field-marker-cross {
  stroke: var(--color-text);
  stroke-width: 1.25;
  stroke-linecap: round;
}

/* T1-G: solid-geometry coordinate axes. Lighter than the wireframe so the
   solid stays the subject and the frame reads as reference. */
.solid-geometry-widget-axis {
  stroke: var(--color-text-muted);
  stroke-width: 1;
}

.solid-geometry-widget-axis-label {
  fill: var(--color-text-muted);
  font-size: 10px;
  font-style: italic;
}

.solid-geometry-widget-axis-origin {
  fill: var(--color-text-muted);
  stroke: none;
}

/* circuit_diagram_v1 (CIRCUIT-1) -- the eight classes the frozen schema
   names, and no others. Same existing design tokens as every widget above;
   no new color is introduced.

   EVERY rule below paints with a token that is DECLARED in the :root block
   at the top of this file. That is not a style preference: an undefined
   var() with no fallback is invalid at computed-value time, so a stroke
   naming a misspelt token resolves to the property's initial value --
   `none` -- and the element paints NOTHING. (Not written out as a literal
   example here: verify_step1 section 72 scans this file for undeclared
   tokens by regex and would flag the example itself.) Three Tier 1
   primitives shipped invisible exactly
   that way behind a fully green jsdom suite, because jsdom builds a DOM and
   never paints. verify_step1 section 72 now checks this mechanically; keep
   it true by construction as well.

   Deliberately monochrome: a circuit diagram is an academic schematic, and
   colouring a component would read as a hint about which one the question is
   about. --color-primary-* is reserved elsewhere in this platform for
   answer/solution emphasis, so nothing here uses it. */
.circuit-widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 16px;
  margin-bottom: 4px;
}

.circuit-widget-canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* Wires are butt-capped on purpose. A round or square cap would extend the
   stroke half its width past the endpoint, which is precisely where the
   renderer BREAKS the wire either side of a component -- a cap would poke
   back inside the symbol body and undo the break. */
.circuit-widget-wire {
  stroke: var(--color-text);
  stroke-width: 1.75;
  stroke-linecap: butt;
  fill: none;
}

/* Component outlines: resistor body, lamp circle and its inscribed X, meter
   circles, cell long plate, switch lever. Same weight as the wire so the
   symbol reads as part of the same conductor, not an annotation on it. */
.circuit-widget-component {
  stroke: var(--color-text);
  stroke-width: 1.75;
  stroke-linecap: round;
  fill: none;
}

/* Solid parts: a cell's short thick plate and a switch's terminal dots. The
   thick plate is a filled <rect> rather than a heavier stroke because
   stroke-width would have to be an inline presentation attribute, and this
   renderer takes all of its styling from classes. */
.circuit-widget-component-fill {
  fill: var(--color-text);
  stroke: none;
}

/* Junction dots mark a DERIVED node of degree >= 3. Same ink as the wire:
   a junction is a property of the wiring, not a separate object, and giving
   it its own color would imply the author marked it (they cannot -- the
   schema has no junction field). */
.circuit-widget-junction {
  fill: var(--color-text);
  stroke: none;
}

/* 11 user units, fixed by the schema's RESPONSIVE section: against the
   400-unit viewBox that measures 8.50 CSS px on a 375px phone and 15.79 px
   on desktop, clearing the 6.5/12 measured floors the responsive contract
   spec asserts. Do not shrink it without redoing that arithmetic. */
.circuit-widget-label {
  fill: var(--color-text);
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* The "A"/"V" inside a meter circle -- the only glyphs this renderer
   generates itself. Bolder than an author label so it reads as part of the
   symbol rather than as text that happens to sit near it. */
.circuit-widget-meter-text {
  fill: var(--color-text);
  font-size: 11px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------------------------------------------------------------------------
   React migration shell (FRONTEND-3 Batch 0).

   CONTAINMENT, NOT DESIGN. This block exists because the shell would otherwise
   render as unstyled browser-default markup on every screen of the live
   prototype -- a real, user-visible defect that no gate can see: verify_step1
   section 72 reads this stylesheet and can only check that declared custom
   properties resolve, so a class with NO rule at all is invisible to it, the
   same paint-blindness that section exists to fix, one layer up. It is
   deliberately not branding or layout work: it reuses existing tokens only,
   claims no vertical space beyond its content, and is scoped entirely under
   #react-root so it cannot affect the legacy application above it.

   The muted, bordered treatment is the point: this is a development surface
   sitting beside the real product, and it should read as one. It goes away
   with the shell.
   --------------------------------------------------------------------------- */
#react-root:empty {
  display: none; /* before mount, and if React never loads, occupy nothing at all */
}

#react-root .react-shell {
  max-width: 640px;              /* matches the app's own content width; also keeps
                                    the panel off the horizontal-overflow budget the
                                    Playwright responsive contract measures */
  margin: 24px auto;
  padding: 12px 16px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 13px;
}

#react-root .react-shell-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

#react-root .react-shell-note {
  margin: 0 0 8px;
}

#react-root .react-shell-subjects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;               /* wraps rather than overflowing on a narrow phone */
  gap: 6px;
}

#react-root .react-shell-subject {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}

#react-root .react-shell-subject-count {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

#react-root .react-shell-subject-flag {
  color: var(--color-warning-text);
}

/* ---------------------------------------------------------------------------
   FRONTEND-3 Batch 1 — the React-owned subject screen.

   Layout only. Every card rule this screen uses is the EXISTING
   .subject-card / .subject-list block above: the React markup reuses those
   class names deliberately so the migrated screen inherits the legacy
   appearance rather than re-deriving it, which is what makes a visual diff
   against the legacy selector meaningful. Only the outer box needs defining,
   because #react-root is a plain <div> and does not inherit main#app-root's
   content column.

   The two rules are keyed off the same <html> attribute frontend/app.js sets
   when it hands the screen over, so the layout switch needs no JavaScript and
   cannot disagree with the ownership state.
   --------------------------------------------------------------------------- */

/* While React owns the screen, #app-root is deliberately empty (see
   renderSubjectSelect in frontend/app.js). Collapsing its padding stops that
   empty box from pushing the React screen down the page. */
html[data-csca-subject-selection="react"] main#app-root {
  padding: 0;
}

/* NUBE-1: the subject screen is the product's home, and the only screen that
   widens past the 640px reading column -- to fit the subjects board's row of
   five cards. Every reading surface (practice, explanation, topic reading)
   keeps the 640px measure. */
#react-root .react-subject-select {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;   /* PREPPALS-1: no top padding -- the hero band meets the header */
}
@media (min-width: 720px) {
  #react-root .react-subject-select { padding: 0 24px 56px; }
}

/* Matches .error-box exactly -- same surface, same rail, same scale. These were
   two near-duplicate rules describing one visual object with no shared selector,
   drifting from each other and from the legacy box. (The old note here claimed
   5.58:1; the token block's own measured figure for this pair is 5.92:1 -- the
   stale number was the retired pre-PALETTE-1 red.) */
#react-root .react-subject-error,
#react-root .react-nav-error {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect-text);
  border: 1px solid var(--color-incorrect-text);
  box-shadow: inset 4px 0 0 currentColor;
  font-size: var(--text-md);
}
#react-root .react-subject-error p,
#react-root .react-nav-error p {
  margin: 0;
  line-height: var(--leading-normal);
}
#react-root .react-subject-error .retry-btn,
#react-root .react-nav-error .retry-btn { margin-top: var(--space-4); }

/* ---------------------------------------------------------------------------
   FRONTEND-3 Batch 2 — the React-owned content navigation screens.

   Layout only, again, and even less of it than Batch 1 needed. The module,
   topic and subtopic markup reuses the EXISTING .view-module-browse,
   .module-section, .module-heading, .topic-list, .topic-chip and
   .progress-indicator blocks above, so the migrated screens inherit the legacy
   appearance rather than re-deriving it. No colour is declared here: every
   value comes from the rules those class names already match, which is also
   why dark mode needs nothing -- it works by re-pointing tokens those rules
   read.

   .practice-all-btn is the one genuinely new class, and it existed for a
   SAFETY reason rather than a visual one. Legacy's equivalent control was a
   .submit-btn, and at the time this class was introduced .submit-btn was one
   of three classes legacy's own submitAnswer/lockOptions/unlockOptions
   queried DOCUMENT-WIDE -- so a React-rendered .submit-btn would have landed
   inside a legacy querySelectorAll and let legacy reach into React-owned
   DOM. That specific query was deleted along with submitAnswer (Legacy
   Removal, Phase 3), and .submit-btn's own last legacy assignment -- the
   Upgrade screen's guest-variant Create Account button -- was deleted the
   same way (Legacy Removal, Phase 6). .practice-all-btn stays a separate
   class regardless, a cheap permanent guarantee -- nothing is gained by
   merging back into it now that no hazard is left to avoid.
   It is joined to the shared button selector lists above instead of
   restating their values, so the two controls cannot drift apart.
   --------------------------------------------------------------------------- */

/* Same collapse as the subject screen: while React owns a content screen,
   #app-root is deliberately empty and its padding would otherwise push the
   React screen down the page. */
html[data-csca-navigation="module"] main#app-root,
html[data-csca-navigation="subtopic"] main#app-root,
html[data-csca-navigation="reading"] main#app-root {
  padding: 0;
}

#react-root .react-content-nav {
  max-width: 640px;                /* identical content column to main#app-root */
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;                       /* matches .view-module-browse's own gap */
}

/* The heading pair reads as one block, exactly as .view-eyebrow + h1 does on
   the legacy screens. */
/* Same correction as the generic .view-eyebrow + h1 rule above -- restated here
   only because this selector carries an id and would otherwise win with the
   `margin-top: 0` that provably does nothing against a flex gap. */
#react-root .react-content-nav .view-eyebrow + h1 {
  margin-top: calc(-1 * var(--nav-stack-gap));
}

/* The practice control is a leading action, not a full-width bar -- same
   treatment .view-module-browse gives its own button. */
#react-root .react-content-nav .practice-all-btn {
  align-self: flex-start;
}

/* .react-nav-error is styled with .react-subject-error above -- one object, one
   rule. This is the LoadFrame error and the topic-not-found branch, which now
   share the class rather than rendering as unstyled body text. */

/* ---------------------------------------------------------------------------
   FRONTEND-3 Batch 4 — the React-owned Account Gateway / Login / Signup
   screens.

   Layout only, same as Batch 2: every visual rule these screens need already
   exists (.auth-gateway-subtitle, .auth-gateway-actions, .auth-form,
   .auth-field*, .auth-switch-*, .auth-quiet-link, .btn-secondary, .error-box,
   .next-btn, .react-submit-btn), so this block is just the content-column
   wrapper and the same #app-root padding-collapse the other two React screen
   groups already needed, keyed off all three data-csca-auth values. */
html[data-csca-auth="gateway"] main#app-root,
html[data-csca-auth="login"] main#app-root,
html[data-csca-auth="signup"] main#app-root {
  padding: 0;
}

#react-root .react-auth {
  max-width: 640px;                /* identical content column to main#app-root */
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ---------------------------------------------------------------------------
   FRONTEND-3 Batch 5 — the React-owned Interface Language Select / Exam
   Language Select screens.

   Layout only, same as Batch 4: .brand-lockup*, .language-options,
   .language-option-btn, .exam-language-option-btn and every other class
   these two screens need already carry their full visual treatment. Neither
   legacy screen's own .view-language-select/.view-exam-language-select
   class carries any rule at all, so (unlike every earlier batch) there is
   no existing "content column" class to inherit -- .react-language is the
   one this batch adds, shared by both screens and disambiguated by the
   data-csca-language attribute, mirroring .react-auth immediately above. */
html[data-csca-language="interface"] main#app-root,
html[data-csca-language="exam"] main#app-root {
  padding: 0;
}

#react-root .react-language {
  max-width: 640px;                /* identical content column to main#app-root */
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ---------------------------------------------------------------------------
   FRONTEND-3 Batch 6 — the React-owned paywall (TRIAL-1 free-tier upgrade
   screen).

   Layout only, same as Batch 5: .auth-gateway-subtitle, .auth-gateway-actions,
   .next-btn, .btn-secondary, .auth-quiet-link, .view-complete,
   .complete-message and .back-btn all already carry their full visual
   treatment. .view-upgrade itself carries no rule at all (confirmed by
   grep), so .react-upgrade is the one this batch adds, mirroring
   .react-language immediately above. The expired_trial variant stacks this
   WITH .view-complete deliberately, not redundantly: main#app-root's own
   base padding (this same 640px/20px-16px-40px column, above) is what
   .view-complete's card padding nests inside of in legacy today, so
   replacing that zeroed-out padding with .react-upgrade's identical rule
   reproduces the same nesting, not double padding. */
html[data-csca-upgrade="guest"] main#app-root,
html[data-csca-upgrade="expired_trial"] main#app-root {
  padding: 0;
}

#react-root .react-upgrade {
  max-width: 640px;                /* identical content column to main#app-root */
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ---------------------------------------------------------------------------
   ATTEMPT-HISTORY-1 — the React-owned Review screen.

   Same content-column treatment every other top-level React screen above
   takes: main#app-root's own base padding (864) is zeroed while this screen
   owns the page (root.innerHTML is emptied, but the base rule's padding
   would otherwise still occupy an empty visible gap), and .react-attempt-
   history re-applies the identical 640px/20px-16px-40px column itself.
   --------------------------------------------------------------------------- */
html[data-csca-history] main#app-root {
  padding: 0;
}

#react-root .react-attempt-history {
  max-width: 640px;                /* identical content column to main#app-root */
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* PREPPALS-1 SCREEN CARD. The screens that are one column of controls or of
   reading -- the account gateway, Login, Signup, both language choices, the
   paywall, Review and a topic reading -- sit on one white card on the page
   ground, as the reference sets its forms and articles: a 1px quiet edge, the
   large radius and a soft shadow. Each keeps its own 640px column (two specs
   pin it); the card is that column, its padding inside it. */
#react-root .react-auth,
#react-root .react-language,
#react-root .react-upgrade,
#react-root .react-attempt-history,
#react-root .react-content-nav[data-react-topic-reading] {
  margin: var(--space-6) auto var(--space-7);
  padding: var(--space-6) var(--space-6) var(--space-7);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
@media (max-width: 679px) {
  #react-root .react-auth,
  #react-root .react-language,
  #react-root .react-upgrade,
  #react-root .react-attempt-history,
  #react-root .react-content-nav[data-react-topic-reading] {
    margin: var(--space-4) var(--space-4) var(--space-6);
    padding: var(--space-5) var(--space-4) var(--space-6);
    border-radius: var(--radius-lg);
  }
}

.attempt-history-empty {
  color: var(--color-text-muted);
}

/* Only rendered when a session's history spans more than one subject --
   AttemptHistory.tsx derives these from the entries actually fetched, never
   a hardcoded subject list, so a single-subject session sees no filter row
   at all rather than dead tabs that would always return nothing. */
.attempt-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.attempt-history-filter {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--color-text);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
  min-height: 32px;
  cursor: pointer;
}
.attempt-history-filter:hover {
  border-color: var(--color-primary);
}
.attempt-history-filter:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.attempt-history-filter--active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.attempt-history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* One row per past attempt -- a button, not a link, matching .subject-card's
   own reasoning (focusable/activatable via Enter/Space for free). */
.attempt-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  /* --radius-lg, matching .subject-card/.topic-chip -- the same "clickable
     list card" role, so it should carry the same card radius rather than the
     bare --radius workhorse value no other card-shaped control in the app uses. */
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  text-align: start;
  font: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.attempt-history-row:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.attempt-history-row:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.attempt-history-row-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  flex: 1 1 auto;
}

.attempt-history-subject {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  /* --tracking-wide, the same token .view-eyebrow and .question-meta use for
     an uppercase micro-label -- not a hand-picked 0.02em this one rule alone
     carried. */
  letter-spacing: var(--tracking-wide);
}

.attempt-history-stem {
  font-size: var(--text-sm);
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attempt-history-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  flex: 0 0 auto;
}

/* Same correct/incorrect token PAIRS .result-banner's own
   .result-correct/.result-incorrect use (already-verified contrast), not a
   new colour combination invented for this badge. */
.attempt-history-badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.attempt-history-badge--correct {
  color: var(--color-correct-text);
  background: var(--color-correct-bg);
}
.attempt-history-badge--incorrect {
  color: var(--color-incorrect-text);
  background: var(--color-incorrect-bg);
}

.attempt-history-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.react-attempt-history-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* SAVED-ITEMS-1: Review's two tabs -- past attempts and saved questions --
   as the subject filters' pills, a size up; each saved question a row like
   an attempt's, its star beside it; an open one under a bar with Back and
   its star. */
.review-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}
.review-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.review-tab:hover { border-color: var(--color-primary); }
.review-tab:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.review-tab[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.review-tab-count {
  min-width: 1.5em;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.saved-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.saved-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.saved-row-open { flex: 1 1 auto; min-width: 0; }
.saved-row-level { text-transform: none; letter-spacing: 0; }
.saved-row-star { flex: none; }
.saved-row-star .save-item-btn { min-width: 44px; justify-content: center; }
/* In a row, the star is its icon alone: its words stay its accessible name. */
.saved-row-star .save-item-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.saved-detail-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
/* MISTAKES-1: the notebook -- its exit rule as two radios, its filters as
   selects dressed like the practice filter, a line of counts with "Practise
   these" beside it, and each row's standing as a small tag: lacquer for not
   yet corrected, gold for corrected once, the correct green for left. A run
   of questions shows "Question 2 of 5" in its bar and ends on its summary. */
.mistakes-exit {
  min-width: 0;
  margin: 0 0 var(--space-3);
  padding: 0;
  border: none;
  font-size: var(--text-sm);
}
.mistakes-exit legend {
  margin: 0 0 var(--space-1);
  padding: 0;
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}
.mistakes-exit-option {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-inline-end: var(--space-4);
  cursor: pointer;
}
.mistakes-exit-option input { width: 18px; height: 18px; accent-color: var(--color-primary); }
.mistakes-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-3);
}
.mistakes-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}
.mistakes-filter select {
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.mistakes-filter select:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.mistakes-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-3);
}
.mistakes-counts { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.mistake-badge {
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}
.mistake-badge[data-standing="uncorrected"] { background: var(--color-incorrect-bg); color: var(--color-incorrect-text); }
.mistake-badge[data-standing="corrected"] { background: var(--color-primary-subtle-bg); color: var(--color-achievement-text); }
.mistake-badge[data-standing="left"] { background: var(--color-correct-bg); color: var(--color-correct-text); }
.item-run-progress { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.item-run-summary { margin: 0; }
.item-run-summary:focus { outline: none; }

/* On a phone a saved row stacks its date under the stem, so the stem keeps
   the row's width beside the star. */
@media (max-width: 599px) {
  .saved-row-open { flex-direction: column; align-items: stretch; gap: var(--space-1); }
  .saved-row-open .attempt-history-row-meta { align-items: flex-start; }
}

/* ---------------------------------------------------------------------------
   FRONTEND-3 RENDER-RECOVERY-1 — the React shell's last-resort recovery panel.

   NOT AN ERROR BOX, and deliberately not styled as one. .error-box,
   .react-subject-error and .react-nav-error are all the incorrect-red family
   because they report a failure INSIDE a working screen, with the screen still
   around them. This is the screen: it renders only when a React screen threw
   and the legacy application could not take it back, so there is nothing else
   on the page. It therefore takes the elevated-card treatment every other
   TERMINAL surface takes (.view-complete above is the precedent), not the
   inline-alarm treatment. A full viewport of red for a state whose entire
   remedy is one button would be the wrong volume.

   NO COLOUR VALUES HERE, only tokens -- which is also why dark mode needs
   nothing: it works by re-pointing the tokens these rules read.
   --------------------------------------------------------------------------- */
#react-root .react-shell-recovery {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-sm);
  /* THE PANEL HAS TO CARRY ITS OWN CONTENT COLUMN, exactly as
     .react-subject-select and .react-content-nav above do and for the same
     reason: #react-root is a plain <div> and inherits nothing from
     main#app-root's column. Caught by looking at a screenshot, not by reading
     this file -- the panel laid out flush against the top-left corner of the
     viewport while every assertion about it still passed, because "inside the
     viewport" and "no horizontal overflow" are both true of a box jammed into
     the corner.

     min() rather than the siblings' padded-wrapper idiom because this element
     is the card AND the column: a bare `margin: X auto` would centre it at
     640px on desktop but let it touch both screen edges at 375px, where a card
     with a border and a shadow needs a gutter to read as a card at all. */
  max-width: min(var(--measure), 100% - 2 * var(--space-4));
  margin: var(--space-5) auto var(--space-6);
  /* Left-aligned text, unlike .view-complete: this panel has a heading, a
     sentence and a control, and centring a paragraph of running text costs
     legibility that a one-line congratulation does not have to pay. */
  text-align: start;
}
/* The heading keeps the screen-h1 scale it inherits -- it IS the screen's
   heading, and it is where focus lands. Only its trailing space is set here. */
#react-root .react-shell-recovery h1 { margin-top: 0; }
#react-root .react-shell-recovery .react-shell-recovery-note {
  margin: 0 0 var(--space-5);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}
/* Focus is moved here programmatically when the panel appears; the heading is a
   heading, not a control, so it is announced without advertising itself as one
   -- the same treatment .error-box gets for the same reason. */
#react-root .react-shell-recovery h1:focus { outline: none; }
#react-root .react-shell-recovery h1:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   FRONTEND-3 BATCH 3 (Practice) — React-owned Question/Feedback.

   MOST OF THIS SCREEN'S OWN RULES NEED NO NEW CSS AT ALL: .question-
   subject, .question-meta, .question-stem, .options-group, .item-figure's
   OWN rules, .result-banner(-correct/-incorrect), .correct-answer-line,
   .explanation-text, .explanation-section(-heading/-body)(--idea/data/calc/
   result/error), .explanation-language-notice and .next-btn/.back-btn/
   .retry-btn are all reused verbatim -- none of them are among the three
   classes frontend/app.js queries document-wide, so there is nothing unsafe
   about emitting them from React, and no visual system to re-derive.

   .view-question's OWN CONTAINING COLUMN IS THE ONE EXCEPTION, and the
   omission this comment used to claim didn't exist is exactly what let
   backend/static_assets.py's MOBILE_ASSET_WIDTH_PX contract silently drift
   30px wide on a phone. Legacy's .view-question is a direct CHILD of
   main#app-root, so it gets TWO independent insets stacked: main#app-root's
   own 16px column padding on the OUTSIDE, and .view-question's own
   --question-pad on the INSIDE. .item-figure's negative margin (see that
   rule's own comment) cancels only the INNER one, bleeding to
   .view-question's own edge -- which the OUTER main#app-root padding still
   holds 16px off the viewport. Restating that padding directly ON
   .view-question (what an earlier version of this fix tried) collapses
   back to ONE inset layer instead of two, since a later padding value
   REPLACES rather than adds to an earlier one -- .view-question already
   carries its own --question-pad rule. #react-root is a plain, unstyled
   <div> with no outer column of its own (same fact the Batch 1/2 comments
   above state for Subject Selection and Navigation), so Practice.tsx wraps
   its returned screens in a dedicated OUTER element for exactly this,
   mirroring main#app-root's own values on a SEPARATE box from
   .view-question's own padding, the same two-layer shape legacy has. */
/* NUBE-1: 760px rather than the 640px reading column, so the explanation's
   margin-note layout (a label column beside the prose) keeps a comfortable
   ~65-character measure for the prose itself. Phones are unaffected: below
   760px the column is the viewport, with the same 16px gutter. */
.react-activity-column {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}
/* While React owns the practice screen #app-root is empty; collapse its
   padding like every other React screen does, so no blank band sits above
   the question (it was the one screen without this rule). */
html[data-csca-activity="react"] main#app-root {
  padding: 0;
}
/* Phones: the forward actions (Submit, Next question, and SIMILAR-ITEMS-1's
   offer above Next) span the column. */
@media (max-width: 480px) {
  .view-question .next-btn,
  .view-question .similar-btn { width: 100%; }
}

/* THREE NEW CLASSES EXISTED FOR A SAFETY REASON, NOT A VISUAL ONE -- the
   exact reason .practice-all-btn exists (see the FRONTEND-3 Batch 2 comment
   above): .option-btn, .submit-btn and .result-section were three
   document-wide-queried classes (legacy's own lockOptions/unlockOptions/
   submitAnswer/renderFeedback all reached them via document.querySelectorAll,
   not a closure), so a React-rendered element using any of them would have
   sat inside a legacy query and could have been reached from legacy code
   React did not expect to run. That legacy code was deleted along with
   react_activity (Legacy Removal, Phase 3), which retired .option-btn and
   .result-section outright, and .submit-btn's own last legacy assignment --
   the Upgrade screen's guest-variant Create Account button -- was deleted
   the same way once react_upgrade retired too (Legacy Removal, Phase 6):
   all three of the original risks are gone. .react-submit-btn and
   .react-option-btn (like .react-result-section below) stay their own
   permanent classes regardless, rather than merging back into the
   now-unused shared ones -- a cheap guarantee that costs nothing to keep,
   not active protection against anything any more.

   .react-submit-btn is the smaller of the two remaining: it rides on
   .next-btn (already safe, already exactly the right filled/primary look)
   for everything except the disabled state, which .next-btn has no rule for
   because legacy's Next button is never disabled. Only that one state is
   restated here. */
.react-submit-btn:disabled {
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  cursor: not-allowed;
  border: 1px solid var(--color-border-strong);
  box-shadow: none;      /* no glow: a control you cannot press does not stand up */
  transform: none;
}

/* THE DEAD SUBMIT BUTTON DISAPPEARS ONCE THE QUESTION IS GRADED. It is never
   re-enabled on the success path, so without this it would sit between the
   options and the feedback for the rest of the question as a permanently
   inert grey control, directly above the live "Next question" it has been
   replaced by. It stays in the DOM, still disabled. .react-submit-btn rides
   on .next-btn for its base look, which the live "Next question" control in
   .react-result-section ALSO uses, so without this the spent submit and the
   live Next would otherwise both be visible, identically styled, stacked
   controls. */
.view-question:has(.react-result-section:not(:empty)) .react-submit-btn { display: none; }
.view-question:has(.react-result-section:not(:empty)) .options-group { margin-bottom: 0; }

/* ===========================================================================
   REPORT ERROR (ITEM-REPORT-1, ITEM_REPORT_CONTRACT.md)

   The control a student uses to flag a problem with one question, and the
   small dialog behind it: in a mock-exam sitting (left of Submit, as on the
   real CSCA exam) and in Practice (under Submit, then under Next question --
   one at a time, the way the Submit button gives way to Next). Quiet on
   purpose: a way out for a broken question, never the screen's main action.

   Tokens only, so the dark palette comes with them. The dialog is its own set
   of classes rather than a reuse of .mock-dialog: Practice has no business
   carrying a mock-exam class, and the exam block is another session's
   territory. Same look, same z-index.
   =========================================================================== */
.report-error-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-2);
}
/* SAVED-ITEMS-1: the star, as quiet as the report link beside it; filled
   in the deep gold once the question is saved. A refusal (full list, a
   locked question) is said under it. */
.save-item { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.save-item-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-md);
  cursor: pointer;
}
.save-item-btn:hover { color: var(--color-text); }
.save-item-btn:hover .save-item-label { text-decoration: underline; }
.save-item-btn[aria-pressed="true"] { color: var(--color-achievement-text); }
.save-item-btn[aria-busy="true"] { cursor: progress; }
.save-item-btn:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.save-item-star { flex: none; }
.save-item-problem {
  max-width: 32ch;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-incorrect-text);
}
/* In a mock exam's review it rides in the question's title row, at its end. */
.mock-review-save { margin-inline-start: auto; }
.report-error-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-md);
  cursor: pointer;
}
.report-error-btn:hover { color: var(--color-text); }
.report-error-btn:hover .report-error-label { text-decoration: underline; }
.report-error-btn:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.report-error-icon {
  flex: none;
  color: var(--color-warning-text);
}
/* In the sitting's title row it rides against Submit: the heading keeps the
   left, and this and Submit sit together on the right. */
.report-error-btn--exam {
  margin-inline-start: auto;
  font-size: var(--text-lg);
}
/* On a phone the row has no width for a label beside "Question 48" and
   Submit: the triangle stays (44px, a full touch target) and the words become
   the button's accessible name only. */
@media (max-width: 599px) {
  .report-error-btn--exam {
    min-width: 44px;
    justify-content: center;
    padding: 0;
  }
  .report-error-btn--exam .report-error-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  /* And the row now holds three things where it held two. "Question 48",
     the triangle and Submit need about 275px; a 360px phone has 292 inside
     the card, so the heading and Submit give a little back. Without this
     Submit drops under the heading from the tenth question on, when the
     number gets a second digit. The longer selectors are what beat the exam
     block's own rules, which come later in this file. */
  .mock-exam .mock-exam-bar--title { gap: var(--space-2); }
  .mock-exam .mock-exam-bar--title h1 { font-size: 1.375rem; }
  .mock-exam .mock-exam-bar--title .mock-exam-submit {
    padding-inline-start: var(--space-3);
    padding-inline-end: var(--space-3);
  }
}

.report-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--color-overlay);
}
.report-dialog {
  width: min(100%, 32rem);
  max-height: calc(100vh - 2 * var(--space-4));
  max-height: calc(100dvh - 2 * var(--space-4));
  overflow-y: auto;
  padding: var(--space-5);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
}
.report-dialog h2 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}
.report-dialog p {
  margin: 0 0 var(--space-3);
  line-height: var(--leading-normal);
}
.report-dialog-context {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.report-dialog-fieldset {
  min-width: 0;
  margin: var(--space-4) 0;
  padding: 0;
  border: 0;
}
.report-dialog-fieldset legend {
  margin-bottom: var(--space-2);
  padding: 0;
  font-weight: var(--weight-semibold);
}
.report-dialog-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 44px;
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  line-height: var(--leading-snug);
  cursor: pointer;
}
.report-dialog-option:hover { background: var(--color-primary-subtle-bg); }
.report-dialog-option[data-selected="true"] {
  border-color: var(--color-primary-text);
  background: var(--color-primary-subtle-bg);
}
.report-dialog-radio {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 2px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface-elevated);
  cursor: pointer;
}
.report-dialog-radio::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary-text);
  transform: scale(0);
  transition: transform 100ms ease;
}
.report-dialog-radio:checked { border-color: var(--color-primary-text); }
.report-dialog-radio:checked::before { transform: scale(1); }
.report-dialog-radio:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.report-dialog-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--weight-semibold);
}
/* 16px or more, or a phone browser zooms the page in when the field is focused. */
.report-dialog-comment {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 6.5rem;
  padding: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  resize: vertical;
}
.report-dialog-comment:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.report-dialog p.report-dialog-count {
  margin: var(--space-1) 0 var(--space-3);
  text-align: end;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}
.report-dialog-clock {
  font-weight: var(--weight-semibold);
  color: var(--color-warning-text);
}
.report-dialog-error {
  font-weight: var(--weight-semibold);
  color: var(--color-incorrect-text);
}
.report-dialog-sent-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}
.report-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.report-dialog-actions > .next-btn { min-width: 0; }
/* No category chosen yet: the same dead-key look as Practice's Submit. */
.report-dialog-send:disabled {
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  cursor: not-allowed;
  border: 1px solid var(--color-border-strong);
  box-shadow: none;
  transform: none;
}
/* In flight: aria-disabled rather than disabled, so the focused button keeps focus. */
.report-dialog-send[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.75;
}
@media (max-width: 480px) {
  .report-dialog { padding: var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .report-dialog-radio::before { transition: none; }
}

/* .react-option-btn restates .option-btn's own rules (deleted along with
   the rest of legacy's Practice renderer, Legacy Removal Phase 3) --
   base/hover/focus/selected/disabled, plus the flex layout + radio-fill
   selected state -- under a new selector rather than joining the shared one.

   AN OPTION IS A CHOICE, NOT A TEXT FIELD. Resting, these sit one step
   BELOW the card on --color-bg (a well); HOVER LIFTS them to the card's own
   elevated surface with a shadow. Inputs do not lift; buttons do. The
   letter prefix stays the ordering cue it always was.

   BORDER AND SHADOW ONLY ON HOVER -- DELIBERATELY NOT background-color.
   Transitioning the fill makes the option's computed background a function
   of TIME: for ~120ms after a click the selected option would still report
   the unselected colour, both a real defect (the student's own choice
   should be confirmed instantly) and a measurement trap (see
   specs/dragon_gate_a11y_polish_responsive.spec.js's freezeMotion helper for
   the same reasoning applied to the contrast gate).

   The post-submit state classes (.option-was-correct/-incorrect,
   .option-is-correct, .option-radio's own correctness colours, and the
   ::after markers) are NOT restated: none of them are compounded with
   .option-btn in their own selectors, so they already apply to this class
   with no change needed. */
.react-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--color-text);
  font: inherit;
  min-height: 56px;
  padding-block: var(--space-2);
  padding-inline: var(--space-2) var(--space-4);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  text-align: start;
  /* PREPPALS-1: a white row on the white card -- its 1px boundary at 3:1
     identifies it, a soft contact shadow lifts it. Opaque on purpose: the
     specs measure option text against the option's OWN background. */
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  /* Border, transform and shadow only -- never background-color, so a
     selection is confirmed instantly and no spec samples a colour mid-fade. */
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.react-option-btn:hover:not(:disabled) {
  border-color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.react-option-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}
.react-option-btn:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
/* SELECTED, before submitting: INK, not Cinnabar. A Cinnabar selection would
   sit one shade away from the crimson "incorrect" state the same option may
   turn into a second later; Ink is the one colour that means "your choice"
   without hinting at right or wrong. Peach behind it, an Ink border drawn
   2px wide (the inset ring adds the second pixel without moving the text),
   the letter bubble filled. */
.react-option-btn.option-selected {
  border-color: var(--color-text);
  background: var(--color-primary-subtle-bg);
  box-shadow: inset 0 0 0 1px var(--color-text), var(--shadow-sm);
}
.react-option-btn.option-selected .option-label {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-surface-elevated);
}
/* GRADED. Options lock (disabled) the moment Submit is pressed; colour plus
   the ✓/✗ marker plus the aria-label carry the outcome. */
.react-option-btn:disabled {
  cursor: default;
  opacity: 1;
  box-shadow: none;
}
.react-option-btn.option-was-correct,
.react-option-btn.option-is-correct {
  border-color: var(--color-correct-text);
  background: var(--color-correct-bg);
}
.react-option-btn.option-was-incorrect {
  border-color: var(--color-incorrect-text);
  background: var(--color-incorrect-bg);
}
.react-option-btn.option-was-correct .option-label,
.react-option-btn.option-is-correct .option-label {
  background: var(--color-correct-text);
  border-color: var(--color-correct-text);
  color: var(--color-correct-bg);
}
.react-option-btn.option-was-incorrect .option-label {
  background: var(--color-incorrect-text);
  border-color: var(--color-incorrect-text);
  color: var(--color-incorrect-bg);
}
@media (prefers-reduced-motion: reduce) {
  .react-option-btn:hover:not(:disabled),
  .react-option-btn:active:not(:disabled) { transform: none; }
}

/* .react-result-section restates what used to be .result-section's
   non-empty spacing only -- React never renders this element until there is
   a graded result to put in it, so no :empty reset is needed. */
.react-result-section {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.react-result-section h2 {
  font-size: 1.5rem;
  font-weight: var(--weight-semibold);
  margin: var(--space-6) 0 var(--space-3);
}

/* Same reduced-motion carve-out .option-btn/.submit-btn/etc. used to get (see the
   file's own comment above @media (prefers-reduced-motion: reduce)). */
@media (prefers-reduced-motion: reduce) {
  .react-option-btn, .react-submit-btn { transition: none; }
}

/* ---------------------------------------------------------------------------
   READING_CONTENT_CONTRACT.md — the "Read" affordance on a topic chip, and
   the topic reading screen itself.

   .topic-chip-group wraps ONE topic's chip and its "Read" button. It exists
   because .topic-chip is a <button> (see the block above) and a <button>
   cannot contain a second interactive control -- ContentNavigation.tsx wraps
   at the .map() call site rather than changing NodeChip, so this class is
   the flex item .topic-list now wraps instead of .topic-chip directly. Same
   min-width and mobile full-width behaviour as .topic-chip itself, so a
   group takes exactly the space one chip used to.
   --------------------------------------------------------------------------- */
.topic-chip-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 150px;
}
.topic-chip-group .topic-chip {
  min-width: 0;   /* the group now owns the min-width; avoid doubling it */
}

/* Option C from the read-button comparison mock-up (2026-09-01): a tinted
   pill, not an outline -- filled with --color-primary-subtle-bg so it
   reads as a genuine second action sitting under the chip, not a hairline
   afterthought (the outline-on-transparent version this replaced). Still
   deliberately smaller than .btn-secondary -- it sits directly under a
   chip that is already the primary control in this row, and a full 44px
   button here would visually compete with it. */
.topic-chip-read {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-primary-text);
  background: var(--color-primary-subtle-bg);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
}
.topic-chip-read-icon {
  flex-shrink: 0;
}
.topic-chip-read:hover {
  filter: brightness(0.96);
}
.topic-chip-read:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .topic-chip-group { width: 100%; min-width: 0; }
}

/* The reading screen's own content: title/eyebrow/CTA all come from
   .react-content-nav / .view-eyebrow / .practice-all-btn above, so only the
   section list and the empty state need new rules. */
.reading-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
/* Each section after the first opens with a hairline, so the four parts of
   a reading read as four parts, not one long column. */
.reading-section + .reading-section {
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.reading-section-heading {
  margin: 0;
}
/* The <h2> above carries no font styling of its own any more -- the visible
   label lives on .reading-section-toggle-label so it can sit beside the
   prompt/chevron inside one clickable row. The <button> resets browser
   button chrome to read as a plain, full-width heading row. */
.reading-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: start;
  font: inherit;
  color: inherit;
}
.reading-section-toggle:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
/* SECTION TITLES THAT READ AS TITLES (NUBE-1, at the product owner's request:
   the small-caps margin labels were too quiet to find a section by). A
   display heading in Ink (the serif until PREPPALS-1), led by a square seal whose glyph and colour name the part:
   概 overview (Jade), 核 key concepts (Gold), 例 worked example (Ink),
   误 common pitfalls (Cinnabar) -- the explanation's own colour code. The
   seal is generated content with empty alt text, so a heading's text and
   accessible name stay exactly the translated title. */
.reading-section-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--weight-display);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}
.reading-section-toggle-label::before {
  content: var(--reading-seal-glyph) / "";
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--reading-seal);
  color: var(--reading-seal-on);
  font-family: var(--font-cjk);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.reading-section {
  --reading-seal-glyph: "";
  --reading-seal: var(--color-text-muted);
  --reading-seal-on: var(--color-bg);
}
.reading-section[data-react-reading-section="overview"] {
  --reading-seal-glyph: "概";
  --reading-seal: var(--color-accent);
  --reading-seal-on: var(--color-on-accent);
}
.reading-section[data-react-reading-section="key_concepts"] {
  --reading-seal-glyph: "核";
  --reading-seal: var(--color-achievement);
  --reading-seal-on: var(--color-on-achievement);
}
.reading-section[data-react-reading-section="worked_example"] {
  --reading-seal-glyph: "例";
  --reading-seal: var(--color-text);
  --reading-seal-on: var(--color-bg);
}
.reading-section[data-react-reading-section="common_pitfalls"] {
  --reading-seal-glyph: "误";
  --reading-seal: var(--color-primary);
  --reading-seal-on: var(--color-on-primary);
}
@media (max-width: 599px) {
  .reading-section-toggle-label { font-size: 1.25rem; gap: var(--space-2); }
  .reading-section-toggle-label::before { width: 28px; height: 28px; font-size: 1rem; }
  /* The worked example's invitation takes its own line under the title
     instead of a sliver of column beside it; the chevron stays on the
     title's line, at its end. */
  .reading-section-toggle .reading-section-prompt { order: 1; flex-basis: 100%; }
  .reading-section-toggle .reading-section-chevron { margin-inline-start: auto; }
}
/* ...and the reading's own title stays the largest thing on the page, above
   the section titles it now has to outrank. */
[data-react-topic-reading] h1 { font-size: clamp(2rem, 1.6rem + 1.2vw, 2.5rem); }
/* The self-check prompt (worked_example only, SECTION_DISPLAY) -- distinct
   from the plain uppercase label so it reads as an invitation, not a
   category tag. Only ever shown while the section is collapsed. */
.reading-section-prompt {
  flex: 1;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-primary-text);
  text-transform: none;
  letter-spacing: normal;
}
/* A chevron (angle-corner, no shaft), not a plus/minus glyph -- two square
   sides rotated to a corner point. rotate(-45deg) points right (closed,
   "next state is: expand rightward/down"); rotate(45deg) points down
   (open). Drawn with borders rather than a Unicode glyph so weight/size/
   colour stay under CSS control and rendering doesn't depend on the
   platform font actually shipping a matching chevron character. */
.reading-section-chevron {
  flex-shrink: 0;
  align-self: center;
  width: 7px;
  height: 7px;
  margin-inline-end: 2px;
  border-style: solid;
  border-color: var(--color-text-muted);
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
.reading-section-chevron[data-open="true"] {
  transform: rotate(45deg);
}
.reading-section-body {
  font-family: var(--font-sans);       /* PREPPALS-1: read text is the system sans */
  font-size: calc(1.0625rem * var(--text-scale, 1));
  line-height: 1.7;
  font-variant-numeric: lining-nums;
  color: var(--color-text);
  margin: 0;
  white-space: pre-wrap;   /* authored paragraph breaks in content_i18n survive */
}
/* READING_CONTENT_CONTRACT.md SS9: a renderer figure placed as a block inside
   a reading section. The .item-figure plate inside it is the practice
   screen's, which bleeds to a question card's edges through --question-pad;
   a reading has no card, so here the plate sits inside the text column with
   a border of its own. white-space resets the body's pre-wrap, which would
   otherwise reach the renderers' own text. */
.reading-figure {
  margin: var(--space-3) 0;
  white-space: normal;
}
.reading-figure .item-figure {
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.reading-figure-caption {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
  text-align: center;
}
.reading-unavailable {
  color: var(--color-text-muted);
  font-size: var(--text-md);
  margin: 0;
}
/* The live "N of M questions in this bank cover this topic" line --
   enrichment, so it reads as a quiet fact under the title, not a second
   heading competing with it. The column's stack gap would otherwise open a
   ~44px hole between the title and this line (gap + the h1's own bottom
   margin), so it is pulled back up the same way .view-eyebrow + h1 is: the
   title and its fact read as one block, the gap below the line stays whole. */
.reading-item-share {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: calc(-1 * var(--nav-stack-gap, 0px)) 0 0;
}

/* ---------------------------------------------------------------------------
   READING_CONTENT_CONTRACT.md SS7 -- info-note buttons and the keyword
   underline toggle. Both are purely additive: a reading with no [[info:...]]
   / [[kw]] markers in its content_i18n renders with none of this visible.
   --------------------------------------------------------------------------- */

/* A quiet secondary control, same visual family as .topic-chip-read
   (small, transparent, border on hover) -- it sits right under the item-
   share line rather than competing with the title or the practice CTA. */
.reading-keyword-toggle {
  align-self: flex-start;
  padding: var(--space-1) var(--space-2);
  min-height: 32px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-primary-text);
  background: transparent;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
}
.reading-keyword-toggle:hover {
  background: var(--color-primary-subtle-bg);
}
.reading-keyword-toggle:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.reading-keyword-toggle[aria-pressed="true"] {
  background: var(--color-primary-subtle-bg);
  border-color: var(--color-primary-text);
}

/* Highlighter-pen style, not underline -- a solid yellow marker swatch
   behind the word, black-ish text forced ON TOP of it regardless of
   theme (a highlight has to stay legible against ITSELF, independent of
   whatever --color-text currently resolves to). Pure CSS switch keyed off
   the ancestor data-reading-keywords attribute (TopicReading.tsx) -- the
   span is ALWAYS in the DOM regardless of toggle state, only its paint
   changes, so there is no re-render or re-parse cost to toggling. */
.reading-keyword {
  background: var(--color-keyword-highlight-bg);
  color: var(--color-keyword-highlight-text);
  padding: 0.05em 0.15em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;    /* the highlight wraps per LINE, not one box across a break */
}
[data-reading-keywords="off"] .reading-keyword {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* The info button anchor. position:relative so its popover (position:
   absolute) anchors to THIS span, not to the paragraph or the screen. */
.reading-info-anchor {
  position: relative;
  display: inline-block;
}
.reading-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-inline-start: 2px;
  padding: 0;
  border: 1px solid var(--color-primary-text);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-primary-text);
  font-size: 0.7rem;
  font-weight: var(--weight-medium);
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transform: translateY(-1px);
}
.reading-info-btn:hover {
  background: var(--color-primary-subtle-bg);
}
.reading-info-btn:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.reading-info-btn[aria-expanded="true"] {
  background: var(--color-primary-subtle-bg);
}

/* Anchored popover, not a modal (SS7.4) -- deliberately simple positioning
   for this first pass: left-anchored with a capped width rather than
   viewport-aware flipping. KNOWN ROUGH EDGE, accepted for the pilot: a
   button near the right edge of a narrow viewport can push this slightly
   past it. See READING_CONTENT_CONTRACT.md SS7.4 before "fixing" this. */
.reading-info-popover {
  position: absolute;
  z-index: 5;
  top: 100%;
  inset-inline-start: 0;
  margin-top: var(--space-1);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  width: max-content;
  max-width: min(280px, calc(100vw - 48px));
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  line-height: var(--leading-snug);
  color: var(--color-text);
  text-decoration: none;             /* never inherit an ancestor .reading-keyword's underline */
  white-space: normal;               /* independent of .reading-section-body's pre-wrap */
}
.reading-info-popover-body {
  flex: 1;
}
.reading-info-popover-close {
  flex-shrink: 0;
  padding: 0;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.reading-info-popover-close:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   CARD-SHAPED CONTROLS (PREPPALS-1, after NUBE-1's chunky keys) -- one
   treatment for every card-shaped control that has no rule of its own: the
   topic chips, the language choices, the Review rows and the auth inputs. A
   1px boundary (still --color-border-strong, so still 3:1), a soft contact
   shadow, a 1px lift onto a wider shadow on hover, and a press that settles
   it. Placed after their own rules on purpose: it overrides by source order,
   and it stays above the dark-mode token blocks, which must remain last in
   the file.
   --------------------------------------------------------------------------- */
.topic-chip,
.language-option-btn,
.attempt-history-row {
  border-width: 1px;
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.topic-chip:hover:not(.topic-chip--disabled),
.language-option-btn:hover,
.attempt-history-row:hover {
  border-color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.topic-chip:active:not(.topic-chip--disabled),
.language-option-btn:active,
.attempt-history-row:active {
  transform: translateY(0);
  box-shadow: none;
}
.topic-chip--disabled,
.topic-chip--disabled:hover {
  box-shadow: none;
  transform: none;
}
.topic-chip-name { font-weight: var(--weight-semibold); }
.language-option-btn { font-weight: var(--weight-semibold); }
.auth-field-input { border-width: 1px; }
@media (prefers-reduced-motion: reduce) {
  .topic-chip, .language-option-btn, .attempt-history-row { transition: none; }
  .topic-chip:hover:not(.topic-chip--disabled), .language-option-btn:hover, .attempt-history-row:hover,
  .topic-chip:active:not(.topic-chip--disabled), .language-option-btn:active, .attempt-history-row:active {
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   MOCK EXAMS (MOCK-UI-1, phase 1 of .claude/interfaces/PLAN.md): the hub
   (MockHub.tsx), the sitting (MockExam.tsx) and the results (MockResults.tsx).

   THE SITTING COPIES THE REAL CSCA COMPUTER-BASED TEST, from the product
   owner's screenshot: one elevated card; a sidebar behind a vertical rule
   (about a quarter of the card) holding the candidate panel and an
   eight-column grid of round numbered chips, the current one green with a
   ring; a main pane with "Question N" and Submit on one row, "Mark for review"
   and "Save & exit" against Back, F4, Next, F5 and the clock on the next, a
   full-width dark instruction band, the stem and the options as a 2x2 grid of
   radios. The palette is Nube's: Jade for Submit and the current chip (green,
   as on the real exam), Cinnabar for Next and a chosen radio (the original's
   blue has no place on this board). LACA-1 keeps that green through the
   exam room's own --mock-go tokens, so the brand's move to deep Gold leaves
   the sitting looking like the real test; Next and the radio follow the
   primary, now the lacquer red. The exam room uses the interface sans,
   like the real one, not the display face of the other screens. Below 900px the sidebar becomes a
   strip above the question and the grid folds behind a "Questions" button.
   The review on the results screen reuses the same card and grid.
   --------------------------------------------------------------------------- */

/* The sitting is the whole page, as in the exam room: no app header. Its own
   "Save & exit" is the way out. */
html[data-csca-mock="test"] .app-header { display: none; }

/* A THIRD SECTION IN THE ONE-ROW HEADER. "Mock exams" took about 140px of
   the row, and between 1280px (where the row starts) and 1440px the signed-in
   email had to give it all back -- squeezed to 75px of its 200px cap with the
   trial countdown showing. In that range the pills tighten their padding and
   the three section pills drop their decorative seals (科 模 复); every word
   stays. Placed after the seal rules so it wins on source order. */
@media (min-width: 1280px) and (max-width: 1439px) {
  .app-nav .nav-link { padding: 0 var(--space-3); }
  #nav-subjects-link::before,
  #nav-mocks-link::before,
  #nav-history-btn::before { content: none; }
}
/* #app-root is empty while React owns these screens; its padding would only
   push the screen down (the same rule as the Review screen's). */
html[data-csca-mock] main#app-root { padding: 0; }

/* -- Next-exam countdown (EXAM-COUNTDOWN-1, phase 2; PREPPALS-1 bar) -----
   The reference's coloured announcement bar, in Cinnabar: the first thing
   on this hub (the subjects screen shows the days on its hero card
   instead), flush under the header and as wide as the page (its ground is painted outside its own centred box with
   border-image-outset, the same full-width-without-a-wider-box device as the
   subjects screen's hero). One centred line from 768px: the 考 seal on a
   white disc, the label and the dates, the days left in a darker Cinnabar
   chip (white on it 8.42:1), the official notice with an arrow, and the hide
   button at the right end. Wraps on a phone; the link and the hide button
   keep 44px targets. Every text is white on the bar (4.89:1 at its lightest,
   5.33:1 on the solid Cinnabar under the gradient), in both schemes. */
.exam-countdown {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-1) var(--space-3);
  min-height: 52px;
  margin: 0 auto var(--space-6);
  padding-block: var(--space-1);
  padding-inline: var(--space-2) 48px;
  background-color: var(--color-primary);
  border-image-source: var(--gradient-countdown);
  border-image-slice: 0 fill;
  border-image-outset: 0 100vw;
  color: var(--color-on-primary);
}
/* On the hub the Jade band follows it with no gap. */
.exam-countdown:has(+ .mock-hub-hero) { margin-bottom: 0; }
.exam-countdown-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-on-primary);
  color: var(--color-primary);             /* 6.54:1 on the white disc */
  font-family: var(--font-cjk);
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.exam-countdown-text {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 0.9375rem;
  line-height: var(--leading-snug);
}
.exam-countdown-tail { white-space: nowrap; }
.exam-countdown-label { font-weight: var(--weight-bold); }
.exam-countdown-date { font-weight: var(--weight-medium); }
.exam-countdown-dot { margin: 0 2px; }
/* The days left, as one of the reference's countdown chips. */
.exam-countdown-days {
  display: inline-block;
  margin-inline-start: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-lacquer-deep);
  color: var(--color-on-primary);
  font-weight: var(--weight-bold);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.exam-countdown-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-on-primary);
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
/* The reference's "↗": it leaves the site. Empty alternative text -- the
   link already says it opens a new tab. */
.exam-countdown-link::after {
  content: "↗";
  content: "↗" / "";
  text-decoration: none;
  display: inline-block;
}
.exam-countdown-link:hover { text-decoration-thickness: 2px; }
.exam-countdown-link:focus-visible {
  outline: 3px solid var(--color-on-primary);
  outline-offset: -2px;
}
.exam-countdown-hide {
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-on-primary);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}
.exam-countdown-hide:hover { background: var(--brand-lacquer-deep); }
.exam-countdown-hide:focus-visible {
  outline: 3px solid var(--color-on-primary);
  outline-offset: -3px;
}
@media (max-width: 599px) {
  .exam-countdown { justify-content: flex-start; padding-inline-start: 0; }
  .exam-countdown-text { flex: 1 1 12rem; }
}

/* -- Seal --------------------------------------------------------------- */
/* PREPPALS-1: the subject cards' tinted square (it was NUBE-1's hexagon). */
.mock-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--subject-tint, var(--color-figure-accent-subtle));
  color: var(--subject-text, var(--color-accent-text));
  font-family: var(--font-cjk);
  font-size: 1.25rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}

/* -- Hub ---------------------------------------------------------------- */
/* PREPPALS-1: no top padding, so the countdown bar sits flush under the
   header; the hub's own heading keeps its distance from whatever is above. */
#react-root .mock-hub {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
@media (min-width: 720px) {
  #react-root .mock-hub { padding: 0 24px 56px; }
}
/* The hub's heading on the subjects screen's deep-Jade band, shorter and
   centred (the band, its full-width ground and its wave are shared with
   .subject-hero -- see there). */
.mock-hub-hero {
  text-align: center;
  margin-bottom: var(--space-6);
  padding: var(--space-7) 0 calc(var(--space-6) + 2 * var(--wave-amp) + var(--wave-base));
}
.mock-hub-hero h1 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  color: var(--color-on-hero);
}
.mock-hub-subtitle {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  color: var(--color-on-hero-muted);
  line-height: var(--leading-normal);
}
.mock-hub-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
}
.mock-hub-stat {
  min-width: 9rem;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  text-align: center;
}
.mock-hub-stat dt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.mock-hub-stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-display);
  font-variant-numeric: lining-nums tabular-nums;
}
/* Wrapping rows centred, so five subjects read as three and two under one
   axis (as the subject screen centres its orphans), and a card that opens its
   start confirmation does not stretch its neighbours. */
.mock-hub-subjects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--space-4);
}
.mock-hub-card {
  flex: 0 1 21rem;
  min-width: min(100%, 17rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
}
.mock-hub-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.mock-hub-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  color: var(--subject-text, var(--color-text));
}
.mock-hub-card-meta {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.mock-hub-card-scores {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  font-size: var(--text-sm);
}
.mock-hub-card-running {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-accent-text);
}
.mock-hub-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}
.mock-hub-card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.mock-hub-card-actions > .next-btn,
.mock-hub-card-actions > .btn-secondary {
  flex: 1 1 auto;
  min-width: 0;
}
.mock-hub-confirm {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}
.mock-hub-confirm-title {
  margin: 0;
  font-weight: var(--weight-semibold);
}
.mock-hub-confirm-body {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.mock-hub-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-1);
}
.mock-hub-confirm-actions > .next-btn { min-width: 0; }
.mock-hub-error {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-incorrect-text);
}
.mock-hub-history {
  max-width: 760px;
  margin: var(--space-7) auto 0;
}
.mock-hub-history h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-display);
}
.mock-hub-history-empty {
  margin: 0;
  color: var(--color-text-muted);
}
.mock-hub-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mock-hub-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding-block: var(--space-2);
  padding-inline: var(--space-4) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
}
.mock-hub-history-subject {
  font-weight: var(--weight-semibold);
  color: var(--subject-text, var(--color-text));
}
.mock-hub-history-date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.mock-hub-history-score strong {
  font-size: var(--text-lg);
  font-variant-numeric: tabular-nums;
}
.mock-hub-history-max {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
@media (max-width: 599px) {
  .mock-hub-history-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: var(--space-3);
  }
  .mock-hub-history-row > .btn-secondary { grid-column: 1 / -1; }
}
.mock-gate {
  max-width: 36rem;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
  text-align: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
}
.mock-gate h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-display);
}
.mock-gate p {
  margin: 0 0 var(--space-5);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}
.mock-gate p:last-child { margin-bottom: 0; }
.mock-gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* -- The sitting ---------------------------------------------------------- */
#react-root .mock-exam,
#react-root .mock-results {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-6);
}
/* Loading, failure and "still running" states sit in the reading column. */
#react-root .mock-exam--status {
  max-width: var(--measure);
  padding-top: var(--space-6);
}
.mock-exam-status-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}
.mock-exam-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.mock-exam-card {
  display: grid;
  grid-template-columns: minmax(17rem, 23%) minmax(0, 1fr);
  min-height: min(48rem, calc(100dvh - 5rem));
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
}
.mock-exam-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5) var(--space-4);
  border-inline-end: 1px solid var(--color-border);
}
.mock-exam-candidate {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
/* The real exam's photo slot, holding the subject's seal here. */
.mock-exam-photo {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 76px;
  border: 1px solid var(--color-border-strong);
  border-radius: 4px;
  background: var(--subject-tint, var(--color-figure-accent-subtle));
}
.mock-exam-candidate-info {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  margin: 0;
  font-size: var(--text-sm);
}
.mock-exam-candidate-info > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
}
.mock-exam-candidate-info dt { font-weight: var(--weight-semibold); }
.mock-exam-candidate-info dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.mock-exam-nav-toggle { display: none; }
.mock-exam-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: var(--space-3) var(--space-1);
}
/* Each cell spans its column and centres its chip: a cell that shrank to its
   content would leave the chip's percentage width nothing to resolve against,
   and the circle collapsed to the width of its digits. */
.mock-exam-grid > li {
  display: flex;
  justify-content: center;
  min-width: 0;
}
.mock-exam-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 34px);
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--color-track);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.mock-exam-chip:hover { border-color: var(--color-text); }
.mock-exam-chip:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
}
/* Answered: an inked bubble, as on an answer sheet. */
.mock-exam-chip[data-state="answered"] {
  background: var(--color-text);
  color: var(--color-surface);
}
.mock-exam-chip[aria-current="step"] {
  background: var(--mock-go);
  color: var(--color-on-mock-go);
  box-shadow: 0 0 0 2px var(--color-surface-elevated), 0 0 0 4px var(--mock-go);
}
/* Marked for review: a Gold dot on the chip. */
.mock-exam-chip[data-marked="true"]::after {
  content: "";
  position: absolute;
  top: -3px;
  inset-inline-end: -3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--color-surface-elevated);
  border-radius: 50%;
  background: var(--color-achievement);
}
.mock-exam-progress {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.mock-exam-pace {
  margin: var(--space-1) 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.mock-exam-pace[data-pace="behind"] { color: var(--color-warning-text); }
.mock-exam-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.mock-exam-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.mock-exam-swatch {
  width: 12px;
  height: 12px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--color-track);
}
.mock-exam-swatch[data-state="current"] { background: var(--mock-go); }
.mock-exam-swatch[data-state="answered"] { background: var(--color-text); }
.mock-exam-swatch[data-state="marked"] { background: var(--color-achievement); }
.mock-exam-swatch[data-state="correct"] {
  background: var(--color-correct-bg);
  border-color: var(--color-correct-text);
}
.mock-exam-swatch[data-state="incorrect"] {
  background: var(--color-incorrect-bg);
  border-color: var(--color-incorrect-text);
}

.mock-exam-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5) var(--space-6) var(--space-6);
}
.mock-exam-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
/* The interface sans, as on the real exam's "Question 1" -- not the display
   face every other h1 here wears: the sitting copies the real CBT screen. */
.mock-exam-bar--title h1,
.mock-review-question-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 1.45rem + 0.9vw, 2.25rem);
  font-weight: var(--weight-bold);
  font-variant-numeric: lining-nums;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
}
.mock-exam-submit {
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  border: 2px solid var(--mock-go);
  border-radius: var(--radius);
  background: var(--mock-go);
  color: var(--color-on-mock-go);
  font: inherit;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.mock-exam-submit:hover {
  background: var(--mock-go-hover);
  border-color: var(--mock-go-hover);
}
.mock-exam-submit:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.mock-exam-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}
.mock-exam-tool {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-1);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-lg);
  cursor: pointer;
}
.mock-exam-tool:hover { color: var(--color-text); }
.mock-exam-tool:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.mock-exam-mark { color: var(--color-text); }
/* TEXT-SIZE-1: A− / A+ at the end of the tools, as plain as the tools. */
.mock-exam-text-size .text-size-btn { border-color: transparent; background: none; color: var(--color-text-muted); }
.mock-exam-text-size .text-size-btn:hover { color: var(--color-text); }
.mock-exam-mark[aria-pressed="true"] { color: var(--color-achievement-text); }
.mock-exam-star { flex: none; }
.mock-exam-move {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.mock-exam-back,
.mock-exam-next {
  min-width: 6rem;
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.mock-exam-back {
  border-color: var(--color-border-strong);
  background: var(--color-surface-elevated);
  color: var(--color-text);
}
.mock-exam-back:hover { border-color: var(--color-text); }
.mock-exam-next {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}
.mock-exam-next:hover {
  border-color: var(--color-primary-hover);
  background: var(--color-primary-hover);
}
.mock-exam-back[aria-disabled="true"],
.mock-exam-next[aria-disabled="true"] {
  border-color: var(--color-disabled-bg);
  background: var(--color-disabled-bg);
  color: var(--color-disabled-text);
  cursor: default;
}
.mock-exam-back:focus-visible,
.mock-exam-next:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.mock-exam-key {
  padding: 0 var(--space-1);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.mock-exam-timer {
  margin-inline-start: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--color-text);
}
.mock-exam-timer[data-urgent="true"] { color: var(--color-incorrect-text); }
.mock-exam-instructions {
  margin: 0;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  background: var(--color-text);
  color: var(--color-surface);
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}
.mock-exam-error { margin: 0; }
.mock-exam-question {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}
.mock-exam-stem {
  margin: 0;
  font-size: calc(1.25rem * var(--text-scale, 1));
  line-height: var(--leading-normal);
  /* authored line breaks in stems (reading passages, tables) must survive */
  white-space: pre-line;
  font-variant-numeric: lining-nums;
  overflow-x: auto;
  overflow-y: hidden;
}
.mock-exam-options {
  display: grid;
  gap: var(--space-2) var(--space-6);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.mock-exam-options[data-layout="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mock-exam-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3);
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: calc(1.125rem * var(--text-scale, 1));
  line-height: var(--leading-snug);
  cursor: pointer;
}
.mock-exam-option:hover { background: var(--color-primary-subtle-bg); }
.mock-exam-option[data-selected="true"] {
  border-color: var(--color-primary-subtle-bg);
  background: var(--color-primary-subtle-bg);
}
.mock-exam-radio {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  border: 2px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface-elevated);
  cursor: pointer;
}
.mock-exam-radio::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary-text);
  transform: scale(0);
  transition: transform 100ms ease;
}
.mock-exam-radio:checked { border-color: var(--color-primary-text); }
.mock-exam-radio:checked::before { transform: scale(1); }
.mock-exam-radio:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.mock-exam-option-letter {
  flex: none;
  font-weight: var(--weight-semibold);
}
.mock-exam-option-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: lining-nums;
  overflow-x: auto;
  overflow-y: hidden;
}
.mock-exam-save-error {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-incorrect-text);
}

/* -- Dialogs -------------------------------------------------------------- */
.mock-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: var(--color-overlay);
}
.mock-dialog {
  width: min(100%, 30rem);
  padding: var(--space-5);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  box-shadow: var(--shadow-md);
}
.mock-dialog h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}
.mock-dialog p {
  margin: 0 0 var(--space-3);
  line-height: var(--leading-normal);
}
.mock-dialog-note {
  font-weight: var(--weight-semibold);
  color: var(--color-warning-text);
}
.mock-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.mock-dialog-actions > .next-btn { min-width: 0; }

/* -- Results ------------------------------------------------------------- */
.mock-results-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-width: 40rem;
  margin: 0 auto var(--space-6);
  text-align: center;
}
.mock-results-eyebrow {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--subject-text, var(--color-accent-text));
}
.mock-results-summary h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.625rem);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
}
.mock-results-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-1);
  margin: 0;
}
.mock-results-score-value {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 2.8rem + 3vw, 5rem);
  font-weight: var(--weight-display);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.mock-results-score-max {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
}
.mock-results-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-1) var(--space-5);
  color: var(--color-text-muted);
}
.mock-results-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.mock-results-summary .mock-hub-confirm {
  max-width: 30rem;
  text-align: start;
}
.mock-review-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-display);
}
/* In the review the chips keep their verdict colours; the current one gets a
   ring rather than the sitting's Jade fill. */
.mock-exam-chip[data-state="correct"] {
  border-color: var(--color-correct-text);
  background: var(--color-correct-bg);
  color: var(--color-correct-text);
}
.mock-exam-chip[data-state="incorrect"] {
  border-color: var(--color-incorrect-text);
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect-text);
}
.mock-exam-card--review .mock-exam-chip[aria-current="step"] {
  box-shadow: 0 0 0 2px var(--color-surface-elevated), 0 0 0 4px var(--color-text);
}
.mock-exam-card--review .mock-exam-chip[data-state="open"][aria-current="step"] {
  background: var(--color-track);
  color: var(--color-text);
}
.mock-review-verdict {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.mock-review-verdict[data-verdict="correct"] {
  background: var(--color-correct-bg);
  color: var(--color-correct-text);
}
.mock-review-verdict[data-verdict="incorrect"] {
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect-text);
}
.mock-review-verdict[data-verdict="unanswered"] {
  background: var(--color-track);
  color: var(--color-text);
}
.mock-review-time {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.mock-review-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.mock-review-option {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1.125rem;
  line-height: var(--leading-snug);
}
.mock-review-option[data-correct="true"] {
  border-color: var(--color-correct-text);
  background: var(--color-correct-bg);
}
.mock-review-option[data-chosen="true"]:not([data-correct="true"]) {
  border-color: var(--color-incorrect-text);
  background: var(--color-incorrect-bg);
}
.mock-review-tag {
  margin-inline-start: auto;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.mock-review-option[data-chosen="true"]:not([data-correct="true"]) .mock-review-tag { color: var(--color-incorrect-text); }
.mock-review-option[data-correct="true"] .mock-review-tag { color: var(--color-correct-text); }
.mock-review-explanation-heading {
  margin: var(--space-3) 0 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

/* -- Narrow screens ------------------------------------------------------ */
@media (max-width: 899px) {
  .mock-exam-card {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .mock-exam-side {
    gap: var(--space-3);
    padding: var(--space-4);
    border-inline-end: none;
    border-bottom: 1px solid var(--color-border);
  }
  .mock-exam-candidate { padding-bottom: var(--space-3); }
  .mock-exam-photo { width: 48px; height: 56px; }
  .mock-exam-photo .mock-seal { width: 36px; height: 32px; font-size: 1rem; }
  .mock-exam-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    min-height: 44px;
    padding: var(--space-2) var(--space-4);
    border: 2px solid var(--color-border-strong);
    border-radius: var(--radius);
    background: var(--color-surface-elevated);
    color: var(--color-text);
    font: inherit;
    font-weight: var(--weight-semibold);
    cursor: pointer;
  }
  .mock-exam-nav-toggle::after {
    content: "";
    width: 8px;
    height: 8px;
    border-inline-end: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
  }
  .mock-exam-nav-toggle[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
  .mock-exam-nav-toggle-count {
    margin-inline-start: auto;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
  }
  .mock-exam-nav-toggle:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
  }
  .mock-exam-nav:not([data-open="true"]) { display: none; }
  .mock-exam-grid { max-width: 26rem; }
  .mock-exam-main { padding: var(--space-4); }
}
@media (max-width: 599px) {
  #react-root .mock-exam,
  #react-root .mock-results { padding: var(--space-3) var(--space-4) var(--space-5); }
  .mock-exam-options[data-layout="grid"] { grid-template-columns: minmax(0, 1fr); }
  .mock-exam-move {
    width: 100%;
    justify-content: space-between;
  }
  /* F4/F5 mean nothing on a phone's keyboard. */
  .mock-exam-key { display: none; }
  .mock-exam-timer { margin-inline-start: auto; }
  .mock-exam-tool { font-size: var(--text-md); }
  .mock-exam-instructions { font-size: var(--text-md); }
  .mock-exam-stem { font-size: calc(1.125rem * var(--text-scale, 1)); }
  .mock-exam-option { font-size: calc(var(--text-md) * var(--text-scale, 1)); }
  .mock-exam-submit { font-size: var(--text-md); }
}
@media (prefers-reduced-motion: reduce) {
  .mock-exam-radio::before { transition: none; }
}

/* ===========================================================================
   DRAGON GATE — DARK MODE (FE-0 foundation)
   ===========================================================================

   PLACED LAST IN THE FILE, DELIBERATELY. Three gates read this stylesheet by
   regex and take the FIRST rule that matches a selector:
   backend/verify_step1.py section 70.2 (each *-widget-canvas block must
   contain width:100% and height:auto) and section 72.3 (four named T1 renderer
   classes). A block placed earlier in the file would be inspected instead of
   the real definition. Nothing below re-declares a *widget* class at all, but
   the ordering rule is recorded because the next batch will be tempted to.

   TOKENS ONLY, NO COMPONENT RULES. This block re-points the palette and stops
   there. FE-0's job is to prove the token architecture supports a second
   scheme, not to restyle the application twice; the systematic dark-mode
   application belongs to the next visual batch.

   HOW IT WORKS: --color-primary is declared as var(--product-primary), and
   custom properties resolve at computed-value time, so re-pointing the two
   Tier 2 variables below re-skins every Tier 3 token defined through them.
   Only tokens that are literal values in :root need restating here.

   HONEST TEST-COVERAGE NOTE: tests/playwright/playwright.config.js sets no
   colorScheme, so Playwright's default 'light' means the 106 pre-existing specs
   never exercise this block, and jsdom paints nothing at all. That gap is why
   tests/dom/tests/62_brand_tokens.test.js parses these declarations and
   recomputes their contrast ratios, and why
   tests/playwright/specs/dragon_gate_brand_responsive.spec.js runs a
   colorScheme:'dark' project against the real browser. Without those two, this
   block would be entirely unverified.

   DRAGON-GATE-PALETTE-1: RE-DERIVED, not transplanted. The old dark surfaces
   (#0D1412/#141E1B/#1B2925) were a COOL near-black picked to suit the old
   cool Ink primitive. This palette's Ink is warm (#241C16), so the dark
   surfaces below were warm too -- a warm brown-black stack, not the old cool
   one re-skinned with new accent colours on top. Every brand-on-dark variant
   (Green, Cinnabar, Gold) was independently contrast-derived against THOSE
   surfaces, the same discipline FE-0 used for the original dark palette.

   DRAGON-GATE-PALETTE-1A: the "warm brown-black stack" above was a defect,
   not a feature -- manual product review found it read as brown/sepia/
   espresso, especially since --color-bg/--color-surface/--color-surface-
   elevated occupy most of a dark-mode viewport. The whole NEUTRAL ladder
   (bg, surface, elevated, border, structure, figure-muted, border-strong,
   disabled-bg, disabled-text -- every dark token whose hue came from the old
   Ink primitive at low-to-mid lightness) is re-hued here from H~33-38°
   (orange/brown) to H~145-160° (a restrained, low-chroma green -- "warm
   charcoal / subtly green-black", never above ~15% saturation, deliberately
   short of the Imperial Green primitive's own 70% saturation so the neutral
   family reads as charcoal-with-personality, not as a colored background).
   --color-text and --color-text-muted keep their ORIGINAL warm hue on
   purpose: at 67-93% lightness the same H~34-36° reads as warm white/warm
   grey, not brown -- the brief's complaint is specifically about large
   LOW-lightness fills, which text colour never is. Every re-hued token kept
   its OLD lightness (only hue and saturation moved), which is why every
   contrast ratio below lands within a few hundredths of its PALETTE-1
   figure: this was a hue correction, not a re-derivation from scratch.
   Brand-on-dark variants (Green/Cinnabar/Gold-on-dark), every semantic
   bg/text pair, and --color-primary-subtle-bg were independently re-verified
   against the new surfaces (see the PALETTE-1A commit) and needed no change
   -- they remained comfortably accessible and visually coherent, per the
   instruction not to touch what is not demonstrably broken.

   Chosen via a 3-candidate real-browser comparison (near-neutral / this one
   / cooler-greener) scored by an independent panel against exactly the
   brief's criteria (brown avoidance, charcoal-first character, green-black
   subtlety, premium/academic tone, brand coherence): this candidate won
   unanimously. The rejected cooler/greener candidate's surface and elevated
   tokens pushed green far enough ahead of blue (G-B ~7-8 vs ~3-4 here) to
   read as distinctly green-tinted card/panel surfaces rather than a
   charcoal whisper -- the specific "too green" overreach the brief warned
   against, despite that candidate's hue nominally sitting closer to
   Imperial Green's own. The rejected near-neutral candidate was safe but
   flat: correct, unmistakably non-brown, but under-delivering on "subtly
   related to China" with almost no brand personality in the neutral layer.

   DRAGON-GATE-NUBE-1 (2026-10-08): first only the BRAND layer moved. Dragon
   Orange's dark variant gave way to the board Cinnabar's (#F0806B), Imperial
   Green's to Jade's (#6CC9A6), Gold's to #E2C25A, and the subject colours
   gained their dark text/mark/tint members.

   NUBE-1 NIGHT, the same day, REVERSES PALETTE-1A's hue choice by the
   product owner's explicit decision: the dark mode must be the Nube board's
   own night, whose neutrals are warm browns (#191816 page, #23211E card,
   #3A3632 divider), not the green-tinted charcoal. The board also keeps the
   deep Cinnabar as the fill of a primary control, with a white label, so the
   primary no longer inverts to a bright fill with an Ink label -- see the
   block's own header. Semantic state pairs are unchanged.

   EVERY RATIO BELOW IS MEASURED against the dark surfaces declared here. */
/* ---------------------------------------------------------------------------
   MY PLAN (STUDY-PLAN-1, phase 3 of .claude/interfaces/PLAN.md). The screen
   (StudyPlan.tsx): the deep-Jade band with the heading, then one card per
   subject, its topics numbered weakest first -- each with the mock-exam line
   and its bar, the practice line apart, and Read / Practise. The subjects
   screen's card (PlanCard.tsx) is the way in. Every hue on them is a
   subject's own (--subject-*), set by data-subject-tone.
   --------------------------------------------------------------------------- */
html[data-csca-plan] main#app-root { padding: 0; }
#react-root .study-plan {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
@media (min-width: 720px) {
  #react-root .study-plan { padding: 0 24px 56px; }
}
.study-plan-hero {
  text-align: center;
  margin-bottom: var(--space-6);
  padding: var(--space-7) 0 calc(var(--space-6) + 2 * var(--wave-amp) + var(--wave-base));
}
.study-plan-hero h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  color: var(--color-on-hero);
}
.study-plan-subtitle {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
}
.study-plan-subjects {
  display: grid;
  gap: var(--space-5);
}
.study-plan-subject,
.study-plan-empty {
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.study-plan-subject-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.study-plan-subject-title { min-width: 0; }
.study-plan-subject-title h2 {
  margin: 0;
  font-size: 1.375rem;
  color: var(--subject-text, var(--color-text));
}
.study-plan-subject-meta {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
/* Numbered weakest first: the number is generated content with empty
   alternative text -- the list itself is an ordered list for assistive
   technology. */
.study-plan-topics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  counter-reset: plan-topic;
}
.study-plan-topic {
  position: relative;
  counter-increment: plan-topic;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  padding-block: var(--space-4);
  padding-inline: 60px var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
}
.study-plan-topic::before {
  content: counter(plan-topic);
  content: counter(plan-topic) / "";
  position: absolute;
  inset-inline-start: var(--space-4);
  top: var(--space-4);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--subject-tint, var(--color-figure-accent-subtle));
  color: var(--subject-text, var(--color-accent-text));
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-display);
}
.study-plan-topic-text { flex: 1 1 18rem; min-width: 0; }
.study-plan-topic-name {
  margin: 0;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}
.study-plan-topic-module {
  margin: 2px 0 var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.study-plan-topic-mock {
  margin: 0 0 6px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
/* The share right, drawn in the subject's progress mark (3:1 or more on the
   track); the sentence above it says the same in words. */
.study-plan-bar {
  display: block;
  max-width: 16rem;
  height: 6px;
  margin-bottom: var(--space-2);
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-track);
}
.study-plan-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--subject-mark, var(--color-progress-fill));
}
.study-plan-topic-practice {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.study-plan-topic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.study-plan-topic-actions .next-btn,
.study-plan-topic-actions .btn-secondary {
  min-width: 0;
  min-height: 44px;
  padding: 10px var(--space-5);
  font-size: var(--text-sm);
}
.study-plan-few {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.study-plan-empty {
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
}
.study-plan-empty h2 { margin: 0 0 var(--space-3); }
.study-plan-empty p { margin: 0 0 var(--space-5); color: var(--color-text-muted); }
@media (max-width: 599px) {
  .study-plan-subject { padding: var(--space-4); }
  .study-plan-topic { padding-block: var(--space-3); padding-inline: 52px var(--space-3); }
  .study-plan-topic::before { inset-inline-start: var(--space-3); top: var(--space-3); }
  /* The two buttons share the row when their labels fit side by side, and
     each takes a full line when they do not (a long label, as Russian's
     "Практиковать", never runs out of its pill). */
  .study-plan-topic-actions { width: 100%; }
  .study-plan-topic-actions > * { flex: 1 1 auto; }
}

/* The subjects screen's way in: one white card under the subject cards, a
   计 (计划, "plan") seal, a line and a glimpse of the first topics. */
.plan-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-6) 0 0;
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.plan-card-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);       /* 5.57:1 on its tint, 6.06:1 at night */
  font-family: var(--font-cjk);
  font-size: 1.5rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.plan-card-body { flex: 1 1 18rem; min-width: 0; }
.plan-card-body h2 { margin: 0 0 4px; font-size: 1.25rem; }
.plan-card-text { margin: 0; color: var(--color-text-muted); }
.plan-card-topics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}
.plan-card-topics li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding-block: 4px;
  padding-inline: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--subject-tint);
  color: var(--subject-text);            /* 4.88:1 or more on its tint, both schemes */
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.plan-card-topic-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-surface-elevated);
  font-family: var(--font-cjk);
  font-size: 0.8125rem;
  line-height: 1;
}
.plan-card-cta { flex: none; }
@media (max-width: 599px) {
  .plan-card { padding: var(--space-4); }
  .plan-card-cta { width: 100%; }
}

/* ===========================================================================
   MOTION-1 (DASHBOARD-1, product owner 2026-10-23: "mejores animaciones").
   The subjects screen ARRIVES instead of appearing: the hero's lines one
   after another and the Gold stroke drawing itself under the heading, the
   subject cards in turn, each progress bar sweeping to its width, every card
   below fading in as it is drawn, and a shimmering outline of the cards
   while the catalog loads. Four rules hold for all of it:

   1. ONLY WHERE MOTION IS WELCOME. Every animation below sits inside
      @media (prefers-reduced-motion: no-preference): with "reduce" the
      screen is drawn exactly as it always was. The numbers that count up
      follow the same media query in motion.tsx.
   2. NEVER THE BOX. Entrances animate opacity, filter and clip-path only,
      never a transform or a margin: the responsive specs measure boxes the
      moment a screen is drawn, and a box on its way in would be measured
      mid-flight. (The Gold stroke is generated content, which no box
      measurement reaches, so it may scale.) Hover and press keep the small
      transforms they already had.
   3. SHORT AND FINITE. Nothing lasts longer than 0.9 s with its delay, the
      stagger stops at the sixth element, and nothing loops except the
      skeleton's shimmer, which exists only while the catalog loads.
   4. NOTHING LEFT BEHIND. Entrances fill BACKWARDS only: once one has run,
      the element has no opacity, filter or clip-path of its own, so no
      contrast walker, screenshot or stacking context ever sees a residue.
   =========================================================================== */
:root {
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-quick: 180ms;
  --motion-base: 420ms;
  --motion-slow: 760ms;
  --motion-stagger: 70ms;
  /* RTL-DASHBOARD-1: the way a line reads, 1 here and -1 in a right-to-left page
     (the RIGHT-TO-LEFT block): an arrow's turn and its nudge on hover follow it. */
  --dash-line: 1;
}

@keyframes dg-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Fade and de-blur: arrives in place, without moving. */
@keyframes dg-focus-in {
  from { opacity: 0; filter: blur(6px); }
  to { opacity: 1; filter: blur(0); }
}
/* The heading rises out of its own line box: a reveal, not a movement. The
   negative insets keep its text-shadow glow and descenders unclipped. */
@keyframes dg-reveal-up {
  from { clip-path: inset(-30% -8% 100% -8%); opacity: 0.2; }
  to { clip-path: inset(-30% -8% -30% -8%); opacity: 1; }
}
@keyframes dg-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
/* A progress fill sweeps from the left to the width it already has. */
@keyframes dg-fill {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes dg-shimmer {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

@media (prefers-reduced-motion: no-preference) {
  /* THE HERO, line by line. */
  .subject-hero-chip { animation: dg-focus-in var(--motion-base) var(--ease-out-expo) backwards; }
  .subject-hero h1 { animation: dg-reveal-up var(--motion-slow) var(--ease-out-expo) 60ms backwards; }
  .subject-hero h1::after {
    transform-origin: left center;
    animation: dg-draw 640ms var(--ease-out-expo) 220ms backwards;
  }
  .subject-hero-subtitle { animation: dg-focus-in var(--motion-base) var(--ease-out-expo) 160ms backwards; }
  .hero-stats > * {
    animation: dg-focus-in var(--motion-base) var(--ease-out-expo) backwards;
    animation-delay: calc(240ms + var(--dg-i, 0) * var(--motion-stagger));
  }

  /* THE SUBJECT CARDS, in turn, and every progress bar on the screen. */
  .subject-list > * {
    animation: dg-focus-in var(--motion-base) var(--ease-out-expo) backwards;
    animation-delay: calc(var(--dg-i, 0) * var(--motion-stagger));
  }
  .react-subject-select .progress-bar-fill {
    animation: dg-fill 700ms var(--ease-out-expo) 160ms backwards;
  }

  /* THE CARDS BELOW, as each is drawn (most arrive after their own fetch). */
  .react-subject-select > .plan-card,
  .react-subject-select > .exam-dates,
  .react-subject-select > .dash-card,
  .progress-overview {
    animation: dg-appear var(--motion-base) ease-out backwards;
  }

  /* The stagger index, by position: the sixth and later share the last delay. */
  .hero-stats > :nth-child(2), .subject-list > :nth-child(2) { --dg-i: 1; }
  .hero-stats > :nth-child(3), .subject-list > :nth-child(3) { --dg-i: 2; }
  .hero-stats > :nth-child(4), .subject-list > :nth-child(4) { --dg-i: 3; }
  .hero-stats > :nth-child(5), .subject-list > :nth-child(5) { --dg-i: 4; }
  .hero-stats > :nth-child(n + 6), .subject-list > :nth-child(n + 6) { --dg-i: 5; }

  /* THE SEAL ANSWERS THE POINTER: a small tilt with the card's own lift. */
  .subject-card-seal { transition: transform var(--motion-quick) var(--ease-out-expo); }
  .subject-card:hover .subject-card-seal { transform: rotate(-6deg) scale(1.06); }
  .subject-card:active .subject-card-seal { transform: none; }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-1 (product owner 2026-10-23: "poner más cosas en el dashboard"),
   finished as INK-GOLD-1 (the same day: "todo se ve muy cutre, hazlo ver más
   premium", then direction B, "Tinta y oro", chosen from three previews on
   the live screen). Under the subject grid the home screen carries what a
   student needs before the exam: their own figures, the plan, the other
   parts of the product, how each paper works, the home-exam checklist with
   one verified fact a day, and the exam dates. Every card is additive: while
   its data loads, or when it cannot be read, it is simply not there.

   THE LOOK, in five decisions:
   1. SECTIONS, NOT BOXES. A section's title stands on the page itself, large
      and opened by a short Gold rule; only its content sits on a panel. The
      exam dates' own title, which already stood on the page, takes the same
      scale and rule.
   2. HAIRLINES, NOT SHADOWS. Panels are white with a quiet hairline; the
      subject cards keep their 3:1 boundary and lose their resting shadow
      (the pointer still lifts them).
   3. TWO INK PANELS. "Your progress" and "The CSCA in brief" are set in the
      hero's ink with a Gold rim and Gold labels: the two places the screen
      shows figures. The same ink by day and at night (a lighter night ink
      read as "brighter"; the product owner kept the dark one).
   4. STAMPS, NOT CHIPS. A seal is a character inside a square rule, the way
      a seal is pressed in ink: no tinted fill. The subject cards keep their
      tinted seals, the screen's one place for colour.
   5. ONE FILLED ACTION PER PLACE, AND IT IS FLAT. The lacquer pills lose
      their glow on this screen; secondary ways on are text links.
   --------------------------------------------------------------------------- */

/* 1. THE SECTIONS */
.dash-card { min-width: 0; margin: var(--space-8) 0 0; }
.dash-card-heading,
.react-subject-select .exam-dates h2 {
  margin: 0 0 var(--space-5);
  font-size: clamp(1.75rem, 1.15rem + 1.7vw, 2.625rem);
  font-weight: var(--weight-display);
  line-height: 1.04;
  letter-spacing: -0.038em;
}
.dash-card-heading::before,
.react-subject-select .exam-dates h2::before {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin: 0 0 var(--space-4);
  background: var(--brand-gold);
}
.react-subject-select .exam-dates { margin-top: var(--space-8); }

/* THE PANELS */
.dash-panel {
  min-width: 0;
  padding: var(--space-6);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
@media (max-width: 599px) {
  .dash-panel { padding: var(--space-5) 20px; }
}
/* The ink panels. The solid ink is what a contrast check reads; the Gold
   light in the corner is painted over it. Every text on them is one of the
   hero band's own tokens (--color-on-hero*), 9.91:1 or more in both
   schemes. */
.dash-panel--ink {
  background-color: var(--color-feature-ground);
  background-image: radial-gradient(110% 130% at 100% 0%, var(--color-feature-glow), transparent 58%);
  border-color: var(--color-feature-rim);
  color: var(--color-on-hero);
}

/* 4. THE STAMPS: the explore tiles' seals and the plan card's. Deep Gold,
   6.30:1 on the card (9.25:1 at night). */
.dash-explore-seal,
.react-subject-select .plan-card-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--color-accent-text);
  font-family: var(--font-cjk);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}

/* 5. A WAY ON AS A TEXT LINK: its words, then an arrow that moves on hover. */
.dash-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-1);
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.dash-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.dash-link:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.dash-link-arrow { color: var(--color-primary-text); }
.dash-panel--ink .dash-link,
.dash-panel--ink .dash-link-arrow { color: var(--color-on-hero-accent); }
/* The focus ring is ink by day: on an ink panel it takes the band's white. */
.dash-panel--ink :focus-visible { outline-color: var(--color-on-hero); }

/* THE REST OF THE SCREEN, FINISHED TO MATCH (scoped to the subjects screen,
   so the same components elsewhere keep their own finish for now). */
/* The primary pill, flat: the lacquer itself, a darker lacquer on hover. */
.react-subject-select .next-btn { background-image: none; box-shadow: none; }
.react-subject-select .next-btn:hover { background-color: var(--color-primary-hover); }
/* The subject cards rest flat on their boundary; the pointer still lifts an
   available one and gives it a soft shadow (an unavailable one stays still). */
.react-subject-select .subject-card { box-shadow: none; }
.react-subject-select .subject-card:not(.subject-card--disabled):hover {
  box-shadow: 0 24px 48px -28px var(--color-shadow-strong);
}
/* "10 free" as a Gold tint rather than a bright yellow pill: deep Gold on
   the tint 5.54:1 (7.12:1 at night), with a hairline of its own colour. */
.react-subject-select .subject-card-badge {
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent-text) 32%, transparent);
  font-weight: var(--weight-semibold);
}
/* The plan card: a panel like the others. */
.react-subject-select .plan-card {
  margin-top: var(--space-7);
  border-radius: var(--radius-lg);
  box-shadow: none;
}
/* The exam dates' panels: hairlines, no shadows. */
.react-subject-select .exam-dates-later,
.react-subject-select .exam-cal,
.react-subject-select .exam-dates-local { box-shadow: none; }
/* THE HERO'S TWO CARDS AS DARK GLASS on the photograph, their seals as Gold
   stamps. The glass is nearly opaque where a contrast check reads it (white
   11.56:1 or more, the muted text 8.70:1, the Gold 6.66:1, even composited
   over white), and the blur is only what shows through. */
.react-subject-select .hero-stat {
  background-color: var(--color-glass-ground);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--color-glass-rim);
  box-shadow: none;
  color: var(--color-on-hero);
}
.react-subject-select .hero-stat-unit,
.react-subject-select .hero-stat-caption { color: var(--color-on-hero-muted); }
.react-subject-select .hero-stat .hero-stat-seal {
  border-radius: 8px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--color-on-hero-accent);
}

/* THE SKELETON while the catalog loads: five quiet outlines in the grid's
   own arrangement, so the cards arrive where the eye already is instead of
   pushing the page down. Decoration (aria-hidden): the "Loading..." line
   above it still says what is happening. */
.subject-skeleton {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.subject-skeleton-card {
  display: block;
  height: 120px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-elevated);
  background-image: linear-gradient(100deg, transparent 30%, var(--color-control-hover) 50%, transparent 70%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
}
@media (min-width: 720px) {
  .subject-skeleton { gap: var(--space-4); }
  .subject-skeleton-card { height: 290px; }
}
/* The grid's own tablet arrangement: three a row, the last two centred. */
@media (min-width: 720px) and (max-width: 1099px) {
  .subject-skeleton { display: flex; flex-wrap: wrap; justify-content: center; }
  .subject-skeleton > * { flex: 0 1 calc((100% - 2 * var(--space-4)) / 3); min-width: 0; }
}
@media (min-width: 1100px) {
  .subject-skeleton { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  .subject-skeleton-card { animation: dg-shimmer 1.4s linear infinite; }
  .dash-link-arrow { transition: transform var(--motion-quick) var(--ease-out-expo); }
  .dash-link:hover .dash-link-arrow { transform: translateX(calc(3px * var(--dash-line))) scaleX(var(--dash-line)); }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-1 "Your progress" (ProgressSnapshot.tsx), on the first ink panel:
   the student's figures in columns divided by hairlines (questions
   practised, subjects started, focus sessions this week), Gold labels in
   small capitals over large numerals, one line about the daily streak, and
   the subjects not started yet as outlined pills that start them. Every text
   is one of the band's own tokens on the ink (see .dash-panel--ink).
   --------------------------------------------------------------------------- */
.dash-progress-head { min-width: 0; }

/* THE FIGURES: as many columns as there are figures (two or three), divided
   by hairlines; stacked on a phone. */
.dash-progress-tiles {
  display: grid;
  grid-auto-flow: column;                    /* one equal column a figure, without counting them */
  grid-auto-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
}
.dash-progress-tile {
  --dg-i: 0;                                 /* set per tile by the component */
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  padding: 0 var(--space-6);
  border-inline-start: 1px solid var(--color-feature-divider);
}
.dash-progress-tile:first-child { padding-inline-start: 0; border-inline-start: 0; }
.dash-progress-label {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.09em;
  line-height: var(--leading-snug);
  text-transform: uppercase;
  color: var(--color-on-hero-accent);
}
/* The numeral, with its "of 2,830 in the bank" beside it on the baseline
   while it fits, under it when it does not. */
.dash-progress-figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-2);
  min-width: 0;
  margin: 0;
}
.dash-progress-value {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.9rem + 1.6vw, 3.5rem);
  font-weight: var(--weight-semibold);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--color-on-hero);
}
.dash-progress-of {
  min-width: 0;
  font-size: 0.9375rem;
  line-height: var(--leading-snug);
  color: var(--color-on-hero-muted);
}
.dash-progress-today {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-on-hero-muted);
}

/* THE STREAK LINE under a hairline: the band's white when the streak is
   already safe, its Gold when today still needs an answer. */
.dash-progress-nudge {
  margin: var(--space-6) 0 0;
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--color-feature-divider);
  font-weight: var(--weight-medium);
  line-height: var(--leading-normal);
  color: var(--color-on-hero);
}
.dash-progress-nudge--keep { color: var(--color-on-hero-accent); }

/* THE SUBJECTS NOT STARTED YET: outlined pills with a Gold point, 44px
   tall. Their rim is the band's white at 42%, 4.04:1 on the ink. */
.dash-progress-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-4) 0 0;
}
.dash-progress-start-label {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-on-hero-muted);
}
.dash-progress-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-progress-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid color-mix(in srgb, var(--color-on-hero) 42%, transparent);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-on-hero);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.dash-progress-chip::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-gold);
}
.dash-progress-chip:hover { border-color: var(--color-on-hero-accent); }
.dash-progress-error {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--color-on-hero);
}

@media (max-width: 599px) {
  .dash-progress-tiles { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); }
  .dash-progress-tile { padding: var(--space-4) 0; border-inline-start: 0; border-top: 1px solid var(--color-feature-divider); }
  .dash-progress-tile:first-child { padding-top: 0; border-top: 0; }
  .dash-progress-tile:last-child { padding-bottom: 0; }
  .dash-progress-value { font-size: 2.5rem; }
}

/* The figures arrive one after another, fade and de-blur only. */
@media (prefers-reduced-motion: no-preference) {
  .dash-progress-tile {
    animation: dg-focus-in var(--motion-base) var(--ease-out-expo) backwards;
    animation-delay: calc(80ms + var(--dg-i, 0) * var(--motion-stagger));
  }
  .dash-progress-chip { transition: border-color var(--motion-quick) ease; }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-1 "More ways to prepare" (ExploreTools.tsx): the mock exams, the
   exam guide, the city guide and the review, each a white panel with its
   Gold stamp, its name, one line of what it offers and a ringed arrow that
   fills on hover. Four in a row from 1100px, two from 600px, and on a phone
   one compact row each (stamp, words, arrow). Links: the tile's edge is the
   interactive boundary, 3.69:1 against the tile (3.54:1 at night).
   --------------------------------------------------------------------------- */
.dash-explore-head { min-width: 0; }
.dash-explore-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) {
  .dash-explore-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .dash-explore-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.dash-explore-item { display: flex; min-width: 0; }
.dash-explore-tile {
  --dg-i: 0;                                 /* set per tile by the component */
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
  min-height: 44px;
  padding: var(--space-5);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  text-decoration: none;
}
.dash-explore-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
  overflow-wrap: anywhere;
}
.dash-explore-name {
  font-size: 1.1875rem;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: -0.02em;
}
.dash-explore-desc {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}
/* "Part of full access" on the mock exams for a guest or an expired trial:
   the same Gold tint as the subject cards' "10 free". */
.dash-explore-badge {
  display: inline-block;
  margin-top: var(--space-2);
  padding: 1px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-figure-accent-subtle);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent-text) 32%, transparent);
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.6;
}
/* THE RINGED ARROW, level with the stamp; it fills with ink on hover. */
.dash-explore-arrow {
  position: absolute;
  top: var(--space-5);
  inset-inline-end: var(--space-5);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1;
}
.dash-explore-tile:hover { border-color: var(--color-text); }
.dash-explore-tile:hover .dash-explore-arrow {
  background: var(--color-text);
  box-shadow: none;
  color: var(--color-surface-elevated);
}
.dash-explore-tile:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }

/* A PHONE: one row per tile -- stamp, words, arrow. */
@media (max-width: 599px) {
  .dash-explore-tile {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
  }
  .dash-explore-text { flex: 1 1 auto; }
  .dash-explore-name { font-size: var(--text-lg); }
  .dash-explore-arrow { position: static; flex: none; width: 34px; height: 34px; }
}

/* The tiles arrive in turn; the pointer gets a soft shadow under the tile
   and the arrow a short slide (never the tile's own box). */
@media (prefers-reduced-motion: no-preference) {
  .dash-explore-tile {
    transition: border-color var(--motion-quick) ease, box-shadow var(--motion-quick) ease;
    animation: dg-focus-in var(--motion-base) var(--ease-out-expo) backwards;
    animation-delay: calc(80ms + var(--dg-i, 0) * var(--motion-stagger));
  }
  .dash-explore-tile:hover { box-shadow: 0 24px 48px -30px var(--color-shadow-strong); }
  .dash-explore-arrow { transition: background-color var(--motion-quick) ease, color var(--motion-quick) ease; }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-1 "The CSCA in brief" (ExamBrief.tsx), on the second ink panel:
   how the real papers work, from the exam guide's own data. One column per
   kind of paper with the time it gives each question, then the top score
   with the pass-mark rule, then the registration fee, divided by hairlines;
   under them, where the facts were checked and a Gold link into the guide.
   Four columns from 1100px, two from 600px, one on a phone.
   --------------------------------------------------------------------------- */
.dash-brief-head { min-width: 0; margin: 0 0 var(--space-5); }
.dash-brief-head .dash-card-heading { margin-bottom: 0; }
.dash-brief-intro { min-width: 0; }
.dash-brief-lead {
  max-width: 60ch;
  margin: var(--space-3) 0 0;
  font-size: 1.0625rem;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

/* THE COLUMNS. Each spans two rows of the grid and takes them as a subgrid,
   so the labels of one row share a height and the big figures under them
   start on one line, however many lines a language needs for the longest
   label. Where subgrid is not supported each column simply stacks. */
.dash-brief-tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) {
  .dash-brief-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .dash-brief-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.dash-brief-tile {
  --dg-i: 0;                                 /* set per tile by the component */
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: var(--space-3);
  min-width: 0;
  margin: 0;
  padding: 0 var(--space-6);
  border-inline-start: 1px solid var(--color-feature-divider);
  overflow-wrap: anywhere;
}
/* The hairlines between columns, row by row for each arrangement. */
@media (min-width: 1100px) {
  .dash-brief-tile:nth-child(4n + 1) { padding-inline-start: 0; border-inline-start: 0; }
  .dash-brief-tile:nth-child(n + 5) { margin-top: var(--space-6); }
}
@media (min-width: 600px) and (max-width: 1099px) {
  .dash-brief-tile:nth-child(odd) { padding-inline-start: 0; border-inline-start: 0; }
  .dash-brief-tile:nth-child(n + 3) {
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-feature-divider);
  }
}
@media (max-width: 599px) {
  .dash-brief-tile { padding: var(--space-5) 0; border-inline-start: 0; border-top: 1px solid var(--color-feature-divider); }
  .dash-brief-tile:first-child { padding-top: 0; border-top: 0; }
}
.dash-brief-tile-title {
  align-self: end;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.09em;
  line-height: var(--leading-snug);
  text-transform: uppercase;
  color: var(--color-on-hero-accent);
}
.dash-brief-tile-body { min-width: 0; }

/* The figure and its unit share one line box ("75 seconds", "67,5 секунды"),
   so the unit keeps its space and drops under the figure, rather than
   overflowing, when a column is narrow. */
.dash-brief-stat { margin: 0; line-height: 1; }
.dash-brief-figure {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.9rem + 1.6vw, 3.5rem);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.05em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--color-on-hero);
}
.dash-brief-unit {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  color: var(--color-on-hero-muted);
}
.dash-brief-caption {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-on-hero-muted);
}
/* The paper's questions and minutes, its languages, or a column's note,
   under a hairline. */
.dash-brief-details {
  margin: var(--space-4) 0 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--color-feature-divider);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}
.dash-brief-details p { margin: 0; }
.dash-brief-details p + p { margin-top: var(--space-1); }
.dash-brief-shape { font-weight: var(--weight-semibold); color: var(--color-on-hero); }
.dash-brief-languages,
.dash-brief-note { color: var(--color-on-hero-muted); }

/* THE FEES: each row's subjects (Gold) above its amount, a smaller figure
   than the other columns' single one, since this column carries two. */
.dash-brief-fees { margin: 0; }
.dash-brief-fee + .dash-brief-fee { margin-top: var(--space-3); }
.dash-brief-fee dt {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-on-hero-accent);
}
.dash-brief-fee dd { margin: 4px 0 0; line-height: 1.1; }
.dash-brief-figure--fee { font-size: 2rem; }

/* WHERE THE FACTS WERE CHECKED, and the Gold way into the guide. */
.dash-brief-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-6) 0 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--color-feature-divider);
}
.dash-brief-source {
  flex: 1 1 16rem;
  min-width: 0;
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-on-hero-muted);
}
.dash-brief-cta { flex: none; }

@media (max-width: 599px) {
  .dash-brief-figure { font-size: 2.5rem; }
  .dash-brief-figure--fee { font-size: 1.75rem; }
}

/* The columns arrive in reading order (the papers, the score, the fee),
   fade and de-blur only; no column takes longer than 0.85 s. */
@media (prefers-reduced-motion: no-preference) {
  .dash-brief-tile {
    animation: dg-focus-in var(--motion-base) var(--ease-out-expo) backwards;
    animation-delay: calc(80ms + var(--dg-i, 0) * var(--motion-stagger));
  }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-1's checklist ring, drawn since DASHBOARD-2 by the checklist
   banner (ExamDayCard.tsx's ChecklistBanner; the banner's own layout is in
   the DASHBOARD-2 block): a fine ring with the ticked items counted inside.
   --------------------------------------------------------------------------- */
.dash-ready-ring {
  display: grid;
  place-items: center;
  flex: none;
  width: 128px;
  height: 128px;
}
.dash-ready-ring > * { grid-area: 1 / 1; }
.dash-ready-ring svg { display: block; width: 100%; height: 100%; }
/* THE RAIL recedes (1.35:1 on the card, 1.38:1 at night), as every progress
   track does here: what the eye reads is the arc against it. */
.dash-ready-ring-track {
  fill: none;
  stroke: var(--color-track);
  stroke-width: 6;
}
/* THE ARC: the progress fill, which brightens at night where the lacquer
   red itself would read only 2.46:1 on the card. 6.54:1 on the card and
   4.83:1 on the rail; 6.62:1 and 4.79:1 at night. The two dash values come
   from the component; the defaults here are the same length (2π × 52) and
   an empty ring. */
.dash-ready-ring-progress {
  --dash-ready-length: 326.73;
  --dash-ready-offset: 326.73;
  fill: none;
  stroke: var(--color-progress-fill);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: var(--dash-ready-length);
  stroke-dashoffset: var(--dash-ready-offset);
}
/* Every essential item ticked: the arc turns Gold, this screen's colour for
   an achievement, in its text-strength member (the bright fill would read
   only 2.10:1 on the white card). 6.30:1 on the card and 4.66:1 on the rail;
   9.25:1 and 6.69:1 at night. The essentials line says it in words. */
.dash-ready-ring[data-dash-ready-essentials="ready"] .dash-ready-ring-progress {
  stroke: var(--color-achievement-text);
}
.dash-ready-ring-label {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
  color: var(--color-text);
}
.dash-ready-ring-done {
  font-size: 2.25rem;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.04em;
}
.dash-ready-ring-total {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}

/* THE RING SWEEPS from empty to its value. Nothing moves a box. */
@keyframes dash-ready-sweep {
  from { stroke-dashoffset: var(--dash-ready-length); }
}
@media (prefers-reduced-motion: no-preference) {
  .dash-ready-ring-progress {
    animation: dash-ready-sweep var(--motion-slow) var(--ease-out-expo) 120ms backwards;
  }
}









/* ===========================================================================
   MOTION-2 (DASHBOARD-2, product owner 2026-10-23: "agrega las animaciones
   como las tiene PrepPals"). The competitor's homepage moves in four ways,
   and the subjects screen now does too:
   1. THE SCROLL REVEAL. A section that starts below the fold waits there,
      faded and 24px low, and rises into place as it enters the viewport
      (motion.tsx's useScrollReveal sets data-reveal="pending", then "in"),
      its marked children (data-reveal-child) one after another. This is the
      one place the motion layer moves a box -- and only a box that is off
      screen until the student scrolls to it, for 0.7 s; everything already
      on screen keeps MOTION-1's entrance.
   2. THE SHEEN. A soft band of light crosses each filled button every few
      seconds, the competitor's signature. A loop, so it lives on a
      pseudo-element: the button's own box never moves, and a click or a
      measurement never waits for it.
   3. THE ARROW. A button or link that ends in an arrow sends it a few pixels
      further on hover.
   4. THE FLOAT. A purely decorative element (data-float) drifts gently;
      never one a student can press.
   Everything here sits inside prefers-reduced-motion: no-preference, so with
   "reduce" the screen is still drawn as it always was.
   =========================================================================== */
@keyframes dg-sheen {
  0%, 64%, 100% { transform: translateX(-292%) skewX(-18deg); }
  84% { transform: translateX(248%) skewX(-18deg); }
}
@keyframes dg-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@media (prefers-reduced-motion: no-preference) {
  /* 1. THE SCROLL REVEAL. Only the way in is a transition: a section is
     put in waiting at once, without a fade, so nothing moves while it is
     still out of sight. */
  [data-reveal="pending"] { opacity: 0; transform: translateY(24px); }
  [data-reveal="pending"] [data-reveal-child] { opacity: 0; transform: translateY(16px); }
  /* A section that waits arrives by rising in, not by MOTION-1's entrance:
     it never starts one out of sight, nor replays it when it is reached.
     (As specific as MOTION-1's ".react-subject-select > .dash-card", and
     later, so it wins.) */
  :is(.react-subject-select, .about-page) [data-reveal] { animation: none; }
  [data-reveal="in"] {
    transition: opacity 700ms var(--ease-out-expo), transform 700ms var(--ease-out-expo);
  }
  [data-reveal="in"] [data-reveal-child] {
    transition: opacity 600ms var(--ease-out-expo), transform 600ms var(--ease-out-expo);
    transition-delay: calc(140ms + var(--dg-i, 0) * var(--motion-stagger));
  }

  /* 2. THE SHEEN on the filled buttons of the subjects screen and About us:
     over the lacquer, under the label (the button isolates its own
     stacking). */
  .react-subject-select .next-btn,
  .about-page .next-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .react-subject-select .next-btn::after,
  .about-page .next-btn::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;               /* the middle: the same in both directions */
    z-index: -1;
    width: 38%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.30) 50%, transparent 100%);
    transform: translateX(-292%) skewX(-18deg);
    animation: dg-sheen 5.2s ease-in-out infinite;
    pointer-events: none;
  }

  /* 3. THE ARROW goes a little further on hover. */
  .react-subject-select .exam-dates-all > [aria-hidden="true"],
  .react-subject-select .dash-link-arrow {
    display: inline-block;
    transition: transform var(--motion-quick) var(--ease-out-expo);
  }
  .react-subject-select .exam-dates-all:hover > [aria-hidden="true"],
  .react-subject-select .dash-link:hover .dash-link-arrow { transform: translateX(calc(4px * var(--dash-line))) scaleX(var(--dash-line)); }

  /* 4. THE FLOAT, for decoration only. */
  [data-float] { animation: dg-float 5.5s ease-in-out infinite; }
}

/* ---------------------------------------------------------------------------
   NAV-RESOURCES-1 (product owner 2026-10-23, after the competitor's header):
   Home, CSCA guide, Resources (the mock exams, the city guide and its
   universities), My plan, Review and About us. Six sections are one more
   than this row was measured for, so below 1440px they sit a little closer
   (7px of padding, not 10px) for everyone. A signed-in row also carries the
   name, the trial days and the streak, and below 1600px that is more than
   one row holds: there "About us" moves into the account menu, so the name
   keeps its room. Below 1440px a signed-in row is tighter still, and the
   lockup keeps its seal and wordmark only (the "CSCA Prep" label and its
   hairline leave the row), as Back already gives up its label there.
   --------------------------------------------------------------------------- */
#nav-account-about-us-link { display: none; }
@media (min-width: 1280px) and (max-width: 1599px) {
  .app-header:has(.nav-account-btn--identity) #nav-about-us-link { display: none; }
  .app-header:has(.nav-account-btn--identity) #nav-account-about-us-link { display: flex; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
  .app-nav .app-nav-sections .nav-link { padding: 0 7px; }
  .app-header:has(.nav-account-btn--identity) .app-brand-sep,
  .app-header:has(.nav-account-btn--identity) .app-brand-product { display: none; }
  /* Indonesian's section names are the longest of the five (measured
     2026-10-24: "Rencana saya", "Tentang kami", "Sumber daya"), and there
     a visitor's row has no room for the label either, so in Indonesian the
     lockup keeps its seal and wordmark in this range for everyone. */
  html[lang="id"] .app-brand-sep,
  html[lang="id"] .app-brand-product { display: none; }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-2 "One CSCA exam" (StatsBand.tsx): the figures band, after the
   reference's own. On the page itself, centred: a very large two-line
   headline opened by the sections' Gold rule, its second line in Gold; under
   it the upper part of a slowly turning globe in ink and Gold (cobe, WebGL),
   or, where there is no WebGL, a still disc of the same colours; and over
   the globe's lower edge a white panel with a hairline and a soft shadow,
   holding the product's real figures in columns divided by hairlines: two
   columns below 900px, one row from there.
   --------------------------------------------------------------------------- */
.dash-card--stats {
  /* The globe's window: 520px wide at most, the full width on a phone. The
     panel's overlap is measured in the same width (both resolve their
     percentage against this section). */
  --dash-stats-stage: min(520px, 100%);
  text-align: center;
}
.dash-stats-head { min-width: 0; }

/* THE HEADLINE: larger than the other sections' titles, balanced over its
   lines, its Gold rule centred over it. Ink, then deep Gold: 5.74:1 on the
   page (bright Gold at night, 9.25:1 or more). */
.dash-card--stats .dash-stats-headline {
  margin: 0 auto;
  font-size: clamp(2.125rem, 1rem + 3.5vw, 3.375rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.dash-card--stats .dash-stats-headline::before { margin-inline: auto; }
.dash-stats-line { display: block; }
.dash-stats-line--gold { color: var(--color-accent-text); }

/* THE STAGE: a window onto the globe's upper part (StatsBand.tsx places the
   globe in it from the same proportions). Its three colours are read by the
   component, so the globe is drawn in the screen's own tokens. */
.dash-stats-stage {
  --dg-i: 0;                                 /* set by the component */
  --dash-stats-globe-land: var(--brand-gold);
  --dash-stats-globe-glow: var(--brand-gold);
  --dash-stats-globe-marker: var(--brand-gold-on-dark);
  position: relative;
  width: var(--dash-stats-stage);
  aspect-ratio: 52 / 31;
  margin: var(--space-3) auto 0;
}
.dash-stats-globe { position: absolute; inset: 0; }
.dash-stats-globe canvas { display: block; width: 100%; height: 100%; }

/* THE STILL DISC where there is no WebGL: the globe's upper half in the
   band's ink (a solid colour first, then light over it: a Gold sheen at the
   top and a field of Gold dots), a Gold rim, and a soft Gold glow around it.
   Its box ends at the stage's foot, which the panel covers, so nothing of it
   reaches past the stage. Drawn from the globe's own numbers in
   StatsBand.tsx: a radius of 42% of the stage's width, its top 6.5% of the
   width below the stage's top (10.9% of the stage's height), so the corners'
   vertical radius is 0.42 / (0.5962 - 0.065) = 79.07% of the disc's height. */
.dash-stats-disc {
  position: absolute;
  top: 10.9%;
  inset-inline: 8%;
  bottom: 0;
  border-radius: 50% 50% 0 0 / 79.07% 79.07% 0 0;
  background-color: var(--color-feature-ground);
  background-image:
    radial-gradient(120% 80% at 50% 0%, var(--color-feature-glow), transparent 62%),
    radial-gradient(circle, var(--color-feature-rim) 0 1px, transparent 1.6px);
  background-size: auto, 11px 11px;
  box-shadow:
    inset 0 1px 0 var(--color-feature-rim),
    0 -10px 56px -14px var(--color-feature-rim);
}

/* THE PANEL over the globe's lower edge: white, a hairline, a soft shadow,
   above the stage it overlaps. Every text on it is the page's own
   (--color-text 16.48:1, --color-text-muted 7.03:1; 13.89:1 and 6.51:1 at
   night). */
.dash-stats-panel {
  --dg-i: 0;                                 /* set by the component */
  position: relative;
  z-index: 1;
  max-width: 64rem;
  margin: calc(var(--dash-stats-stage) * -0.11) auto 0;
  padding: var(--space-6) var(--space-5);
  background-color: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px var(--color-shadow), 0 34px 64px -38px var(--color-shadow-strong);
}

/* THE FIGURES: a large quiet numeral over a short muted line, and under two
   of them the fact that keeps them honest in the screen's Gold small
   capitals (deep Gold 6.30:1 on the panel, 9.25:1 at night). */
.dash-stats-figures {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dash-stats-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
}
.dash-stats-value {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.9rem + 1.6vw, 3.5rem);   /* the progress card's numerals */
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--color-text);
}
.dash-stats-label {
  max-width: 18rem;
  font-size: 0.9375rem;
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
  overflow-wrap: break-word;
  text-wrap: balance;
}
.dash-stats-note {
  max-width: 18rem;
  margin-top: calc(var(--space-1) - var(--space-2));   /* closer to its words than the words to the number */
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.09em;
  line-height: var(--leading-snug);
  text-transform: uppercase;
  color: var(--color-accent-text);
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* Below 900px: two columns, a hairline between them and between rows; a
   figure left alone on the last row takes the whole row. */
@media (max-width: 899px) {
  .dash-stats-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-stats-figure { padding: var(--space-4) var(--space-3); }
  .dash-stats-figure:nth-child(-n + 2) { padding-top: 0; }
  .dash-stats-figure:nth-child(even) { border-inline-start: 1px solid var(--color-border); }
  .dash-stats-figure:nth-child(n + 3) { border-top: 1px solid var(--color-border); }
  .dash-stats-figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dash-stats-figure:nth-last-child(-n + 2):nth-child(odd),
  .dash-stats-figure:last-child { padding-bottom: 0; }
}
/* From 900px: one row, an equal column a figure without counting them. */
@media (min-width: 900px) {
  .dash-stats-figures { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .dash-stats-figure { padding: var(--space-1) var(--space-5); }
  .dash-stats-figure + .dash-stats-figure { border-inline-start: 1px solid var(--color-border); }
}
@media (max-width: 599px) {
  .dash-stats-panel { padding: var(--space-5) var(--space-3); }
  .dash-stats-value { font-size: 2rem; }
  .dash-stats-label { font-size: var(--text-sm); }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-2 "Home exam checklist" as a banner (ExamDayCard.tsx's
   ChecklistBanner): the same ring, count, essentials line, note and button
   as DASHBOARD-1's card, across the screen's whole width in one panel. From
   760px three zones -- the ring, the words, the button -- and narrower the
   ring keeps the count beside it while the note and the button stack below.
   The ring itself is still drawn by the DASHBOARD-1 rules (.dash-ready-ring
   and its parts, the dash-ready-sweep entrance).
   --------------------------------------------------------------------------- */
.dash-banner-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "ring figures"
    "note note"
    "action action";
  align-items: center;
  gap: var(--space-4) var(--space-5);
}
.dash-banner-ring,
.dash-banner-figures,
.dash-banner-note,
.dash-banner-action {
  --dg-i: 0;                                 /* set per zone by the component (the reveal's stagger) */
  min-width: 0;
}
.dash-banner-ring { grid-area: ring; }
.dash-banner-figures {
  grid-area: figures;
  display: grid;
  gap: var(--space-1);
}
.dash-banner-progress {
  margin: 0;
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.625rem);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  text-wrap: balance;
}
/* Balanced too: "2 of 8" never ends up with the 8 alone on a line. */
.dash-banner-essential {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  overflow-wrap: break-word;
  text-wrap: balance;
}
.dash-banner-check {
  margin-inline-end: var(--space-1);
  color: var(--color-achievement-text);    /* 6.30:1 on the card, 9.25:1 at night */
  font-weight: var(--weight-bold);
}
.dash-banner-note {
  grid-area: note;
  max-width: 60ch;
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  overflow-wrap: break-word;
}
.dash-banner-action { grid-area: action; }

/* The ring's phone size, restated here so the banner keeps it whatever
   happens to the DASHBOARD-1 card's own phone block. */
@media (max-width: 599px) {
  .dash-banner .dash-ready-ring { width: 104px; height: 104px; }
  .dash-banner .dash-ready-ring-done { font-size: 1.875rem; }
  .dash-banner-cta { width: 100%; }
}
@media (min-width: 760px) {
  .dash-banner-panel {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "ring figures action"
      "ring note action";
    gap: var(--space-2) var(--space-6);
  }
  .dash-banner-figures { align-self: end; }
  .dash-banner-note { align-self: start; }
  .dash-banner-action { justify-self: end; }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-2 "Good to know" as a carousel (ExamDayCard.tsx's FactsCarousel),
   after the competitor's testimonial carousel, with no people in it. No
   panel: one verified fact at a time stands on the page, centred, in very
   large type -- its first sentence underlined in Gold, a faint Gold quote
   mark behind it -- then a Gold stamp and where the fact comes from, with
   "Read more" beside them, and under it all a round Previous button, the
   dots (the current one stretched into a pill) and a round Next button. The
   Pause button sits level with the heading, first in the tab order.

   THE STAGE IS AS TALL AS ITS TALLEST FACT. Every fact is laid out in one
   grid cell, the copies invisible (visibility: hidden, so no text check and
   no pointer sees them), and the fact on show centred in the same cell: the
   buttons never move under the pointer and nothing below ever jumps.
   --------------------------------------------------------------------------- */
.dash-facts { --dash-facts-interval: 8s; } /* the component sets its real interval inline */

.dash-facts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
  margin: 0 0 var(--space-6);
}
.dash-facts-head .dash-card-heading { min-width: 0; margin: 0; }

.dash-facts-stage,
.dash-facts-nav {
  --dg-i: 0;                                 /* set by the component (the reveal's stagger) */
}
.dash-facts-stage {
  display: grid;
  max-width: 61.25rem;                       /* about 980px, centred under the heading */
  margin: 0 auto;
  text-align: center;
}
.dash-facts-stage > * { grid-area: 1 / 1; min-width: 0; }
.dash-facts-sizer {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}
.dash-facts-sizer > * { grid-area: 1 / 1; }
.dash-facts-live {
  display: grid;
  align-content: center;
}
.dash-facts-slide {
  position: relative;
  min-width: 0;
  padding: var(--space-3) 0 0;
}

/* THE QUOTE MARK: decoration only (aria-hidden, generated glyph), never
   wider than its own em, centred over the first line and behind it. */
.dash-facts-mark {
  position: absolute;
  top: -0.06em;
  left: 50%;
  z-index: 0;
  width: 1em;
  height: 1em;
  translate: -50% 0;       /* centred on left: 50%, and composed with its drift */
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5.5rem, 4.25rem + 5vw, 9rem);
  line-height: 1;
  text-align: center;
  color: var(--brand-gold);
  opacity: 0.2;
  pointer-events: none;
}
.dash-facts-mark::before { content: "\201C"; }

/* THE FACT. One size scale for the whole fact (--dash-facts-scale steps it
   down for a long one); the first sentence on its own line(s) with the Gold
   underline, the rest a little smaller beneath it. Both in the text colour:
   15.01:1 on the page (15.35:1 at night). */
.dash-facts-text {
  --dash-facts-scale: 1;
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: calc(var(--dash-facts-scale) * clamp(1.25rem, 0.9rem + 1.6vw, 2.125rem));
  font-weight: var(--weight-regular);
  line-height: 1.34;
  letter-spacing: -0.018em;
  color: var(--color-text);
  overflow-wrap: break-word;
}
.dash-facts-text:lang(zh) { letter-spacing: 0; }
.dash-facts-slide[data-size="medium"] .dash-facts-text { --dash-facts-scale: 0.88; }
.dash-facts-slide[data-size="long"] .dash-facts-text { --dash-facts-scale: 0.76; }
.dash-facts-lead {
  display: block;
  font-weight: var(--weight-medium);
  text-decoration-line: underline;
  text-decoration-color: var(--brand-gold);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: none;
  text-wrap: balance;
}
.dash-facts-rest {
  display: block;
  margin-top: 0.45em;
  font-size: max(0.84em, var(--text-sm));    /* never under 14px, even for the longest fact on a phone */
  line-height: 1.42;
  text-wrap: pretty;
}

/* WHERE IT COMES FROM, in place of the competitor's speaker: the stamp and
   two lines (the part, then the official site), with "Read more" beside
   them; stacked and centred on a phone. */
.dash-facts-cite {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-6);
  margin: var(--space-6) 0 0;
}
.dash-facts-source {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  max-width: 100%;
  text-align: start;
}
/* The screen's Gold stamp (as the explore tiles'): deep Gold, 5.74:1 on the
   page (9.25:1 or more at night). */
.dash-facts-stamp {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--color-accent-text);
  font-family: var(--font-cjk);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.dash-facts-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-facts-part {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-text);
  overflow-wrap: break-word;
}
.dash-facts-official {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);            /* 6.40:1 on the page, 7.19:1 at night */
  overflow-wrap: anywhere;
}
.dash-facts-more { flex: none; }

/* THE CONTROLS: round 44px buttons with a 3:1 rim (3.36:1 against the page,
   3.91:1 at night) that fill with ink on hover, the arrow or icon turning
   to the card's white. */
.dash-facts-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin: var(--space-6) 0 0;
}
.dash-facts-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}
.dash-facts-btn:hover {
  border-color: var(--color-text);
  background: var(--color-text);
  color: var(--color-surface-elevated);
}
.dash-facts-btn:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.dash-facts-arrow { display: block; }
/* Never the pointer's target: a press swaps the Pause/Resume icon's shapes,
   and a shape removed from under the pointer takes the carousel's
   pointerleave with it in Chromium, so the facts would stay paused as if
   still hovered. With the icon out of the way the button, which stays, is
   what the pointer is over. */
.dash-facts-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: var(--color-text);
  pointer-events: none;
}
.dash-facts-btn:hover .dash-facts-icon { fill: var(--color-surface-elevated); }

/* THE DOTS (decoration: each slide names its place). The current one is a
   pill: a Gold tint, filled in deep Gold -- whole at rest, and running as
   its time does while the facts move by themselves (below). */
.dash-facts-pager {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dash-facts-dot {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-border-strong);
  overflow: hidden;
}
.dash-facts-dot--edge { width: 5px; height: 5px; }
.dash-facts-dot--active {
  width: 34px;
  background: color-mix(in srgb, var(--color-accent-text) 24%, transparent);
}
.dash-facts-dot--active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--color-accent-text);
  transform-origin: left center;
}
@media (forced-colors: active) {
  .dash-facts-dot { forced-color-adjust: none; background: CanvasText; }
  .dash-facts-dot--active { background: Canvas; box-shadow: inset 0 0 0 1px CanvasText; }
  .dash-facts-dot--active::after { background: Highlight; }
}

@media (max-width: 599px) {
  /* A phone's floor (20px) is small for a short fact and large for a long
     one: the short grow, the long shrink less, and the stage (as tall as the
     longest) leaves less air around a one-liner. */
  .dash-facts-slide[data-size="short"] .dash-facts-text { --dash-facts-scale: 1.15; }
  .dash-facts-slide[data-size="medium"] .dash-facts-text { --dash-facts-scale: 0.95; }
  .dash-facts-slide[data-size="long"] .dash-facts-text { --dash-facts-scale: 0.8; }
  .dash-facts-head { margin-bottom: var(--space-5); }
  .dash-facts-cite { flex-direction: column; gap: var(--space-1); margin-top: var(--space-5); }
  .dash-facts-nav { gap: var(--space-3); margin-top: var(--space-5); }
}

/* MOTION, only where it is welcome. The pill fills over the interval and
   restarts with each fact (a new active dot); it pauses with the timer
   (hover, keyboard focus, a hidden tab, off screen, the Pause button), as
   does the quote mark's drift. A changed fact rises into place, never the
   first one, which arrives with its section. */
@keyframes dash-facts-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes dash-facts-rise {
  from { opacity: 0; transform: translateY(12px); }
}
@media (prefers-reduced-motion: no-preference) {
  .dash-facts[data-autoplay="on"] .dash-facts-dot--active::after {
    animation: dash-facts-fill var(--dash-facts-interval) linear;
  }
  .dash-facts[data-running="false"] .dash-facts-dot--active::after,
  .dash-facts[data-running="false"] .dash-facts-mark { animation-play-state: paused; }
  .dash-facts-slide[data-changed="true"] .dash-facts-text,
  .dash-facts-slide[data-changed="true"] .dash-facts-cite {
    animation: dash-facts-rise var(--motion-base) var(--ease-out-expo) backwards;
  }
  .dash-facts-slide[data-changed="true"] .dash-facts-cite { animation-delay: 70ms; }
}

/* ---------------------------------------------------------------------------
   ABOUT-1 "About us" (AboutUs.tsx, at #/about; part of DASHBOARD-2, product
   owner 2026-10-23: "agregar un About us", the mission and the method). The
   city guide's ink band with the heading, then the subjects screen's
   INK-GOLD-1 language: each section's title stands on the page under its
   Gold rule (.dash-card-heading) and only its content sits on a panel
   (.dash-panel, .dash-panel--ink).
     STORY: a white panel, the brand's gate and the idiom of its name over
       the legend set large behind a Gold rule, two short paragraphs beside
       it from 900px.
     MISSION: one statement on the page itself, large behind a Gold rule,
       and two paragraphs under it.
     METHOD: the ink panel, four principles divided by hairlines, each under
       a Gold stamp: four columns from 1100px, two from 600px, one on a phone.
     WHAT: six links to the parts of the product, each a white tile with its
       stamp, its name over one line, and a ringed arrow: three a row from
       900px, two from 600px, one on a phone.
     INDEPENDENT and LANGUAGES side by side from 900px, then the page's one
       filled action and the guide as a text link.
   Nothing on the page is loaded: it is drawn whole at once.
   --------------------------------------------------------------------------- */
html[data-csca-about] main#app-root { padding: 0; }
#react-root .about-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;   /* no top padding: the band meets the header */
}
@media (min-width: 720px) {
  #react-root .about-page { padding: 0 24px 56px; }
}

/* THE BAND: the shared ink band and its wave (styles.css's "THE BAND: shared
   by this hero, ..." lists .about-hero), spaced and centred as the city
   guide's is. */
.about-hero {
  margin: 0 0 var(--space-7);
  padding: var(--space-7) 0 calc(var(--space-6) + 2 * var(--wave-amp) + var(--wave-base));
  text-align: center;
}
.about-hero h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  color: var(--color-on-hero);
  hyphens: auto;
  overflow-wrap: anywhere;
}
.about-hero-subtitle {
  max-width: 44rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
}

/* THE SECTIONS, spaced like the subjects screen's. */
.about-section { min-width: 0; margin: var(--space-8) 0 0; }
.about-hero + .about-section { margin-top: 0; }

/* THE STAMPS: a character inside a square rule, the subjects screen's Gold
   stamp. Deep Gold on the white tiles (6.30:1, 9.25:1 at night), the band's
   Gold on the ink panel (8.44:1 or more). Decoration only (aria-hidden). */
.about-stamp {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--color-accent-text);
  font-family: var(--font-cjk);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.about-stamp--ink { color: var(--color-on-hero-accent); }

/* THE STORY: the brand's gate in deep Gold, the idiom the name comes from and
   the legend set large behind a Gold rule, like "Good to know"'s fact; the
   two paragraphs under them, or beside them from 900px. */
.about-prose {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
}
@media (min-width: 900px) {
  .about-prose {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-7);
    align-items: start;
  }
}
.about-story-legend {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}
.about-story-mark {
  display: block;
  width: 40px;
  height: 38px;
  color: var(--color-accent-text);          /* deep Gold: 6.30:1 on the panel, 9.25:1 at night */
}
.about-story-idiom {
  margin: 0;
  font-family: var(--font-cjk);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.24em;
  line-height: var(--leading-snug);
  color: var(--color-accent-text);
}
.about-prose-lead {
  margin: 0;
  padding-inline-start: var(--space-5);
  border-inline-start: 2px solid var(--brand-gold);
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
  font-weight: var(--weight-semibold);
  line-height: 1.32;
  letter-spacing: -0.02em;
  color: var(--color-text);
  overflow-wrap: break-word;
  text-wrap: balance;
}
.about-prose-text {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}
.about-prose-text p,
.about-mission-text p {
  max-width: 62ch;
  margin: 0;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  overflow-wrap: break-word;
}

/* THE MISSION: one statement on the page itself, large behind a Gold rule,
   and the two paragraphs that ground it, side by side from 900px. */
.about-mission {
  display: grid;
  gap: var(--space-6);
}
.about-mission-lead {
  max-width: 34ch;
  margin: 0;
  padding-inline-start: var(--space-5);
  border-inline-start: 3px solid var(--brand-gold);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.375rem);
  font-weight: var(--weight-semibold);
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--color-text);
  overflow-wrap: break-word;
  text-wrap: balance;
}
.about-mission-text {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}
@media (min-width: 900px) {
  .about-mission-text { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-7); }
}

/* METHOD: the principles on the ink panel, divided by hairlines row by row for
   each arrangement, as "The CSCA in brief" is. Every text is one of the
   band's own tokens on the ink. */
.about-how-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  list-style: none;
}
@media (min-width: 600px) {
  .about-how-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .about-how-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.about-how-item {
  --dg-i: 0;                                 /* set per item by the component */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
  margin: 0;
  padding: 0 var(--space-6);
  border-inline-start: 1px solid var(--color-feature-divider);
  overflow-wrap: break-word;
}
@media (min-width: 1100px) {
  .about-how-item:nth-child(4n + 1) { padding-inline-start: 0; border-inline-start: 0; }
  .about-how-item:nth-child(4n) { padding-inline-end: 0; }
}
@media (min-width: 600px) and (max-width: 1099px) {
  .about-how-item:nth-child(odd) { padding-inline-start: 0; border-inline-start: 0; }
  .about-how-item:nth-child(even) { padding-inline-end: 0; }
  .about-how-item:nth-child(n + 3) {
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-feature-divider);
  }
}
/* A phone: one principle under another, its stamp beside its title and the
   text under both at the panel's full width. */
@media (max-width: 599px) {
  .about-how-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas: "stamp title" "body body";
    align-items: center;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-5) 0;
    border-inline-start: 0;
    border-top: 1px solid var(--color-feature-divider);
  }
  .about-how-item:first-child { padding-top: 0; border-top: 0; }
  .about-how-item:last-child { padding-bottom: 0; }
  .about-how-item > .about-stamp { grid-area: stamp; }
  .about-how-item > .about-how-title { grid-area: title; margin: 0; }
  .about-how-item > .about-how-body { grid-area: body; }
}
.about-how-title {
  margin: var(--space-1) 0 0;
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  color: var(--color-on-hero);
}
.about-how-body {
  margin: 0;
  font-size: 0.9375rem;
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
}

/* WHAT: compact link tiles. The tile's edge is the interactive boundary,
   3.69:1 against the tile (3.54:1 at night); on hover it darkens and the
   ringed arrow fills with ink, as on the subjects screen's tiles. */
.about-what-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) {
  .about-what-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
}
@media (min-width: 900px) {
  .about-what-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.about-what-item {
  --dg-i: 0;                                 /* set per item by the component */
  display: flex;
  min-width: 0;
}
.about-what-tile {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  min-width: 0;
  min-height: 44px;
  padding: var(--space-5);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  text-decoration: none;
}
.about-what-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-1);
  min-width: 0;
  overflow-wrap: anywhere;
}
.about-what-name {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: -0.015em;
}
.about-what-desc {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}
/* "Part of full access" for a guest or an expired trial: the subjects
   screen's Gold tint, deep Gold on it 5.54:1 (7.12:1 at night). */
.about-what-badge {
  display: inline-block;
  margin-top: var(--space-2);
  padding: 1px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-figure-accent-subtle);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent-text) 32%, transparent);
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.6;
}
.about-what-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1;
}
.about-what-tile:hover { border-color: var(--color-text); }
.about-what-tile:hover .about-what-arrow {
  background: var(--color-text);
  box-shadow: none;
  color: var(--color-surface-elevated);
}
.about-what-tile:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
@media (max-width: 599px) {
  .about-what-tile { gap: var(--space-3); padding: var(--space-4); }
}

/* INDEPENDENT AND LANGUAGES: side by side from 900px, each panel as tall as
   the row. */
.about-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--space-6);
}
@media (min-width: 900px) {
  .about-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.about-row > .about-section { display: flex; flex-direction: column; }
.about-row > .about-section > .dash-panel { flex: 1 1 auto; }

/* The official site sits at the foot of its panel, level with the end of
   the languages beside it. */
.about-independent { display: flex; flex-direction: column; }
.about-independent-statement {
  margin: 0;
  font-size: 1.1875rem;
  font-weight: var(--weight-semibold);
  line-height: 1.45;
  letter-spacing: -0.012em;
  color: var(--color-text);
  overflow-wrap: break-word;
}
.about-independent-final {
  margin: var(--space-3) 0 var(--space-5);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  overflow-wrap: break-word;
}
.about-official {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-2);
  margin: auto 0 0;
  padding: var(--space-3) 0 0;
  border-top: 1px solid var(--color-border);
}
.about-official-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}

/* The languages: Gold labels in small capitals, as "Good to know" names its
   source; the interface languages each in its own script, a plain list. */
.about-languages-label {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.09em;
  line-height: var(--leading-snug);
  text-transform: uppercase;
  color: var(--color-accent-text);
}
.about-languages-label:not(:first-child) {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.about-languages-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}
.about-language {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-text);
}
/* Each name opens with a Gold point, the subjects screen's mark for a
   subject not started: a shape, not a character, so nothing is read out,
   and a name that wraps onto a new line still opens with its own. */
.about-language::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-gold);
}
.about-languages-text {
  margin: 0;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  overflow-wrap: break-word;
}
.about-languages-text + .about-languages-text { margin-top: var(--space-2); }

/* THE WAY ON: the page's one filled action, flat as on the subjects screen,
   and the guide as a text link, under a hairline. */
.about-closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin: var(--space-8) 0 0;
  padding: var(--space-6) 0 0;
  border-top: 1px solid var(--color-border);
}
.about-page .next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  text-align: center;
  text-decoration: none;
  background-image: none;
  box-shadow: none;
}
.about-page .next-btn:hover { background-color: var(--color-primary-hover); }
/* .dash-link was drawn for buttons: as a link it loses the underline at rest. */
.about-page a.dash-link { text-decoration: none; }
.about-page a.dash-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* MOTION, only where it is welcome. The band's lines arrive as the subject
   hero's do; the first panel fades in under them; the sections below the
   fold rise in as they are reached (motion.tsx's useScrollReveal, MOTION-2),
   their tiles in turn. Entrances fill backwards only, so the resting page is
   the finished page. */
@media (prefers-reduced-motion: no-preference) {
  .about-hero h1 { animation: dg-reveal-up var(--motion-slow) var(--ease-out-expo) 60ms backwards; }
  .about-hero-subtitle { animation: dg-focus-in var(--motion-base) var(--ease-out-expo) 160ms backwards; }
  .about-hero + .about-section > .dash-panel { animation: dg-focus-in var(--motion-base) var(--ease-out-expo) 240ms backwards; }
  .about-what-tile { transition: border-color var(--motion-quick) ease, box-shadow var(--motion-quick) ease; }
  .about-what-tile:hover { box-shadow: 0 24px 48px -30px var(--color-shadow-strong); }
  .about-what-arrow { transition: background-color var(--motion-quick) ease, color var(--motion-quick) ease; }
  .about-page .dash-link-arrow {
    display: inline-block;
    transition: transform var(--motion-quick) var(--ease-out-expo);
  }
  .about-page .dash-link:hover .dash-link-arrow { transform: translateX(calc(4px * var(--dash-line))) scaleX(var(--dash-line)); }
}
/* ---------------------------------------------------------------------------
   THE CITY GUIDE (CITY-GUIDE-1, redesigned as CITY-GUIDE-2, product owner
   2026-10-20): "Choose a city". The Jade band; then "What matters most to
   you?" -- six compact priority buttons, a drop-down beneath for each chosen
   one that needs an answer, never a wall of options -- which folds into one
   summary line once the cities are shown; the cities, best match first, as
   short cards (match, how each priority fits, four key figures with their
   seals, the best Double First-Class universities by name) whose details
   fold out; and a tray to compare up to three side by side.
   --------------------------------------------------------------------------- */
html[data-csca-cities] main#app-root { padding: 0; }
#react-root .city-guide { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }
@media (min-width: 720px) { #react-root .city-guide { padding: 0 24px 56px; } }
.city-guide-hero {
  text-align: center;
  margin-bottom: var(--space-6);
  padding: var(--space-7) 0 calc(var(--space-6) + 2 * var(--wave-amp) + var(--wave-base));
}
.city-guide-hero h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  color: var(--color-on-hero);
  hyphens: auto;
  overflow-wrap: anywhere;
}
.city-guide-subtitle {
  max-width: 44rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
}
.city-guide-body { display: grid; gap: var(--space-5); }

/* THE PRIMARY ACTIONS of the guide: the app's Cinnabar pill. */
.city-guide .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--color-primary);
  background-image: var(--gradient-primary);
  color: var(--color-on-primary);
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  box-shadow: var(--shadow-primary);
  cursor: pointer;
}
.city-guide .btn-primary:hover:not(:disabled) { background-color: var(--color-primary-hover); background-image: var(--gradient-primary-hover); }
.city-guide .btn-primary:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.city-guide .btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.city-guide .btn-secondary { padding: var(--space-2) var(--space-5); font-size: var(--text-sm); }
.city-guide .btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* SEALS: decoration only -- the glyph is generated content with empty
   alternative text (the NUBE-1 convention), so it is never read or copied. */
.city-seal {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  font-family: var(--font-cjk);
  font-size: 1rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.city-seal::before { content: attr(data-seal); content: attr(data-seal) / ""; }
.city-seal--small { width: 22px; height: 22px; margin-inline-end: var(--space-2); font-size: 0.8125rem; vertical-align: -5px; }

/* STEP 1: what matters most -- one compact button per priority. */
.city-chooser {
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.city-chooser h2 { margin: 0; font-size: 1.25rem; }
.city-chooser h2:focus { outline: none; }
.city-chooser-hint { margin: var(--space-1) 0 var(--space-4); color: var(--color-text-muted); font-size: var(--text-sm); }
.city-priorities { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.city-priorities li { display: flex; max-width: 100%; }
.city-priority {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  max-width: 100%;
  padding-block: var(--space-1);
  padding-inline: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  text-align: start;
  cursor: pointer;
}
.city-priority .city-seal { border-radius: var(--radius-pill); }
.city-priority:hover { background: var(--color-control-hover); }
.city-priority:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.city-priority[aria-pressed="true"] {
  border-color: var(--hero-ground);
  background: var(--hero-ground);
  color: var(--color-on-hero);             /* 6.40:1 or more on the band's Jade */
}
.city-priority[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.city-priority-rank {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--color-achievement);
  color: var(--color-on-achievement);      /* 7.84:1 on Gold */
  font-weight: var(--weight-bold);
}

/* STEP 2: a drop-down beneath for each chosen priority that needs an answer. */
.city-questions { display: grid; gap: var(--space-3); align-items: start; margin: var(--space-4) 0 0; }
@media (min-width: 720px) { .city-questions { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.city-question { display: grid; gap: var(--space-1); align-content: start; min-width: 0; }
.city-question select { width: 100%; }
.city-question-hint { margin: 0; font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--color-text-muted); }
.city-question label { font-size: var(--text-sm); font-weight: var(--weight-bold); }
.city-question select,
.city-sort select {
  min-height: 44px;
  max-width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
}
.city-question[data-answered="false"] select { border-color: var(--brand-gold); border-width: 2px; }
.city-question select:focus-visible,
.city-sort select:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.city-chooser-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-5) 0 0; }
.city-chooser-missing { flex-basis: 100%; margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }

/* THE SUMMARY: the chosen priorities on one line, and "Change". */
.city-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.city-summary-text { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; min-width: 0; }
.city-summary-label { font-weight: var(--weight-bold); }
.city-summary-items { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.city-summary-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-block: 2px;
  padding-inline: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-control-hover);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.city-summary-rank {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: var(--color-achievement);
  color: var(--color-on-achievement);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

/* THE RESULTS */
.city-guide-results { min-width: 0; }
.city-guide-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-3);
}
.city-guide-count { margin: 0; font-size: 1.125rem; }
.city-guide-count:focus { outline: none; }
.city-sort { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.city-guide-list { display: grid; gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
@media (min-width: 960px) { .city-guide-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }

/* A SHORT CARD */
.city-card {
  min-width: 0;
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.city-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px var(--space-3);
  margin: 0 0 var(--space-3);
}
.city-rank {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--color-control-hover);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.city-card-head h3 { grid-column: 2; margin: 0; font-size: 1.3125rem; line-height: 1.2; overflow-wrap: anywhere; }
.city-hanzi {
  margin-inline-start: var(--space-2);
  font-family: var(--font-cjk);
  font-size: 1.0625rem;
  font-weight: var(--weight-semibold);
  color: var(--color-accent-text);
}
.city-where { grid-column: 2; margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.city-score {
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}
.city-score[data-city-score-badge="none"] { background: var(--color-control-hover); color: var(--color-text-muted); white-space: normal; }

/* How each priority fits: a mark (generated, alt "") and the city's own figure. */
.city-reasons { display: grid; gap: var(--space-1); margin: 0 0 var(--space-3); padding: 0; list-style: none; font-size: var(--text-sm); }
.city-reason { display: flex; gap: var(--space-2); align-items: baseline; }
.city-reason::before {
  flex: none;
  width: 1.25em;
  font-weight: var(--weight-bold);
  text-align: center;
}
.city-reason[data-fit="good"]::before { content: "✓"; content: "✓" / ""; color: var(--color-accent-text); }
.city-reason[data-fit="partly"]::before { content: "≈"; content: "≈" / ""; color: var(--color-text-muted); }
.city-reason[data-fit="poor"]::before { content: "✗"; content: "✗" / ""; color: var(--color-primary-text); }
.city-reason[data-fit="unknown"] { color: var(--color-text-muted); font-style: italic; }
.city-reason[data-fit="unknown"]::before { content: "–"; content: "–" / ""; }

/* Four key figures in a row (two by two on a phone). */
.city-keyfacts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--color-control-hover);
}
/* Four across only where a card has the whole row (one card per row). */
@media (min-width: 600px) and (max-width: 959px) {
  .city-keyfacts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.city-keyfacts > div { min-width: 0; }
.city-keyfacts dt { font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--color-text-muted); overflow-wrap: anywhere; }
.city-keyfacts dd { display: flex; flex-direction: column; margin: 2px 0 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.city-keyfacts dd small { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.city-top-unis { margin: 0 0 var(--space-3); font-size: var(--text-sm); line-height: var(--leading-normal); overflow-wrap: anywhere; }
.city-top-more { color: var(--color-text-muted); white-space: nowrap; }
.city-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.city-compare-toggle[aria-pressed="true"] { border-color: var(--hero-ground); background: var(--hero-ground); color: var(--color-on-hero); }
.city-compare-toggle[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* THE DETAILS, folded out */
.city-details { margin: var(--space-4) 0 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--color-border); }
.city-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-3) var(--space-4);
  margin: 0 0 var(--space-4);
}
.city-facts > div { min-width: 0; }
.city-facts dt { font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); }
.city-facts dd { display: flex; flex-direction: column; gap: 2px; margin: var(--space-1) 0 0; font-weight: var(--weight-semibold); }
.city-facts dd small { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.city-tier { align-self: flex-start; padding: 2px 10px; border-radius: var(--radius-pill); font-size: var(--text-sm); }
.city-tier[data-tier="below"] { background: var(--color-figure-accent-subtle); color: var(--color-accent-text); }
.city-tier[data-tier="around"] { background: var(--color-surface-elevated); color: var(--color-text); }
.city-tier[data-tier="above"] { background: var(--color-primary-subtle-bg); color: var(--color-primary-text); }
.city-details .city-tier[data-tier="around"] { background: var(--color-control-hover); }
.city-dfc { margin: 0 0 var(--space-4); }
.city-dfc h4 { margin: 0 0 var(--space-1); font-size: 1rem; }
.city-dfc-mid { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.city-dfc-list { display: grid; gap: var(--space-1); margin: 0; padding-inline-start: var(--space-5); font-size: var(--text-sm); overflow-wrap: anywhere; }
.city-dfc-zh { margin-inline-start: var(--space-2); font-family: var(--font-cjk); color: var(--color-text-muted); }
.city-dfc-level { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }
.city-dfc-list li[data-level="top"] { font-weight: var(--weight-semibold); }
.city-desc { margin: 0 0 var(--space-2); line-height: var(--leading-normal); }
.city-desc-label { font-weight: var(--weight-bold); }
.city-tag {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  vertical-align: 1px;
}
.city-no-data { color: var(--color-text-muted); font-style: italic; }
.city-sources { margin: var(--space-3) 0 0; font-size: var(--text-xs); color: var(--color-text-muted); overflow-wrap: anywhere; }
.city-sources a { color: var(--color-primary-text); text-underline-offset: 3px; }

/* COMPARE: a tray at the foot of the screen, and the comparison itself --
   a table from 720px, one city under another below. */
.city-compare-tray {
  position: sticky;
  bottom: var(--space-3);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.city-compare-tray-text { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-bold); }
.city-compare-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; flex: 1 1 auto; min-width: 0; }
.city-compare-chip {
  min-height: 44px;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-control-hover);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.city-compare-chip:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.city-compare-tray-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.city-compare {
  margin: 0 0 var(--space-5);
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 2px solid var(--hero-ground);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.city-compare-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0 0 var(--space-3); }
.city-compare-head h2 { margin: 0; font-size: 1.25rem; }
.city-compare-head h2:focus { outline: none; }
.city-compare-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--text-sm); }
.city-compare-table th,
.city-compare-table td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.city-compare-table thead th { font-size: 1rem; }
.city-compare-table tbody th { width: 9.5rem; color: var(--color-text-muted); font-weight: var(--weight-bold); }
.city-compare-stack { display: none; }
.city-compare-city + .city-compare-city { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.city-compare-city h3 { margin: 0 0 var(--space-2); font-size: 1.125rem; }
.city-compare-city dl { display: grid; gap: var(--space-2); margin: 0; }
.city-compare-city dt { font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--color-text-muted); }
.city-compare-city dd { margin: 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
@media (max-width: 719px) {
  .city-compare-table { display: none; }
  .city-compare-stack { display: block; }
}
.city-compare-note { margin: var(--space-3) 0 0; font-size: var(--text-xs); color: var(--color-text-muted); }

.city-guide-note {
  margin: var(--space-5) 0 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--brand-gold);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.city-guide-note p { margin: 0; }
.city-guide-note p + p { margin-top: var(--space-2); }
.city-guide-note a { color: var(--color-primary-text); text-underline-offset: 3px; }
/* THE TABS (UNI-FINDER-1): "Cities" and "Universities", one row of two 44px tabs. */
.city-tabs {
  display: flex;
  gap: var(--space-1);
  margin: 0 0 var(--space-5);
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-sm);
  width: fit-content;
  max-width: 100%;
}
.city-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding-block: var(--space-1);
  padding-inline: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.city-tab:hover { background: var(--color-control-hover); }
.city-tab:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.city-tab[aria-selected="true"] { background: var(--hero-ground); color: var(--color-on-hero); }
.city-tab .city-seal--small { margin-inline-end: 0; vertical-align: 0; }
.city-card-head h3:focus { outline: none; }

/* THE UNIVERSITY FINDER (UNI-FINDER-1) */
.finder-head h2 { margin: 0; font-size: 1.375rem; }
.finder-head h2:focus { outline: none; }
.finder-intro { margin: var(--space-1) 0 var(--space-4); color: var(--color-text-muted); }
.finder-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 720px) { .finder-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .finder-filters { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); } }
.finder-field { display: grid; gap: var(--space-1); min-width: 0; font-size: var(--text-sm); font-weight: var(--weight-bold); }
.finder-field input,
.finder-field select {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.finder-field input::placeholder { color: var(--color-text-muted); }
.finder-field input:focus-visible,
.finder-field select:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.finder-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-3); }
.finder-count { margin: 0; font-size: 1.125rem; font-weight: var(--weight-bold); }
.finder-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.finder-none { margin: 0; padding: var(--space-5); border: 1px dashed var(--color-border-strong); border-radius: var(--radius-xl); color: var(--color-text-muted); text-align: center; }
.finder-list { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
@media (min-width: 960px) { .finder-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.finder-item {
  min-width: 0;
  padding: var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.finder-item-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-1) var(--space-3); margin: 0 0 var(--space-2); }
.finder-item-head h3 { margin: 0; min-width: 0; font-size: 1.0625rem; line-height: 1.3; overflow-wrap: anywhere; }
.finder-zh { display: block; margin-top: 2px; font-family: var(--font-cjk); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-accent-text); }
.finder-level {
  flex: none;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-control-hover);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}
.finder-level[data-level="top"] { background: var(--color-figure-accent-subtle); color: var(--color-accent-text); }
.finder-city { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.finder-city .city-seal--small { margin-inline-end: 0; }
.finder-see-city,
.finder-more {
  min-height: 44px;
  padding: 0 var(--space-2);
  border: none;
  background: none;
  color: var(--color-primary-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.finder-see-city:focus-visible,
.finder-more:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.finder-own, .finder-disciplines-count { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--color-text-muted); }
.finder-chips { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); margin: 0; padding: 0; list-style: none; }
.finder-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--space-1);
  max-width: 100%;
  padding: 2px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}
.finder-chip[data-match="true"] { border-color: var(--hero-ground); background: var(--hero-ground); color: var(--color-on-hero); }
.finder-chip-zh { font-family: var(--font-cjk); font-weight: var(--weight-medium); color: var(--color-text-muted); }
.finder-chip[data-match="true"] .finder-chip-zh { color: var(--color-on-hero); }
.finder-note { margin-top: var(--space-5); }

@media (max-width: 599px) {
  /* The chips already say which cities; the count line would only cost a row. */
  .city-compare-tray-text { display: none; }
  .city-chooser { padding: var(--space-4); }
  .city-card { padding: var(--space-4); }
  .city-card-head { grid-template-columns: auto minmax(0, 1fr); }
  .city-score { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .city-compare { padding: var(--space-4); }
  .finder-filters { padding: var(--space-3); }
  .city-tabs { width: 100%; }
  .city-tab { flex: 1 1 0; justify-content: center; padding: var(--space-1) var(--space-3); }
}

/* ---------------------------------------------------------------------------
   THE EXAM DATES (REGISTRATION-1, product owner 2026-10-20): further down
   the subjects screen. The heading and the later sittings, each with its
   registration state, beside a wall calendar of the next sitting -- its
   days large, its registration window and where it stands -- then the
   next sitting's papers in the student's own time zone and the exam-day
   login rule. The calendar's head is the band's Jade with the gate's Gold
   rings; "open" is the action Cinnabar, as urgent as registration is.
   --------------------------------------------------------------------------- */
.exam-dates {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "text" "cal" "local" "rules";
  gap: var(--space-6);
  margin: var(--space-8) 0 0;
}
@media (min-width: 900px) {
  .exam-dates {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas: "text cal" "local local" "rules rules";
    align-items: center;
    column-gap: var(--space-7);
  }
}
.exam-dates-text { grid-area: text; min-width: 0; }
.exam-dates h2 {
  margin: 0 0 var(--space-5);
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
}
.exam-dates-subhead { margin: 0 0 var(--space-3); font-size: 1.125rem; }
.exam-dates-later {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding: var(--space-3);
  list-style: none;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.exam-dates-later li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-3) var(--space-2);
  text-align: center;
}
.exam-dates-month {
  color: var(--color-accent-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.exam-dates-days {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: var(--weight-display);
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}
.exam-dates-chip {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  color: var(--color-text-muted);
}
.exam-dates-chip[data-status="open"] { color: var(--color-primary-text); }
.exam-dates-all { display: inline-flex; align-items: center; gap: var(--space-2); }
/* EXAM-CHECKLIST-1: "Home exam checklist" beside it. */
.exam-dates-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.exam-dates-checklist { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }

/* THE WALL CALENDAR */
.exam-cal {
  grid-area: cal;
  position: relative;
  margin-top: 16px;                     /* room for the rings */
  padding: 0 0 var(--space-5);
  text-align: center;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.exam-cal-ring {
  position: absolute;
  top: -14px;
  width: 14px;
  height: 34px;
  border-radius: 8px;
  background: var(--brand-gold);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.18);
}
.exam-cal-ring--left { inset-inline-start: 22%; }
.exam-cal-ring--right { inset-inline-end: 22%; }
.exam-cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  padding: var(--space-5) var(--space-5) var(--space-3);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--hero-ground);
  color: var(--color-on-hero);
  font-weight: var(--weight-semibold);
}
.exam-cal-month { font-weight: var(--weight-bold); }
.exam-cal-days {
  margin: var(--space-5) 0 var(--space-4);
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 2.4rem + 4vw, 5.5rem);
  font-weight: var(--weight-display);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: lining-nums tabular-nums;
}
.exam-cal-reg {
  margin: 0 var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.exam-cal-label { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.exam-cal-window { margin: var(--space-1) 0 0; font-size: 1.25rem; font-weight: var(--weight-bold); }
.exam-cal-status {
  display: inline-flex;
  margin: var(--space-2) 0 0;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.exam-cal-status[data-status="open"] { background: var(--color-primary-subtle-bg); color: var(--color-primary-text); }
.exam-cal-status[data-status="closed"] { background: var(--color-control-hover); color: var(--color-text-muted); }
.exam-cal-note { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }

/* THE PAPERS IN THE STUDENT'S TIME ZONE, AND THE EXAM-DAY RULE */
.exam-dates-local {
  grid-area: local;
  min-width: 0;
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}
.exam-dates-papers { display: grid; margin: 0; padding: 0; list-style: none; }
.exam-dates-papers li {
  display: grid;
  grid-template-columns: minmax(8rem, auto) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--space-1) var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.exam-dates-papers li:last-child { border-bottom: none; }
.exam-dates-paper-day { font-size: var(--text-sm); color: var(--color-text-muted); }
.exam-dates-paper-name { font-weight: var(--weight-semibold); }
.exam-dates-paper-time { font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.exam-dates-rules {
  grid-area: rules;
  margin-top: calc(-1 * var(--space-3));
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.exam-dates-rules p { margin: 0 0 var(--space-1); }
.exam-dates-sources { overflow-wrap: anywhere; }
.exam-dates-sources a { color: var(--color-primary-text); text-underline-offset: 3px; }
.exam-guide-sittings .exam-dates-chip { flex: 1 1 100%; order: 3; }
@media (max-width: 599px) {
  .exam-dates-papers li { grid-template-columns: minmax(0, 1fr) auto; }
  .exam-dates-paper-day { grid-column: 1 / -1; }
  .exam-dates-all { width: 100%; justify-content: center; }
  .exam-dates-checklist { width: 100%; }
  .exam-dates-local { padding: var(--space-4); }
}

/* ---------------------------------------------------------------------------
   THE HOMEPAGE (WELCOME-1, phase 5 of .claude/interfaces/PLAN.md). The screen
   (Landing.tsx, #/welcome): the Jade band, centred -- its own language row,
   the gate, the promise, Start free and the guide, the live figures -- then
   the three steps under 一 二 三, the five subjects in their own tones, the
   guide card, the closing call and the disclaimer.
   --------------------------------------------------------------------------- */
html[data-csca-welcome] main#app-root { padding: 0; }
#react-root .landing {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
@media (min-width: 720px) {
  #react-root .landing { padding: 0 24px 56px; }
}
.landing-hero {
  text-align: center;
  padding: var(--space-5) 0 calc(var(--space-7) + 2 * var(--wave-amp) + var(--wave-base));
}
.landing-langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-1);
  margin: 0 0 var(--space-6);
}
.landing-lang {
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-on-hero);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.landing-lang:hover { border-color: var(--color-hero-line); }
.landing-lang[aria-pressed="true"] {
  border-color: var(--color-hero-line);
  background: var(--hero-chip);          /* white on it 15.43:1 */
}
.landing-lang:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.landing-emblem {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-5);
  border-radius: 22px;
  box-shadow: 0 0 0 6px var(--color-hero-line), var(--shadow-lg);
}
.landing-hero h1 {
  max-width: 18ch;
  margin: 0 auto var(--space-4);
  font-size: clamp(2.25rem, 1.5rem + 2.8vw, 3.75rem);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  color: var(--color-on-hero);
  hyphens: auto;
  overflow-wrap: anywhere;
}
.landing-subtitle {
  max-width: 42rem;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
}
.landing-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
}
.landing-note {
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.landing-hero .landing-note { color: var(--color-on-hero-muted); }
.landing-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}
.landing-stats li {
  padding: 6px 14px;
  border: 1px solid var(--color-hero-line);
  border-radius: var(--radius-pill);
  background: var(--hero-chip);
  color: var(--color-on-hero);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.landing-section { margin: var(--space-8) 0 0; }
.landing-section > h2,
.landing-final h2 {
  margin: 0 0 var(--space-5);
  font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem);
  letter-spacing: var(--tracking-display);
  line-height: 1.15;
  text-align: center;
}
.landing-steps {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 900px) {
  .landing-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
}
.landing-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.landing-step-seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 0 var(--space-4);
  border-radius: 16px;
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);       /* 5.57:1 on its tint, 6.06:1 at night */
  font-family: var(--font-cjk);
  font-size: 1.5rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.landing-step h3 { margin: 0 0 var(--space-2); font-size: 1.25rem; }
.landing-step p {
  flex: 1 1 auto;
  margin: 0 0 var(--space-3);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.landing-step-link {
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-primary-text);      /* 5.33:1 on the white card */
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.landing-step-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.landing-step-link:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; border-radius: 4px; }

.landing-subjects {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 600px) {
  .landing-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  /* Five in a row: each tile stands, the seal above its words. */
  .landing-subjects { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .landing-subject { flex-direction: column; align-items: center; text-align: center; }
  .landing-subject-text { align-items: center; }
}
.landing-subject {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}
.landing-subject-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.landing-subject-name { font-weight: var(--weight-bold); }
.landing-subject-meta { font-size: var(--text-sm); color: var(--color-text-muted); }

.landing-guide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--brand-gold);
  border-radius: var(--radius-xl);
}
.landing-guide-text { flex: 1 1 22rem; min-width: 0; }
.landing-guide-text h2 { margin: 0 0 var(--space-2); font-size: 1.375rem; }
.landing-guide-text p { margin: 0; color: var(--color-text-muted); }

.landing-final {
  margin: var(--space-8) 0 0;
  padding: var(--space-7) var(--space-5);
  text-align: center;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.landing-disclaimer {
  max-width: 40rem;
  margin: var(--space-6) auto 0;
  font-size: var(--text-sm);
  text-align: center;
  color: var(--color-text-muted);
}
@media (max-width: 599px) {
  .landing-ctas > * { flex: 1 1 100%; }
  .landing-final .landing-start { width: 100%; }
  .landing-guide { padding: var(--space-4); }
  .landing-guide > .btn-secondary { width: 100%; }
}

/* ---------------------------------------------------------------------------
   THE INSTALL NOTICE (PWA-1, PWA.md). A small card floating at the foot of
   the subjects screen once the browser says the app can be installed:
   the gate, a sentence, Install and a close key. On a phone the sentence
   takes the first line beside the close key, Install the second.
   --------------------------------------------------------------------------- */
.install-notice:not([hidden]) {
  position: fixed;
  left: 50%;
  bottom: var(--space-4);
  z-index: 50;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 44px;
  grid-template-areas: "icon text action close";
  align-items: center;
  gap: var(--space-3);
  width: min(560px, calc(100vw - 2 * var(--space-4)));
  padding-block: var(--space-3);
  padding-inline: var(--space-4) var(--space-2);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}
.install-notice-icon { grid-area: icon; display: block; width: 40px; height: 40px; }
.install-notice-text {
  grid-area: text;
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text);
}
.install-notice-btn { grid-area: action; }
.install-notice-close {
  grid-area: close;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}
.install-notice-close:hover { background: var(--color-control-hover); color: var(--color-text); }
.install-notice-close:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.install-notice-close svg { display: block; }
@media (max-width: 599px) {
  .install-notice:not([hidden]) {
    grid-template-columns: 40px minmax(0, 1fr) 44px;
    grid-template-areas:
      "icon text close"
      "action action action";
    bottom: var(--space-3);
    width: calc(100vw - 2 * var(--space-3));
  }
  .install-notice-btn { width: 100%; }
}

/* ---------------------------------------------------------------------------
   THE EXAM GUIDE (EXAM-GUIDE-1, phase 4 of .claude/interfaces/PLAN.md). The
   screen (ExamGuide.tsx): the Jade band with the heading and the date the
   guide was checked, the contents (a sticky column from 1024px), then one
   white card per section -- its text, its tables drawn from the guide's
   data, and the official pages it was checked against -- the official links
   and the disclaimer. A table wider than a phone scrolls inside its own
   frame, never the page.
   --------------------------------------------------------------------------- */
html[data-csca-guide] main#app-root { padding: 0; }
#react-root .exam-guide {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
@media (min-width: 720px) {
  #react-root .exam-guide { padding: 0 24px 56px; }
}
.exam-guide-hero {
  text-align: center;
  margin-bottom: var(--space-6);
  padding: var(--space-7) 0 calc(var(--space-6) + 2 * var(--wave-amp) + var(--wave-base));
}
.exam-guide-hero h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  color: var(--color-on-hero);
}
.exam-guide-subtitle {
  max-width: 40rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
}
.exam-guide-checked {
  display: inline-flex;
  margin: var(--space-4) 0 0;
  padding: 6px 14px;
  border: 1px solid var(--color-hero-line);
  border-radius: var(--radius-pill);
  background: var(--hero-chip);
  color: var(--color-on-hero);           /* 15.43:1 on the chip */
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
}

.exam-guide-body {
  display: grid;
  gap: var(--space-5);
}
@media (min-width: 1024px) {
  .exam-guide-body {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--space-6);
    align-items: start;
  }
  .exam-guide-toc { position: sticky; top: var(--space-5); }
}

/* THE CONTENTS: buttons (the hash is the app's route), numbered like the
   sections by a counter; the official pages, which have no number, by a ring. */
.exam-guide-toc {
  padding: var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.exam-guide-toc-title {
  margin: 0 0 var(--space-2);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.exam-guide-toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: guide-section;
}
@media (min-width: 600px) and (max-width: 1023px) {
  .exam-guide-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-3); }
}
.exam-guide-toc li { counter-increment: guide-section; }
.exam-guide-toc button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: 6px var(--space-3);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  text-align: start;
  cursor: pointer;
}
.exam-guide-toc button::before {
  content: counter(guide-section);
  content: counter(guide-section) / "";
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}
.exam-guide-toc li:last-child button::before {
  content: "";
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--color-figure-accent-subtle);
}
.exam-guide-toc button:hover { background: var(--color-control-hover); }
.exam-guide-toc button:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: -3px; }

/* THE SECTIONS */
.exam-guide-sections {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}
.exam-guide-section {
  min-width: 0;
  padding: var(--space-5) var(--space-6);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  scroll-margin-top: var(--space-4);
}
.exam-guide-section h2 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  line-height: 1.25;
  /* A long word ("зарегистрироваться") must not run out of a 320px card:
     hyphenated in the page's language, broken anywhere as a last resort. */
  hyphens: auto;
  overflow-wrap: anywhere;
}
.exam-guide-section h2:focus { outline: none; }
.exam-guide-section h2:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 4px; }
.exam-guide-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);       /* 5.57:1 on its tint, 6.06:1 at night */
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}
.exam-guide-p,
.exam-guide-list {
  max-width: 68ch;
  margin: 0 0 var(--space-4);
  line-height: var(--leading-normal);
}
.exam-guide-list {
  display: grid;
  gap: var(--space-3);
  padding-inline-start: 1.4rem;
}
.exam-guide-list li { padding-inline-start: var(--space-1); }
.exam-guide-list li::marker { color: var(--color-accent-text); font-weight: var(--weight-bold); }

/* THE TABLES */
.exam-guide-table-wrap {
  max-width: 100%;
  margin: 0 0 var(--space-4);
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.exam-guide-table-wrap:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.exam-guide-table-wrap:has(.exam-guide-fees) { max-width: 30rem; }
.exam-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.exam-guide-table caption {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-weight: var(--weight-bold);
  text-align: start;
}
.exam-guide-table th,
.exam-guide-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: start;
  vertical-align: top;
}
.exam-guide-table thead th {
  background: var(--color-figure-accent-subtle);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  white-space: nowrap;
}
.exam-guide-table tbody tr:last-child > * { border-bottom: none; }
.exam-guide-table tbody th { font-weight: var(--weight-semibold); }
.exam-guide-subject-name { display: block; }
.exam-guide-subject-group {
  display: block;
  margin-top: 2px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}
.exam-guide-clock {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.exam-guide-times {
  display: grid;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
}
.exam-guide-times .exam-guide-table-wrap { margin: 0; }
.exam-guide-day { white-space: nowrap; }

/* THE UPCOMING SITTINGS, from the countdown's calendar */
.exam-guide-sittings {
  margin: 0 0 var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.exam-guide-sittings h3 { margin: 0 0 var(--space-2); font-size: 1.0625rem; }
.exam-guide-sittings p { margin: 0; color: var(--color-text-muted); }
.exam-guide-sittings ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.exam-guide-sittings li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}
.exam-guide-sittings li:last-child { border-bottom: none; }
.exam-guide-sitting-date { font-weight: var(--weight-semibold); }

/* THE SYLLABUS: one disclosure per subject, its modules and their topics */
.exam-guide-syllabus { margin: 0 0 var(--space-4); }
.exam-guide-syllabus h3 { margin: 0 0 var(--space-1); font-size: 1.0625rem; }
.exam-guide-syllabus-note {
  max-width: 68ch;
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.exam-guide-syllabus-subject {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.exam-guide-syllabus-subject + .exam-guide-syllabus-subject { margin-top: var(--space-2); }
.exam-guide-syllabus-subject summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-height: 48px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
/* The open/closed mark: a chevron at the row's end (a flex summary draws no
   marker of its own), turned when the panel is open. */
.exam-guide-syllabus-subject summary { list-style: none; }
.exam-guide-syllabus-subject summary::-webkit-details-marker { display: none; }
.exam-guide-syllabus-subject summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-inline-start: auto;
  border-inline-end: 2px solid var(--color-accent-text);
  border-bottom: 2px solid var(--color-accent-text);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 120ms ease;
}
.exam-guide-syllabus-subject[open] > summary::after { transform: translateY(2px) rotate(225deg); }
@media (prefers-reduced-motion: reduce) {
  .exam-guide-syllabus-subject summary::after { transition: none; }
}
.exam-guide-syllabus-subject summary:hover { background: var(--color-control-hover); }
.exam-guide-syllabus-subject summary:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.exam-guide-syllabus-count {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}
.exam-guide-syllabus-subject ul {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-2) var(--space-4) var(--space-4);
  list-style: none;
}
.exam-guide-syllabus-module {
  display: block;
  font-weight: var(--weight-semibold);
}
.exam-guide-syllabus-topics {
  display: block;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

.exam-guide-sources {
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.exam-guide-sources-label { font-weight: var(--weight-semibold); }
.exam-guide-sources a,
.exam-guide-sittings a {
  color: var(--color-primary-text);      /* 5.33:1 on the white card */
  text-underline-offset: 3px;
}
.exam-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* THE OFFICIAL PAGES, and the disclaimer under them */
.exam-guide-links {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) {
  .exam-guide-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.exam-guide-links a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  height: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  text-decoration: none;
}
.exam-guide-links a:hover { border-color: var(--color-border-strong); background: var(--color-control-hover); }
.exam-guide-links a:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.exam-guide-link-label { font-weight: var(--weight-semibold); color: var(--color-primary-text); }
.exam-guide-link-url {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}
.exam-guide-disclaimer {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--brand-gold);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.exam-guide-disclaimer p { margin: 0; }
.exam-guide-disclaimer p + p { margin-top: var(--space-2); }
.exam-guide-disclaimer-date { font-weight: var(--weight-semibold); }

/* THE HOME-EXAM CHECKLIST (EXAM-CHECKLIST-1): a card after the numbered
   sections, named in the contents apart from them, its ✓ in place of a
   number, both on the lacquer tint. Its groups are fieldsets; each item is a
   label around its box, the whole row a target, tinted once ticked; the
   essential ones carry a lacquer tag. The progress line counts the ticks. */
.exam-guide-toc .exam-guide-checklist-jump {
  margin-top: var(--space-2);
  background: var(--color-primary-subtle-bg);
  color: var(--color-primary-text);
}
.exam-guide-toc .exam-guide-checklist-jump::before { content: none; }
.exam-guide-toc .exam-guide-checklist-jump:hover {
  background: var(--color-primary-subtle-bg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.exam-guide-checklist-jump-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-surface-elevated);
  color: var(--color-primary-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}
.exam-checklist .exam-checklist-mark {
  background: var(--color-primary-subtle-bg);
  color: var(--color-primary-text);
}
.exam-checklist-progress {
  display: grid;
  gap: var(--space-2);
  max-width: 68ch;
  margin: 0 0 var(--space-3);
}
.exam-checklist-progress p { margin: 0; font-weight: var(--weight-semibold); }
.exam-checklist-bar {
  display: block;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-track);
  overflow: hidden;
}
.exam-checklist-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-progress-fill);
  transition: width 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .exam-checklist-bar > span { transition: none; }
}
.exam-checklist-legend {
  margin: 0 0 var(--space-5);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.exam-checklist-badge {
  display: inline-block;
  margin-inline-end: var(--space-2);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-subtle-bg);
  color: var(--color-primary-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.exam-checklist-group {
  min-width: 0;
  margin: 0 0 var(--space-5);
  padding: 0;
  border: none;
}
.exam-checklist-group legend {
  margin: 0 0 var(--space-2);
  padding: 0;
  font-size: 1.0625rem;
  font-weight: var(--weight-bold);
}
.exam-checklist-group ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.exam-checklist-group label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  min-height: 44px;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  line-height: var(--leading-normal);
  cursor: pointer;
}
.exam-checklist-group label:hover { border-color: var(--color-border-strong); }
.exam-checklist-group label:has(input:checked) {
  background: var(--color-correct-bg);
  border-color: var(--color-correct-bg);
}
.exam-checklist-group input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.exam-checklist-group input:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.exam-checklist-text { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 599px) {
  .exam-guide-section { padding: var(--space-4); }
  .exam-guide-section h2 { gap: var(--space-2); }
  .exam-guide-num { width: 30px; height: 30px; }
  /* A phone fits the five columns by letting every cell wrap; the frame
     scrolls only if a language's words still do not fit. */
  .exam-guide-table { font-size: 0.8125rem; }
  .exam-guide-table th,
  .exam-guide-table td { padding: var(--space-2); }
  .exam-guide-table thead th { white-space: normal; font-size: 0.75rem; }
  .exam-guide-table caption { padding: var(--space-2) var(--space-3); }
  .exam-guide-actions > * { flex: 1 1 100%; }
}

@media (prefers-color-scheme: dark) {
  /* :not([data-theme="light"]) -- an explicit Light choice (PALETTE-1A's
     manual theme toggle, see frontend/app.js and the [data-theme="dark"]
     block below) must win even when the OS itself prefers dark. Absent an
     explicit choice, system preference alone still governs, unchanged from
     PALETTE-1/FE-0. */
  :root:not([data-theme="light"]) {
    /* NUBE-1 NIGHT (2026-10-08). The product owner asked for the Nube
       board's own dark palette: its warm brown neutrals instead of
       PALETTE-1A's green-tinted charcoal, and the board Cinnabar kept as the
       FILL of a primary control with a white label, exactly as on the board.
       So the Tier 2 primary is no longer re-pointed here -- the light mapping
       and its hover and pressed states carry through unchanged -- and what
       brightens at night is everything that is READ on the dark ground:
       Cinnabar text, progress fills, Jade and Gold. Jade stays re-pointed, as
       it is read text and figure ink far more often than it is a fill.
       LACA-1 keeps that shape with its own colours: the lacquer red stays
       the fill, its text and bars brighten, and the deep-Gold secondary
       becomes the bright on-dark Gold. */
    --product-secondary: var(--brand-gold-on-dark);
    --product-secondary-deep: #EDD58A;        /* ink on it 11.37:1 */

    /* Tier 3: only the tokens that are literal values in :root. The neutral
       ladder is the board's night: page, card, divider, rail. */
    --color-bg: #191816;                      /* --color-text on it: 15.35:1 */
    --color-surface: #23211E;                 /* the board's card; --color-text on it: 13.89:1 */
    --color-surface-elevated: #23211E;        /* one card colour, as in light (both white) */

    /* The lacquer FILL is the light one (see above); only its tint and its
       text member change at night. */
    --color-primary-subtle-bg: #402E29;       /* primary-text on it 5.27:1; CIEDE2000 10.36 from --color-incorrect-bg */
    --color-primary-text: var(--brand-lacquer-on-dark); /* 6.62:1 on surface, 7.31:1 on bg */

    /* Secondary (deep Gold by day, bright Gold at night); academic figures
       follow it. */
    --color-accent-hover: #EDD58A;            /* ink on it 11.37:1 */
    --color-accent-text: var(--brand-gold-on-dark); /* 9.25:1 on surface */
    --color-figure-accent: var(--brand-gold-on-dark);
    --color-figure-accent-deep: #EDD58A;
    --color-figure-accent-subtle: #3A3426;    /* a Gold tint at night; accent-text on it 7.12:1 */

    /* A bright Gold fill takes Ink, not white. The lacquer fill keeps its
       white label, so --color-on-primary is not restated (white on the fill
       6.54:1, on hover 8.47:1, pressed 11.65:1). */
    --color-on-accent: var(--neutral-ink);    /* on dark --color-accent: 9.50:1 */

    /* The exam room's green at night: the Jade the sitting had under Nube,
       bright, with Ink on it (see --mock-go in :root). */
    --mock-go: #6CC9A6;                       /* ink on it 8.28:1 */
    --mock-go-hover: #8AD8BA;                 /* ink on it 9.90:1 */
    --color-on-mock-go: var(--neutral-ink);

    /* Gold is legible enough on dark to be its own text colour, which it is
       NOT in light mode. */
    --color-achievement: var(--brand-gold-on-dark); /* ink on it: 9.50:1 */
    --color-achievement-text: var(--brand-gold-on-dark); /* 9.25:1 on surface */

    /* Text and structure on the board's night ground. */
    --color-text: #F2EEE8;
    --color-text-muted: #ABA49A;              /* 6.51:1 on surface, 7.19:1 on bg */
    --color-border: #3A3632;                  /* decorative dividers and quiet card edges only */
    --color-structure: #5C5650;               /* coordinate grid only: 2.22:1 on surface, 2.45:1 on bg */
    --color-track: #3C3834;                   /* 1.38:1 on surface, 1.53:1 on bg; progress fill on it 4.79:1, Gold 6.69:1 */
    --color-figure-muted: #8A8279;            /* vs edge-visible 3.27:1; on surface 4.24:1 */
    --color-border-strong: #7D756C;           /* the board's UI border, a step quieter at night (a light rim glares on dark): 3.54:1 on surface, 3.91:1 on bg */
    --color-focus-ring: #F2EEE8;              /* the text colour, mirroring light mode's Ink ring: 15.35:1 on bg */

    /* Semantic states stay independent of the brand. --color-incorrect-text
       (#F0A0A8) is NOT --brand-lacquer-on-dark (#F08A80): separate tokens
       in both schemes. */
    --color-correct-bg: #173425;
    --color-correct-text: #7FD9A8;            /* on correct-bg: 7.97:1 */
    --color-incorrect-bg: #331419;
    --color-incorrect-text: #F0A0A8;          /* on incorrect-bg: 8.21:1 */
    --color-warning-bg: #332711;
    --color-warning-text: #EACB7E;            /* on warning-bg: 9.27:1 */
    --color-info-bg: #122238;
    --color-info-text: #8FBEEA;               /* on info-bg: 8.17:1 */
    --color-disabled-bg: #1E1C1A;             /* recedes into its surface by design (WCAG-exempt) */
    --color-disabled-text: #706A63;           /* 3.18:1 on disabled-bg; inactive controls are WCAG-exempt */
    --color-overlay: rgba(0, 0, 0, 0.60);
    --color-shadow: rgba(0, 0, 0, 0.45);
    /* PREPPALS-1 night shadows: deeper, because a shadow only reads on a dark
       ground when it is close to black; the lacquer glow is quieter. */
    --color-shadow-strong: rgba(0, 0, 0, 0.60);
    --color-primary-glow: rgba(179, 38, 30, 0.30);
    --color-control-hover: rgba(242, 238, 232, 0.08);
    /* INK-POUR-1: the closing band's night ink, a deep lacquer: white on it
       16.85:1, the muted text 12.69:1. */
    --color-closing-flood: #34130F;
    --color-closing-glow: rgba(226, 194, 90, 0.20);

    /* Bars brighten at night (see --color-progress-fill in :root). */
    --color-progress-fill: var(--brand-lacquer-on-dark); /* 4.79:1 on track */
    --color-progress-fill-strong: #F49B92;    /* 5.51:1 on track */


    /* NUBE-1 subject colours: badge fills keep their light values (white
       label, AA in both schemes); text, progress mark and tint brighten. The
       tints are the board's own night tints. */
    --subject-mathematics-text: #6CC9A6;      /* 8.06:1 on surface, 6.06:1 on tint */
    --subject-mathematics-mark: #6CC9A6;      /* 5.83:1 on track */
    --subject-mathematics-tint: #2D3931;
    --subject-physics-text: #7FA9E6;          /* 6.67:1 on surface, 5.20:1 on tint */
    --subject-physics-mark: #7FA9E6;          /* 4.82:1 on track */
    --subject-physics-tint: #30343A;
    --subject-chemistry-text: #B996DA;        /* 6.45:1 on surface, 5.07:1 on tint */
    --subject-chemistry-mark: #B996DA;        /* 4.67:1 on track */
    --subject-chemistry-tint: #383138;
    --subject-science-chinese-text: #E8A15A;  /* 7.40:1 on surface, 5.65:1 on tint */
    --subject-science-chinese-mark: #E8A15A;  /* 5.35:1 on track */
    --subject-science-chinese-tint: #3F3326;
    --subject-humanities-chinese-text: #F0806B; /* 6.12:1 on surface, 4.88:1 on tint */
    --subject-humanities-chinese-mark: #F0806B; /* 4.43:1 on track */
    --subject-humanities-chinese-tint: #402E29;

    color-scheme: dark;
  }
}

/* Explicit Dark override (PALETTE-1A's manual theme toggle) -- applies
   regardless of system preference, so a user who explicitly picked Dark
   sees it even on a light-preferring OS. Deliberately a full duplicate of
   the @media block above rather than a shared "raw value" tier: this file's
   3-tier architecture already has a documented seam for product re-skinning
   (Tier 2) and doesn't need a fourth, private tier just to save re-typing
   ~35 declarations in a stylesheet that has no build step to de-duplicate
   them for us. KEEP THIS BLOCK IN SYNC WITH THE @media BLOCK ABOVE -- the
   two must always declare the same values; a test in
   tests/dom/tests/62_brand_tokens.test.js asserts they match so drift fails
   the DOM suite rather than shipping silently. */
:root[data-theme="dark"] {
  --product-secondary: var(--brand-gold-on-dark);
  --product-secondary-deep: #EDD58A;
  --color-bg: #191816;
  --color-surface: #23211E;
  --color-surface-elevated: #23211E;
  --color-primary-subtle-bg: #402E29;
  --color-primary-text: var(--brand-lacquer-on-dark);
  --color-accent-hover: #EDD58A;
  --color-accent-text: var(--brand-gold-on-dark);
  --color-figure-accent: var(--brand-gold-on-dark);
  --color-figure-accent-deep: #EDD58A;
  --color-figure-accent-subtle: #3A3426;
  --color-on-accent: var(--neutral-ink);
  --mock-go: #6CC9A6;
  --mock-go-hover: #8AD8BA;
  --color-on-mock-go: var(--neutral-ink);
  --color-achievement: var(--brand-gold-on-dark);
  --color-achievement-text: var(--brand-gold-on-dark);
  --color-text: #F2EEE8;
  --color-text-muted: #ABA49A;
  --color-border: #3A3632;
  --color-structure: #5C5650;
  --color-track: #3C3834;
  --color-figure-muted: #8A8279;
  --color-border-strong: #7D756C;
  --color-focus-ring: #F2EEE8;
  --color-correct-bg: #173425;
  --color-correct-text: #7FD9A8;
  --color-incorrect-bg: #331419;
  --color-incorrect-text: #F0A0A8;
  --color-warning-bg: #332711;
  --color-warning-text: #EACB7E;
  --color-info-bg: #122238;
  --color-info-text: #8FBEEA;
  --color-disabled-bg: #1E1C1A;
  --color-disabled-text: #706A63;
  --color-overlay: rgba(0, 0, 0, 0.60);
  --color-shadow: rgba(0, 0, 0, 0.45);
  --color-shadow-strong: rgba(0, 0, 0, 0.60);
  --color-primary-glow: rgba(179, 38, 30, 0.30);
  --color-control-hover: rgba(242, 238, 232, 0.08);
  --color-closing-flood: #34130F;
  --color-closing-glow: rgba(226, 194, 90, 0.20);
  --color-progress-fill: var(--brand-lacquer-on-dark);
  --color-progress-fill-strong: #F49B92;
  --subject-mathematics-text: #6CC9A6;
  --subject-mathematics-mark: #6CC9A6;
  --subject-mathematics-tint: #2D3931;
  --subject-physics-text: #7FA9E6;
  --subject-physics-mark: #7FA9E6;
  --subject-physics-tint: #30343A;
  --subject-chemistry-text: #B996DA;
  --subject-chemistry-mark: #B996DA;
  --subject-chemistry-tint: #383138;
  --subject-science-chinese-text: #E8A15A;
  --subject-science-chinese-mark: #E8A15A;
  --subject-science-chinese-tint: #3F3326;
  --subject-humanities-chinese-text: #F0806B;
  --subject-humanities-chinese-mark: #F0806B;
  --subject-humanities-chinese-tint: #402E29;

  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   THE POMODORO TIMER (POMODORO-1, product owner 2026-10-20): one compact row
   above a practice question or a topic reading -- the 时 seal, "Start
   pomodoro" with its length and the sound switch, or the phase, the time
   left, Pause and Stop -- and, when a phase ends, a notice with the next
   step. It never covers what the student is working on.
   --------------------------------------------------------------------------- */
.pomodoro {
  margin: 0 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.pomodoro[data-pomodoro-phase="focus"] { border-color: var(--hero-ground); }
.pomodoro[data-pomodoro-phase="short_break"],
.pomodoro[data-pomodoro-phase="long_break"] { border-color: var(--brand-gold); }
.pomodoro-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.pomodoro-seal { width: 32px; height: 32px; }
.pomodoro-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--space-1) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.pomodoro-btn:hover { background: var(--color-control-hover); }
.pomodoro-btn:focus-visible,
.pomodoro-plan select:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.pomodoro-btn--primary {
  border-color: var(--hero-ground);
  background: var(--hero-ground);
  color: var(--color-on-hero);             /* 6.40:1 or more on the band's Jade */
}
.pomodoro-btn--primary:hover { background: var(--hero-ground); filter: brightness(1.08); }
.pomodoro-sound[aria-pressed="false"] { color: var(--color-text-muted); text-decoration: line-through; }
.pomodoro-plan select {
  min-height: 44px;
  max-width: 100%;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
}
.pomodoro-phase {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}
.pomodoro-phase[data-phase="short_break"],
.pomodoro-phase[data-phase="long_break"] { background: var(--color-control-hover); color: var(--color-text); }
.pomodoro-time {
  min-width: 4.5ch;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--weight-display);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.pomodoro-paused { font-size: var(--text-sm); font-style: italic; color: var(--color-text-muted); }
.pomodoro-count { margin-inline-start: auto; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.pomodoro-notice {
  margin: 0 0 var(--space-2);
  padding: var(--space-3);
  border-inline-start: 4px solid var(--brand-gold);
  border-radius: var(--radius);
  background: var(--color-control-hover);
}
.pomodoro-notice p { margin: 0 0 var(--space-2); font-weight: var(--weight-bold); }
.pomodoro-notice-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 479px) {
  .pomodoro-count { margin-inline-start: 0; flex-basis: 100%; }
}

/* ---------------------------------------------------------------------------
   THE REAL-EXAM MODE (MOCK-REAL-1, piece 1a of .claude/competencia/PLAN.md;
   MOCK_TEST_CONTRACT.md Amendment 3): the practice-or-real choice in a start
   panel, the exam-day rules and the box that confirms them, the 3-2-1
   countdown, the note that takes Submit's place in a real sitting, the
   warning when the exam window is left, and the "Real exam" badge.
   --------------------------------------------------------------------------- */
.mock-mode {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-1);
}
.mock-mode-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}
.mock-mode-choice legend {
  margin: 0 0 var(--space-2);
  padding: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.mock-mode-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  cursor: pointer;
}
.mock-mode-option[data-selected="true"] {
  border-color: var(--color-primary-text);
  box-shadow: inset 0 0 0 1px var(--color-primary-text);
}
.mock-mode-option:has(input:focus-visible) {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.mock-mode-option input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
}
.mock-mode-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mock-mode-option-title { font-weight: var(--weight-bold); }
.mock-mode-option-hint {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}
.mock-real-rules {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
}
.mock-real-rules-heading { margin: 0 0 var(--space-2); font-weight: var(--weight-bold); }
.mock-real-rules ul {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding-inline-start: 1.2em;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.mock-real-rules-source {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.mock-real-agree {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin-top: var(--space-2);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.mock-real-agree input { flex: none; width: 20px; height: 20px; accent-color: var(--color-primary); }

/* THE COUNTDOWN: the whole window in the band's ink, one large number. */
.mock-countdown {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--hero-ground);
  color: var(--color-on-hero);
  text-align: center;
}
.mock-countdown-label { margin: 0; font-size: var(--text-xl); color: var(--color-on-hero-muted); }
.mock-countdown-number {
  min-height: 1em;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(6rem, 4rem + 10vw, 12rem);
  font-weight: var(--weight-display);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* In a real sitting, Submit's place says when the sitting ends. */
.mock-real-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.mock-real-warning {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-inline-start: 4px solid var(--color-warning-text);
  border-radius: var(--radius);
  background: var(--color-warning-bg);
  color: var(--color-warning-text);           /* 6.41:1 by day, 9.27:1 at night */
  font-weight: var(--weight-semibold);
}
.mock-real-warning p { margin: 0; }
.mock-real-badge {
  display: inline-block;
  margin-inline-start: var(--space-2);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-text);
  color: var(--color-surface);                /* the page's own pair, reversed */
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1.6;
  vertical-align: middle;
  white-space: nowrap;
}
.mock-hub-card-running .mock-real-badge,
.mock-results-facts .mock-real-badge { margin-inline-start: 0; }
/* The running line wraps whole: the dot and its words, then the badge. */
.mock-hub-card-running { flex-wrap: wrap; row-gap: var(--space-1); }
/* A start button waiting for its rules box reads as waiting (disabled
   controls are exempt from WCAG contrast). */
.mock-hub-confirm-actions .next-btn:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   REFERENCE DATA (REFDATA-1, piece 1b of .claude/competencia/PLAN.md): the
   line an exam paper prints at the top of a page -- for chemistry, the
   relative atomic masses a question may need -- above the stem in Practice
   and in a mock sitting. Quiet, and it wraps pair by pair, never inside one.
   --------------------------------------------------------------------------- */
.reference-data {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px var(--space-3);
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-elevated);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-text);
}
.reference-data-label {
  margin-inline-end: var(--space-1);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);             /* 7.03:1 by day, 6.51:1 at night */
}
.reference-data-pair { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* -- Practice tools (piece 1d of .claude/competencia/PLAN.md) ---------------
   One row at the top of the screen, above the pomodoro: the difficulty
   filter (DIFFICULTY-1) on the left, the text size (TEXT-SIZE-1) on the
   right; on a narrow phone they wrap. The filter is a native select dressed
   like the pomodoro's. */
.practice-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-3);
}
.practice-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}
.practice-filter-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}
.practice-filter select {
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.practice-filter select:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }

/* TEXT-SIZE-1: A− / A+ and the size between them. */
.text-size { display: inline-flex; align-items: center; gap: var(--space-1); }
.text-size-btn {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-bold);
  line-height: 1;
  cursor: pointer;
}
.text-size-btn[data-text-size="smaller"] { font-size: 0.875rem; }
.text-size-btn[data-text-size="larger"] { font-size: 1.125rem; }
.text-size-btn:hover { border-color: var(--color-border-strong); }
.text-size-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.text-size-btn:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.text-size-value {
  min-width: 3.5em;
  text-align: center;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}
/* In a reading it sits on its own, at the end of the line above the pomodoro. */
.reading-text-size { display: flex; justify-content: flex-end; margin: 0 0 var(--space-3); }

/* ---------------------------------------------------------------------------
   MOCK KINDS (MOCK-KINDS-1) AND THE FREE DIAGNOSTIC (FREE-DIAGNOSTIC-1), piece
   2c of .claude/competencia/PLAN.md: the start panel's "which exam?", a
   kind's badge in the history, a diagnostic's map by module, and the hub's
   free-diagnostic offer to a guest or an expired trial. The kind choice is
   the mode choice's twin, so the panel reads as one form.
   --------------------------------------------------------------------------- */
.mock-kind-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
}
.mock-kind-choice legend {
  margin: 0 0 var(--space-2);
  padding: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.mock-kind-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  cursor: pointer;
}
.mock-kind-option[data-selected="true"] {
  border-color: var(--color-primary-text);
  box-shadow: inset 0 0 0 1px var(--color-primary-text);
}
/* A kind already running in this subject: its card's Resume is the way back. */
.mock-kind-option[data-disabled="true"] {
  border-style: dashed;
  cursor: not-allowed;
}
.mock-kind-option:has(input:focus-visible) {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.mock-kind-option input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--color-primary);
}
.mock-kind-option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mock-kind-option-title { font-weight: var(--weight-bold); }
.mock-kind-option-hint {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}
.mock-kind-badge {
  display: inline-block;
  margin-inline-start: var(--space-2);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-subtle-bg);
  color: var(--color-achievement-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1.6;
  vertical-align: middle;
  white-space: nowrap;
}

/* A diagnostic's map: a row per module -- its name, "2 of 3 right", "Review
   first" in words under half right, and a bar under them. Rows wrap whole on
   a phone rather than squeeze a long name. */
.mock-breakdown {
  max-width: 40rem;
  margin: 0 auto var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
}
.mock-breakdown h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-display);
}
.mock-breakdown-intro {
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.mock-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.mock-breakdown-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
}
.mock-breakdown-name {
  flex: 1 1 10rem;
  min-width: 0;
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}
.mock-breakdown-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mock-breakdown-tag {
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-incorrect-bg);
  color: var(--color-incorrect-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  line-height: 1.6;
  white-space: nowrap;
}
.mock-breakdown-bar {
  flex: 1 0 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  overflow: hidden;
}
.mock-breakdown-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-accent-text);
}
.mock-breakdown-row[data-breakdown-level="strong"] .mock-breakdown-fill { background: var(--color-correct-text); }
.mock-breakdown-row[data-breakdown-level="weak"] .mock-breakdown-fill { background: var(--color-incorrect-text); }

/* The hub's free-diagnostic offer: one row per subject, its start panel
   opening in place as a mock card's does. */
.free-diag {
  max-width: 44rem;
  margin: 0 auto var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
}
.free-diag h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-display);
}
.free-diag-body {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}
.free-diag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.free-diag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.free-diag-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  flex: 1 1 14rem;
  min-width: 0;
}
.free-diag-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--subject-text, var(--color-text));
}
.free-diag-status {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-accent-text);
}
.free-diag-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.free-diag-row .mock-hub-confirm { flex-basis: 100%; }
/* On a free diagnostic's results: what full access adds, in words. */
.free-diag-next {
  max-width: 30rem;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  text-align: start;
}
.free-diag-next p { margin: 0; line-height: var(--leading-normal); }
.free-diag-next .free-diag-next-title { margin: 0 0 var(--space-1); font-weight: var(--weight-bold); }

/* ---------------------------------------------------------------------------
   THE REPORT (MOCK-REPORT-1, piece 2f of .claude/competencia/PLAN.md): what a
   graded sitting asks the student to do next -- the topics to review, each
   with its reading and its practice, the questions left unanswered, and the
   trend -- between the score and the question-by-question review.
   --------------------------------------------------------------------------- */
.mock-report {
  max-width: 40rem;
  margin: 0 auto var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-elevated);
  box-shadow: var(--shadow-md);
}
.mock-report h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-display);
}
.mock-report h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
}
.mock-report-part + .mock-report-part {
  margin-block-start: var(--space-5);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--color-border);
}
.mock-report-note {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.mock-report-topics,
.mock-report-jumps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-2);
}
.mock-report-topics { flex-direction: column; }
.mock-report-jumps { flex-wrap: wrap; }
/* A topic: its name and "1 of 3 right" on one line when they fit, its two
   links under them; the row wraps whole on a phone. */
.mock-report-topic {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.mock-report-topic-name {
  flex: 1 1 12rem;
  min-width: 0;
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}
.mock-report-topic-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mock-report-topic-links {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
}
.mock-report-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-primary-text);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mock-report-jump {
  min-height: 44px;
  padding-block: 0;
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.mock-report-more {
  margin-block-start: var(--space-2);
  min-height: 44px;
  padding-block: 0;
  padding-inline: var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.mock-report-more:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.mock-report-more:hover,
.mock-report-jump:hover { background: var(--color-control-hover); }
.mock-report-jump:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}
.mock-report-trend {
  margin: 0;
  line-height: var(--leading-normal);
}

/* ---------------------------------------------------------------------------
   ACCURACY BY MODULE (TOPIC-ACCURACY-1, piece 2g of
   .claude/competencia/PLAN.md): in each subject card of "My plan", a row per
   module -- its name, "7 of 12 right (58%)", a bar in the subject's progress
   mark, the trend when there is one, and its topics a click away.
   --------------------------------------------------------------------------- */
.plan-accuracy {
  margin-block-start: var(--space-5);
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--color-border);
}
.plan-accuracy h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
}
.plan-accuracy-intro {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.plan-accuracy-modules,
.plan-accuracy-topics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.plan-accuracy-modules { gap: var(--space-4); }
.plan-accuracy-topics {
  gap: var(--space-2);
  margin-block-start: var(--space-2);
  padding-inline-start: var(--space-3);
  border-inline-start: 2px solid var(--color-border);
}
.plan-accuracy-row,
.plan-accuracy-topic {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px var(--space-3);
}
.plan-accuracy-name {
  min-width: 0;
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}
.plan-accuracy-topic-name {
  min-width: 0;
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.plan-accuracy-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.plan-accuracy-bar {
  display: block;
  height: 6px;
  margin-block: 6px var(--space-1);
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-track);
}
.plan-accuracy-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--subject-mark, var(--color-progress-fill));
}
.plan-accuracy-trend {
  margin: 0 0 var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.plan-accuracy-trend[data-trend="up"] { color: var(--color-correct-text); }
.plan-accuracy-trend[data-trend="down"] { color: var(--color-incorrect-text); }
.plan-accuracy-trend[data-trend="level"] { color: var(--color-text-muted); }
.plan-accuracy-toggle {
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-primary-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.plan-accuracy-toggle:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   "PLAN YOUR PREP" (STUDY-GOALS-1, piece 2d): the subjects screen's optional
   goals card, under the hero -- the plan card's white card and 计 seal, a
   small "start" state, a form that opens in place, a summary once saved, and
   a single line when the student folds it away.
   --------------------------------------------------------------------------- */
.goals-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-5) 0 0;
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.goals-card[data-goals-card="edit"] { align-items: flex-start; }
.goals-card-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  font-family: var(--font-cjk);
  font-size: 1.5rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.goals-card-seal--small { width: 32px; height: 32px; border-radius: 10px; font-size: 1rem; }
.goals-card-body { flex: 1 1 18rem; min-width: 0; }
.goals-card-body h2,
.goals-form h2 { margin: 0 0 4px; font-size: 1.25rem; }
.goals-card-text { margin: 0; color: var(--color-text-muted); overflow-wrap: anywhere; }
.goals-card-text + .goals-card-text { margin-block-start: var(--space-1); }
.goals-card-actions { display: flex; flex: none; align-items: center; gap: var(--space-2); }
.goals-fold {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.goals-fold:hover { background: var(--color-surface); color: var(--color-text); }
.goals-folded { margin: var(--space-4) 0 0; }
.goals-unfold {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding-block: 0;
  padding-inline: 0 var(--space-2);
  border: none;
  background: none;
  color: var(--color-primary-text);
  font: inherit;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.goals-fold:focus-visible,
.goals-unfold:focus-visible,
.goals-clear:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.goals-form { display: grid; flex: 1 1 18rem; gap: var(--space-4); min-width: 0; }
.goals-field { display: grid; gap: var(--space-1); min-width: 0; margin: 0; padding: 0; border: none; }
.goals-label { padding: 0; font-size: var(--text-sm); font-weight: var(--weight-bold); }
.goals-hint { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.goals-field select,
.goals-target input {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.goals-field select { width: 100%; max-width: 24rem; }
.goals-field select:focus-visible,
.goals-target input:focus-visible,
.goals-subject input:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.goals-target input[aria-invalid="true"] { border-color: var(--color-incorrect-text); }
.goals-subject-list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-block-start: var(--space-1); }
.goals-subject {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding-block: 0;
  padding-inline: var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.goals-subject input { width: 18px; height: 18px; margin: 0; accent-color: var(--color-primary-text); }
.goals-subject[data-checked="true"] { border-color: var(--color-primary-text); background: var(--color-surface); }
.goals-target-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--space-2) var(--space-3); margin-block-start: var(--space-1); }
.goals-target { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-width: 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.goals-target input { width: 4.5rem; flex: none; text-align: center; }
.goals-error { margin: 0; color: var(--color-incorrect-text); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.goals-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.goals-clear {
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-incorrect-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
@media (max-width: 599px) {
  .goals-card { padding: var(--space-4); }
  .goals-card[data-goals-card="saved"] .goals-card-actions,
  .goals-card[data-goals-card="start"] .goals-card-actions { width: 100%; }
  .goals-card[data-goals-card="start"] [data-goals-start],
  .goals-card[data-goals-card="saved"] [data-goals-edit] { flex: 1 1 auto; }
  .goals-actions > .next-btn,
  .goals-actions > .btn-secondary { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------------------
   "TODAY'S 5" (DAILY-SET-1, piece 2b): the subjects screen's card -- the
   plan card's white card, a 日 seal, a line and a dot per question (filled
   once answered) -- Review's "Today" tab, and the streak's savers.
   --------------------------------------------------------------------------- */
.daily-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-5) 0 0;
  padding: var(--space-5);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.daily-card-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  font-family: var(--font-cjk);
  font-size: 1.5rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.daily-card-body { flex: 1 1 18rem; min-width: 0; }
.daily-card-body h2 { margin: 0 0 4px; font-size: 1.25rem; }
.daily-card-text { margin: 0; color: var(--color-text-muted); }
.daily-card-dots { display: flex; gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.daily-card-dots li {
  width: 14px;
  height: 14px;
  border: 2px solid var(--subject-text);
  border-radius: 50%;
}
.daily-card-dots li[data-answered="true"] { background: var(--subject-text); }
.daily-card-cta { flex: none; }
.daily-card-actions { display: flex; flex-wrap: wrap; flex: none; align-items: center; gap: var(--space-2) var(--space-3); }

.daily-view { display: grid; gap: var(--space-3); }
.daily-heading { margin: 0; font-size: 1.25rem; }
.daily-intro,
.daily-progress { margin: 0; color: var(--color-text-muted); }
.daily-progress { font-weight: var(--weight-semibold); color: var(--color-text); }
.daily-list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.daily-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
}
.daily-subject { flex: 1 1 10rem; min-width: 0; font-weight: var(--weight-semibold); }
.daily-kind {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--subject-tint);
  color: var(--subject-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.daily-kind--mistake { background: var(--color-incorrect-bg); color: var(--color-incorrect-text); }
.daily-state { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.daily-row[data-daily-answered="true"] .daily-state { color: var(--color-correct-text); }
.daily-done { margin: 0; color: var(--color-correct-text); font-weight: var(--weight-semibold); }
.daily-view > .next-btn { justify-self: start; }
.daily-savers {
  margin-block-start: var(--space-3);
  padding: var(--space-4);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
}
.daily-savers h3 { margin: 0 0 var(--space-1); font-size: 1rem; }
.daily-savers p { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.daily-savers .daily-savers-count { color: var(--color-text); font-size: 1.125rem; font-weight: var(--weight-bold); }
.daily-savers p + p { margin-block-start: var(--space-1); }
/* SPACED-REVIEW-1 (piece 3a, spacedReview.tsx): the load until the sitting, a
   bar per day in the accent ink on a quiet track. The bars repeat for the eye
   what the line above them says in words. */
.review-forecast {
  margin-block-start: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.review-forecast h3 { margin: 0 0 var(--space-1); font-size: 1rem; }
.review-forecast-total { margin: 0 0 var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); }
.review-forecast-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  block-size: 4.5rem;
  padding-block-end: 1px;
  border-block-end: 1px solid var(--color-border-strong);
}
.review-forecast-bar {
  flex: 1 1 0;
  min-inline-size: 2px;
  max-inline-size: 18px;
  border-radius: 3px 3px 0 0;
  background: var(--color-accent-text);
}
.hero-stat-savers {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}
@media (max-width: 599px) {
  .daily-card { padding: var(--space-4); }
  .daily-card-actions { width: 100%; }
  .daily-card-actions > * { flex: 1 1 auto; }
  .daily-view > .next-btn { justify-self: stretch; }
}

/* ---------------------------------------------------------------------------
   CUSTOM PRACTICE (CUSTOM-PRACTICE-1, piece 2e): Review's "Custom" tab -- the
   goals card's fields and chips, reused -- and the timed exam: a bar with the
   clock, Back / Next / Submit, a numbered palette (filled once answered),
   then a row per question with its verdict.
   --------------------------------------------------------------------------- */
.custom-view { display: grid; gap: var(--space-5); }
.custom-step { display: grid; gap: var(--space-3); min-width: 0; margin: 0; padding: 0; border: none; }
.custom-step-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  font-size: 1.0625rem;
  font-weight: var(--weight-bold);
}
.custom-step-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-figure-accent-subtle);
  color: var(--color-accent-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}
.custom-choice {
  min-height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-semibold);
  text-align: start;
  cursor: pointer;
}
@media (hover: hover) { .custom-choice:hover { border-color: var(--color-primary-text); } }
.custom-choice:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.custom-choice[aria-pressed="true"] {
  border-color: var(--color-primary-text);
  box-shadow: inset 0 0 0 1px var(--color-primary-text);
  background: var(--color-surface);
}
.custom-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: var(--space-2); }
.custom-subject { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); }
.custom-subject-seal {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--subject-tint);
  color: var(--subject-text);
  font-family: var(--font-cjk);
  font-size: 1.0625rem;
  line-height: 1;
}
.custom-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-3); }
.custom-mode-card { display: grid; align-content: start; gap: var(--space-1); padding: var(--space-4); }
.custom-mode-title { font-size: 1.0625rem; font-weight: var(--weight-bold); }
.custom-mode-hint { color: var(--color-text-muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.custom-counts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.custom-count { min-width: 64px; padding: 0 var(--space-4); font-size: 1.0625rem; text-align: center; }
.custom-pill { padding: 0 var(--space-4); border-radius: var(--radius-pill); text-align: center; }
.custom-refine { padding: 0 var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.custom-refine summary { display: grid; gap: 2px; min-height: 44px; padding-block: var(--space-3); cursor: pointer; }
.custom-refine summary:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.custom-refine-title { font-weight: var(--weight-bold); }
.custom-refine-hint { color: var(--color-text-muted); font-size: var(--text-sm); }
.custom-refine-body { display: grid; gap: var(--space-4); padding-block-end: var(--space-4); }
.custom-refine-group { display: grid; gap: var(--space-2); }
.custom-topic-list { max-height: 16rem; overflow-y: auto; padding-block: var(--space-1); }
.custom-start { justify-self: start; }
@media (max-width: 599px) {
  .custom-start { justify-self: stretch; }
  .custom-count { flex: 1 1 0; min-width: 0; }
}
.exam-bar { flex-wrap: wrap; }
.exam-clock { margin-inline-start: auto; font-family: var(--font-mono); font-weight: var(--weight-bold); }
.exam-leave {
  margin: var(--space-3) 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.exam-leave p { margin: 0 0 var(--space-3); }
.exam-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-block-start: var(--space-4); }
.exam-palette { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.exam-palette-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-weight: var(--weight-semibold);
  cursor: pointer;
}
.exam-palette-btn[data-exam-answered="true"] { background: var(--color-surface); border-color: var(--color-primary-text); }
.exam-palette-btn[aria-current="true"] { outline: 3px solid var(--color-primary-text); outline-offset: 1px; }
.exam-palette-btn:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.exam-result-list { display: grid; gap: var(--space-2); margin: var(--space-3) 0; padding: 0; list-style: none; }
.exam-result-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
}
.exam-result-n { min-width: 1.5rem; font-weight: var(--weight-bold); }
.exam-verdict { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.exam-verdict--right { color: var(--color-correct-text); }
.exam-verdict--wrong { color: var(--color-incorrect-text); }
.exam-see { margin-inline-start: auto; }

/* ---------------------------------------------------------------------------
   PACE (PACE-1, piece 3d): under a graded practice answer, the time taken
   next to the real exam's pace, with a soft word -- never red.
   --------------------------------------------------------------------------- */
.pace-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: var(--space-2) 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.pace-chip {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-weight: var(--weight-semibold);
}
.pace-chip--good { color: var(--color-correct-text); }
.pace-chip--slow,
.pace-chip--slower { color: var(--color-warning-text); }

/* STANDING-1 (piece 3e, mockStanding.tsx). The percentile under a sitting's
   facts, its number set large; the readiness band on a plan card as a quiet
   chip like the pace's -- green when ready, the accent ink when close, the
   warning ink when far, never red: a band says where to work, not a fail. */
.mock-percentile {
  margin: var(--space-3) 0 0;
  color: var(--color-text);
  line-height: var(--leading-normal);
}
.mock-percentile-value { font-size: var(--text-xl); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.mock-percentile--pending { color: var(--color-text-muted); font-size: var(--text-sm); }
.readiness {
  margin: var(--space-2) 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.readiness-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-weight: var(--weight-semibold);
}
.readiness-chip--ready { color: var(--color-correct-text); }
.readiness-chip--close { color: var(--color-accent-text); }
.readiness-chip--far { color: var(--color-warning-text); }

/* =============================================================================
   INK-GOLD-2 (product owner, 2026-10-24: "lleva tinta y oro a todas al resto
   de pantallas", after a preview of four of them). The subjects screen's
   "Tinta y oro" language (INK-GOLD-1, the DASHBOARD-1 block) carried to every
   other screen: the mock exams (hub, free diagnostic, results), practice and
   the topic lessons, the topic browse, the exam guide, review (attempts,
   saved, mistakes), the study plan, the city guide and its universities, the
   homepage, the account screens and the upgrade screen.
     - Panels rest flat on a hairline (--color-border), no shadow.
     - A tinted seal becomes a Gold stamp: a glyph in deep Gold inside a
       1.5px square rule (6.30:1 on white, 9.25:1 at night).
     - A subject's name reads in ink; its stamp says which subject it is.
     - A title on the page itself stands under a short Gold rule.
     - The filled action is flat lacquer.
   Never in the exam room itself (data-csca-mock="test"): the sitting copies
   the official computer-based test, and keeps its own look.
   ============================================================================= */

/* THE FILLED ACTION, flat, and the outlined one without its lift. */
html:not([data-csca-mock="test"]) #react-root :is(.next-btn, .btn-primary) {
  background-image: none;
  box-shadow: none;
}
html:not([data-csca-mock="test"]) #react-root :is(.next-btn, .btn-primary):hover:not(:disabled) {
  background-color: var(--color-primary-hover);
}
html:not([data-csca-mock="test"]) #react-root :is(.btn-secondary, .retry-btn) { box-shadow: none; }

/* THE PANELS: flat, on a hairline. */
html:not([data-csca-mock="test"]) #react-root :is(
  .mock-hub-card, .free-diag, .mock-gate, .mock-exam-card--review,
  .study-plan-subject, .study-plan-empty,
  .exam-guide-toc, .exam-guide-section,
  .attempt-history-row,
  .view-question, .pomodoro, .react-content-nav,
  .city-chooser, .city-card, .finder-filters, .finder-item,
  .landing-step, .landing-final,
  .react-auth, .react-upgrade
) {
  box-shadow: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
/* The tabs of the city guide sit on the page without a lift. */
#react-root .city-tabs { box-shadow: none; }
/* An option is a row of the question, on a slightly stronger rule. */
#react-root .react-option-btn {
  box-shadow: none;
  border-radius: var(--radius-lg);
}
/* Rows and cards that can be pressed darken their rule on hover. */
#react-root :is(.attempt-history-row, .city-card, .finder-item, .topic-chip):hover { border-color: var(--color-text); }
#react-root .topic-chip { box-shadow: none; border-radius: var(--radius-lg); }

/* REVIEW stands on the page: its title under the Gold rule, its rows as
   panels of their own. */
#react-root .react-attempt-history {
  box-shadow: none;
  background: transparent;
  border: 0;
}

/* THE STAMPS. */
#react-root :is(.mock-seal, .exam-guide-num, .landing-step-seal, .city-rank) {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  border-radius: 7px;
  color: var(--color-accent-text);
  font-weight: var(--weight-semibold);
}
#react-root .exam-guide-toc .exam-guide-num { box-shadow: inset 0 0 0 1px currentColor; }
/* An option's letter, while the question is open: the same stamp. Chosen,
   right and wrong keep their own colours (DIFFICULTY-1's answer states). */
#react-root .react-option-btn:not(.option-selected, .option-was-correct, .option-is-correct, .option-was-incorrect) .option-label {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  border-radius: 7px;
  color: var(--color-accent-text);
}
#react-root .pomodoro-seal {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  border-radius: 7px;
  color: var(--color-accent-text);
}

/* A SUBJECT'S NAME IN INK: the stamp beside it carries the subject. */
#react-root :is(.mock-hub, .free-diag, .study-plan, .landing) [data-subject-tone] {
  --subject-text: var(--color-text);
}

/* TITLES ON THE PAGE under the Gold rule. */
#react-root :is(.mock-hub-history > h2, .react-attempt-history > h1, .module-heading, .finder-head > h2)::before {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin: 0 0 var(--space-4);
  background: var(--brand-gold);
}
#react-root .mock-hub-history > h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.02em;
}
/* The homepage's titles are centred: their rule is too. */
#react-root .landing :is(#landing-steps-title, #landing-subjects-title, #landing-guide-title, #landing-final-title)::before {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin: 0 auto var(--space-4);
  background: var(--brand-gold);
}
/* The guide's tables: the header on the panel itself, under a firmer rule. */
#react-root .exam-guide-table thead th { background: transparent; }

/* =============================================================================
   GUIDE-PANORAMA-1 (product owner, 2026-10-25: "que deje de ser tan heavy
   reading", direction A of three live previews). The exam guide drawn to be
   seen before it is read; ExamGuide.tsx keeps every word and every hook.
     - THE FIGURES on the band: six numbers in the hero's dark glass, Gold,
       each over its words.
     - THE CONTENTS follow the reading: the card on screen in ink, and from
       1024px, where they stay beside the reader, a Gold bar that fills.
     - A CARD keeps its first paragraph, a little larger; "More details"
       folds the rest and opens it in place; a note sits in a box, a callout
       behind a Gold rule.
     - THE PICTURES: the subjects as five cards (a stamp, the name, its
       numbers large, the language as a chip); the applicants' toggle; the
       two formats as cards; the year's twelve months over a toggle of the
       two timetables, each a card per day with a bar as long as each paper;
       the next sitting on ink, counted down; the registration steps on one
       line; the fees and the scores as tiles; the syllabus as a grid of
       subjects; the sources as chips.
     - THE MOTION, only where it is welcome: a card below the fold fades in
       but never moves (a contents jump lands where it aims), its pictures
       rise in one after another, the bars grow, a panel just chosen fades
       in, and a picture under the pointer lifts.
   Every colour is a token of both palettes; the tables keep their roles.
   ============================================================================= */
@keyframes guide-rise {
  from { opacity: 0; transform: translateY(16px); }
}
@keyframes guide-fade {
  from { opacity: 0; }
}
@keyframes guide-slot {
  from { background-size: 0 100%; }
}

/* THE FIGURES, on the band under the date it was checked. */
.exam-guide-figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  max-width: 60rem;
  margin: var(--space-6) auto 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 359px) {
  .exam-guide-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .exam-guide-figures { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-3); }
}
.exam-guide-figures li {
  --dg-i: 0;                               /* set per figure by the component */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: var(--space-3) var(--space-2);
  border: 1px solid var(--color-glass-rim);
  border-radius: var(--radius-lg);
  background: var(--color-glass-ground);
  text-align: center;
}
.exam-guide-figure-value {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1rem + 1.1vw, 2rem);
  font-weight: var(--weight-display);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--brand-gold);                /* on the dark glass: 6.66:1 even over white (INK-GOLD-1) */
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.exam-guide-figure-label {
  font-size: var(--text-xs);
  line-height: 1.3;
  color: var(--color-on-hero-muted);       /* 8.70:1 on the glass */
  overflow-wrap: anywhere;
}

/* THE CONTENTS: the card being read, in ink; the Gold bar of the reading. */
.exam-guide-toc-bar { display: none; }
@media (min-width: 1024px) {
  .exam-guide-toc-bar {
    display: block;
    height: 3px;
    margin: 0 var(--space-3) var(--space-3);
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--color-track);
  }
  .exam-guide-toc-bar > span {
    display: block;
    inline-size: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-gold);
  }
}
.exam-guide-toc button[aria-current="location"],
.exam-guide-toc .exam-guide-checklist-jump[aria-current="location"] {
  background: var(--color-text);
  color: var(--color-surface-elevated);    /* the ink pill of a chosen control, both palettes */
  text-decoration: none;
}
.exam-guide-toc button[aria-current="location"]::before {
  background: var(--brand-gold);
  box-shadow: none;
  color: var(--brand-ink);                 /* 7.84:1 on Gold */
}

/* A CARD'S WORDS: the lead, a note, a callout, the fold. */
.exam-guide-lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
}
.exam-guide-note {
  max-width: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--color-bg);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.exam-guide-callout {
  max-width: none;
  padding: var(--space-3) var(--space-4);
  border-inline-start: 3px solid var(--brand-gold);
  border-radius: var(--radius);
  background: var(--color-figure-accent-subtle);
  color: var(--color-text);
}
.exam-guide-more { margin: 0 0 var(--space-4); }
.exam-guide-more-body {
  display: grid;
  grid-template-rows: 1fr;
}
.exam-guide-more[data-open="false"] .exam-guide-more-body { grid-template-rows: 0fr; }
.exam-guide-more-clip { min-height: 0; overflow: hidden; }
.exam-guide-more-clip .exam-guide-p { color: var(--color-text-muted); }
.exam-guide-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-primary-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.exam-guide-more-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.exam-guide-more[data-open="true"] .exam-guide-more-toggle::after { transform: translateY(2px) rotate(225deg); }
.exam-guide-more-toggle:hover { text-decoration: underline; text-underline-offset: 4px; }
.exam-guide-more-toggle:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; border-radius: 4px; }

/* THE STAMPS of the pictures: data-seal, drawn (decoration, never read). */
:is(.exam-guide-table--cards tbody th, .exam-guide-formats > li, .exam-guide-tiles > li)[data-seal]::before {
  content: attr(data-seal);
  content: attr(data-seal) / "";
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--color-accent-text);
  font-family: var(--font-cjk);
  font-size: 1.2rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}

/* THE SUBJECTS, five cards: the table's cells laid out as a card each row
   (the explicit roles keep it a table), five a row once the card is wide
   enough, two (one at 320px) on a phone. */
.exam-guide-table-wrap:has(.exam-guide-table--cards) {
  container-type: inline-size;
  overflow: visible;
  border: none;
  border-radius: 0;
}
.exam-guide-table--cards,
.exam-guide-table--cards tbody { display: block; }
.exam-guide-table--cards thead,
.exam-guide-table--agenda caption,
.exam-guide-table--agenda thead,
.exam-guide-fees thead {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.exam-guide-table--cards tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: var(--space-3);
}
@container (min-width: 38rem) {
  .exam-guide-table--cards tbody { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.exam-guide-table--cards tbody tr {
  --dg-i: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: var(--space-2) var(--space-4);
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.exam-guide-table--cards :is(th, td) {
  display: block;
  padding: 0;
  border: none;
}
.exam-guide-table--cards tbody th {
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 1.0625rem;
}
.exam-guide-table--cards tbody th[data-seal]::before { order: -2; margin-block-end: var(--space-2); }
.exam-guide-table--cards .exam-guide-subject-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: var(--weight-bold);
  line-height: 1.2;
  /* A long name in a 105px card: hyphenated in the page's language, as the
     guide's headings are, and broken anywhere only as a last resort. */
  hyphens: auto;
  overflow-wrap: anywhere;
}
.exam-guide-table--cards .exam-guide-subject-group {
  order: -1;
  margin: 0;
  font-size: 0.6875rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  hyphens: auto;                           /* "ПРОФЕССИОНАЛЬНЫЙ" in a 148px card at 320px */
  overflow-wrap: anywhere;
}
.exam-guide-table--cards .exam-guide-cell-figure {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column-reverse;
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.exam-guide-table--cards :is(.exam-guide-cell-figure, .exam-guide-cell-score)::before {
  content: attr(data-label);
  content: attr(data-label) / "";
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  color: var(--color-text-muted);
  white-space: normal;
}
.exam-guide-table--cards .exam-guide-cell-figure::before { margin-block-start: 4px; }
.exam-guide-table--cards .exam-guide-cell-language {
  order: 3;
  padding: 3px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-figure-accent-subtle);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
}
.exam-guide-table--cards .exam-guide-cell-language::before { content: none; color: var(--color-text); }
.exam-guide-table--cards .exam-guide-cell-score {
  display: flex;
  flex: 1 1 100%;
  order: 4;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block-start: var(--space-2);
  border-block-start: 1px dashed var(--color-border);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* THE APPLICANTS' TOGGLE, and the timetables' (Toggle in ExamGuide.tsx): a
   pill of tabs on the page's ground, the ink thumb sliding to the chosen one. */
.exam-guide-toggle {
  --toggle-count: 2;                       /* both set by the component */
  --toggle-chosen: 0;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(var(--toggle-count), minmax(0, 1fr));
  max-width: 40rem;
  margin: 0 0 var(--space-4);
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
}
.exam-guide-toggle [role="tab"] {
  position: relative;
  z-index: 1;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: calc(var(--radius-lg) - 4px);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
}
.exam-guide-toggle [role="tab"]:hover { color: var(--color-text); }
.exam-guide-toggle [role="tab"][aria-selected="true"] { color: var(--color-surface-elevated); }
.exam-guide-toggle [role="tab"]:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.exam-guide-toggle-thumb {
  position: absolute;
  z-index: 0;
  inset-block: 4px;
  inset-inline-start: calc(4px + (100% - 8px) / var(--toggle-count) * var(--toggle-chosen));
  inline-size: calc((100% - 8px) / var(--toggle-count));
  border-radius: calc(var(--radius-lg) - 4px);
  background: var(--color-text);
}
.exam-guide-applicants {
  display: block;
  max-width: 68ch;
  padding: 0;
  list-style: none;
}
.exam-guide-applicants li { padding: 0; line-height: 1.7; }
.exam-guide-applicants li:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 4px; border-radius: 4px; }
.exam-guide-applicants .exam-guide-item-head {
  display: block;
  margin-block-end: var(--space-1);
  font-size: 1.0625rem;
}
.exam-guide-mark {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--color-figure-accent-subtle);
  color: inherit;
  font-weight: var(--weight-semibold);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* THE FORMATS, two cards; a step to the home exam's checklist under them. */
.exam-guide-formats,
.exam-guide-tiles {
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  max-width: none;
  padding: 0;
  list-style: none;
}
.exam-guide-formats > li {
  --dg-i: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.exam-guide-formats > li[data-seal]::before { width: 48px; height: 48px; border-radius: 11px; font-size: 1.5rem; }
.exam-guide-formats .exam-guide-item-head {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--color-text);
}
.exam-guide-item-colon { display: none; }
.exam-guide-formats .exam-guide-item-body {
  display: block;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.exam-guide-formats .exam-guide-item-body::first-letter { text-transform: uppercase; }
.exam-guide-inline-jump {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  margin: calc(-1 * var(--space-2)) 0 var(--space-3);
  padding: 0;
  border: none;
  background: none;
  color: var(--color-primary-text);
  font: inherit;
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.exam-guide-inline-jump:hover { text-decoration: underline; text-underline-offset: 4px; }
.exam-guide-inline-jump:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; border-radius: 4px; }
.exam-guide-inline-jump-arrow { display: inline-block; }

/* THE DATES: the year's months, the days of a sitting, its timetables. */
.exam-guide-times { margin: 0 0 var(--space-4); }
.exam-guide-months {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
}
@media (min-width: 720px) {
  .exam-guide-months { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
.exam-guide-months li { --dg-i: 0; min-width: 0; }
.exam-guide-months li > * {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 2px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: capitalize;
}
.exam-guide-months li[data-sitting] > button {
  border: 1px solid transparent;
  background: var(--color-figure-accent-subtle);
  color: var(--color-text);
  font-weight: var(--weight-bold);
  cursor: pointer;
}
.exam-guide-months li[data-sitting] > button::after {
  content: "";
  position: absolute;
  inset-block-end: 6px;
  inset-inline-start: calc(50% - 2.5px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-gold);
}
.exam-guide-months li[data-sitting="shown"] > button {
  background: var(--color-text);
  color: var(--color-surface-elevated);
}
.exam-guide-days-note,
.exam-guide-zone {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.exam-guide-days-note::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gold);
  box-shadow: 0 0 0 4px var(--color-figure-accent-subtle);
}
.exam-guide-zone { margin: var(--space-3) 0 0; }
.exam-guide-zone::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(currentColor, currentColor) 50% 25% / 1.5px 40% no-repeat;
}
.exam-guide-times .exam-guide-table-wrap {
  overflow: visible;
  border: none;
  border-radius: 0;
}
.exam-guide-table--agenda {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-3);
}
.exam-guide-table--agenda tbody {
  --dg-i: 0;
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.exam-guide-table--agenda tr {
  --slot: 100%;                            /* this paper's share of the longest, set by the component */
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.exam-guide-table--agenda :is(th, td) {
  display: block;
  padding: 0;
  border: none;
}
.exam-guide-table--agenda .exam-guide-day {
  order: -1;
  margin-block-end: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-text);
}
.exam-guide-table--agenda tr:not([data-first-of-day]) .exam-guide-day {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.exam-guide-table--agenda .exam-guide-clock {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: var(--weight-bold);
}
.exam-guide-table--agenda tbody th {
  order: 1;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.4;
  color: var(--color-text-muted);
}
.exam-guide-table--agenda tr::after {
  content: "";
  order: 2;
  display: block;
  height: 4px;
  margin-block-start: var(--space-1);
  border-radius: var(--radius-pill);
  background: linear-gradient(var(--brand-gold), var(--brand-gold)) 0 0 / var(--slot) 100% no-repeat, var(--color-track);
}

/* THE SITTINGS: the next one on ink, counted down; the others beside it. */
.exam-guide-sittings {
  padding: 0;
  border: none;
  border-radius: 0;
}
.exam-guide-sittings h3 { margin-block-end: var(--space-3); }
.exam-guide-sittings li { --dg-i: 0; }
.exam-guide-sittings li.exam-guide-sitting-next {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--color-feature-rim);
  border-radius: var(--radius-lg);
  background-color: var(--color-feature-ground);
  background-image: radial-gradient(110% 130% at 100% 0%, var(--color-feature-glow), transparent 58%);
  color: var(--color-on-hero);             /* white on the ink 17.21:1 */
}
.exam-guide-next-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-on-hero-accent);
}
.exam-guide-sitting-next .exam-guide-sitting-date {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.exam-guide-next-when {
  font-size: 1.0625rem;
  font-weight: var(--weight-bold);
  color: var(--color-on-hero-accent);
}
.exam-guide-sitting-next .exam-dates-chip { flex: none; order: 0; color: var(--color-on-hero-muted); }   /* on the ink 12.96:1 */
.exam-guide-sitting-next .exam-dates-chip[data-status="open"] { color: var(--color-on-hero-accent); }
.exam-guide-sittings .exam-guide-sitting-next a { color: var(--color-on-hero); font-weight: var(--weight-semibold); }
@media (min-width: 720px) {
  .exam-guide-sittings ul:has(> li + li) {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: var(--space-5);
  }
  .exam-guide-sittings ul:has(> li + li) > .exam-guide-sitting-next { grid-row: 1 / span 12; margin: 0; }
  .exam-guide-sittings ul:has(> li + li) > li:not(.exam-guide-sitting-next) { grid-column: 2; }
}

/* THE REGISTRATION STEPS on one line from 760px (a column on a phone), the
   numbers drawn by a counter, joined by a Gold line. */
.exam-guide-steps {
  --steps: 3;                              /* set by the component */
  gap: var(--space-4);
  max-width: none;
  padding: 0;
  list-style: none;
  counter-reset: guide-step;
}
.exam-guide-steps > li {
  --dg-i: 0;
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  padding: 0;
  counter-increment: guide-step;
}
.exam-guide-steps > li::before {
  content: counter(guide-step);
  content: counter(guide-step) / "";
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-text);
  box-shadow: 0 0 0 6px var(--color-surface-elevated);
  color: var(--color-surface-elevated);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: var(--weight-bold);
}
.exam-guide-steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-block: 50px calc(-1 * var(--space-4) + 6px);
  inset-inline-start: 21px;
  width: 2px;
  background: linear-gradient(var(--brand-gold), var(--color-border));
}
@media (min-width: 760px) {
  .exam-guide-steps { grid-template-columns: repeat(var(--steps), minmax(0, 1fr)); }
  .exam-guide-steps > li { grid-template-columns: minmax(0, 1fr); }
  .exam-guide-steps > li:not(:last-child)::after {
    inset-block: 21px auto;
    inset-inline: 54px calc(-1 * var(--space-4) + 6px);
    width: auto;
    height: 2px;
    background: linear-gradient(to right, var(--brand-gold), var(--color-border));
  }
}

/* THE FEES, two tiles. */
.exam-guide-table-wrap:has(.exam-guide-fees) {
  max-width: 36rem;
  overflow: visible;
  border: none;
  border-radius: 0;
}
.exam-guide-fees,
.exam-guide-fees tbody { display: block; }
.exam-guide-fees tbody {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-3);
}
.exam-guide-fees tbody tr {
  --dg-i: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.exam-guide-fees :is(th, td) {
  display: block;
  padding: 0;
  border: none;
}
.exam-guide-fees tbody th {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
}
.exam-guide-fees tbody td {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--color-accent-text);         /* deep Gold: 6.30:1 on the card, 9.25:1 at night */
  font-variant-numeric: lining-nums tabular-nums;
}

/* THE SCORES, four tiles, each figure set off in Gold. */
.exam-guide-tiles > li {
  --dg-i: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.exam-guide-tiles > li:not([data-seal]) { grid-template-columns: minmax(0, 1fr); }
.exam-guide-tile-text { padding-block-start: 8px; line-height: var(--leading-normal); }
.exam-guide-figure {
  font-family: var(--font-display);
  font-size: 1.25em;
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--color-accent-text);
}

/* THE SYLLABUS: a grid of subjects; an open one takes the whole row. */
.exam-guide-syllabus {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--space-2) var(--space-3);
}
.exam-guide-syllabus > h3,
.exam-guide-syllabus > .exam-guide-syllabus-note,
.exam-guide-syllabus > [open] { grid-column: 1 / -1; }
.exam-guide-syllabus-subject { --dg-i: 0; background: var(--color-surface); }
.exam-guide-syllabus-subject + .exam-guide-syllabus-subject { margin-top: 0; }

/* THE SOURCES, as chips (the commas between them stay for a screen reader). */
.exam-guide-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}
.exam-guide-sources > span:has(> a) { font-size: 0; }
.exam-guide-sources a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 2px var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  text-decoration: none;
}
.exam-guide-sources a::after {
  content: "↗";
  content: "↗" / "";
}
.exam-guide-sources a:hover { border-color: var(--color-primary-text); }

@media (max-width: 599px) {
  .exam-guide-table--cards tbody tr,
  .exam-guide-formats > li,
  .exam-guide-tiles > li { padding: var(--space-4); }
  .exam-guide-table--cards .exam-guide-cell-figure { font-size: 1.375rem; }
}

/* THE MOTION, where it is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .exam-guide-figures li {
    animation: guide-rise var(--motion-base) var(--ease-out-expo) backwards;
    animation-delay: calc(240ms + var(--dg-i) * var(--motion-stagger));
  }
  /* A card below the fold only fades in: it never moves, so a contents jump
     lands where it aims (MOTION-2's own rule lifts it 24px). */
  .exam-guide [data-reveal="pending"] { transform: none; }
  /* Its pictures rise in, one after another, as it arrives -- or as the
     screen opens, for a card already on screen. */
  .exam-guide [data-reveal="pending"] :is(
    .exam-guide-table--cards tbody > tr, .exam-guide-formats > li, .exam-guide-steps > li,
    .exam-guide-fees tbody > tr, .exam-guide-tiles > li, .exam-guide-months > li,
    .exam-guide-table--agenda > tbody, .exam-guide-sittings li, .exam-guide-syllabus-subject
  ) { opacity: 0; }
  .exam-guide-sections > :not([data-reveal="pending"]) :is(
    .exam-guide-table--cards tbody > tr, .exam-guide-formats > li, .exam-guide-steps > li,
    .exam-guide-fees tbody > tr, .exam-guide-tiles > li, .exam-guide-months > li,
    .exam-guide-table--agenda > tbody, .exam-guide-sittings li, .exam-guide-syllabus-subject
  ) {
    animation: guide-rise 600ms var(--ease-out-expo) backwards;
    animation-delay: calc(140ms + var(--dg-i) * var(--motion-stagger));
  }
  /* A paper's bar grows to its length; a panel just chosen fades in. */
  .exam-guide-sections > :not([data-reveal="pending"]) .exam-guide-table--agenda tr::after {
    animation: guide-slot 900ms var(--ease-out-expo) backwards;
    animation-delay: calc(400ms + var(--dg-i) * 140ms);
  }
  .exam-guide-applicants li:not([hidden]) { animation: guide-fade var(--motion-base) ease; }
  .exam-guide-toggle-thumb { transition: inset-inline-start var(--motion-base) var(--ease-out-expo); }
  .exam-guide-toggle [role="tab"] { transition: color var(--motion-quick) ease; }
  .exam-guide-toc-bar > span { transition: inline-size 160ms linear; }
  .exam-guide-more-body { transition: grid-template-rows var(--motion-base) var(--ease-out-expo); }
  .exam-guide-more-toggle::after { transition: transform var(--motion-quick) ease; }
  /* A picture under the pointer lifts, its stamp turning Gold. */
  :is(.exam-guide-table--cards tbody tr, .exam-guide-formats > li, .exam-guide-tiles > li, .exam-guide-fees tbody tr) {
    transition: transform var(--motion-base) var(--ease-out-expo), border-color var(--motion-quick) ease, box-shadow var(--motion-base) ease;
  }
  :is(.exam-guide-table--cards tbody tr, .exam-guide-formats > li, .exam-guide-tiles > li, .exam-guide-fees tbody tr):hover {
    transform: translateY(-3px);
    border-color: var(--brand-gold);
    box-shadow: var(--shadow-lg);
  }
  :is(.exam-guide-table--cards tbody th, .exam-guide-formats > li, .exam-guide-tiles > li)[data-seal]::before {
    transition: transform var(--motion-base) var(--ease-out-expo), background-color var(--motion-quick) ease, color var(--motion-quick) ease;
  }
  :is(.exam-guide-table--cards tbody tr:hover th, .exam-guide-formats > li:hover, .exam-guide-tiles > li:hover)[data-seal]::before {
    transform: rotate(-8deg) scale(1.05);
    background: var(--brand-gold);
    box-shadow: none;
    color: var(--brand-ink);
  }
  .exam-guide-months li[data-sitting] > button { transition: transform var(--motion-quick) var(--ease-out-expo), background-color var(--motion-quick) ease, color var(--motion-quick) ease; }
  .exam-guide-months li[data-sitting] > button:hover { transform: translateY(-2px); }
  .exam-guide-inline-jump-arrow { transition: transform var(--motion-quick) var(--ease-out-expo); }
  .exam-guide-inline-jump:hover .exam-guide-inline-jump-arrow { transform: translateX(calc(4px * var(--dash-line))) scaleX(var(--dash-line)); }
}

/* =============================================================================
   ABOUT-2 (product owner, 2026-10-25: "hazlo más dinámico", level 2 of the
   live previews, with the changes its tests asked for). About us arrives
   alive; its words are untouched (AboutUs.tsx):
     - THE LEAP: over the band, the carp of the brand's name leaps the Dragon
       Gate once, pale before the gate and Gold past it, sparks behind it,
       ripples where it leaves and lands; the gate glows as it passes;
     - the idiom comes in character by character, each title's Gold rule
       draws itself, the stamps are pressed on one after another;
     - a Gold highlighter crosses the mission word by word (the words are
       drawn whole from the start: a highlight under them, never a fade);
     - a Gold light follows the pointer over the method, a tile leans
       towards it and its stamp turns Gold;
     - a Gold point runs once along the interface languages.
   Every move is finite and inside prefers-reduced-motion: no-preference;
   with "reduce" the carp rests, Gold, at the top of its leap.
   ============================================================================= */
.about-page { --about-highlight: color-mix(in srgb, var(--brand-gold) 32%, transparent); }

/* THE LEAP: a 320x132 scene, over the heading, shrinking with a narrow band. */
.about-leap {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 320 / 132;
  margin: calc(-1 * var(--space-4)) auto var(--space-3);
}
.about-leap-stage { position: absolute; inset: 0; }
.about-leap-gate {
  position: absolute;
  inset-block-end: 6%;
  inset-inline-start: 37.5%;
  width: 25%;
  height: auto;
  color: var(--brand-gold);
  filter: drop-shadow(0 8px 14px var(--color-shadow-strong));
}
.about-leap-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.about-leap-water { fill: none; stroke: var(--color-hero-line); stroke-width: 1.5; }
.about-leap-ripple {
  fill: none;
  stroke: var(--color-on-hero-muted);
  stroke-width: 1;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.about-leap-spark { --spark: 0; fill: var(--brand-gold); opacity: 0; }
/* At rest -- where motion is not welcome -- the carp is Gold at the top of its leap. */
.about-leap-carp {
  color: var(--brand-gold);
  transform: translate(160px, 8px);
}
.about-leap-carp path { fill: currentColor; }
.about-leap-eye { fill: var(--brand-ink); }

/* The leap, sampled at every tenth of its arc: x = 30 + 260t,
   y = 120 - 448t(1 - t), heading = atan2(448(2t - 1), 260). A linear
   timing over even steps keeps the run even and lets the arc fall as a
   thrown thing does. */
@keyframes about-leap {
  0% { transform: translate(30px, 120px) rotate(-60deg); opacity: 0; color: var(--color-on-hero-muted); }
  10% { transform: translate(56px, 79.7px) rotate(-54deg); opacity: 1; }
  20% { transform: translate(82px, 48.3px) rotate(-45.9deg); }
  30% { transform: translate(108px, 25.9px) rotate(-34.6deg); }
  40% { transform: translate(134px, 12.5px) rotate(-19deg); color: var(--color-on-hero-muted); filter: none; }
  50% { transform: translate(160px, 8px) rotate(0deg); }
  60% { transform: translate(186px, 12.5px) rotate(19deg); color: var(--brand-gold); filter: drop-shadow(0 0 6px var(--brand-gold)); }
  70% { transform: translate(212px, 25.9px) rotate(34.6deg); }
  80% { transform: translate(238px, 48.3px) rotate(45.9deg); }
  90% { transform: translate(264px, 79.7px) rotate(54deg); opacity: 1; }
  100% { transform: translate(290px, 120px) rotate(60deg); opacity: 0; color: var(--brand-gold); filter: drop-shadow(0 0 6px var(--brand-gold)); }
}
@keyframes about-leap-spark {
  0% { transform: translate(30px, 120px); opacity: 0; }
  12% { opacity: 0.9; }
  20% { transform: translate(82px, 48.3px); }
  40% { transform: translate(134px, 12.5px); }
  50% { transform: translate(160px, 8px); }
  60% { transform: translate(186px, 12.5px); }
  80% { transform: translate(238px, 48.3px); opacity: 0.4; }
  100% { transform: translate(290px, 120px); opacity: 0; }
}
@keyframes about-ripple {
  from { transform: scale(0.3); opacity: 0.9; }
  to { transform: scale(1.6); opacity: 0; }
}
@keyframes about-gate-glow {
  0%, 100% { filter: drop-shadow(0 8px 14px var(--color-shadow-strong)); }
  35% { filter: drop-shadow(0 0 16px var(--brand-gold)); }
}
@keyframes about-ink-in {
  from { opacity: 0; filter: blur(4px); }
}
@keyframes about-mark-in {
  0% { opacity: 0; transform: scale(0.7); }
  60% { opacity: 1; filter: drop-shadow(0 0 8px var(--brand-gold)); }
  100% { filter: none; }
}
@keyframes about-rule {
  from { width: 0; }
}
@keyframes about-stamp {
  0% { opacity: 0; transform: scale(1.8) rotate(-12deg); }
  60% { opacity: 1; transform: scale(0.94) rotate(2deg); }
  100% { transform: none; }
}
@keyframes about-highlight {
  from { background-size: 0 100%; }
}
@keyframes about-language {
  35% { color: var(--color-accent-text); }
}
@keyframes about-language-point {
  35% { transform: scale(1.9); box-shadow: 0 0 0 4px var(--about-highlight); }
}

/* THE MISSION'S HIGHLIGHTER: under the lower half of each word's line. */
.about-mission-word {
  --w: 0;                                  /* set per word by the component */
  background: linear-gradient(transparent 60%, var(--about-highlight) 60%, var(--about-highlight) 92%, transparent 92%) 0 0 / 100% 100% no-repeat;
}
.about-idiom-char { --c: 0; }
.about-language { --li: 0; }
.about-what-tile { --lean-x: 0deg; --lean-y: 0deg; }
.about-how-list { --light-x: 50%; --light-y: -400px; }

@media (prefers-reduced-motion: no-preference) {
  .about-leap-carp { animation: about-leap 2s linear 450ms both; }
  .about-leap-spark {
    animation: about-leap-spark 2s linear both;
    animation-delay: calc(550ms + var(--spark) * 80ms);
  }
  .about-leap-ripple--from { animation: about-ripple 1.1s ease-out 300ms both; }
  .about-leap-ripple--to { animation: about-ripple 1.1s ease-out 2.35s both; }
  .about-leap-gate { animation: about-gate-glow 1.6s ease-out 1.2s both; }

  /* Each section's moves begin as it comes in -- at once for one already on screen. */
  .about-section:not([data-reveal="pending"]) .about-idiom-char {
    animation: about-ink-in 700ms var(--ease-out-expo) backwards;
    animation-delay: calc(240ms + var(--c) * 120ms);
  }
  .about-section:not([data-reveal="pending"]) .about-story-mark { animation: about-mark-in 1.1s var(--ease-out-expo) 150ms backwards; }
  .about-section:not([data-reveal="pending"]) > .dash-card-heading::before { animation: about-rule 900ms var(--ease-out-expo) 100ms backwards; }
  .about-section:not([data-reveal="pending"]) .about-stamp {
    animation: about-stamp 700ms cubic-bezier(0.2, 0.9, 0.25, 1.2) backwards;
    animation-delay: calc(240ms + var(--dg-i, 0) * 110ms);
  }
  .about-section[data-reveal="pending"] .about-mission-word { background-size: 0 100%; }
  .about-section:not([data-reveal="pending"]) .about-mission-word {
    animation: about-highlight 500ms ease-out backwards;
    animation-delay: calc(350ms + var(--w) * 60ms);
  }
  .about-section:not([data-reveal="pending"]) .about-language {
    animation: about-language 900ms ease-in-out backwards;
    animation-delay: calc(450ms + var(--li) * 180ms);
  }
  .about-section:not([data-reveal="pending"]) .about-language::before {
    animation: about-language-point 900ms ease-in-out backwards;
    animation-delay: calc(450ms + var(--li) * 180ms);
  }

  /* The method: a Gold light under the pointer. */
  .about-how-list { position: relative; isolation: isolate; }
  .about-how-list::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(320px circle at var(--light-x) var(--light-y), color-mix(in srgb, var(--brand-gold) 22%, transparent), transparent 62%);
    opacity: 0;
    transition: opacity var(--motion-base) ease;
    pointer-events: none;
  }
  .about-how-list:hover::after { opacity: 1; }

  /* The tiles lean towards the pointer and lift; the stamp turns Gold, the arrow leans on. */
  .about-what-tile {
    transition: transform var(--motion-base) var(--ease-out-expo), border-color var(--motion-quick) ease, box-shadow var(--motion-quick) ease;
  }
  .about-what-tile:hover {
    transform: perspective(800px) rotateX(var(--lean-x)) rotateY(var(--lean-y)) translateY(-4px);
    border-color: var(--brand-gold);
  }
  .about-what-tile .about-stamp {
    transition: transform var(--motion-base) var(--ease-out-expo), background-color var(--motion-quick) ease, color var(--motion-quick) ease;
  }
  .about-what-tile:hover .about-stamp {
    transform: rotate(-8deg) scale(1.06);
    background: var(--brand-gold);
    box-shadow: none;
    color: var(--brand-ink);
  }
  .about-what-arrow { transition: transform var(--motion-quick) var(--ease-out-expo), background-color var(--motion-quick) ease, color var(--motion-quick) ease; }
  .about-what-tile:hover .about-what-arrow { transform: translateX(calc(4px * var(--dash-line))) scaleX(var(--dash-line)); }
}

/* ---------------------------------------------------------------------------
   HERO-LIGHT-1 (product owner 2026-10-26: "aplicar ese efecto de luminosidad
   de our method" to the other screens' top bands): ABOUT-2's Gold light
   under the pointer, over the bands of the informational screens -- the
   homepage, guide, cities, pricing, subjects, About, mocks and Study.
   All top bands share the same decoration. useBandLight writes the pointer's
   place into --light-x and --light-y and marks the band data-band-light="on"
   while the pointer is over it: nothing for a touch, nothing where motion is
   not welcome.
   The band's ground reaches the window's edges as ink overflow (the shared
   band's border-image-outset), and so does its light: a layer the size of
   the band's box would stop at the column, and one 100vw wide would scroll
   the page sideways. So the light is the same kind of image, outset 100vw on
   either side, and its centre is the pointer's place plus that 100vw. The
   wave clips it as it clips the ground. At its brightest, under any word of
   the band, the copy keeps 4.5:1 or more (hero_light_responsive.spec.js).
   --------------------------------------------------------------------------- */
.landing-hero,
.exam-guide-hero,
.city-guide-hero,
.pricing-hero, .subject-hero, .about-hero, .mock-hub-hero, .study-hero { --light-x: 50%; --light-y: -400px; }

@media (prefers-reduced-motion: no-preference) {
  .landing-hero,
  .exam-guide-hero,
  .city-guide-hero,
  .pricing-hero, .subject-hero, .about-hero, .mock-hub-hero, .study-hero { isolation: isolate; }
  .landing-hero::after,
  .exam-guide-hero::after,
  .city-guide-hero::after,
  .pricing-hero::after, .subject-hero::after, .about-hero::after, .mock-hub-hero::after, .study-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-image-source: radial-gradient(320px circle at calc(100vw + var(--light-x)) var(--light-y), color-mix(in srgb, var(--brand-gold) 22%, transparent), transparent 62%);
    border-image-slice: 0 fill;
    border-image-outset: 0 100vw;
    opacity: 0;
    transition: opacity var(--motion-base) ease;
    pointer-events: none;
  }
  .landing-hero[data-band-light="on"]::after,
  .exam-guide-hero[data-band-light="on"]::after,
  .city-guide-hero[data-band-light="on"]::after,
  .pricing-hero[data-band-light="on"]::after, .subject-hero[data-band-light="on"]::after, .about-hero[data-band-light="on"]::after, .mock-hub-hero[data-band-light="on"]::after, .study-hero[data-band-light="on"]::after { opacity: 1; }
}

/* ---------------------------------------------------------------------------
   DASHBOARD-3 THE CLOSING BAND (ClosingBand.tsx; product owner 2026-10-24,
   after the competitor's journey band): the subjects screen's last section,
   centred as the reference sets it: the brand's gate in its lacquer seal,
   large, floating over a soft Gold halo; the motivating line in the display
   face at the size of the hero's title; one line under it; and the flat
   lacquer button (MOTION-2's sheen crosses it).
   INK-POUR-1 (product owner 2026-10-25, direction A of three live
   previews): the band is a stage the whole width of the window, as the hero
   band is, and at least its height, so the screen is ink once the ink is
   poured. The ink is the band's own ground (--color-closing-flood: the ink
   by day, a deep lacquer at night). Over it lies a cover in the page's
   ground, in which ClosingBand.tsx cuts a hole the shape of the gate's
   doorway that widens as the band scrolls up (data-closing-ink: "waiting",
   "pouring", "full"). The cover lies over the words and under the gate, so
   the gate stands on the page first and the words show as the ink reaches
   them. A band nobody pours (reduced motion, focus inside it, no viewport
   to watch) is "full": no cover at all.
   --------------------------------------------------------------------------- */
.dash-closing {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--space-5);
  min-block-size: 100svh;
  margin-block: var(--space-8) 0;
  margin-inline: calc(50% - 50vw);
  padding-block: var(--space-8) calc(var(--space-8) + var(--space-3));
  padding-inline: var(--space-6);
  overflow: hidden;
  isolation: isolate; /* the cover's layers stay inside the band */
  background-color: var(--color-closing-flood);
  background-image: radial-gradient(70% 55% at 50% 30%, var(--color-closing-glow), transparent 72%);
  color: var(--color-on-hero);
  text-align: center;
}
/* The cover: the page's ground, aria-hidden, letting every pointer through. */
.dash-closing-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-color: var(--color-bg);
  pointer-events: none;
  visibility: hidden;
}
.dash-closing:is([data-closing-ink="waiting"], [data-closing-ink="pouring"]) .dash-closing-cover { visibility: visible; }
/* The words and the button under the cover; the gate and its halo over it. */
.dash-closing > :is(.dash-closing-heading, .dash-closing-lead, .dash-closing-cta) {
  position: relative;
  z-index: 1;
}
.dash-closing-stage {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 176px;
  height: 176px;
  margin-block-end: var(--space-2);
}
/* The halo: Gold light, strongest behind the seal, gone at the edge. */
.dash-closing-halo {
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-gold) 42%, transparent), transparent 74%);
}
/* The seal: the header's lacquer seal, at the scale of the reference's
   mascot. */
.dash-closing-seal {
  position: relative;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 30px;
  background-color: var(--color-primary);
  background-image: var(--gradient-primary);
  color: var(--color-on-primary);
  box-shadow: 0 28px 48px -22px var(--color-primary-glow), inset 0 0 0 1px color-mix(in srgb, var(--color-on-primary) 18%, transparent);
}
.dash-closing-mark { display: block; width: 66px; height: 62px; }
.dash-closing-heading {
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.15rem + 3.4vw, 3.75rem);
  font-weight: var(--weight-semibold);
  line-height: 1.06;
  letter-spacing: -0.035em;
  color: var(--color-on-hero);
  overflow-wrap: break-word;
  text-wrap: balance;
}
.dash-closing-lead {
  max-width: 44ch;
  margin: 0;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
}
.dash-closing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 48px;
  margin-block-start: var(--space-2);
  padding: 0 var(--space-6);
  text-decoration: none;
}
.react-subject-select .dash-closing-cta { color: var(--color-on-primary); }
.dash-closing-cta:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 3px; }
@media (max-width: 599px) {
  .dash-closing { padding: var(--space-7) var(--space-4) var(--space-8); }
  .dash-closing-stage { width: 136px; height: 136px; }
  .dash-closing-seal { width: 92px; height: 92px; border-radius: 24px; }
  .dash-closing-mark { width: 52px; height: 49px; }
  /* A phone's button spans the band; a label that still needs two lines
     wraps as text does, balanced, the arrow after its last word. */
  .dash-closing-cta {
    display: block;
    justify-self: stretch;
    padding: var(--space-3) var(--space-4);
    line-height: 1.5;
    text-wrap: balance;
  }
  .dash-closing-arrow { margin-inline-start: var(--space-2); }
}

/* The halo breathes and the arrow leans on; the gate's drift is MOTION-2's
   data-float. Decoration only, and only where motion is welcome. */
@keyframes dash-closing-breathe {
  0%, 100% { opacity: 0.75; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.04); }
}
@media (prefers-reduced-motion: no-preference) {
  .dash-closing-halo { animation: dash-closing-breathe 5.5s ease-in-out infinite; }
  .dash-closing-arrow { display: inline-block; transition: transform var(--motion-quick) var(--ease-out-expo); }
  .dash-closing-cta:hover .dash-closing-arrow { transform: translateX(calc(4px * var(--dash-line))) scaleX(var(--dash-line)); }
}

/* ---------------------------------------------------------------------------
   FAQ-1 (DASHBOARD-3, product owner 2026-10-24, after the competitor's FAQ):
   "Frequently asked questions" (FaqSection.tsx), the subjects screen's last
   section before the closing band. In the INK-GOLD language: the title
   stands on the page under the Gold rule with one line under it; the four
   categories are a quiet segmented control on a hairline, the one on show
   filled with the band's ink and inlaid with a Gold hairline (which is also
   what marks it at night, where the ink meets a dark ground); the category's
   name is a small Gold label; each question is a flat panel on a hairline,
   its words and, at the end of the line, a ringed plus like the explore
   tiles' ringed arrow, filling with ink on hover and turning into a minus
   when the answer is open. The answer is in the muted text, its ways on are
   text links (.dash-link) under it. Tabs wrap two by two below 768px, where
   four in a row would not fit every language.
   --------------------------------------------------------------------------- */
.dash-faq { --dash-faq-column: 54rem; }   /* the reading column of the questions */
/* CENTRED, as the reference sets its FAQ (the product owner, 2026-10-24):
   the Gold rule over the middle of the title, the line, the categories,
   the category's name and a reading column of questions under them, all on
   the section's axis -- the closing band below it is centred too. */
.dash-faq-head { min-width: 0; margin: 0 0 var(--space-5); text-align: center; }
.dash-faq-head .dash-card-heading { margin-bottom: 0; }
.dash-faq-head .dash-card-heading::before { margin-inline: auto; }
.dash-faq-lead {
  --dg-i: 0;                                 /* set per reveal child by the component */
  max-width: 60ch;
  margin: var(--space-3) auto 0;
  font-size: 1.0625rem;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

/* THE CATEGORIES: two by two on a phone or a small tablet, one row of pills
   from 768px. The ink tab reads 17:1 against the control by day; at night
   its Gold inlay (9.25:1 on the dark card) is what sets it apart. */
.dash-faq-tabs {
  --dg-i: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-1);
  max-width: var(--dash-faq-column);
  margin: 0 auto var(--space-6);
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
}
.dash-faq-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: calc(var(--radius-lg) - var(--space-1));
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  text-align: center;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.dash-faq-tab:hover:not([aria-selected="true"]) {
  background: var(--color-control-hover);
  color: var(--color-text);
}
.dash-faq-tab:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.dash-faq-tab[aria-selected="true"] {
  background: var(--hero-ground);
  box-shadow: inset 0 0 0 1px var(--color-on-hero-accent);
  color: var(--color-on-hero);
}
@media (min-width: 768px) {
  .dash-faq-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    border-radius: var(--radius-pill);
  }
  .dash-faq-tab {
    flex: 0 1 auto;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-pill);
    font-size: 0.9375rem;
  }
}

/* THE CATEGORY'S NAME, as the About page labels its languages. */
.dash-faq-category {
  --dg-i: 0;
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.09em;
  line-height: var(--leading-snug);
  text-align: center;
  text-transform: uppercase;
  color: var(--color-accent-text);
}

/* THE QUESTIONS: flat panels on a hairline; a row darkens its rule while
   the pointer is on its question, as INK-GOLD-2's pressable rows do. */
.dash-faq-list {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  max-width: var(--dash-faq-column);
  margin-inline: auto;
}
.dash-faq-item {
  --dg-i: 0;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
}
.dash-faq-item:has(.dash-faq-toggle:hover) { border-color: var(--color-text); }
.dash-faq-question {
  margin: 0;
  font: inherit;
}
.dash-faq-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border: 0;
  border-radius: calc(var(--radius-lg) - 1px);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
  text-align: start;
  cursor: pointer;
}
.dash-faq-toggle:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.dash-faq-toggle-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* THE RINGED PLUS: two bars of the text colour in a fine ring (the
   interactive edge, 3.69:1 on the panel; 3.54:1 at night). The ring fills
   with ink on hover; open, the upright bar is gone and a minus is left. */
.dash-faq-icon {
  position: relative;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--color-border-strong);
  color: var(--color-text);
}
.dash-faq-icon::before,
.dash-faq-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 1px;
  background: currentColor;
}
.dash-faq-icon::before { width: 14px; height: 2px; }
.dash-faq-icon::after { width: 2px; height: 14px; }
.dash-faq-toggle[aria-expanded="true"] .dash-faq-icon::after { transform: scaleY(0); }
.dash-faq-toggle:hover .dash-faq-icon {
  background: var(--color-text);
  box-shadow: none;
  color: var(--color-surface-elevated);
}

/* THE ANSWER: the muted text at a reading measure, then its ways on. Its
   region carries no display of its own, so [hidden] keeps it closed. */
.dash-faq-answer { padding: 0 var(--space-5) var(--space-5); }
.dash-faq-answer-text {
  max-width: 68ch;
  margin: 0;
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}
.dash-faq-ways {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  margin: var(--space-2) 0 calc(-1 * var(--space-2));
  margin-inline-start: calc(-1 * var(--space-1));   /* the link's own inset, so its words line up with the answer's */
}
/* .dash-link was drawn for buttons: as a link it loses the underline at
   rest, as on About us (its weight, its ink and its arrow mark it). */
a.dash-faq-way { text-decoration: none; }
a.dash-faq-way:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 599px) {
  .dash-faq-toggle {
    gap: var(--space-3);
    padding: var(--space-4);
    font-size: var(--text-md);
  }
  .dash-faq-icon { width: 34px; height: 34px; }
  .dash-faq-answer { padding: 0 var(--space-4) var(--space-4); }
}

/* MOTION, only where it is welcome. A category arrives with a fade and a
   de-blur; an answer unveils downward as it opens (clip-path and opacity:
   its box is where it rests from the first frame); the plus turns half a
   circle as its upright bar folds away; the ring and the tabs ease their
   colours. With "reduce" the answer is simply there. */
@keyframes dash-faq-unveil {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .dash-faq-panel { animation: dg-focus-in 320ms var(--ease-out-expo) backwards; }
  .dash-faq-answer { animation: dash-faq-unveil 380ms var(--ease-out-expo) backwards; }
  .dash-faq-icon {
    transition: background-color var(--motion-quick) ease, color var(--motion-quick) ease,
      transform 360ms var(--ease-out-expo);
  }
  .dash-faq-icon::after { transition: transform 360ms var(--ease-out-expo); }
  .dash-faq-toggle[aria-expanded="true"] .dash-faq-icon { transform: rotate(180deg); }
  .dash-faq-tab { transition: background-color var(--motion-quick) ease, color var(--motion-quick) ease; }
  /* (No transition on .dash-faq-item itself: it is a reveal child, and the
     scroll reveal's own transition must stay the only one it has.) */
}

/* ---------------------------------------------------------------------------
   DASHBOARD-3 THE PLANS PAGE (Pricing.tsx at #/pricing, PAYWALL-1; product
   owner 2026-10-24: "a premium plans page (free against full access) that
   replaces today's notices where access is blocked"). The ink band with the
   title, then three plans side by side from 900px (one a row below): Free on
   a white panel, Monthly and Annual -- full access -- on the ink panel, each
   under its Gold stamp, with its price line on a hairline, what it includes
   after Gold checks, and its one action at the foot, level across the row.
   No prices yet: the paid plans read "Price to be announced", and a
   Subscribe that cannot be pressed is drawn as an outline with its reason
   under it. Then one honest line about payment.
   Also here: "See plans", the link the paywall, the mock-exam gate and the
   study plan's gate carry to this page (.pricing-gate-link).
   --------------------------------------------------------------------------- */
html[data-csca-pricing] main#app-root { padding: 0; }
.trial-activation {
  margin-block: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.trial-activation h2 { margin: 0; }
.trial-activation-form { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: end; }
.trial-activation form { margin-block-start: var(--space-4); }
.trial-activation-form .auth-field { flex: 1 1 16rem; min-width: 0; }
.trial-activation-form button { max-width: 100%; white-space: normal; }

#react-root .pricing-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;   /* no top padding: the band meets the header */
}
@media (min-width: 720px) {
  #react-root .pricing-page { padding: 0 24px 56px; }
}

/* THE BAND: the shared band's ink ground (the gradient over its solid, painted
   outside the box as ink overflow, so the page never scrolls sideways),
   spaced and centred as the city guide's is. Its edge is flat: the wave
   belongs to the classes the shared band lists. Were .pricing-hero added to
   that list, the wave would come with it, and the bottom padding already
   makes room for it (--wave-amp and --wave-base are the shared band's). */
.pricing-hero {
  position: relative;
  margin: 0 0 var(--space-7);
  padding: var(--space-7) 0 calc(var(--space-7) + 2 * var(--wave-amp, 0px) + var(--wave-base, 0px));
  background-color: var(--hero-ground);
  border-image-source: var(--gradient-hero);
  border-image-slice: 0 fill;
  border-image-outset: 0 100vw;
  color: var(--color-on-hero);
  text-align: center;
}
.pricing-hero h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3.25rem);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  color: var(--color-on-hero);
  hyphens: auto;
  overflow-wrap: anywhere;
}
.pricing-hero-subtitle {
  max-width: 44rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: var(--leading-normal);
  color: var(--color-on-hero-muted);
  text-wrap: pretty;
}

/* Free + three passes: one per row, a readable two-by-two grid from 900px. */
.pricing-plans {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 900px) {
  .pricing-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
}
/* The card is .dash-panel (white) or .dash-panel--ink: a column whose
   action, last, is pushed to the foot. */
.pricing-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
  margin: 0;
}
@media (min-width: 900px) and (max-width: 1099px) {
  .pricing-plan.dash-panel { padding: var(--space-5); }
}

/* THE HEAD: the stamp, and the name over its kind. */
.pricing-plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-3);
}
/* THE STAMPS: a character inside a square rule, the subjects screen's Gold
   stamp. Deep Gold on the white card (6.30:1, 9.25:1 at night), the band's
   Gold on the ink (8.44:1 or more). Decoration only (aria-hidden). */
.pricing-stamp {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  color: var(--color-accent-text);
  font-family: var(--font-cjk);
  font-size: 1.125rem;
  font-weight: var(--weight-semibold);
  line-height: 1;
}
.pricing-plan--paid .pricing-stamp { color: var(--color-on-hero-accent); }
.pricing-plan-titles { flex: 1 1 8rem; min-width: 0; }
.pricing-plan-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.875rem);
  font-weight: var(--weight-display);
  line-height: 1.1;
  letter-spacing: var(--tracking-heading);
  color: var(--color-text);
  overflow-wrap: break-word;
}
.pricing-plan--paid .pricing-plan-name { color: var(--color-on-hero); }
/* The kind, in tracked small capitals: muted on white, Gold on the ink. */
.pricing-plan-kind {
  margin: var(--space-1) 0 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--color-text-muted);
  overflow-wrap: break-word;
}
.pricing-plan--paid .pricing-plan-kind { color: var(--color-on-hero-accent); }

/* THE TAGS sit on the card's top edge, at its end, so a tagged card's rows
   stay level with its neighbours': "Your plan" in a Gold rule on the card's
   own ground; "Best value", shown only when the prices make it true, filled
   in Gold (ink on it 7.84:1). */
.pricing-plan-tags {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: var(--space-5);
  display: flex;
  gap: var(--space-2);
  max-width: calc(100% - 2 * var(--space-5));
  transform: translateY(-50%);
}
.pricing-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-surface-elevated);
  box-shadow: inset 0 0 0 1px currentColor;
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  white-space: nowrap;
}
.pricing-plan--paid .pricing-tag {
  background: var(--color-feature-ground);
  color: var(--color-on-hero-accent);
}
.pricing-plan--paid .pricing-tag--best,
.pricing-tag--best {
  background: var(--brand-gold);
  box-shadow: none;
  color: var(--brand-ink);
}

/* THE PRICE LINE, on a hairline: the display face, large and quiet. A set
   price is its figure set larger, then its period. */
.pricing-price {
  margin: 0;
  padding-block-start: var(--space-4);
  border-block-start: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--color-text);
  overflow-wrap: break-word;
}
.pricing-plan--paid .pricing-price {
  border-block-start-color: var(--color-feature-divider);
  color: var(--color-on-hero);
}
.pricing-amount {
  font-size: clamp(2rem, 1.6rem + 1.2vw, 2.625rem);
  letter-spacing: var(--tracking-display);
  font-variant-numeric: tabular-nums;
}
.pricing-period {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  color: var(--color-text-muted);
}
.pricing-plan--paid .pricing-period { color: var(--color-on-hero-muted); }

/* WHAT IT INCLUDES: each line after a Gold check, drawn by this rule. */
.pricing-features {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pricing-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
  line-height: var(--leading-normal);
  color: var(--color-text);
}
.pricing-plan--paid .pricing-feature { color: var(--color-on-hero-muted); }
.pricing-feature-text { min-width: 0; overflow-wrap: break-word; }
.pricing-check {
  flex: none;
  width: 18px;
  height: 18px;
  margin-block-start: 0.2em;
}
.pricing-check path {
  fill: none;
  stroke: var(--color-accent-text);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pricing-plan--paid .pricing-check path { stroke: var(--color-on-hero-accent); }

/* A plain sentence at the foot of a card: what a trial keeps after it ends. */
.pricing-plan-note {
  margin: auto 0 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
}

/* THE ACTION, at the foot of the card. */
.pricing-plan-action {
  display: grid;
  gap: var(--space-2);
  margin-block-start: auto;
}
/* The trial: the flat lacquer pill, the card's whole width, wrapping when a
   language needs two lines. */
.pricing-page .pricing-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: break-word;
}
/* Practise for free: a text link, centred on the row the pills sit on. */
.pricing-page .pricing-free-link {
  justify-content: center;
  width: 100%;
  min-height: 48px;
  text-align: center;
  text-decoration: none;
}
.pricing-page .pricing-free-link:hover { text-decoration: underline; text-underline-offset: 4px; }
/* Subscribe, while no payment exists: a real button that cannot be pressed,
   drawn as a dimmed outline on the ink so it never reads as the card's way
   on; its reason sits under it in words (disabled controls are exempt from
   WCAG contrast; the reason is not, and clears 11:1). */
.pricing-subscribe {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--brand-gold);
  border-radius: var(--radius-pill);
  background: var(--brand-gold);
  color: var(--brand-ink);
  font: inherit;
  font-weight: var(--weight-bold);
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}
.pricing-subscribe:disabled {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--color-on-hero) 30%, transparent);
  background: transparent;
  color: color-mix(in srgb, var(--color-on-hero) 58%, transparent);
  cursor: not-allowed;
}
.pricing-subscribe:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
.pricing-reason {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  text-align: center;
  color: var(--color-on-hero-muted);
}
/* A trial's full access, said on the card that holds it. */
.pricing-trial {
  margin: 0 0 var(--space-1);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
  color: var(--color-on-hero);
}

/* THE HONEST LINE under the plans. */
.pricing-note {
  max-width: 44rem;
  margin: var(--space-6) auto 0;
  line-height: var(--leading-normal);
  text-align: center;
  text-wrap: pretty;
  color: var(--color-text-muted);
}
.billing-return,
.billing-access,
.billing-error {
  max-width: 44rem;
  margin: 0 auto var(--space-5);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  line-height: var(--leading-normal);
  text-align: center;
}
.billing-error p { margin: 0 0 var(--space-3); }
.billing-error .btn-secondary { min-height: 44px; }

/* "SEE PLANS" on the paywall and the two gates: the text link, centred
   under their own buttons. As a link it loses the underline at rest. */
.pricing-gate-link {
  display: flex;
  justify-content: center;
  margin-block-start: var(--space-3);
}
.pricing-gate-link .dash-link { text-decoration: none; }
.pricing-gate-link .dash-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* MOTION, only where it is welcome. The band's lines arrive as About us's
   do; the cards fade in where they stand, one after another, then the line
   under them; the lacquer pill carries the sheen MOTION-2 gives the filled
   buttons of the subjects screen. Entrances fill backwards only, so the
   resting page is the finished page, and nothing a student can press moves. */
@media (prefers-reduced-motion: no-preference) {
  .pricing-hero h1 { animation: dg-reveal-up var(--motion-slow) var(--ease-out-expo) 60ms backwards; }
  .pricing-hero-subtitle { animation: dg-focus-in var(--motion-base) var(--ease-out-expo) 160ms backwards; }
  .pricing-plan {
    animation: dg-focus-in var(--motion-base) var(--ease-out-expo) backwards;
    animation-delay: calc(240ms + var(--dg-i, 0) * var(--motion-stagger));
  }
  .pricing-note { animation: dg-appear var(--motion-base) ease-out 480ms backwards; }
  .pricing-page .pricing-cta {
    position: relative;
    overflow: hidden;
    isolation: isolate;
  }
  .pricing-page .pricing-cta::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;               /* the middle: the same in both directions */
    z-index: -1;
    width: 38%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.30) 50%, transparent 100%);
    transform: translateX(-292%) skewX(-18deg);
    animation: dg-sheen 5.2s ease-in-out infinite;
    pointer-events: none;
  }
}

/* ---------------------------------------------------------------------------
   FOOTER-1 (DASHBOARD-3, product owner 2026-10-24, after the competitor's
   footer). Under every screen once the app is entered (app.js's
   renderFooter): the lockup and its line, then the app's places in four
   columns -- four from 900px, two below -- and a last
   row under a hairline with the independence disclaimer, the legal links
   (LEGAL-1: prepared, hidden until their pages exist) and the copyright.
   On the page ground, its links in the muted ink with the Gold rule as the
   only ornament, as INK-GOLD quiets everything around the content.
   --------------------------------------------------------------------------- */
/* No margin of its own: the screen above already ends on its padding. */
.app-footer {
  margin: 0;
  padding: var(--space-8) var(--space-6) var(--space-6);
  border-block-start: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
}
/* Not in the exam room: the sitting is the whole page, as in the real one. */
html[data-csca-mock="test"] .app-footer { display: none; }
.app-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
  max-width: 1120px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .app-footer-inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 3fr); column-gap: var(--space-8); }
}
.app-footer-brand { display: grid; align-content: start; gap: var(--space-3); min-width: 0; }
.app-footer-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  justify-self: start;
  min-height: 44px;
  color: var(--color-text);
  text-decoration: none;
}
.app-footer-lockup:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; border-radius: var(--radius); }
.app-footer-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
}
.app-footer-tagline {
  max-width: 28ch;
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-muted);
  text-wrap: balance;
}
.app-footer-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6) var(--space-5);
  min-width: 0;
}
@media (min-width: 900px) { .app-footer-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Each column spans a heading row and a list row of the columns' grid
   (subgrid), so a heading that needs two lines in one language keeps the
   lists of its row level. */
.app-footer-column {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: 0;
  align-content: start;
  min-width: 0;
}
.app-footer-heading {
  margin: 0 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
}
.app-footer-heading::before {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 0 var(--space-3);
  background: var(--brand-gold);
}
.app-footer-column ul { display: grid; align-content: start; gap: 0; margin: 0; padding: 0; list-style: none; }
/* A link that wraps keeps its own space around it, so two wrapped names
   never read as one. */
.app-footer-column a,
.app-footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: var(--space-2);
  line-height: 1.35;
  color: var(--color-text-muted);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.app-footer-column a:hover,
.app-footer-legal a:hover { color: var(--color-text); text-decoration: underline; text-underline-offset: 4px; }
.app-footer-column a:focus-visible,
.app-footer-legal a:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; border-radius: var(--radius); }
.app-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding-block-start: var(--space-5);
  border-block-start: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
@media (min-width: 900px) { .app-footer-bottom { grid-column: 1 / -1; } }
.app-footer-disclaimer { flex: 1 1 32rem; margin: 0; line-height: var(--leading-normal); }
/* :not([hidden]): a display rule of its own would otherwise outrank the
   attribute, and the empty, hidden list would still take its gap. */
.app-footer-legal:not([hidden]) { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); }
.app-footer-copyright { margin: 0; }
@media (max-width: 599px) {
  .app-footer { padding: var(--space-7) var(--space-5) var(--space-6); }
}
/* The homepage (Landing.tsx) ends on a short disclaimer of its own for a
   first visit, when the footer is not drawn yet. Once it is, the footer's
   fuller one stands for it: one disclaimer on the page, never two. */
html:has(#app-footer:not([hidden])) .landing-disclaimer { display: none; }

/* RESET-1 password-recovery surfaces. */
.auth-intro {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}
.auth-intro bdi { overflow-wrap: anywhere; }
.auth-notice {
  background: var(--color-correct-bg);
  color: var(--color-correct-text);
  border: 1px solid var(--color-correct-text);
  box-shadow: inset 4px 0 0 currentColor;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-4) 0 0;
}
.auth-notice-message { margin: 0; line-height: var(--leading-normal); }
.auth-forgot-link {
  align-self: flex-end;
  min-height: 44px;
  margin-top: calc(-1 * var(--space-3));
  padding: var(--space-2) 0;
  background: none;
  border: none;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-primary-text);
  text-decoration: underline;
  text-decoration-color: transparent;
  cursor: pointer;
  transition: text-decoration-color 120ms ease;
}
.auth-forgot-link:hover { text-decoration-color: currentColor; }
.auth-forgot-link:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .auth-forgot-link { transition: none; } }

/* =============================================================================
   STUDY — subject workspace. One selected subject, readings alongside practice,
   then the existing plan and exams. Shared tokens preserve dark mode and RTL.
   ============================================================================= */
#react-root .study-page.study-plan { max-width: 1320px; }
.study-page .study-hero {
  text-align: start;
  padding-block: 38px 44px;
  margin-block-end: 12px;
}
.study-page .study-hero h1 { font-size: clamp(2.25rem, 3.4vw, 3.25rem); margin-block: 8px 12px; }
.study-kicker {
  display: inline-flex; align-items: center; gap: 12px; margin: 0;
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .22em;
  text-transform: uppercase; color: var(--color-on-hero-accent);
}
.study-kicker::before, .study-kicker::after { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.study-hero-lead { max-width: 52rem; margin: 0; font-size: var(--text-md); line-height: 1.6; color: var(--color-on-hero-muted); }
.study-chapters { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-block-start: 14px; }
.study-chapter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px;
  padding: 0; border: 0; background: transparent; color: var(--color-on-hero-muted);
  font: inherit; font-size: var(--text-sm); cursor: pointer;
}
.study-chapter:hover { color: var(--color-on-hero); }
.study-seal, .study-group-seal {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 7px;
  box-shadow: inset 0 0 0 1px currentColor; color: var(--color-accent-text);
  font-family: var(--font-cjk); font-size: 18px; line-height: 1;
}
.study-chapter .study-seal { width: 22px; height: 22px; font-size: 13px; color: var(--color-on-hero-accent); box-shadow: none; }
.study-seal-lg { width: 44px; height: 44px; border-radius: 10px; font-size: 25px; }
.study-seal-wrong { color: var(--color-incorrect-text); }
.study-seal-today { color: var(--color-primary-text); }
.study-layout, .study-main, .study-readings-subject { min-width: 0; }
.study-rail { margin-block: 0 20px; }
.study-rail-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.study-subjects {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 8px; list-style: none; margin: 0; padding: 0;
}
.study-subjects li { min-width: 0; }
.study-subjects button {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid transparent;
  border-radius: 10px; background: none; color: var(--color-text); font: inherit;
  font-size: var(--text-sm); font-weight: var(--weight-semibold); cursor: pointer;
  line-height: 1.35; text-align: start;
}
.study-subjects button:hover { background: var(--color-control-hover); }
.study-subjects button[aria-pressed="true"] { background: var(--color-surface-elevated); border-color: var(--color-border); color: var(--color-primary-text); box-shadow: 0 4px 14px rgb(0 0 0 / .04); }
.study-subjects button[aria-pressed="true"]::after {
  content: ""; position: absolute; inset-block-end: -1px; inset-inline: 14px;
  height: 3px; border-radius: 3px; background: var(--color-primary);
}
/* STUDY-AIDS-1: compact standalone references, never question-side hints. */
/* STUDY-CARDS-1: dedicated recall/reveal/rate surface, independent progress. */
.study-cards { margin-block-end: var(--space-6); padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); overflow-wrap: anywhere; }
.study-cards > h3 { margin-block: 0 var(--space-2); }
.study-cards > p { color: var(--color-text-muted); }
.study-cards button { padding: var(--space-3) var(--space-4); margin-block-start: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-bg); color: var(--color-text); font: inherit; cursor: pointer; }
.study-cards button:disabled { opacity: .55; cursor: wait; }
.study-cards button:focus-visible { outline: 2px solid var(--color-text); outline-offset: 3px; }
.study-card-summary { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.study-card-summary > div { flex: 1 1 110px; }
.study-card-summary dt { color: var(--color-text-muted); font-size: .85rem; }
.study-card-summary dd { margin-inline-start: 0; font-size: 1.4rem; font-weight: 600; }
.study-card-front, .study-card-back { margin-block: var(--space-4); padding-block: var(--space-3); }
.study-card-back { border-block-start: 1px solid var(--color-border); }
.study-card-term { font-size: 1.6rem; }
.study-card-ratings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.study-card-ratings button { padding-inline: var(--space-2); }
.study-card-limit { font-size: .8rem; }
.study-card-close { margin-inline-start: var(--space-2); }
@media (max-width: 480px) { .study-cards { padding: var(--space-3); } .study-card-ratings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.study-aids-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.study-aid { min-width: 0; padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); overflow-wrap: anywhere; }
.study-aid h3 { margin-block: 0 var(--space-3); font-size: var(--text-lg); line-height: 1.4; }
.study-aid-kind { margin-block: 0 var(--space-2); color: var(--color-text-muted); font-size: var(--text-sm); }
.study-aid-equation { overflow-x: auto; max-width: 100%; text-align: center; font-size: 1.15rem; padding-block: var(--space-2); }
.study-aid-equation .katex-display { margin-block: var(--space-2); }
.study-aid-condition { line-height: var(--leading-normal); }
.study-aid-symbols { margin-block: var(--space-4) 0; }
.study-aid-symbols > div { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: var(--space-2); padding-block: var(--space-2); border-block-start: 1px solid var(--color-border); }
.study-aid-symbols dt { text-align: start; }
.study-aid-symbols dd { margin: 0; }
.study-aid-unit, .study-aid-exact { color: var(--color-text-muted); font-size: var(--text-sm); }
.study-aid-unit { white-space: nowrap; }
.study-aid-exact { border-block-start: 1px solid var(--color-border); padding-block-start: var(--space-3); line-height: 1.6; }
.study-aid-chinese { font-size: 1.75rem; margin-block: var(--space-2); }
.study-aid-pinyin { color: var(--color-text-muted); }
.study-aid-term-pair { text-align: start; }
.study-aids-notice { padding-block: var(--space-3); }
@media (max-width: 700px) {
  .study-aids-grid { grid-template-columns: minmax(0, 1fr); }
  .study-aid { padding: var(--space-4); }
}
.study-subjects li:last-child .study-group-seal { display: none; }
.study-subjects li:last-child button { font-size: var(--text-xs); color: var(--color-text-muted); }
.study-main { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.study-section {
  min-width: 0; padding: 24px; border: 1px solid var(--color-border); border-radius: 16px;
  background: var(--color-surface-elevated); scroll-margin-block-start: 24px;
}
#study-aids, #study-plan, #study-mocks { grid-column: 1 / -1; }
#study-readings { min-height: 430px; }
#study-questions { padding: 20px; }
.study-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-block-end: 18px; }
.study-section-title { flex: 1 1 8rem; min-width: 0; }
.study-section-title h2 { margin: 0; font-size: clamp(1.35rem, 1.6vw, 1.85rem); line-height: 1.2; letter-spacing: -.025em; }
.study-section-title h2:focus:not(:focus-visible) { outline: none; }
.study-section-lead, .study-section .study-section-lead.study-plan-subtitle {
  max-width: none; margin: 5px 0 0; font-size: var(--text-sm); line-height: 1.5;
  text-align: start; color: var(--color-text-muted);
}
.study-link { min-height: 36px; padding: 4px 0; border: 0; background: none; color: var(--color-primary-text); font: inherit; font-size: var(--text-xs); font-weight: var(--weight-bold); cursor: pointer; }
.study-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.study-reading-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-block: 0 22px; }
.study-subject-coverage { flex: 1; max-width: 25rem; font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.5; }
.study-coverage-track { display: block; height: 5px; border-radius: 20px; background: var(--color-track); overflow: hidden; margin-block-start: 8px; }
.study-coverage-track > span { display: block; height: 100%; background: var(--subject-mark, var(--color-progress-fill)); border-radius: inherit; }
#react-root .study-view-all { min-width: 0; min-height: 40px; padding: 8px 16px; font-size: var(--text-sm); }
#react-root .study-group-title { display: flex; align-items: center; gap: 10px; margin: 24px 0 12px; font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .07em; text-transform: uppercase; color: var(--color-text-muted); }
#react-root .study-module:first-child .study-group-title { margin-block-start: 0; }
.study-group-title::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.study-group-count { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.study-readings-grid { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.study-readings-grid > li[hidden] { display: none; }
.study-readings-grid > li + li { border-block-start: 1px solid var(--color-border); }
.study-reading {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(100px, .55fr) auto;
  align-items: center; gap: 16px; width: 100%; min-height: 98px; padding: 18px 16px;
  border: 0; background: transparent; color: var(--color-text); font: inherit; text-align: start; cursor: pointer;
  transition: background .15s ease;
}
.study-reading:hover { background: var(--color-control-hover); }
.study-reading:focus-visible { outline-offset: -3px; }
.study-reading-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--color-bg); color: var(--color-text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.study-reading-copy { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.study-reading-title { font-size: var(--text-md); font-weight: var(--weight-bold); line-height: 1.4; overflow-wrap: anywhere; }
.study-reading-count, .study-reading-coverage { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.5; }
.study-reading-foot { grid-column: 4; }
.study-reading-go { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--color-border-strong); border-radius: 24px; min-height: 36px; min-width: 76px; padding: 6px 14px; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.study-reading:hover .study-reading-go { border-color: var(--color-primary-text); color: var(--color-primary-text); }
.study-tag { display: inline-flex; max-width: 100%; padding: 3px 8px; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px currentColor; color: var(--color-accent-text); font-size: var(--text-2xs); font-weight: var(--weight-bold); line-height: 1.4; }
.study-tag-plan { box-shadow: none; background: var(--color-primary-subtle-bg); color: var(--color-primary-text); }
.study-more { display: block; width: 100%; min-height: 44px; margin-block-start: 8px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--color-text-muted); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.study-more:hover { background: var(--color-control-hover); color: var(--color-text); }
.study-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.study-tool {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg);
  color: var(--color-text); font: inherit; text-align: start; overflow-wrap: anywhere;
}
button.study-tool { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
button.study-tool:hover { border-color: var(--color-border-strong); background: var(--color-control-hover); }
.study-tool-today { background: var(--color-primary-subtle-bg); }
.study-tool-head { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; }
.study-tool .study-seal { width: 28px; height: 28px; font-size: 15px; }
.study-tool-title { font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: 1.35; }
.study-tool-text { grid-column: 1 / -1; margin-inline-start: 38px; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.study-tool:not(.study-tool-today):has(.study-tool-figure) .study-tool-text { display: none; }
.study-tool-foot { display: flex; grid-column: 1 / -1; align-items: center; flex-wrap: wrap; gap: 8px; margin-inline-start: 38px; }
.study-tool-today .study-tool-head, .study-tool-today .study-tool-text { grid-column: 1; }
.study-tool-today .study-tool-foot { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.study-tool-today[data-study-today="guest"] .study-tool-foot { grid-column: 1 / -1; grid-row: auto; margin-inline-start: 38px; }
.study-tool-today[data-study-today="guest"] .study-tool-text { grid-column: 1 / -1; }
.study-tool-foot:empty { display: none; }
.study-tool-figure { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--color-text-muted); }
#react-root .study-tool .study-tool-cta { min-width: 0; min-height: 34px; margin: 2px 0 0; padding: 7px 16px; font-size: var(--text-xs); }
.study-today-bar { display: block; grid-column: 1 / -1; margin-inline-start: 38px; margin-block: 4px 2px; height: 5px; overflow: hidden; border-radius: var(--radius-pill); background: var(--color-track); }
.study-today-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--color-progress-fill); }
.study-mocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.study-mock { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg); min-width: 0; }
.study-mock-title { flex: 1 1 100%; margin: 0; font-size: var(--text-lg); }
.study-mock-text { flex: 1 1 120px; margin: 0; font-size: var(--text-xs); line-height: 1.5; color: var(--color-text-muted); }
.study-mock-sizes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--text-xs); color: var(--color-text-muted); }
.study-mock-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.study-mock-seals { margin-inline-end: 8px; font-family: var(--font-cjk); color: var(--color-accent-text); }
#react-root .study-mock > :is(.next-btn, .btn-secondary) { min-width: 0; min-height: 38px; padding: 8px 16px; margin: 0; font-size: var(--text-sm); }
.study-mock-full { border-color: var(--color-feature-rim); background: var(--color-feature-ground); color: var(--color-on-hero); }
.study-mock-full :is(.study-mock-text, .study-mock-sizes) { color: var(--color-on-hero-muted); }
.study-mock-full :is(.study-tag, .study-mock-seals) { color: var(--color-on-hero-accent); }
.study-scores { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-start: 18px; }
.study-scores-title { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.study-scores-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.study-score { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: 1px solid var(--color-border); border-radius: 24px; font-size: var(--text-sm); }
.study-score b { font-family: var(--font-display); }
.study-page #study-plan .study-plan-empty { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; align-items: center; max-width: none; margin: 0; padding: 20px; text-align: start; background: var(--color-bg); }
.study-page #study-plan .study-plan-empty h2, .study-page #study-plan .study-plan-empty p { grid-column: 1; margin: 0; }
.study-page #study-plan .study-plan-empty .next-btn { grid-column: 2; grid-row: 1 / span 2; }
.study-page #study-plan .study-plan-empty h2 { font-size: var(--text-lg); }
.study-page #study-plan .study-plan-empty p { font-size: var(--text-sm); }
.study-page #study-plan .study-plan-empty .next-btn { margin: 0; min-height: 40px; padding: 8px 18px; font-size: var(--text-sm); }
.study-page #study-plan .study-plan-subjects { grid-template-columns: minmax(0, 1fr); }
.study-page #study-plan .study-plan-topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.study-page #study-plan .study-plan-topic { display: flex; flex-direction: column; align-items: stretch; border: 1px solid var(--color-border); border-radius: 10px; padding: 16px; padding-inline-start: 54px; min-width: 0; }
.study-page #study-plan .study-plan-topic-text { flex: 1 1 auto; }
.study-page #study-plan .study-plan-topic-actions { margin-block-start: auto; padding-block-start: 12px; }
@media (prefers-reduced-motion: reduce) {
  .study-reading, button.study-tool { transition: none; }
}
@media (max-width: 1099px) {
  .study-main { grid-template-columns: minmax(0, 1.8fr) minmax(270px, 1fr); gap: 14px; }
  .study-section { padding: 18px; }
  .study-subjects { display: flex; overflow-x: auto; padding-block-end: 8px; scrollbar-width: thin; }
  .study-subjects li { flex: 0 0 auto; }
  .study-subjects button { min-height: 56px; }
  .study-reading { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; padding: 14px 12px; }
  .study-reading-coverage { grid-column: 2; grid-row: 2; }
  .study-reading-foot { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 799px) {
  .study-main { grid-template-columns: minmax(0, 1fr); }
  #study-readings { min-height: 0; }
  .study-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .study-page #study-plan .study-plan-topics { grid-template-columns: minmax(0, 1fr); }
  .study-page #study-plan .study-plan-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 479px) {
  .study-page .study-hero { padding-block: 30px 34px; }
  .study-chapters { gap: 4px 16px; }
  .study-section, #study-questions { padding: 16px; border-radius: 12px; }
  .study-section-head { gap: 10px; }
  .study-seal-lg { width: 36px; height: 36px; font-size: 21px; }
  .study-reading-summary { gap: 10px; align-items: flex-start; }
  .study-subject-coverage { font-size: var(--text-xs); }
  #react-root .study-view-all { padding: 8px 12px; flex: 0 1 auto; }
  .study-reading { grid-template-columns: 24px minmax(0, 1fr); min-height: 0; }
  .study-reading-number { width: 24px; height: 24px; }
  .study-reading-foot { grid-column: 2; grid-row: auto; }
  .study-reading-go { min-height: 36px; }
  .study-reading-coverage { grid-row: auto; }
  .study-tools, .study-mocks { grid-template-columns: minmax(0, 1fr); }
  .study-tool { padding: 12px; }
}

/* Immutable item revisions: the origin remains mounted during new practice. */
.item-revision-origin { display: contents; }
.item-revision-origin[hidden] { display: none; }
.item-revision-notice { grid-column: 1 / -1; border-inline-start: 3px solid currentColor; padding: .75rem 1rem; margin-block: .75rem; }
.item-revision-notice p { margin: 0 0 .5rem; }
.item-revision-badge { display: block; font-size: .85em; }
.saved-row:has(> .item-revision-notice) { flex-wrap: wrap; }
.saved-row:has(> .item-revision-notice) .saved-row-open { flex-basis: 0; }
.saved-row .item-revision-notice, .daily-row .item-revision-notice { flex-basis: 100%; }
.item-revision-activity { min-width: 0; max-width: 640px; margin-inline: auto; padding: var(--space-6) var(--space-4) var(--space-8); }

/* =============================================================================
   RIGHT-TO-LEFT -- I18N-FOUNDATION-4
   Everything above is written with logical properties (margin-inline-*,
   inset-inline-*, text-align: start/end, border-inline-*, border-*-*-radius), so
   a right-to-left page mirrors by itself. This block holds only what cannot be
   expressed that way: content that must NOT mirror, and the few glyphs and
   rotations that point somewhere.

   Keyed on <html dir="rtl">, which applyInterfaceLanguage (app.js) writes and
   index.html's pre-paint script restores for a right-to-left language only.
   No rule below can match a left-to-right page, so the published languages are
   untouched. verify_step1 section 96 caps the physical-direction declarations
   outside this block, so new CSS has to keep using logical properties.
   ============================================================================= */

/* Math, figures and controls whose direction means something are left-to-right
   whatever the page does. KaTeX's own stylesheet sets no direction, so inside an
   RTL paragraph its inline-block parts would lay out right-to-left and a formula
   would read backwards; isolate keeps surrounding Arabic punctuation from
   reordering it. An SVG's text-anchor "start" follows `direction`, so a figure
   would shift its labels. A range slider's value grows to the right. */
html[dir="rtl"] .katex,
html[dir="rtl"] .katex-display {
  direction: ltr;
  unicode-bidi: isolate;
}
html[dir="rtl"] svg,
html[dir="rtl"] input[type="range"] {
  direction: ltr;
}

/* An email address or a password is typed left-to-right, but sits at the end
   of the field, where Arabic readers expect it. */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="number"] {
  direction: ltr;
  text-align: right;
}

/* Glyphs and rotations that point "forward". */
html[dir="rtl"] .nav-back-btn-arrow {
  display: inline-block;
  transform: scaleX(-1);
}
html[dir="rtl"] .react-result-section .next-btn::after {
  content: " \2190";
  content: " \2190" / "";
}
/* The closed reading section's chevron points at where the content will open:
   the end of the line, which is the left in a right-to-left page. */
html[dir="rtl"] .reading-section-chevron:not([data-open="true"]) {
  transform: rotate(135deg);
}
/* The speech-bubble tail points at the companion on the start side. */
html[dir="rtl"] .subject-companion-bubble::before {
  transform: rotate(-45deg);
}

/* RTL-DASHBOARD-1 (Arabic, released 2026-10-25). The dashboard's ways on --
   text links, the explore tiles' ringed arrows, the facts' Read more and
   their two buttons, the exam dates' button, the closing band's button,
   About us's tiles, the plans page and the guide's inline jumps -- point
   the way the line reads, to the left. Their nudges on hover follow
   --dash-line, so they go left too, and only where motion is welcome, as
   in a left-to-right page. */
html[dir="rtl"] { --dash-line: -1; }
/* An arrow in the line of text becomes a box, so it can turn; a ringed or
   block arrow keeps its own box, which centres the glyph in its ring. */
html[dir="rtl"] .dash-link-arrow,
html[dir="rtl"] .dash-closing-arrow,
html[dir="rtl"] .exam-dates-all > [aria-hidden="true"] {
  display: inline-block;
}
html[dir="rtl"] .dash-link-arrow,
html[dir="rtl"] .dash-explore-arrow,
html[dir="rtl"] .dash-facts-arrow,
html[dir="rtl"] .dash-closing-arrow,
html[dir="rtl"] .about-what-arrow,
html[dir="rtl"] .exam-guide-inline-jump-arrow,
html[dir="rtl"] .exam-dates-all > [aria-hidden="true"] {
  transform: scaleX(-1);
}
/* The facts' running pill fills from the start of its row, the right. */
html[dir="rtl"] .dash-facts-dot--active::after { transform-origin: right center; }
/* The subjects hero's photograph is turned over, so the copy, which starts
   on the right here, sits on its soft side as it does on the left in a
   left-to-right page (HERO-PHOTO-1's contrast was measured there); the
   shade around the copy turns with it. */
html[dir="rtl"] .subject-hero::before { transform: translateX(-50%) scaleX(-1); }
html[dir="rtl"] .auth-notice { box-shadow: inset -4px 0 0 currentColor; }
html[dir="rtl"] .auth-forgot-link { align-self: flex-start; }
