/* design tokens and base components.
   Source of truth for values. Reasoning lives in DESIGN.md.

   Redesign "ink, paper, highlighter", October 2026. Plan and token table:
   docs/plans/redesign-2026-10.md (Decisions). Source boards:
   docs/design/redesign-2026-10/. Replaces the 2026-09-25 Ink retheme
   (docs/design/retheme-ink-spec.md); the rules it set (one warm hue for
   validation only, green for live only, no danger colour) are kept.

   Fonts are self-hosted by site/fonts/fonts.css (Bricolage Grotesque for
   display and headings, Hanken Grotesk for reading text and controls, Geist
   Mono for machine-readable values and eyebrows). No external font host:
   the pages' Content Security Policy forbids one and the generator works
   offline. Every page also carries:
     <meta name="color-scheme" content="light dark">

   Fidelity build (docs/plans/redesign-fidelity.md, task F-2): tokens and base
   components are transcribed from docs/design/redesign-2026-10/Foundations
   and the helmet CSS of Main, SiteHeader, AppCodes and GenFullStyle.

   NOTE: there is deliberately no --color-danger, --color-error, --color-success
   or --color-accent* token. Failed payment, cancellation, and redirect-failure
   states all use --color-surface or --color-surface-2. Reaches, all enforced
   by test/design-tokens.test.mjs:
   - --color-invalid*: input validation only (.input[aria-invalid="true"],
     .field-error, .gen-notice-blocked). DESIGN-1a.
   - --color-signal (green): working or verified: the live dot and the word
     Live, a verified scan, a status bar, a computed pass. Never a button or a
     large fill. DESIGN-1b.
   - --color-highlight / --color-on-highlight: a fill behind ink text wherever a
     board draws it (.btn-highlight, .mark, .hl, chips, the closing band, the
     scan line) and the link-hover underline. As text only on dark bands. DESIGN-1c.
   - --color-rust: delete actions, the grace dot, decorative tiles. Billing
     states stay neutral. DESIGN-9.
   See DESIGN.md before touching any of them. */

