/* =============================================================================================
   Apni Kalam · "Ink and paper" design system
   ---------------------------------------------------------------------------------------------
   One bundled font (Noto Sans Devanagari, variable wght 100-900 / wdth 62.5-100), system mono,
   CSS-mask icons from inline SVG data URIs. No network assets.

   Three token families that NEVER read each other:
     1. Staff tokens   (--paper, --ink, ...)        setup, teacher, answer-sheet chrome, pause console
     2. Exam text pair (--x-bg, --x-fg, ...)        the student's AAA screen, per theme
     3. Exam state     (--st-listen, ...)           fixed per theme, same in yellow + white themes
   Staff contrast: text >= 4.5:1, field borders / focus >= 3:1 (tools/palette.py checks all pairs).
   Exam contrast: every text pair >= 7:1.
   ============================================================================================= */

@font-face {
  font-family: "Noto Sans Devanagari";
  src: url("../fonts/NotoSansDevanagari.ttf") format("truetype");
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-display: swap;
}

/* ---------------------------------------------------------------- 1. staff tokens: light */
:root {
  /* paper */
  --paper:        #F7F2E7;   /* page: warm exam-board paper */
  --paper-card:   #FFFCF6;   /* cards: a fresh sheet on the desk */
  --paper-sunk:   #F0E9DA;   /* wells, code, previews */
  --paper-raise:  #FFFFFF;
  --rule:         #E3D9C6;   /* hairlines (decorative, not a boundary) */
  --rule-strong:  #CFC2AA;
  --field-line:   #8A7F6B;   /* 3.85:1 on card: real field boundary */

  /* ink */
  --ink:          #141C44;   /* deep indigo-navy: text, primary buttons */
  --ink-2:        #363D68;   /* secondary text 10.1:1 */
  --ink-3:        #585D7C;   /* muted text 6.3:1 card / 5.3:1 sunk */
  --ink-on:       #FFFCF6;   /* text on an ink fill */

  /* marigold & saffron */
  --marigold:     #F2A60C;   /* fills only, with ink text (8:1) */
  --marigold-2:   #E09400;   /* hover */
  --marigold-tint:#FCEFD0;
  --saffron:      #9E4A00;   /* accent TEXT on paper 6:1 */

  /* signal */
  --ok:           #16703E;   --ok-tint:   #E2F1E6;
  --warn:         #875000;   --warn-tint: #FBEED2;
  --bad:          #B0241C;   --bad-tint:  #FAE3E0;
  --info:         #2B3FA0;   --info-tint: #E6E9F7;

  --focus:        #C25700;   /* saffron ring, 4.4:1 on card */

  /* type */
  --font: "Noto Sans Devanagari", "Nirmala UI", "Mangal", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --t-12: 12.5px; --t-13: 13.5px; --t-14: 14.5px; --t-16: 16px; --t-18: 18px;
  --t-20: 20px; --t-24: 24px; --t-30: 30px; --t-40: 40px;
  --lh-tight: 1.25; --lh: 1.55; --lh-deva: 1.65;

  /* space (4px grid) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  /* shape */
  --r-1: 6px; --r-2: 10px; --r-3: 14px; --r-pill: 999px;
  --shadow-1: 0 1px 0 rgba(20, 28, 68, .04), 0 1px 2px rgba(20, 28, 68, .06);
  --shadow-2: 0 1px 0 rgba(20, 28, 68, .04), 0 6px 18px -6px rgba(20, 28, 68, .16);
  --shadow-3: 0 18px 48px -12px rgba(12, 18, 48, .38);
  --shadow-up: 0 -10px 24px -14px rgba(20, 28, 68, .28);

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-1: 120ms; --dur-2: 220ms;

  /* chevron for selects (stroke = --ink) */
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141C44' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* ---------------------------------------------------------------- 1b. staff tokens: dark ("ink-well") */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C1230; --paper-card: #141B3D; --paper-sunk: #0A0F28; --paper-raise: #1A2248;
    --rule: #263063; --rule-strong: #34407A; --field-line: #7F87B0;
    --ink: #F4EDDF; --ink-2: #D3CFDD; --ink-3: #ADAAC2; --ink-on: #0C1230;
    --marigold: #F5B53F; --marigold-2: #F8C463; --marigold-tint: #2A2A3A; --saffron: #F5B53F;
    --ok: #63D69C; --ok-tint: #12302A; --warn: #F5B53F; --warn-tint: #2C2717;
    --bad: #FF9289; --bad-tint: #3A1C25; --info: #A9B6FF; --info-tint: #1C2552;
    --focus: #F5B53F;
    --shadow-1: 0 1px 0 rgba(0,0,0,.25); --shadow-2: 0 8px 22px -8px rgba(0,0,0,.55);
    --shadow-3: 0 18px 48px -10px rgba(0,0,0,.7); --shadow-up: 0 -10px 24px -12px rgba(0,0,0,.6);
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F4EDDF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0C1230; --paper-card: #141B3D; --paper-sunk: #0A0F28; --paper-raise: #1A2248;
  --rule: #263063; --rule-strong: #34407A; --field-line: #7F87B0;
  --ink: #F4EDDF; --ink-2: #D3CFDD; --ink-3: #ADAAC2; --ink-on: #0C1230;
  --marigold: #F5B53F; --marigold-2: #F8C463; --marigold-tint: #2A2A3A; --saffron: #F5B53F;
  --ok: #63D69C; --ok-tint: #12302A; --warn: #F5B53F; --warn-tint: #2C2717;
  --bad: #FF9289; --bad-tint: #3A1C25; --info: #A9B6FF; --info-tint: #1C2552;
  --focus: #F5B53F;
  --shadow-1: 0 1px 0 rgba(0,0,0,.25); --shadow-2: 0 8px 22px -8px rgba(0,0,0,.55);
  --shadow-3: 0 18px 48px -10px rgba(0,0,0,.7); --shadow-up: 0 -10px 24px -12px rgba(0,0,0,.6);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F4EDDF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* ---------------------------------------------------------------- 2. base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-16);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; }
