/* HELEN IELTS – design tokens: the one source of truth for spacing, type, colour roles, radius, shadow, control
   heights and focus (design system, phase 2, 01/11/2026; guide: ielts-eclass-docs/docs/design-system.md).
   Loaded by assets/app.css and assets/exam.css (@import, first line) and linked by index.html (the exam room keeps its
   own inline styles). Colours are today's brand colours; values that failed WCAG AA were changed here (see the guide).
   Below the tokens: a tiny shared base every page gets (focus ring, .sr-only, reduced motion). Components (buttons,
   dialogs…) live in app.css / exam.css and read these tokens. Old names (--ink, --brand, --line…) stay in app.css as
   aliases, so nothing written before has to change. */
:root {
  /* spacing (4-point scale) */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;

  /* type: families, sizes, line heights, weights */
  --font-sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-mono: 'IBM Plex Mono', Consolas, ui-monospace, monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-base: 15px; --fs-lg: 16px; --fs-xl: 18px; --fs-2xl: 20px; --fs-3xl: 24px; --fs-4xl: 30px; --fs-5xl: 32px;
  --lh-tight: 1.2; --lh-snug: 1.35; --lh-base: 1.5; --lh-read: 1.6;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;

  /* long reading text (passages, transcripts, essays): a book serif, a comfortable size and line, a readable measure.
     --read-scale is set by the A− / A+ control (assets/js/text-size.js, the exam room's Text A button) */
  --read-font: var(--font-serif);
  --read-size: 18px;
  --read-lh: var(--lh-read);
  --read-measure: 72ch;
  --read-scale: 1;

  /* colour roles */
  --c-brand: #1F4E79;            /* primary actions, links, current tab */
  --c-brand-strong: #163A5C;     /* hover / pressed of brand */
  --c-brand-soft: #E8EFF7;       /* selected rows, soft badges */
  --c-brand-tint: #DCE6F0;       /* avatars, answered markers */
  --c-text-1: #18202B;           /* body text, headings (16.4 : 1 on white) */
  --c-text-2: #3D4654;           /* secondary text (9.5 : 1) */
  --c-text-3: #5B6472;           /* muted text, captions (6.0 : 1 on white, 5.2 : 1 on --c-brand-soft) */
  --c-text-on-dark: #FFFFFF;
  --c-text-on-dark-2: #B8C1CE;   /* (9.0 : 1 on --c-surface-dark) */
  --c-surface: #FFFFFF;          /* cards, panels, inputs */
  --c-surface-2: #F6F7F9;        /* the page */
  --c-surface-3: #F2F5F9;        /* hover of rows and menu items */
  --c-surface-dark: #18202B;     /* exam-room header, dark bars, toasts */
  --c-surface-dark-2: #2B3442;
  --c-border: #E2E6EC;           /* card and table lines (decorative) */
  --c-border-2: #EEF0F3;         /* inner row lines */
  --c-border-strong: #CBD2DB;    /* outlines of neutral buttons (labelled, so the text identifies them) */
  --c-border-control: #7D8796;   /* the edge of text boxes and selects: 3.6 : 1 on white (WCAG 1.4.11 needs 3 : 1; was #B8C1CE = 1.8 : 1) */
  --c-border-on-dark: #4A5566;
  --c-success: #1E5631; --c-success-bg: #E3F1E7;
  --c-warn: #8A3F06;    --c-warn-bg: #FDF1E3;
  --c-danger: #B42318;  --c-danger-strong: #8E1B1B; --c-danger-bg: #FBE9E9; --c-danger-border: #E6B8B3;
  --c-info: #1F4E79;    --c-info-bg: #E8EFF7;
  --c-focus: #1F4E79;            /* focus ring on light surfaces (8.7 : 1) */
  --c-focus-on-dark: #FFE58F;    /* focus ring on dark bars (13 : 1; the brand blue is 1.9 : 1 there) */
  --c-overlay: rgba(24, 32, 43, 0.45);
  /* the four skills (02/11/2026: chip dots, score chips and the progress charts of the student class page; the same hues
     as My progress' Band by week, student-overview.js SKILL_COLORS): text-safe on white — 5.5 / 7.1 / 5.0 / 6.7 : 1 */
  --c-skill-listening: #0F766E; --c-skill-reading: #6D28D9; --c-skill-writing: #B45309; --c-skill-speaking: #1D4ED8;
  --c-skill-overall: #18202B;

  /* radius */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 14px; --r-pill: 999px;

  /* shadow */
  --sh-1: 0 1px 2px rgba(24, 32, 43, 0.06);
  --sh-2: 0 2px 8px rgba(24, 32, 43, 0.08);
  --sh-3: 0 10px 28px rgba(24, 32, 43, 0.16);
  --sh-4: 0 16px 40px rgba(24, 32, 43, 0.30);

  /* control heights (buttons, inputs, selects) */
  --ctl-sm: 36px; --ctl-md: 44px; --ctl-lg: 52px;

  /* focus ring */
  --focus-w: 2px; --focus-offset: 2px;

  /* layout: the page's width (header, Back bar and pages line up on it). page-wide (01/11/2026, user: "shrink the
     empty space on both sides"): the whole window minus the side gutter (16 px at every width); the content is capped
     at --page-max (1920 px) only on wider screens, centred. Prose and forms keep their own measure inside it.
     --page-outer = the box with its gutters (use it as max-width on a box whose padding is the gutter). */
  --page-max: 1920px; --page-gutter: 16px;
  --page-outer: calc(var(--page-max) + 2 * var(--page-gutter));
  /* dialogs: always inside the window, scrolled inside when long */
  --modal-max-h: calc(100vh - 32px);
}

/* ---- builder lecture-font-sync (09/11/2026) ---- */
/* the test text's size ratios, shared by the student test room (index.html, "questions pane text size") and the
   teacher's Lecture (app.css, "builder lecture-font-sync"): sizes are body × ratio, so both scale the same way.
   body = the passage size; "Questions x–y" 1.1×; a passage / Listening part title 4/3×; the transcript's heading
   22/18×; helpers 0.875× (never under --fs-xs); the transcript's speaker label 2/3× (never under --fs-xs) */
:root {
  --tx-head: 1.1;
  --tx-title: calc(4 / 3);
  --tx-tr-head: calc(22 / 18);
  --tx-small: 0.875;
  --tx-speaker: calc(2 / 3);
}

/* ---- shared base ---- */
/* a visible focus ring on every interactive element (keyboard only: :focus-visible); page rules may restyle it.
   :where() keeps it at zero specificity so any component's own ring wins */
:where(a, button, input, select, textarea, summary, [tabindex], [role="button"], [role="tab"], [contenteditable="true"]):focus-visible {
  outline: var(--focus-w) solid var(--c-focus); outline-offset: var(--focus-offset);
}
/* dark bars (exam-room header, the Lecture's bar, the floating pens, dark heroes): a light ring */
:where(.xh, .tv-bar, .pen-float, .rs-hero, .on-dark) :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline-color: var(--c-focus-on-dark);
}
.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; }
/* the line icons of assets/js/icons.js */
.ic { display: inline-block; flex: none; width: 1.15em; height: 1.15em; vertical-align: -0.2em; }@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