:root {
  color-scheme: light;

  --color-bg: #F4F2EC;
  --color-surface: #FFFFFF;
  --color-surface-2: #ECE9E1;
  --color-grid: #ECE9E1;
  --color-text: #121210;
  --color-text-muted: #5E5C55;
  --color-line: #E2DFD6;
  --color-border-control: #8A8983;
  --color-caption: #5B5B57;
  --color-primary: #121210;
  --color-primary-hover: #2D2B27;
  --color-primary-active: #43423D;
  --color-on-primary: #F4F2EC;
  --color-focus: #121210;
  --color-signal: #1E7A45;
  --color-signal-on-band: #4ADE80;
  --color-invalid: #A1321F;
  --color-invalid-soft: #FEF0ED;
  --color-invalid-border: #C4422C;
  --color-disabled-fill: #EAE8E2;
  --color-disabled-text: #9A9893;
  --color-selection: #D6D4CE;
  --color-backdrop: rgb(18 18 16 / 0.5);
  --color-qr-plate: #FFFFFF;

  /* Rust: delete actions, the grace dot, decorative tiles. Never billing
     states, never validation. 5.0:1 on paper, 5.6:1 on a surface (DESIGN-7).
     Reach is DESIGN-9. */
  --color-rust: #B4421F;

  /* The generator's working surface behind the plate (GenFullStyle). */
  --color-stage: #EAE7DF;

  /* Switch off-track. On is ink (--color-primary). */
  --color-switch-track: #FFFFFF;

  /* Use tiles on the home page: a coloured ground with a white plate on it and
     a kind label in the tile's own foreground. The same in both modes (the
     board does not change them), so decorative text sits on its own ground and
     is checked against it by DESIGN-7. */
  --color-tile-ink: #1C1C1A;
  --color-tile-ink-fg: #A5A39B;
  --color-tile-paper: #E6E3DA;
  --color-tile-paper-fg: #5E5C55;
  --color-tile-green: #1E7A45;
  --color-tile-green-fg: #D9F2E3;
  --color-tile-rust: #B4421F;
  --color-tile-rust-fg: #FBE4DC;
  --color-tile-band: #2C2C29;
  --color-tile-band-fg: #A5A39B;

  /* The phone preview's device (D44): a light phone in both modes, because what a scanner opens is not
     ours to recolour. The same values in all three blocks; identical-in-both-modes is DESIGN-6.
     --color-sheet is the paper the surface preview draws a code on (the board's --paper). */
  --color-phone-bezel: #1B1B19;
  --color-phone-screen: #F7F6F2;
  --color-phone-ink: #121210;
  --color-phone-ink-on: #F4F2EC;
  --color-phone-muted: #5E5C55;
  --color-phone-line: #E2DFD6;
  --color-phone-bar: #FFFFFF;
  --color-phone-skeleton: #D9D6CD;
  --color-phone-block: #E1DED4;
  --color-phone-chip: #ECE9E0;
  --color-phone-avatar: #E8E5DC;
  --color-phone-outline: #B9B6AC;
  --color-phone-field: #D9D6CD;
  --color-phone-faint: #9B988F;
  --color-phone-toggle: #C9C7BF;
  --color-phone-map: #E9E6DC;
  --color-phone-map-block: #DCDACF;
  --color-phone-chat: #EDEAE1;
  --color-phone-dim: rgb(18 18 16 / .38);
  --color-sheet: #F6F5F1;
  --color-sheet-edge: #E3E1DA;

  /* The highlighter. A fill behind ink text, never text itself and never a
     focus ring (1.11:1 on paper). Same two values in both modes: ink on it
     is 15.12:1. Reach is DESIGN-1c; identical-in-both-modes is DESIGN-6. */
  --color-highlight: #D4F53C;
  --color-on-highlight: #121210;

  /* Dark panels inside the light page (.panel-dark, the timeline, the closing
     band). In dark mode they sit one step above the ground. */
  --color-band: #121210;
  --color-on-band: #F4F2EC;
  --color-band-muted: #A5A39B;
  --color-band-line: #2C2C29;

  /* Tonal ramp — generated in OKLCH on one shared lightness scale (C 0.008,
     H 90, see the plan). Only chroma and hue change between steps; do not
     hand-pick intermediate values. Components use roles above, never these
     steps directly, except swatch displays and .tag-neutral. */
  --color-neutral-100: #F7F5EF;
  --color-neutral-200: #EAE8E2;
  --color-neutral-300: #D6D4CE;
  --color-neutral-400: #B9B7B2;
  --color-neutral-500: #9A9893;
  --color-neutral-600: #7C7A75;
  --color-neutral-700: #605E59;
  --color-neutral-800: #43423D;
  --color-neutral-900: #2D2B27;

  /* Shadows are soft and far. Resting elevation is near-none: cards sit on a
     1px line border. -raised is a card on hover and a menu; -2 is a dialog.
     Dark mode adds a faint 1px white edge to each (D34), because a dark drop
     shadow is invisible on near-black: see the dark blocks. */
  --shadow-1: 0 1px 2px rgb(18 18 16 / .04);
  --shadow-raised: 0 24px 48px -24px rgb(15 15 14 / .35);
  --shadow-2: 0 40px 80px -30px rgb(0 0 0 / .5);
  /* The QR plate itself, and the plates on the home page (hero, use tile,
     closing band). */
  --shadow-plate: none;
  --shadow-plate-hero: 0 30px 60px -20px rgb(0 0 0 / .6), 0 0 0 1px rgb(255 255 255 / .08);
  --shadow-plate-tile: 0 16px 32px -14px rgb(0 0 0 / .5);
  --shadow-plate-cta: 0 40px 80px -30px rgb(0 0 0 / .5);
  /* The phone preview's device and the surface preview's paper. */
  --shadow-device: 0 18px 40px -20px rgb(15 15 14 / .55);
  --shadow-paper: 0 30px 60px -30px rgb(15 15 14 / .5);
  --shadow-phone-dialog: 0 20px 44px -18px rgb(15 15 14 / .5);
  --shadow-band: 0 40px 80px -40px rgb(15 15 14 / .5);
  /* Toast and tooltip: ink on any ground, so the same in both modes. */
  --shadow-toast: 0 10px 30px -10px rgb(0 0 0 / .4);
  --shadow-tooltip: 0 10px 24px -10px rgb(0 0 0 / .4);

  --font-body: "Hanken Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-heading: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-heading-weight: 800;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-heavy: 800;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Layout. 1240px container, 12 columns, 24px gutter; phone is <=720px,
     wide is >=1024px. */
  --container: 1240px;
  --gutter: 24px;
  --section-y: clamp(64px, 9vw, 128px);
  --page-pad: clamp(16px, 4vw, 40px);

  /* Radius by role, not by component: 6 / 8 / 10 / 12 / 14 / 16 / 18 / 20 / 22 /
     24 / 28 / pill. Nested radius = outer minus padding. The QR symbol never
     inherits an interface radius. */
  --radius-tick: 6px;     /* checkbox box, skeleton bar */
  --radius-mark: 8px;     /* logo mark, tags, QR thumbnail in a code row, colour swatch; art 56px and below */
  --radius-item: 10px;    /* menu item, tooltip, small plate */
  --radius-control: 12px; /* inputs, selects, blocked-pair notice, tile art 72px and above */
  --radius-inset: 12px;   /* inset panels inside a card */
  --radius-box: 14px;     /* notice, menu, table row card, option tile */
  --radius-well: 16px;    /* empty panel, scrim, use tile on a phone */
  --radius-tier: 18px;    /* the featured plan's inner edge */
  --radius-card: 20px;    /* cards, calm notice, dialog */
  --radius-plate: 22px;   /* the QR plate */
  --radius-hero: 24px;    /* hero art */
  --radius-panel: 28px;   /* dark panels, hero panels */
  --radius-segment: 999px; /* segmented control: track and options */
  --radius-pill: 999px;   /* buttons, chips, tags */

  /* Minimum interactive sizes. 44px is the touch-target floor; 48px/16px on
     inputs because iOS Safari zooms the viewport on focus below 16px. */
  --touch-min: 44px;
  --input-min: 48px;
  --input-font: 16px;
  --control-h: 48px;

  /* Motion. Durations, delays and travel collapse to 0 under reduced motion, so
     every transition or animation written with these tokens is gated by
     construction. Not colours: the dark blocks do not repeat them. One token
     per board value (R5). */
  --dur-instant: 80ms;    /* press */
  --dur-fast: 120ms;      /* focus ring, chevron, tile ring, preview settle */
  --dur-hover: 200ms;     /* hover colour and background */
  --dur-ui: 250ms;        /* button lift, disclosure chevron */
  --dur-base: 180ms;      /* panel change, notice, disclosure, toast, thumb slide */
  --dur-slow: 260ms;      /* sheet */
  --dur-lift: 350ms;      /* card lift */
  --dur-pop: 500ms;       /* a user-chosen surface change */
  --dur-enter: 900ms;     /* marketing content rising into place */
  --dur-assemble: 1100ms; /* the hero assembling */
  --delay-1: 80ms;        /* staggered entrance, in order */
  --delay-2: 180ms;
  --delay-3: 280ms;
  --delay-4: 400ms;
  --delay-assemble: 200ms;
  --delay-sweep: 1400ms;
  --dur-sweep: 3600ms;    /* loops: only behind the pause button, DESIGN-5 / PAGES-8 */
  --dur-float: 7000ms;
  --dur-float-b: 9000ms;
  --dur-ticker: 40000ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-enter: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-sweep: cubic-bezier(0.45, 0, 0.55, 1);
  --lift: 4px;          /* entrance travel */
  --rise: 28px;         /* marketing entrance travel */
  --lift-hover: 1px;    /* button hover */
  --lift-card: 6px;     /* card hover */
  --float: 12px;        /* hero chip travel */
  interpolate-size: allow-keywords;
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-instant: 0ms; --dur-fast: 0ms; --dur-hover: 0ms; --dur-ui: 0ms; --dur-base: 0ms; --dur-slow: 0ms;
    --dur-lift: 0ms; --dur-pop: 0ms; --dur-enter: 0ms; --dur-assemble: 0ms;
    --delay-1: 0ms; --delay-2: 0ms; --delay-3: 0ms; --delay-4: 0ms; --delay-assemble: 0ms; --delay-sweep: 0ms;
    --dur-sweep: 0ms; --dur-float: 0ms; --dur-float-b: 0ms; --dur-ticker: 0ms;
    --lift: 0px; --rise: 0px; --lift-hover: 0px; --lift-card: 0px; --float: 0px;
  }
}