:lang(hi) { line-height: var(--lh-deva); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--marigold-tint); color: var(--ink); }
a { color: var(--ink); text-decoration-color: var(--saffron); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--saffron); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.hi { color: var(--ink-3); font-weight: 500; }
kbd {
  font-family: var(--mono); font-size: .82em; font-weight: 600;
  display: inline-block; min-width: 1.9em; text-align: center;
  padding: .05em .45em; border-radius: 5px;
  border: 1px solid var(--rule-strong); border-bottom-width: 2.5px;
  background: var(--paper-card); color: var(--ink); line-height: 1.5;
}

/* Small-caps eyebrow: caps + tracking only on Latin, never on Devanagari. */
.eyebrow { font-size: var(--t-12); font-weight: 700; color: var(--ink-3); line-height: 1.4; }
.eyebrow :lang(en), .eyebrow:lang(en) { text-transform: uppercase; letter-spacing: .09em; }
.eyebrow :lang(hi) { font-size: 1.08em; font-weight: 600; letter-spacing: 0; }
.eyebrow .sep { margin: 0 .4em; color: var(--rule-strong); }

/* ---------------------------------------------------------------- 3. icons (CSS masks) */
.ico {
  display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: -.25em;
  background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.i-check   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M7.6 12.4l3 3 5.9-6.2'/%3E%3C/svg%3E"); }
.i-tick    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.6l4.4 4.4L19 7.4'/%3E%3C/svg%3E"); }
.i-wait    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 3h11M6.5 21h11M7.5 3v2.2c0 3.2 4.5 4.3 4.5 6.8s-4.5 3.6-4.5 6.8V21M16.5 3v2.2c0 3.2-4.5 4.3-4.5 6.8s4.5 3.6 4.5 6.8V21'/%3E%3Cpath d='M9.5 18.5h5' stroke-width='2.6'/%3E%3C/svg%3E"); }
.i-alert   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7v6.2M12 16.6v.2'/%3E%3C/svg%3E"); }
.i-warn    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2l9.6 16.9H2.4z'/%3E%3Cpath d='M12 9.6v4.6M12 17.1v.2'/%3E%3C/svg%3E"); }
.i-info    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 11v6M12 7.4v.2'/%3E%3C/svg%3E"); }
.i-mic     { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2.8' width='6' height='11.4' rx='3'/%3E%3Cpath d='M5.4 11a6.6 6.6 0 0 0 13.2 0M12 17.6V21M8.5 21h7'/%3E%3C/svg%3E"); }
.i-speaker { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 9.2v5.6h3.8l5.2 4.4V4.8L7.3 9.2z'/%3E%3Cpath d='M16 9.3a3.8 3.8 0 0 1 0 5.4M18.6 6.6a7.6 7.6 0 0 1 0 10.8'/%3E%3C/svg%3E"); }
.i-hush    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 9.2v5.6h3.8l5.2 4.4V4.8L7.3 9.2z'/%3E%3Cpath d='M16 9.5l5 5M21 9.5l-5 5'/%3E%3C/svg%3E"); }
.i-bubble  { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4.5h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-9l-5 4v-4H4a1 1 0 0 1-1-1v-10a1 1 0 0 1 1-1z'/%3E%3Cpath d='M8 9.2h8M8 12.6h5'/%3E%3C/svg%3E"); }
.i-ask     { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12.5l4 4 6.5-7'/%3E%3Cpath d='M15.6 8.6a2.9 2.9 0 1 1 4.2 2.6c-.8.4-1.3 1-1.3 1.9v.6M18.5 16.8v.2'/%3E%3C/svg%3E"); }
.i-pause   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Crect x='6' y='4.5' width='4.2' height='15' rx='1.2'/%3E%3Crect x='13.8' y='4.5' width='4.2' height='15' rx='1.2'/%3E%3C/svg%3E"); }
.i-lock    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='10.5' width='15' height='10.5' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3M12 14.6v2.4'/%3E%3C/svg%3E"); }
.i-clock   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.3'/%3E%3Cpath d='M12 7v5.2l3.4 2.1'/%3E%3C/svg%3E"); }
.i-clock-off { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.3'/%3E%3Crect x='9' y='9' width='6' height='6' rx='.8' fill='black'/%3E%3C/svg%3E"); }
.i-play    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M7.5 4.6v14.8a.8.8 0 0 0 1.2.7l11.6-7.4a.8.8 0 0 0 0-1.4L8.7 3.9a.8.8 0 0 0-1.2.7z'/%3E%3C/svg%3E"); }
.i-stop    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Crect x='5.5' y='5.5' width='13' height='13' rx='2'/%3E%3C/svg%3E"); }
.i-up      { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E"); }
.i-down    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M6 13l6 6 6-6'/%3E%3C/svg%3E"); }
.i-trash   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5h16M9.5 6.5V4.2h5v2.3M6.2 6.5l.9 13.3h9.8l.9-13.3M10 10.5v5.6M14 10.5v5.6'/%3E%3C/svg%3E"); }
.i-dots    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='5' cy='12' r='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='19' cy='12' r='2'/%3E%3C/svg%3E"); }
.i-plus    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.i-arrow   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
.i-print   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 8.5V3.5h10v5M7 17H4.5V10a1.5 1.5 0 0 1 1.5-1.5h12a1.5 1.5 0 0 1 1.5 1.5v7H17'/%3E%3Crect x='7' y='13.5' width='10' height='7' rx='1'/%3E%3C/svg%3E"); }
.i-search  { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5l5 5'/%3E%3C/svg%3E"); }
.i-paste   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4.5' width='14' height='17' rx='2'/%3E%3Cpath d='M9 4.5V3h6v1.5M8.5 10h7M8.5 13.5h7M8.5 17h4.5'/%3E%3C/svg%3E"); }
.i-doc     { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8.5L19 7.5V21H6z'/%3E%3Cpath d='M14 3v5h5M9 12.5h7M9 16h7'/%3E%3C/svg%3E"); }
.i-shield  { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8l8 3v6.1c0 4.6-3.3 8.1-8 9.4-4.7-1.3-8-4.8-8-9.4V5.8z'/%3E%3Cpath d='M8.4 12.1l2.6 2.6 4.8-5'/%3E%3C/svg%3E"); }
.i-user    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 20.5c1-4 4-6 7.5-6s6.5 2 7.5 6'/%3E%3C/svg%3E"); }
.i-key     { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='7' width='19' height='10' rx='2.2'/%3E%3Cpath d='M7 13.5h10'/%3E%3C/svg%3E"); }
.i-wave    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'%3E%3Cpath d='M4 10v4M8 7v10M12 4v16M16 8v8M20 10.5v3'/%3E%3C/svg%3E"); }
.i-wifi-off{ --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8.8a14 14 0 0 1 19 0M5.6 12.2a9.5 9.5 0 0 1 12.8 0M8.8 15.5a5 5 0 0 1 6.4 0M12 19.3v.2M3 3l18 18'/%3E%3C/svg%3E"); }
.i-save    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h12.5L20 7.5V20H4z'/%3E%3Cpath d='M8 4v5h7V4M8 20v-6h8v6'/%3E%3C/svg%3E"); }
.i-chev    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.i-tap     { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3C/svg%3E"); }
.i-dtap    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Ccircle cx='6.5' cy='12' r='4.3'/%3E%3Ccircle cx='17.5' cy='12' r='4.3'/%3E%3C/svg%3E"); }
.i-hold    { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Crect x='1.5' y='8' width='21' height='8' rx='4'/%3E%3C/svg%3E"); }
.i-headset { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15v-3a8 8 0 0 1 16 0v3'/%3E%3Crect x='3' y='14' width='4.5' height='6.5' rx='1.5'/%3E%3Crect x='16.5' y='14' width='4.5' height='6.5' rx='1.5'/%3E%3C/svg%3E"); }
.i-sheet   { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4.5' y='3' width='15' height='18' rx='1.6'/%3E%3Cpath d='M8 7.5h8M8 11h8M8 14.5h5M4.5 17.5h15'/%3E%3C/svg%3E"); }

/* ---------------------------------------------------------------- 4. logomark + brand lockup */
/* The mark is inline SVG (see any page): an ink seal holding a paper nib with a marigold breather hole. */
.mark { width: 36px; height: 36px; flex: none; }
.mark .seal { fill: var(--ink); }
.mark .nib { fill: var(--paper-card); }
.mark .slit { stroke: var(--ink); }
.mark .hole { fill: var(--marigold); }
.brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.wordmark { display: flex; align-items: baseline; gap: .5em; font-size: var(--t-20); line-height: 1.2; white-space: nowrap; }
.wordmark .en { font-weight: 750; font-stretch: 92%; letter-spacing: -.012em; }
.wordmark .hi { font-weight: 650; color: var(--saffron); line-height: 1.2; }
.wordmark .bar { width: 1.5px; height: .95em; background: var(--rule-strong); align-self: center; }

/* ---------------------------------------------------------------- 5. app bar + tabs */
.appbar {
  position: relative; z-index: 5;
  background: var(--paper-card);
  border-bottom: 1px solid var(--rule);
}
.appbar::after { /* editorial double rule */
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
  border-bottom: 1px solid var(--rule); pointer-events: none;
}
.appbar-in { max-width: 1280px; margin: 0 auto; padding: 0 var(--s-6); min-height: 64px; display: flex; align-items: center; gap: var(--s-8); }
.tabs { display: flex; align-self: stretch; gap: var(--s-1); }
.tab {
  position: relative; display: flex; align-items: center; gap: .5em; padding: 0 var(--s-3);
  text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: var(--t-14); white-space: nowrap;
}
.tab .hi { font-size: .95em; color: var(--ink-3); font-weight: 500; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::after {
  content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -1px; height: 3px;
  background: var(--marigold); border-radius: 3px 3px 0 0;
}
.appbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); color: var(--ink-3); font-size: var(--t-13); }

/* ---------------------------------------------------------------- 6. cards + step headers */
.card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: var(--s-6); }
.card-sunk { background: var(--paper-sunk); border: 1px solid var(--rule); border-radius: var(--r-2); }

.step { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-4); align-items: baseline; }
.step-n {
  font-size: var(--t-30); font-weight: 300; font-stretch: 85%; line-height: 1; color: var(--saffron);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; min-width: 1.4em;
}
.step-t { font-size: var(--t-20); font-weight: 700; line-height: 1.3; letter-spacing: -.005em; }
.step-t .hi { font-weight: 600; margin-left: .35em; }
.step-d { grid-column: 2; color: var(--ink-3); font-size: var(--t-14); margin-top: 2px; }

/* ---------------------------------------------------------------- 7. buttons */
.btn {
  --b-bg: var(--paper-card); --b-fg: var(--ink); --b-line: var(--field-line);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 44px; padding: 0 var(--s-4);
  border: 1.5px solid var(--b-line); border-radius: var(--r-2);
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 650; font-size: var(--t-14); line-height: 1.2; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:hover { --b-bg: var(--paper-sunk); color: var(--b-fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; --b-bg: var(--paper-sunk); --b-fg: var(--ink-3); --b-line: var(--rule-strong); transform: none; }
.btn .ico { width: 1.2em; height: 1.2em; }
.btn-primary   { --b-bg: var(--ink); --b-fg: var(--ink-on); --b-line: var(--ink); }
.btn-primary:hover { --b-bg: var(--ink-2); --b-line: var(--ink-2); }
.btn-accent    { --b-bg: var(--marigold); --b-fg: #141C44; --b-line: var(--marigold); }
.btn-accent:hover { --b-bg: var(--marigold-2); --b-line: var(--marigold-2); }
.btn-secondary { /* default look */ }
.btn-ghost     { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: var(--paper-sunk); }
.btn-danger    { --b-fg: var(--bad); --b-line: var(--bad); }
.btn-danger:hover { --b-bg: var(--bad-tint); }
.btn-danger-solid { --b-bg: var(--bad); --b-fg: #FFFCF6; --b-line: var(--bad); }
.btn-sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--t-13); border-radius: var(--r-1); }
.btn-lg { min-height: 56px; padding: 0 var(--s-6); font-size: var(--t-18); font-weight: 750; border-radius: var(--r-3); }
.btn-xl { min-height: 64px; padding: 0 var(--s-6); font-size: var(--t-20); font-weight: 750; border-radius: var(--r-3); width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn .kbd-hint { font-weight: 500; opacity: .8; font-size: .9em; }

/* ---------------------------------------------------------------- 8. fields */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 650; font-size: var(--t-14); color: var(--ink); line-height: 1.4; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45em; }
.label .hi, .field > label .hi { font-weight: 500; color: var(--ink-3); }
.label .opt, .field > label .opt { font-weight: 500; color: var(--ink-3); font-size: var(--t-13); }
.hint { color: var(--ink-3); font-size: var(--t-13); line-height: 1.5; }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea, .select {
  width: 100%; min-height: 46px;
  padding: 10px 12px;
  background: var(--paper-raise);
  border: 1.5px solid var(--field-line);
  border-radius: var(--r-2);
  color: var(--ink);
  font-size: var(--t-16); line-height: 1.45;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); opacity: .85; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-2); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .input:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-color: var(--ink);
}
.field select, select.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  text-overflow: ellipsis;
}
.field textarea { resize: vertical; min-height: 0; }
.field input[type="number"] { font-variant-numeric: tabular-nums; }
.field[aria-invalid="true"] input, .field.invalid input, .field.invalid select { border-color: var(--bad); border-width: 2px; }
.field-msg { display: flex; gap: 6px; align-items: flex-start; font-size: var(--t-13); font-weight: 600; }
.field-msg[data-tone="bad"] { color: var(--bad); }
.field-msg[data-tone="ok"] { color: var(--ok); }
.field-msg[data-tone="warn"] { color: var(--warn); }
.field-msg .ico { width: 1.15em; height: 1.15em; margin-top: .12em; }
.from-paper { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-12); font-weight: 650; color: var(--saffron); }

/* ---------------------------------------------------------------- 9. choice cards (radio) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-3); }
.choice { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s-3); padding: var(--s-4); border: 1.5px solid var(--field-line); border-radius: var(--r-3); background: var(--paper-raise); cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field-line); margin-top: 2px; display: grid; place-items: center; background: var(--paper-raise); }
.choice .c-t { font-weight: 700; line-height: 1.35; }
.choice .c-t .hi { font-weight: 600; }
.choice .c-d { grid-column: 2; color: var(--ink-3); font-size: var(--t-13); }
.choice .c-tag { grid-column: 2; justify-self: start; margin-top: 4px; }
.choice:has(input:checked) { border-color: var(--ink); border-width: 2px; padding: calc(var(--s-4) - .5px); background: color-mix(in srgb, var(--marigold-tint) 55%, var(--paper-raise)); box-shadow: inset 4px 0 0 var(--marigold); }
.choice:has(input:checked) .radio { border-color: var(--ink); }
.choice:has(input:checked) .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- 10. tags, chips, status rows */
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: var(--r-pill); font-size: var(--t-12); font-weight: 700; line-height: 1;
  background: var(--paper-sunk); color: var(--ink-2); border: 1px solid var(--rule-strong); white-space: nowrap;
}
.tag:lang(en), .tag :lang(en) { letter-spacing: .02em; }
.tag .ico { width: 14px; height: 14px; }
.tag[data-tone="ok"]   { background: var(--ok-tint);   color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.tag[data-tone="warn"] { background: var(--warn-tint); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.tag[data-tone="bad"]  { background: var(--bad-tint);  color: var(--bad);  border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.tag[data-tone="info"] { background: var(--info-tint); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.tag[data-tone="sample"] { background: var(--marigold-tint); color: var(--saffron); border: 1px dashed var(--saffron); }

/* Status chip: icon + word, never colour alone. */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 12px 3px 8px; border-radius: var(--r-pill); font-size: var(--t-13); font-weight: 650; background: var(--paper-sunk); color: var(--ink-2); border: 1px solid var(--rule-strong); }
.chip[data-tone="ok"]   { background: var(--ok-tint);   color: var(--ok); }
.chip[data-tone="warn"], .chip[data-tone="wait"] { background: var(--warn-tint); color: var(--warn); }
.chip[data-tone="bad"]  { background: var(--bad-tint);  color: var(--bad); }

/* Checklist rows (these are the JS .pill items: .dot = icon by data-tone, .txt = JS text). */
.checklist { display: grid; gap: 2px; }
.pill { display: grid; grid-template-columns: 28px 1fr auto; gap: 2px var(--s-3); align-items: start; padding: 9px 0; border-bottom: 1px dashed var(--rule); }
.pill:last-child { border-bottom: 0; }
.pill .dot {
  width: 22px; height: 22px; margin-top: 1px; background: var(--ink-3);
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat;
}
.pill[data-tone="ok"]   .dot { background: var(--ok);   --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3Cmask id='m'%3E%3Crect width='24' height='24' fill='white'/%3E%3Cpath d='M7.4 12.4l3.1 3.1 6.1-6.4' stroke='black' stroke-width='2.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3C/defs%3E%3Ccircle cx='12' cy='12' r='11' mask='url(%23m)'/%3E%3C/svg%3E"); }
.pill[data-tone="wait"] .dot { background: var(--warn); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 3h11M6.5 21h11M7.5 3v2.2c0 3.2 4.5 4.3 4.5 6.8s-4.5 3.6-4.5 6.8V21M16.5 3v2.2c0 3.2-4.5 4.3-4.5 6.8s4.5 3.6 4.5 6.8V21'/%3E%3Cpath d='M9.5 18.5h5' stroke-width='2.6'/%3E%3C/svg%3E"); }
.pill[data-tone="warn"] .dot { background: var(--warn); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3Cmask id='m'%3E%3Crect width='24' height='24' fill='white'/%3E%3Cpath d='M12 9.4v4.8M12 17.2v.2' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3C/mask%3E%3C/defs%3E%3Cpath d='M12 1.8l11 19.4H1z' mask='url(%23m)' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pill[data-tone="bad"]  .dot { background: var(--bad);  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3Cmask id='m'%3E%3Crect width='24' height='24' fill='white'/%3E%3Cpath d='M8 8l8 8M16 8l-8 8' stroke='black' stroke-width='2.6' stroke-linecap='round'/%3E%3C/mask%3E%3C/defs%3E%3Ccircle cx='12' cy='12' r='11' mask='url(%23m)'/%3E%3C/svg%3E"); }
.pill[data-tone="todo"] .dot { background: var(--ink-3); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-dasharray='3.2 2.6'%3E%3Ccircle cx='12' cy='12' r='9.8'/%3E%3C/svg%3E"); }
.pill .txt { font-weight: 650; line-height: 1.4; }
.pill .sub { grid-column: 2 / -1; color: var(--ink-3); font-size: var(--t-13); line-height: 1.45; }
.pill .act { grid-row: 1; grid-column: 3; }
.pill[data-tone="bad"] .sub { color: var(--bad); }

/* ---------------------------------------------------------------- 11. notes, banners, toasts */
.note { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s-3); align-items: start; padding: var(--s-3) var(--s-4); border-radius: var(--r-2); border: 1px solid var(--rule-strong); background: var(--paper-sunk); font-size: var(--t-14); }
.note:empty { display: none; }
.note > .ico { margin-top: .15em; }
.note b { font-weight: 700; }
.note[data-tone="ok"]   { background: var(--ok-tint);   border-color: color-mix(in srgb, var(--ok) 40%, transparent);   color: var(--ink); }
.note[data-tone="ok"] > .ico { color: var(--ok); }
.note[data-tone="warn"] { background: var(--warn-tint); border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--ink); }
.note[data-tone="warn"] > .ico { color: var(--warn); }
.note[data-tone="bad"]  { background: var(--bad-tint);  border-color: color-mix(in srgb, var(--bad) 45%, transparent);  color: var(--ink); }
.note[data-tone="bad"] > .ico { color: var(--bad); }
.note[data-tone="info"] { background: var(--info-tint); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.note[data-tone="info"] > .ico { color: var(--info); }

.toast { position: fixed; left: 50%; bottom: var(--s-6); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: var(--s-3); padding: 10px 10px 10px 16px; border-radius: var(--r-2); background: var(--ink); color: var(--ink-on); box-shadow: var(--shadow-3); font-weight: 600; font-size: var(--t-14); }
.toast .btn { --b-bg: transparent; --b-fg: var(--ink-on); --b-line: color-mix(in srgb, var(--ink-on) 40%, transparent); min-height: 34px; }

/* The online-demo warning: honest, loud, never hidden. */
.banner { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px var(--s-4); background: var(--bad); color: #FFFCF6; font-weight: 700; font-size: var(--t-14); text-align: center; }

/* ---------------------------------------------------------------- 12. tables */
.table { width: 100%; border-collapse: collapse; font-size: var(--t-14); }
.table th { text-align: left; font-size: var(--t-12); font-weight: 700; color: var(--ink-3); padding: 8px 10px; border-bottom: 2px solid var(--ink); }
.table th:lang(en), .table thead:lang(en) th { text-transform: uppercase; letter-spacing: .07em; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 1px solid var(--rule-strong); }
.table .num, .table .t { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- 13. level meter (mic test) */
.meter { position: relative; height: 18px; border-radius: var(--r-pill); background: var(--paper-sunk); border: 1.5px solid var(--field-line); overflow: hidden; }
.meter-zones { position: absolute; inset: 0; display: grid; grid-template-columns: 30% 35% 35%; }
.meter-zones span { border-right: 1.5px dashed color-mix(in srgb, var(--ink-3) 55%, transparent); }
.meter-zones span:last-child { border-right: 0; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, var(--marigold))); border-radius: inherit; transition: width 80ms linear; }
.meter-floor { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--ink); border-radius: 2px; }
.meter-scale { display: grid; grid-template-columns: 30% 35% 35%; font-size: var(--t-12); color: var(--ink-3); font-weight: 600; margin-top: 4px; }
.meter-scale span { padding-left: 4px; }

/* ---------------------------------------------------------------- 14. menus (details) */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 6px; background: var(--paper-raise); border: 1px solid var(--rule-strong); border-radius: var(--r-2); box-shadow: var(--shadow-3); display: grid; }
.menu-pop .btn { justify-content: flex-start; --b-line: transparent; --b-bg: transparent; width: 100%; font-weight: 600; }
.menu-pop .btn:hover { --b-bg: var(--paper-sunk); }
.menu-pop hr { border: 0; border-top: 1px solid var(--rule); margin: 4px 0; }

/* ---------------------------------------------------------------- 15. disclosure */
details.disclose > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s-3); }
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary .chev { transition: transform var(--dur-2) var(--ease); }
details.disclose[open] > summary .chev { transform: rotate(180deg); }

/* =============================================================================================
   EXAM THEMES. Applied on #exam (.exam) and on #screen-preview. Never used by staff screens.
   --x-*  text pair + surfaces for the student, per theme
   --st-* one colour per state, fixed per theme (identical in yellow + white so a code learned
          on one student's screen reads the same on the next)
   --stf-* the invigilator strip + pause console: fixed staff tokens, never the exam text pair
   ============================================================================================= */
.exam, .screen-preview {
  --exam-size: 36px;
  --x-bg: #000; --x-fg: #FFD400; --x-strong: #FFFFFF; --x-muted: #C8C8C8;
  --x-card: #121212; --x-card-line: #8A8A8A; --x-rule: #6E6E6E;
  --x-pend: #FFAB00; --x-pend-bg: #1A1200; --x-unsure: #FFAB00;
  --st-listen: #3DDC84; --st-speak: #7CC4FF; --st-confirm: #FFAB00; --st-think: #D3AEFF;
  --st-work: #E4E4E4; --st-paused: #FF8A80; --st-calib: #FFFFFF; --st-ink: #000;   /* text on a solid state fill */
  --stf-bg: #15171C; --stf-fg: #ECECEC; --stf-muted: #B9BCC4; --stf-line: #5A5F6B;
  --stf-ok: #63D69C; --stf-bad: #FF9289; --stf-warn: #F5B53F;
  --st: var(--st-speak);
}
.exam[data-theme="white"], .screen-preview[data-theme="white"] {
  --x-fg: #FFFFFF; --x-strong: #FFFFFF; --x-muted: #C8C8C8;
}
.exam[data-theme="light"], .screen-preview[data-theme="light"] {
  --x-bg: #FFFFFF; --x-fg: #000000; --x-strong: #000000; --x-muted: #3D3D3D;
  --x-card: #F4F4F4; --x-card-line: #6B6B6B; --x-rule: #6B6B6B;
  --x-pend: #7A3E00; --x-pend-bg: #FFF4E0; --x-unsure: #7A3E00;
  --st-listen: #00602F; --st-speak: #0A4A94; --st-confirm: #7A3E00; --st-think: #56289A;
  --st-work: #333333; --st-paused: #9C1219; --st-calib: #000000; --st-ink: #FFFFFF;
  --stf-bg: #ECEAE4; --stf-fg: #141414; --stf-muted: #3F3F46; --stf-line: #8A8578;
  --stf-ok: #16703E; --stf-bad: #B0241C; --stf-warn: #875000;
}
.exam[data-size="36"] { --exam-size: 36px; }
.exam[data-size="48"] { --exam-size: 48px; }
.exam[data-size="64"] { --exam-size: 64px; }

/* State -> colour, driven only by the existing #badge[data-state] (no new JS). */
.exam:has(#badge[data-state="LISTENING"])      { --st: var(--st-listen); }
.exam:has(#badge[data-state="PRACTICE"])       { --st: var(--st-listen); }
.exam:has(#badge[data-state="SPEAKING"])       { --st: var(--st-speak); }
.exam:has(#badge[data-state="CONFIRMING"]),
.exam:has(#badge[data-state="CONFIRM_ACTION"]) { --st: var(--st-confirm); }
.exam:has(#badge[data-state="THINKING"])       { --st: var(--st-think); }
.exam:has(#badge[data-state="WORKING"])        { --st: var(--st-work); }
.exam:has(#badge[data-state="PAUSED"])         { --st: var(--st-paused); }
.exam:has(#badge[data-state="CALIBRATING"])    { --st: var(--st-calib); }
.exam:has(#badge[data-state="FINISHED"])       { --st: var(--st-work); }

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; }
  *, *::before, *::after { animation: none !important; transition-duration: 0ms !important; scroll-behavior: auto !important; }
}

/* the static online demo's note (online-note.js): its link reads as a link on both looks */
.appbar-end a, .k-foot a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