/* Dark mode: a duplicated block under prefers-color-scheme plus
   [data-theme="dark"], kept in sync by DESIGN-2. light-dark() was rejected
   because iOS Safari before 17.5 discards every token; revisit once that
   traffic is under 1%. The two DARK BLOCK bodies below must stay
   byte-identical — that is what DESIGN-2 checks. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --color-bg: #0E0E0C;
    --color-surface: #171714;
    --color-surface-2: #201F1C;
    --color-grid: #232320;
    --color-text: #F3F1EA;
    --color-text-muted: #A5A39B;
    --color-line: #2A2A26;
    --color-border-control: #8A8983;
    --color-caption: #A5A39B;
    --color-primary: #F3F1EA;
    --color-primary-hover: #FFFFFF;
    --color-primary-active: #D6D4CE;
    --color-on-primary: #0E0E0C;
    --color-focus: #F3F1EA;
    --color-signal: #4ADE80;
    --color-signal-on-band: #4ADE80;
    --color-invalid: #F7A695;
    --color-invalid-soft: #371B16;
    --color-invalid-border: #E17460;
    --color-disabled-fill: #2D2B27;
    --color-disabled-text: #7C7A75;
    --color-selection: #43423D;
    --color-backdrop: rgb(0 0 0 / 0.65);
    --color-qr-plate: #FFFFFF;

    --color-rust: #E8835E;
    --color-stage: #0E0E0C;
    --color-switch-track: #171714;

    --color-tile-ink: #1C1C1A;
    --color-tile-ink-fg: #A5A39B;
    --color-tile-paper: #E6E3DA;
    --color-tile-paper-fg: #5E5C55;
    --color-tile-green: #1E7A45;
    --color-tile-green-fg: #D9F2E3;
    --color-tile-rust: #B4421F;
    --color-tile-rust-fg: #FBE4DC;
    --color-tile-band: #2C2C29;
    --color-tile-band-fg: #A5A39B;

    /* The phone preview's device (D44): a light phone in both modes, because what a scanner opens is not
       ours to recolour. The same values in all three blocks; identical-in-both-modes is DESIGN-6.
       --color-sheet is the paper the surface preview draws a code on (the board's --paper). */
    --color-phone-bezel: #1B1B19;
    --color-phone-screen: #F7F6F2;
    --color-phone-ink: #121210;
    --color-phone-ink-on: #F4F2EC;
    --color-phone-muted: #5E5C55;
    --color-phone-line: #E2DFD6;
    --color-phone-bar: #FFFFFF;
    --color-phone-skeleton: #D9D6CD;
    --color-phone-block: #E1DED4;
    --color-phone-chip: #ECE9E0;
    --color-phone-avatar: #E8E5DC;
    --color-phone-outline: #B9B6AC;
    --color-phone-field: #D9D6CD;
    --color-phone-faint: #9B988F;
    --color-phone-toggle: #C9C7BF;
    --color-phone-map: #E9E6DC;
    --color-phone-map-block: #DCDACF;
    --color-phone-chat: #EDEAE1;
    --color-phone-dim: rgb(18 18 16 / .38);
    --color-sheet: #F6F5F1;
    --color-sheet-edge: #E3E1DA;

    --color-highlight: #D4F53C;
    --color-on-highlight: #121210;

    --color-band: #171714;
    --color-on-band: #F3F1EA;
    --color-band-muted: #A5A39B;
    --color-band-line: #2C2C29;

    --color-neutral-100: #2D2B27;
    --color-neutral-200: #43423D;
    --color-neutral-300: #605E59;
    --color-neutral-400: #7C7A75;
    --color-neutral-500: #9A9893;
    --color-neutral-600: #B9B7B2;
    --color-neutral-700: #D6D4CE;
    --color-neutral-800: #EAE8E2;
    --color-neutral-900: #F7F5EF;

    /* OVERRIDE (dark, D34): dark drop shadows are invisible on near-black, so
       a lifted card, a menu, a dialog and a plate each get a 1px white edge
       (8%; 14% on the plates) and the plates a deeper shadow. */
    --shadow-1: 0 0 0 1px rgb(255 255 255 / .08);
    --shadow-raised: 0 0 0 1px rgb(255 255 255 / .08), 0 24px 48px -24px rgb(0 0 0 / .6);
    --shadow-2: 0 0 0 1px rgb(255 255 255 / .08), 0 40px 80px -30px rgb(0 0 0 / .7);
    --shadow-plate: 0 0 0 1px rgb(255 255 255 / .14);
    --shadow-plate-hero: 0 30px 60px -20px rgb(0 0 0 / .85), 0 0 0 1px rgb(255 255 255 / .14);
    --shadow-plate-tile: 0 16px 32px -14px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .14);
    --shadow-plate-cta: 0 40px 80px -30px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .14);
    --shadow-device: 0 18px 40px -20px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .12);
    --shadow-paper: 0 30px 60px -30px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .09);
    --shadow-phone-dialog: 0 20px 44px -18px rgb(15 15 14 / .5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #0E0E0C;
  --color-surface: #171714;
  --color-surface-2: #201F1C;
  --color-grid: #232320;
  --color-text: #F3F1EA;
  --color-text-muted: #A5A39B;
  --color-line: #2A2A26;
  --color-border-control: #8A8983;
  --color-caption: #A5A39B;
  --color-primary: #F3F1EA;
  --color-primary-hover: #FFFFFF;
  --color-primary-active: #D6D4CE;
  --color-on-primary: #0E0E0C;
  --color-focus: #F3F1EA;
  --color-signal: #4ADE80;
  --color-signal-on-band: #4ADE80;
  --color-invalid: #F7A695;
  --color-invalid-soft: #371B16;
  --color-invalid-border: #E17460;
  --color-disabled-fill: #2D2B27;
  --color-disabled-text: #7C7A75;
  --color-selection: #43423D;
  --color-backdrop: rgb(0 0 0 / 0.65);
  --color-qr-plate: #FFFFFF;

  --color-rust: #E8835E;
  --color-stage: #0E0E0C;
  --color-switch-track: #171714;

  --color-tile-ink: #1C1C1A;
  --color-tile-ink-fg: #A5A39B;
  --color-tile-paper: #E6E3DA;
  --color-tile-paper-fg: #5E5C55;
  --color-tile-green: #1E7A45;
  --color-tile-green-fg: #D9F2E3;
  --color-tile-rust: #B4421F;
  --color-tile-rust-fg: #FBE4DC;
  --color-tile-band: #2C2C29;
  --color-tile-band-fg: #A5A39B;

  /* The phone preview's device (D44): a light phone in both modes, because what a scanner opens is not
     ours to recolour. The same values in all three blocks; identical-in-both-modes is DESIGN-6.
     --color-sheet is the paper the surface preview draws a code on (the board's --paper). */
  --color-phone-bezel: #1B1B19;
  --color-phone-screen: #F7F6F2;
  --color-phone-ink: #121210;
  --color-phone-ink-on: #F4F2EC;
  --color-phone-muted: #5E5C55;
  --color-phone-line: #E2DFD6;
  --color-phone-bar: #FFFFFF;
  --color-phone-skeleton: #D9D6CD;
  --color-phone-block: #E1DED4;
  --color-phone-chip: #ECE9E0;
  --color-phone-avatar: #E8E5DC;
  --color-phone-outline: #B9B6AC;
  --color-phone-field: #D9D6CD;
  --color-phone-faint: #9B988F;
  --color-phone-toggle: #C9C7BF;
  --color-phone-map: #E9E6DC;
  --color-phone-map-block: #DCDACF;
  --color-phone-chat: #EDEAE1;
  --color-phone-dim: rgb(18 18 16 / .38);
  --color-sheet: #F6F5F1;
  --color-sheet-edge: #E3E1DA;

  --color-highlight: #D4F53C;
  --color-on-highlight: #121210;

  --color-band: #171714;
  --color-on-band: #F3F1EA;
  --color-band-muted: #A5A39B;
  --color-band-line: #2C2C29;

  --color-neutral-100: #2D2B27;
  --color-neutral-200: #43423D;
  --color-neutral-300: #605E59;
  --color-neutral-400: #7C7A75;
  --color-neutral-500: #9A9893;
  --color-neutral-600: #B9B7B2;
  --color-neutral-700: #D6D4CE;
  --color-neutral-800: #EAE8E2;
  --color-neutral-900: #F7F5EF;

  /* OVERRIDE (dark, D34): dark drop shadows are invisible on near-black, so
     a lifted card, a menu, a dialog and a plate each get a 1px white edge
     (8%; 14% on the plates) and the plates a deeper shadow. */
  --shadow-1: 0 0 0 1px rgb(255 255 255 / .08);
  --shadow-raised: 0 0 0 1px rgb(255 255 255 / .08), 0 24px 48px -24px rgb(0 0 0 / .6);
  --shadow-2: 0 0 0 1px rgb(255 255 255 / .08), 0 40px 80px -30px rgb(0 0 0 / .7);
  --shadow-plate: 0 0 0 1px rgb(255 255 255 / .14);
  --shadow-plate-hero: 0 30px 60px -20px rgb(0 0 0 / .85), 0 0 0 1px rgb(255 255 255 / .14);
  --shadow-plate-tile: 0 16px 32px -14px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .14);
  --shadow-plate-cta: 0 40px 80px -30px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .14);
  --shadow-device: 0 18px 40px -20px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .12);
  --shadow-paper: 0 30px 60px -30px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .09);
  --shadow-phone-dialog: 0 20px 44px -18px rgb(15 15 14 / .5);
}

html, body {
  background: var(--color-bg);
  color: var(--color-text);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: var(--weight-regular);
}

input[type="radio"] { accent-color: var(--color-primary); }

/* Checkbox: 22px box on the tick radius (Foundations), ink fill and a CSS tick
   when checked. The row it sits in (a label) is the 44px hit area. */
input[type="checkbox"] {
  appearance: none; flex: none; margin: 0; align-self: center;
  inline-size: 22px; block-size: 22px;
  border: 1.5px solid var(--color-border-control); border-radius: var(--radius-tick);
  background: var(--color-surface); cursor: pointer;
  display: inline-grid; place-content: center;
  transition: background-color var(--dur-hover) var(--ease-in-out), border-color var(--dur-hover) var(--ease-in-out),
    outline-offset var(--dur-fast) var(--ease-out);
}
/* A checkbox in a block label (no flex gap) keeps its own gap and centres on the text. */
.field > label > input[type="checkbox"] { vertical-align: middle; margin-inline-end: var(--space-2); }
input[type="checkbox"]:hover { border-color: var(--color-text); }
input[type="checkbox"]::before {
  content: ""; inline-size: 10px; block-size: 6px; margin-block-start: -2px;
  border: solid var(--color-on-primary); border-width: 0 0 2px 2px;
  transform: rotate(-45deg) scale(0); transition: transform var(--dur-instant) var(--ease-out);
}
input[type="checkbox"]:checked { background: var(--color-primary); border-color: var(--color-primary); }
input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
input[type="checkbox"]:disabled { background: transparent; border-style: dashed; color: var(--color-text-muted); cursor: not-allowed; }
input[type="checkbox"]:disabled:checked::before { border-color: var(--color-text-muted); }
input[type="checkbox"]:disabled:checked { background: transparent; border-color: var(--color-border-control); }
@media (forced-colors: active) {
  input[type="checkbox"]:checked { background: Highlight; border-color: Highlight; }
  input[type="checkbox"]::before { border-color: HighlightText; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  margin: 0 0 var(--space-2);
}
h1 { font-size: 32px; line-height: 1.10; letter-spacing: -0.03em; }
h2 { font-size: 28px; font-weight: var(--weight-bold); line-height: 1.15; letter-spacing: -0.025em; }
h3 { font-size: 22px; font-weight: var(--weight-bold); line-height: 1.20; letter-spacing: -0.02em; }
h4 { font-size: 20px; font-weight: var(--weight-bold); line-height: 1.25; letter-spacing: -0.015em; }
h5, h6 { font-family: var(--font-body); font-weight: var(--weight-semibold); }
h5 { font-size: 17px; line-height: 1.30; letter-spacing: -0.005em; }
h6 { font-size: 15px; line-height: 1.35; letter-spacing: 0; }

/* Marketing type. Class-based, so a page picks its own scale: .display is
   the marketing h1, .display--xl the home hero only, .section-title a
   section's heading. */
.display {
  font-family: var(--font-display); font-weight: var(--weight-heavy);
  font-size: clamp(40px, 6vw, 88px); line-height: 0.94; letter-spacing: -0.035em;
}
.display--xl { font-size: clamp(48px, 7.2vw, 104px); }
.section-title {
  font-family: var(--font-display); font-weight: var(--weight-heavy);
  font-size: clamp(32px, 4vw, 56px); line-height: 1.02; letter-spacing: -0.03em;
}

p { margin: 0 0 var(--space-3); }
/* A link is ink and carries no underline outside running text: navigation,
   cards and buttons are recognisable by position and shape. In prose (a
   paragraph or .prose) it is underlined, because colour alone cannot mark a
   link in a sentence (WCAG 1.4.1). On hover it keeps ink and takes a
   highlighter underline, never highlighter text. */
a { color: inherit; text-decoration: none; }
a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--color-highlight); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:where(p, .prose) a:where(:not(.btn)) { color: var(--color-text); text-decoration: underline; text-decoration-color: currentColor; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(p, .prose) a:where(:not(.btn)):hover { text-decoration-color: var(--color-highlight); text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 12px; margin-top: var(--space-1);
  color: var(--color-text-muted);
}

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

/* Focus. Never remove. An ink ring with a 2px background-coloured gap —
   the gap takes the page colour and separates the ring from an ink button.
   outline (not box-shadow) so it follows border-radius and survives
   forced-colours mode. Always 2px offset: never 0, never negative. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
::selection { background: var(--color-selection); }

/* — the eyebrow —
   Geist Mono 12px/500, uppercase by CSS (the source text stays sentence
   case), tracked 0.08em, muted. How every section labels itself
   ("Payment · 2 Aug 2026", "Your codes · all live"). A component, not a
   heading level. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--weight-medium);
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Scan counts, dates, and IDs align down a column. */
.tabular { font-variant-numeric: tabular-nums; }

/* — rules —
   One weight, 1px, only between repeated rows. The old 2px structural rule
   is retired: regions are separated by cards and space now, not lines. */
.hr { height: 1px; border: 0; margin: var(--space-4) 0; background: var(--color-line); }
.rule-soft { border-bottom: 1px solid var(--color-line); }

/* — buttons —
   Pill, 48px, 15px/600. Hover lifts 1px (hover devices only, none under
   reduced motion). .btn-sm is the 40px size. Disabled is dashed, not a grey
   fill: the label and size stay, so nothing moves. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-body); font-weight: var(--weight-semibold);
  font-size: 15px; line-height: normal; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  min-height: var(--control-h);
  transition: transform var(--dur-ui) var(--ease-enter), box-shadow var(--dur-ui) var(--ease-enter),
    background-color var(--dur-ui) var(--ease-enter), border-color var(--dur-hover) var(--ease-in-out),
    color var(--dur-hover) var(--ease-in-out), outline-offset var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .btn:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(calc(var(--lift-hover) * -1)); }
}
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: none; transition-duration: var(--dur-instant); }
.btn svg { display: block; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
/* Ink: navigation and the default action. */
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { background: var(--color-primary-active); }
/* The action that matters on a page: the highlighter as a fill behind ink
   text, with a soft highlighter glow on hover. */
.btn-highlight { background: var(--color-highlight); color: var(--color-on-highlight); }
.btn-highlight:hover:not(:disabled):not([aria-disabled="true"]) { box-shadow: 0 10px 30px -10px var(--color-highlight); }
/* Paper fill on a dark band (.panel-dark and the closing band). */
.btn-inverse { background: var(--color-on-band); color: var(--color-band); }
.btn-inverse:hover { background: color-mix(in srgb, var(--color-on-band), var(--color-band) 8%); }
.btn-inverse:active { background: color-mix(in srgb, var(--color-on-band), var(--color-band) 16%); }
.btn-secondary { background: var(--color-surface); border-color: var(--color-line); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-bg); }
.btn-secondary:active { background: var(--color-bg); }
.btn-ghost { color: var(--color-caption); font-weight: var(--weight-medium); padding-inline: 14px; }
.btn-ghost:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost.btn-sm { padding-inline: 16px; }
/* A destructive owner action (delete): a rust outline, named for what it
   does. The one place rust is a button; the confirm dialog's primary stays ink. */
.btn-delete { background: transparent; color: var(--color-rust); border-color: var(--color-rust); }
.btn-delete:hover { background: color-mix(in srgb, var(--color-rust) 8%, transparent); }
.btn-delete:active { background: color-mix(in srgb, var(--color-rust) 16%, transparent); }
/* De-emphasised action for calm surfaces (failed-payment notice, cancellation
   flow, redirect-failure pages). Identical to .btn-ghost now that both are
   ink, not accent — kept as a named alias so call sites that reach for the
   "calm" variant still read that way. */
.btn-icon { width: 36px; height: 36px; min-height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); justify-content: flex-start; text-align: left; }
/* Disabled: transparent, a dashed border-control edge, muted text, no hover
   lift. aria-disabled (not the attribute) keeps a button focusable so it can
   explain itself; both look the same. Comes after the variants so it wins the
   cascade on equal specificity. */
.btn:disabled, .btn:disabled:hover, .btn:disabled:active,
.btn[aria-disabled="true"], .btn[aria-disabled="true"]:hover, .btn[aria-disabled="true"]:active {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border-control);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* — forms —
   Real <label for>. Placeholder-as-label is banned. A border that is a
   control's only boundary must pass 3:1 — see DESIGN.md — so inputs use
   --color-border-control, not the decorative --color-line. */
.field > label {
  display: block; font-size: 13px; font-weight: var(--weight-semibold); margin-bottom: 6px;
  color: var(--color-text);
}
.input {
  width: 100%; min-height: var(--input-min); padding: 0 14px;
  font: inherit; font-size: 15px;
  color: var(--color-text); caret-color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border-control); border-radius: var(--radius-control);
  transition: border-color var(--dur-hover) var(--ease-in-out), background-color var(--dur-hover) var(--ease-in-out),
    outline-offset var(--dur-fast) var(--ease-out);
}
/* 16px at 720px and below: iOS Safari zooms the viewport on focus under 16px. */
@media (max-width: 720px) { .input { font-size: var(--input-font); } }
textarea.input { padding: 12px 14px; min-height: 84px; resize: none; line-height: 1.45; }
/* Machine-readable values only. */
.input[type="url"], .input[inputmode="url"], .input[type="number"] { font-family: var(--font-mono); }
/* Read-only: paper fill, line border, ink text, selectable and focusable. Always
   carries its reason underneath. */
.input[readonly] { background: var(--color-bg); border-color: var(--color-line); }
/* Disabled: dashed edge, no fill, muted text; used only when the reason sits
   right underneath. */
.input:disabled { background: transparent; border-style: dashed; color: var(--color-text-muted); cursor: not-allowed; }
/* Input validation. Allowed nowhere else — see the header note and DESIGN-1. */
.input[aria-invalid="true"] {
  border-color: var(--color-invalid-border);
  background: var(--color-invalid-soft);
}
.field-error {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 13px; line-height: 1.4;
  color: var(--color-invalid);
  margin-top: var(--space-1);
}

.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
/* Radio: a 22px circle; selected is a 6px ink ring around a surface centre. */
.radio .dot {
  width: 22px; height: 22px; flex: none; border-radius: 50%; box-sizing: border-box;
  border: 1.5px solid var(--color-border-control); background: var(--color-surface);
  transition: border-color var(--dur-hover) var(--ease-in-out);
}
.radio:hover .dot { border-color: var(--color-text); }
.radio input:checked + .dot { border-color: var(--color-primary); border-width: 6px; }
.radio input:disabled + .dot { border-style: dashed; background: transparent; }
.radio input:disabled:checked + .dot { border-color: var(--color-border-control); }
.radio input:focus-visible + .dot { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* Switch. 44 x 26: off is a surface track on a border-control edge, on is an
   ink track; the knob moves 18px. Use <button role="switch" aria-checked>. The
   label beside it is always the setting, never "On/Off". Disabled keeps the
   state it holds, with a dashed edge. */
.switch {
  position: relative; flex: none; inline-size: 44px; block-size: 26px; padding: 0; cursor: pointer;
  border: 1.5px solid var(--color-border-control); border-radius: var(--radius-pill);
  background: var(--color-switch-track);
  transition: background-color var(--dur-hover) var(--ease-in-out), border-color var(--dur-hover) var(--ease-in-out),
    outline-offset var(--dur-fast) var(--ease-out);
}
.switch::after {
  content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px;
  inline-size: 17px; block-size: 17px; border-radius: 50%; background: var(--color-primary);
  transition: inset-inline-start var(--dur-fast) var(--ease-out), background-color var(--dur-hover) var(--ease-in-out);
}
.switch[aria-checked="true"] { background: var(--color-primary); border-color: var(--color-primary); }
.switch[aria-checked="true"]::after { inset-inline-start: 21px; background: var(--color-bg); }
.switch[aria-disabled="true"], .switch:disabled { border-style: dashed; background: transparent; cursor: not-allowed; }
.switch[aria-disabled="true"]::after, .switch:disabled::after { background: var(--color-text-muted); }
.switch[aria-disabled="true"][aria-checked="true"], .switch:disabled[aria-checked="true"] { border-color: var(--color-border-control); }
.switch[aria-disabled="true"][aria-checked="true"]::after, .switch:disabled[aria-checked="true"]::after { background: var(--color-text-muted); }

/* Chip: a choice. Pill, 1px line, 35px (8px 14px padding, 13px/500 on a normal line), transparent; selected
   (aria-pressed) or current (aria-current) is ink-filled and 600. Disabled is dashed and muted; selected and
   disabled keeps the control edge so the state it holds stays readable. .chip-sm is the smaller size. */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: 8px 14px;
  font: inherit; font-size: 13px; font-weight: var(--weight-medium); line-height: normal; white-space: nowrap;
  color: var(--color-text); background: transparent; border: 1px solid var(--color-line);
  border-radius: var(--radius-pill); cursor: pointer; text-decoration: none;
  transition: background-color var(--dur-hover) var(--ease-in-out), color var(--dur-hover) var(--ease-in-out),
    border-color var(--dur-hover) var(--ease-in-out), outline-offset var(--dur-fast) var(--ease-out);
}
.chip:hover { background: var(--color-bg); text-decoration: none; }
.chip[aria-pressed="true"], .chip[aria-current="page"], .chip.is-on {
  background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); font-weight: var(--weight-semibold);
}
.chip[aria-disabled="true"] { background: transparent; border-style: dashed; color: var(--color-text-muted); cursor: not-allowed; }
.chip[aria-disabled="true"][aria-pressed="true"], .chip[aria-disabled="true"].is-on { border-color: var(--color-border-control); }
.chip-sm { padding: 5px 11px; font-size: 12.5px; }

/* Segmented control. A pill track on surface-2; the selected option is an
   ink-filled pill (15.1:1 against the track), so selection needs no ring or
   shadow. */
.seg { display: inline-flex; gap: 2px; padding: var(--space-1); background: var(--color-surface-2); border-radius: var(--radius-segment); }
/* 2 or 3 options: equal columns across the field. 4 or more: hug the content.
   On a phone, 3 or more scroll sideways rather than wrap. */
.seg:has(> .seg-opt:nth-child(2)):not(:has(> .seg-opt:nth-child(3))) {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; inline-size: 100%;
}
@media (min-width: 721px) {
  .seg:has(> .seg-opt:nth-child(3)):not(:has(> .seg-opt:nth-child(4))) {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; inline-size: 100%;
  }
}
.seg:has(> .seg-opt:nth-child(4)) { inline-size: fit-content; max-inline-size: 100%; }
@media (max-width: 720px) {
  .seg:has(> .seg-opt:nth-child(3)) {
    display: flex; flex-wrap: nowrap; inline-size: 100%; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    mask-image: linear-gradient(to right, transparent, #000 var(--space-1), #000 calc(100% - 24px), transparent);
  }
  .seg:has(> .seg-opt:nth-child(3))::-webkit-scrollbar { display: none; }
  .seg:has(> .seg-opt:nth-child(3)) > .seg-opt { flex: none; scroll-snap-align: start; }
}
.seg-opt {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px var(--space-4); min-inline-size: 72px; font-size: 15px; font-weight: var(--weight-semibold);
  color: var(--color-text-muted); cursor: pointer; min-height: var(--touch-min);
  border-radius: var(--radius-segment);
  transition: background-color var(--dur-fast) var(--ease-in-out), color var(--dur-fast) var(--ease-in-out),
    box-shadow var(--dur-fast) var(--ease-out), outline-offset var(--dur-fast) var(--ease-out);
}
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:checked) { background: var(--color-primary); color: var(--color-on-primary); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
/* Forced-colours mode drops background colours, so the selected segment
   would be indistinguishable. This is the one deliberate exception to
   "outline is only for focus" — it marks selection, not focus. */
@media (forced-colors: active) {
  .seg-opt:has(input:checked) { outline: 2px solid CanvasText; outline-offset: -2px; }
}

/* Boxed segmented control (.seg--box): equal columns inside one 1px line box on
   the control radius, no gaps; the selected option is an ink fill that fills
   its cell. For a short set where a pill track is too loud (the generator's
   panels). Options are .seg-opt labels over radios, or buttons with
   aria-pressed. A block of its own: do not combine it with .seg. */
.seg--box {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; inline-size: 100%;
  border: 1px solid var(--color-line); border-radius: var(--radius-control); overflow: hidden;
  background: transparent;
}
.seg--box > .seg-opt, .seg--box > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--touch-min); min-inline-size: 0; padding: 0 var(--space-3);
  border: 0; border-radius: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: var(--weight-semibold); color: var(--color-text-muted);
  transition: background-color var(--dur-hover) var(--ease-in-out), color var(--dur-hover) var(--ease-in-out),
    outline-offset var(--dur-fast) var(--ease-out);
}
.seg--box > .seg-opt:has(input:checked), .seg--box > button[aria-pressed="true"] {
  background: var(--color-primary); color: var(--color-on-primary);
}
.seg--box > .seg-opt:has(input:focus-visible) { outline-offset: -2px; }
.seg--box > button:disabled, .seg--box > .seg-opt:has(input:disabled) { color: var(--color-text-muted); cursor: not-allowed; opacity: .45; }

/* Disclosure. One chevron, 15px/600 summary, hover wash that keeps the text on
   the grid line. Opt in with class="disclosure" on the <summary>. The body
   reveals by height and opacity where the browser can animate it; elsewhere
   it opens instantly. */
summary { transition: background-color var(--dur-fast) var(--ease-in-out), outline-offset var(--dur-fast) var(--ease-out); }
details > summary.disclosure {
  display: flex; align-items: center; gap: var(--space-2); cursor: pointer; list-style: none;
  min-block-size: var(--touch-min); font-size: 15px; font-weight: var(--weight-semibold);
  padding-inline: var(--space-2); margin-inline: calc(-1 * var(--space-2));
  border-radius: var(--radius-control);
}
details > summary.disclosure::-webkit-details-marker { display: none; }
details > summary.disclosure:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
details > summary.disclosure::before {
  content: ""; flex: none; inline-size: 8px; block-size: 8px;
  border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease-out);
}
details[open] > summary.disclosure::before { transform: rotate(45deg); }
html[dir="rtl"] details:not([open]) > summary.disclosure::before { transform: rotate(135deg); }
details::details-content {
  block-size: 0; opacity: 0; overflow: clip;
  transition: block-size var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out),
    content-visibility var(--dur-base) allow-discrete;
}
details[open]::details-content { block-size: auto; opacity: 1; }

/* — cards —
   Cards must earn their existence. Prefer rules and layout. A card is a
   1px line border on the surface colour: no shadow. */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-6); border-radius: var(--radius-card);
  background: var(--color-surface); border: 1px solid var(--color-line);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); }
.card-title { font-family: var(--font-heading); font-weight: var(--weight-bold); font-size: 17px; line-height: 1.3; letter-spacing: -0.005em; }
.card-title--lg { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; }
.card-body { margin: 0; font-size: 14px; color: var(--color-text-muted); flex: 1; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--color-text-muted); }
.elev-1 { box-shadow: var(--shadow-1); }
.elev-2 { box-shadow: var(--shadow-2); }

/* — tags — */
.tag { display: inline-flex; align-items: center; font-size: 11px; letter-spacing: 0.02em; padding: 3px 10px; border-radius: var(--radius-pill); }
/* .tag-neutral and .tag-outline live in site/ui/components.css, after its .tag, so they win the cascade. */

/* A locked paid feature: a dashed border-control outline and room for a lock
   icon (an inline <svg> child, 14px). Never greyed out or hidden. Used only
   where the entitlement catalogue already locks the feature. */
.tag-lock {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: var(--weight-semibold); line-height: 1.2;
  padding: 3px 10px 3px 8px; border-radius: var(--radius-pill);
  border: 1.5px dashed var(--color-border-control); color: var(--color-text);
}
.tag-lock svg { flex: none; inline-size: 14px; block-size: 14px; }

/* The Live indicator — the one place signal green may appear: an 8px dot
   with a 4px halo, and the word "Live" in green beside it. No chip
   background (the green word never sits on surface-2: 4.41:1). See DESIGN-1. */
.badge-live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: var(--weight-semibold);
  color: var(--color-signal);
}
.badge-live::before {
  content: ""; width: 8px; height: 8px; flex: none;
  border-radius: 50%; background: var(--color-signal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-signal) 16%, transparent);
}

/* An 8px status dot, for use outside the Live indicator. Green with a halo
   only while a code is working; grace is rust, lapsed a hollow muted ring, and
   a link with no claim (the footer's Service status) a plain muted dot. The
   word beside it carries the meaning, never the colour alone. Never red. */
.status-dot {
  display: inline-block; width: 8px; height: 8px; flex: none;
  border-radius: 50%; background: var(--color-signal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-signal) 16%, transparent);
}
.status-dot--muted { background: var(--color-text-muted); box-shadow: none; }
.status-dot--grace { background: var(--color-rust); box-shadow: none; }
.status-dot--lapsed { background: transparent; border: 1.5px solid var(--color-text-muted); box-sizing: border-box; box-shadow: none; }

/* — the highlighter —
   .mark is a solid stroke behind a marked word (radius .08em); .hl is the same
   as a band over 74% of the line, like a pen stroke, italic 700 in a heading.
   Both wrap across lines (clone) and keep ink text. .mark--chip is a solid
   chip for a version or label, .mark--pill a pill for a number or a count.
   .mark--tag is kept as the old name of the chip. The only places the
   highlighter appears besides .btn-highlight (DESIGN-1c). */
.mark {
  background: var(--color-highlight); color: var(--color-on-highlight);
  font-style: inherit; padding: 0 .12em; margin: 0 -.04em; border-radius: .08em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hl {
  background: linear-gradient(var(--color-highlight), var(--color-highlight)) no-repeat 0 72% / 100% 74%;
  color: var(--color-on-highlight);
  padding: 0 .12em; margin: 0 -.04em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
h1 .hl, h2 .hl, h3 .hl, .display .hl, .section-title .hl { font-style: italic; font-weight: var(--weight-bold); }
.mark--chip, .mark--tag {
  display: inline-block; background: var(--color-highlight); color: var(--color-on-highlight);
  font-size: 13px; font-weight: var(--weight-semibold); line-height: 1.4;
  padding: 2px 10px; margin: 0; border-radius: var(--radius-mark);
}
.mark--pill {
  display: inline-flex; align-items: center; justify-content: center; background: var(--color-highlight); color: var(--color-on-highlight);
  font-size: 13px; font-weight: var(--weight-semibold); line-height: 1.4;
  padding: 2px 12px; margin: 0; border-radius: var(--radius-pill);
}

/* — navigation — */
.nav { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-line); flex-wrap: wrap; }
.nav-brand { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: 18px; margin-right: auto; }
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-text); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 13px; font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  padding: var(--space-2); border-bottom: 1px solid var(--color-line);
}
.table td { padding: var(--space-2); border-bottom: 1px solid var(--color-line); }
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: var(--space-4); background: var(--color-backdrop); }
.dialog { width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-card); background: var(--color-surface); box-shadow: var(--shadow-2); }
.dialog-title { font-family: var(--font-heading); font-weight: var(--weight-bold); font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; }
.dialog-body { font-size: 14px; color: var(--color-text-muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* — QR plate —
   The QR symbol's own ground: pure white in both modes, never themed. In
   dark mode it is the brightest object on screen, with a 1px white edge; that
   is intended. */
.qr-plate { background: var(--color-qr-plate); border-radius: var(--radius-plate); box-shadow: var(--shadow-plate); }

/* — dark panel —
   A dark band inside the light page. Inside it use .btn-inverse for the
   action (an ink button would vanish) and the muted/line colours below. */
.panel-dark {
  background: var(--color-band); color: var(--color-on-band);
  border-radius: var(--radius-panel); padding: var(--space-8);
}
.panel-dark .text-muted, .panel-dark .eyebrow { color: var(--color-band-muted); }
.panel-dark .hr, .panel-dark .rule-soft { background: var(--color-band-line); border-color: var(--color-band-line); }
.panel-dark a:not(.btn) { color: inherit; }
.panel-dark :focus-visible { outline-color: var(--color-on-band); }
