/*
 * Design tokens, the single source of design values (site-foundation FR-002).
 * Values: ai-docs/references/design-system.md section 7; rules: ai-docs/references/style-guide.md.
 * Layers: primitive (raw values, palette by hue and step), semantic (the section 7 names, referencing
 * primitives only) and component (geometry of one element, referencing semantic tokens only).
 * Type sizes in rem (px / 16), spacing, radii, shadows and tap sizes in px, durations in ms.
 */

/* fonts:start */
/* Generated by `npm run fonts` (scripts/build-fonts.js); edit the script, never this block. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/manrope-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/manrope-cyrillic-800-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "Manrope Fallback: Arial";
  src: local('Arial'), local('ArialMT');
  ascent-override: 103.3095%;
  descent-override: 29.074%;
  line-gap-override: 0%;
  size-adjust: 103.1851%;
}
@font-face {
  font-family: "Manrope Fallback: Roboto";
  src: local('Roboto Regular'), local('Roboto-Regular');
  ascent-override: 103.0832%;
  descent-override: 29.0103%;
  size-adjust: 103.4116%;
}
@font-face {
  font-family: "Inter Fallback: Arial";
  src: local('Arial'), local('ArialMT');
  ascent-override: 90.4365%;
  descent-override: 22.518%;
  line-gap-override: 0%;
  size-adjust: 107.1194%;
}
@font-face {
  font-family: "Inter Fallback: Roboto";
  src: local('Roboto Regular'), local('Roboto-Regular');
  ascent-override: 90.2384%;
  descent-override: 22.4686%;
  size-adjust: 107.3546%;
}
@font-face {
  font-family: "JetBrains Mono Fallback: Arial";
  src: local('Arial'), local('ArialMT');
  ascent-override: 75.7861%;
  descent-override: 22.29%;
  line-gap-override: 0%;
  size-adjust: 134.5893%;
}
@font-face {
  font-family: "JetBrains Mono Fallback: Roboto";
  src: local('Roboto Regular'), local('Roboto-Regular');
  ascent-override: 75.6201%;
  descent-override: 22.2412%;
  size-adjust: 134.8847%;
}
/* fonts:end */

/* layer: primitive */
:root {
  --white: #FFFFFF;

  --sand-25: #FDFCFA;
  --sand-100: #EFECE6;
  --sand-200: #E6E0D6;
  --sand-300: #D5CEC2;
  --sand-600: #9C8C72;

  --porcelain-200: #E3E3DF;

  --plum-500: #86819A;
  --plum-700: #55506A;
  --plum-900: #1E1B2E;

  --teal-50: #E3EFED;
  --teal-200: #C3D8D3;
  --teal-700: #0F5E57;

  --peach-100: #F7E5DF;

  --blue-50: #E8ECF6;
  --blue-100: #E7ECF7;
  --blue-700: #3B5BA9;

  --amber-50: #F7EBDD;
  --amber-100: #F5EBD8;
  --amber-700: #915E14;

  --purple-100: #F0E8F3;
  --purple-700: #7B4B8E;

  --terracotta-100: #F6E6DF;
  --terracotta-700: #9E4A2A;

  --green-100: #E1F3E8;
  --green-700: #1A7D47;

  --red-700: #B5452F;

  --shadow-plum-25: rgba(30, 27, 46, 0.25);
  --shadow-plum-35: rgba(30, 27, 46, 0.35);
  --shadow-plum-50: rgba(30, 27, 46, 0.5);

  /* Dark palette (system A, design-system.md sections 6a and 7) */
  --night-500: #736B7D;
  --night-700: #413C47;
  --night-800: #312D37;
  --night-850: #2B2830;
  --night-900: #221F27;
  --night-950: #17161A;

  --plum-50: #F1EEF7;
  --plum-300: #B6B0C8;

  --teal-300: #8ED2C6;
  --teal-500: #4F8F86;
  --teal-900: #1F3330;
  --teal-950: #10201D;

  --peach-900: #332628;
  --peach-100-a60: rgba(247, 229, 223, 0.6);

  --blue-300: #9DB3F0;
  --blue-900: #262B38;

  --amber-400: #D9A55A;
  --amber-900: #332C22;

  --purple-300: #C39BD6;
  --purple-900: #2E2634;

  --terracotta-400: #E08A68;
  --terracotta-900: #3A2620;

  --green-400: #6FC795;
  --green-900: #1D3327;

  --red-400: #EC8A74;

  --shadow-black-55: rgba(0, 0, 0, 0.55);
  --shadow-black-70: rgba(0, 0, 0, 0.7);

  /* Web face, its metric-adjusted fallback faces (fonts block above), then the section 7 fallbacks. */
  --font-stack-manrope: "Manrope", "Manrope Fallback: Arial", "Manrope Fallback: Roboto", sans-serif;
  --font-stack-inter: "Inter", "Inter Fallback: Arial", "Inter Fallback: Roboto", "Segoe UI", system-ui, sans-serif;
  --font-stack-jetbrains-mono: "JetBrains Mono", "JetBrains Mono Fallback: Arial", "JetBrains Mono Fallback: Roboto",
    ui-monospace, monospace;
}

/* layer: semantic */
:root {
  /* 7.1 Colour */
  --bg: var(--sand-25);
  --surface: var(--white);
  --surface-muted: var(--sand-100);
  --line: var(--sand-200);
  --line-strong: var(--sand-300);
  --input-line: var(--sand-600);
  --option-line: var(--teal-200);
  --ink: var(--plum-900);
  --ink-2: var(--plum-700);
  --ink-3: var(--plum-500);
  --primary: var(--teal-700);
  --on-primary: var(--white);
  --primary-soft: var(--teal-50);
  --focus-ring: var(--teal-700);
  --pastel-peach: var(--peach-100);
  --pastel-blue: var(--blue-50);
  --pastel-sand: var(--amber-50);
  --hero-panel: var(--peach-100);
  --hero-arch: var(--white);
  --arch-line: var(--porcelain-200);
  --hero-band-line: var(--sand-200);
  --quote-card-border: transparent;
  --zone-1: var(--blue-700);
  --zone-1-soft: var(--blue-100);
  --zone-2: var(--amber-700);
  --zone-2-soft: var(--amber-100);
  --zone-3: var(--purple-700);
  --zone-3-soft: var(--purple-100);
  --on-zone: var(--white);
  --record: var(--terracotta-700);
  --record-soft: var(--terracotta-100);
  --on-record: var(--white);
  --ok: var(--green-700);
  --ok-soft: var(--green-100);
  --error: var(--red-700);
  --on-error: var(--white);
  /* Trainer (trainer-rework data-model.md, ui.md): purple accent, blue on steps 2 and 5, amber notices */
  --trainer-accent: var(--purple-700);
  --trainer-accent-soft: var(--purple-100);
  --trainer-voice-accent: var(--blue-700);
  --trainer-voice-soft: var(--blue-100);
  --trainer-notice-bg: var(--amber-100);
  --trainer-notice-text: var(--amber-900);

  /* 7.2 Typography */
  --font-display: var(--font-stack-manrope);
  --font-body: var(--font-stack-inter);
  --font-mono: var(--font-stack-jetbrains-mono);
  --fs-label: 0.75rem;
  --fs-small: 0.8125rem;
  --fs-meta: 0.875rem;
  --fs-body-sm: 0.9375rem;
  --fs-body: 1rem;
  --fs-body-lg: 1.0625rem;
  --fs-button: 1rem;
  --fs-item: 1.25rem;
  --fs-option-long: 1.125rem;
  --fs-card-title: 1.125rem;
  --fs-step-title: 1.1875rem;
  --fs-h3: 1.375rem;
  --fs-stem-long: 1.375rem;
  --fs-headline: 1.5rem;
  --fs-title: 1.625rem;
  --fs-stem: 1.625rem;
  --fs-h2: 1.625rem;
  --fs-h1: 1.875rem;
  --fs-hero: clamp(1.875rem, 8.5vw, 2.375rem);
  --fs-wordmark: 1.0625rem;
  --fs-band-ring: 1.875rem;
  --fs-stat: 1.625rem;
  --fs-price: 2.125rem;
  --fs-band: 3.5rem;
  --fs-timer: 4.5rem;
  /* speaking-sample ui.md: the review size of --fs-timer (design-system.md 7.2: 64px review) */
  --fs-timer-review: 4rem;
  --lh-body: 1.5;
  --lh-snug: 1.4;
  --lh-title: 1.2;
  --lh-display: 1.08;
  --lh-hero: 1.04;
  --tracking-hero: -0.035em;
  --tracking-display: -0.03em;
  --tracking-tight: -0.02em;
  --tracking-label: 0.08em;

  /* 7.3 Spacing and layout */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --gap-tight: 6px;
  --gap-stack: 10px;
  --gap-loose: 14px;
  --space-control-x: 14px;
  --space-screen-bottom: 28px;
  --gutter-phone: 20px;
  --gutter-desktop: 56px;
  --tap-min: 44px;
  --tap-gap: 8px;
  --page-max-phone: 520px;
  --container-max: 1328px;
  --test-column: 480px;
  --hero-band-h: 280px;
  --hero-panel-h: 760px;

  /* 7.4 Radius */
  --radius-button: 999px;
  --radius-pill: 999px;
  --radius-card: 16px;
  --radius-sm: 12px;
  --radius-input: 14px;
  --radius-panel: 20px;
  --radius-frame: 24px;
  --radius-arch: 999px 999px 0 0;

  /* 7.5 Shadow */
  --shadow-card: 0 10px 30px -18px var(--shadow-plum-35);
  --shadow-frame: 0 30px 60px -40px var(--shadow-plum-25);
  --shadow-record: 0 10px 30px -18px var(--shadow-plum-50);

  /* 7.6 Motion */
  --dur-select: 150ms;
  --dur-state: 250ms;
  --dur-exit: 190ms;
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-toggle: cubic-bezier(0.65, 0, 0.35, 1);

  /* 7.7 Breakpoints: media queries cannot read custom properties, so each query writes 64rem. */
  --bp-desktop: 64rem;
}

/* Dark palette on system request only; the hero tokens keep their light values (section 6a) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night-950);
    --surface: var(--night-900);
    --surface-muted: var(--night-850);
    --line: var(--night-800);
    --line-strong: var(--night-700);
    --input-line: var(--night-500);
    --option-line: var(--teal-500);
    --ink: var(--plum-50);
    --ink-2: var(--plum-300);
    --primary: var(--teal-300);
    --on-primary: var(--teal-950);
    --primary-soft: var(--teal-900);
    --focus-ring: var(--teal-300);
    --pastel-peach: var(--peach-900);
    --pastel-blue: var(--blue-900);
    --pastel-sand: var(--amber-900);
    --quote-card-border: var(--peach-100-a60);
    --zone-1: var(--blue-300);
    --zone-1-soft: var(--blue-900);
    --zone-2: var(--amber-400);
    --zone-2-soft: var(--amber-900);
    --zone-3: var(--purple-300);
    --zone-3-soft: var(--purple-900);
    --on-zone: var(--teal-950);
    --record: var(--terracotta-400);
    --record-soft: var(--terracotta-900);
    --on-record: var(--night-950);
    --ok: var(--green-400);
    --ok-soft: var(--green-900);
    --error: var(--red-400);
    --on-error: var(--night-950);
    --trainer-accent: var(--purple-300);
    --trainer-accent-soft: var(--purple-900);
    --trainer-voice-accent: var(--blue-300);
    --trainer-voice-soft: var(--blue-900);
    --trainer-notice-bg: var(--amber-900);
    --trainer-notice-text: var(--amber-100);
    --shadow-card: 0 10px 30px -18px var(--shadow-black-55);
    --shadow-frame: 0 30px 60px -40px var(--shadow-black-55);
    --shadow-record: 0 10px 30px -18px var(--shadow-black-70);
  }
}

/* RESPONSIVE_TOKENS at BREAKPOINT_DESKTOP */
@media (min-width: 64rem) {
  :root {
    --fs-body: 1.125rem;
    --fs-step-title: 1.375rem;
    --fs-h2: 2.125rem;
    --fs-hero: 3.625rem;
    --lh-hero: 1;
    --fs-wordmark: 1.125rem;
  }
}

/* layer: component */
:root {
  /* Focus ring and hairlines */
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;
  --hairline-width: 1px;

  /* Wordmark: the boards set it at line-height normal (1.37 for Manrope); --lh-snug is the nearest token */
  --wordmark-line-height: var(--lh-snug);

  /* Header (screens index, "Shared shell as drawn") */
  --header-padding-top-site-phone: var(--space-md);
  --header-padding-top-status-phone: 18px;
  --header-padding-block-desktop: 22px;

  /* Desktop navigation */
  --nav-desktop-font-size: var(--fs-meta);
  --nav-desktop-gap: 28px;

  /* Phone menu (UX-005) */
  --menu-button-size: var(--tap-min);
  --menu-button-border-width: 1.5px;
  --menu-icon-size: 20px;
  --menu-row-min-height: 52px;
  --menu-row-font-size: var(--fs-body-lg);
  --menu-panel-padding-top: var(--space-sm);
  --menu-panel-padding-bottom: var(--space-md);
  --menu-current-underline-width: 2px;
  --menu-enter-offset: 8px;
  --menu-enter-duration: var(--dur-state);
  --menu-enter-easing: var(--ease-enter);
  --menu-reduced-duration: var(--dur-select);

  /* Status row */
  --status-text-font-size: var(--fs-small);

  /* Footer */
  --footer-font-size: var(--fs-small);
  --footer-line-gap: var(--gap-tight);
  --footer-margin-top-phone: 40px;
  --footer-padding-top-phone: 18px;
  --footer-padding-bottom-phone: var(--space-screen-bottom);
  --footer-margin-top-desktop: 80px;
  --footer-padding-top-desktop: var(--space-lg);
  --footer-padding-bottom-desktop: 40px;
  --footer-link-font-size-desktop: var(--fs-meta);
  --footer-link-gap-desktop: var(--space-lg);
  --footer-wordmark-size-desktop: 1rem;

  /* Desktop test column */
  --test-column-width: var(--test-column);
  --test-column-min-height: 760px;
  --test-column-margin-top: var(--space-lg);
  --test-column-margin-bottom: var(--space-2xl);

  /* Headings: one-off line heights of style-guide.md, Typography */
  --heading-1-line-height: 1.1;
  --heading-2-line-height-desktop: 1.05;
  --heading-3-line-height: 1.15;

  /* Buttons (UX-002) */
  --button-height-primary: 52px;
  --button-height-secondary: 48px;
  --button-height-large: 54px;
  --button-height-compact: 48px;
  --button-padding-inline-primary: 28px;
  --button-padding-inline-secondary: 22px;
  --button-border-width-secondary: 1.5px;
  --button-label-font-size: var(--fs-button);

  /* Cards (UX-003) */
  --card-radius: var(--radius-card);
  --card-border-width: 1px;
  --card-padding: var(--space-md);
  /* Sand callout (writing-sample; style-guide.md, Cards: callout; site.css) */
  --card-sand-padding-block: 14px;
  --card-sand-padding-inline: 16px;
  --card-sand-radius: var(--radius-sm);
  --card-sand-font-size: var(--fs-body-sm);
  --panel-radius: var(--radius-panel);

  /* Privacy page (privacy-page data-model.md); no semantic token holds the list padding or the
     text line height, so they are raw values like the heading line heights above */
  --privacy-measure: var(--page-max-phone);
  --privacy-intro-padding-top: var(--space-lg);
  --privacy-intro-gap: var(--space-sm);
  --privacy-list-padding-top: 20px;
  --privacy-section-gap: var(--space-sm);
  --privacy-section-padding-top: var(--gap-loose);
  --privacy-section-inner-gap: var(--gap-tight);
  --privacy-text-line-height: 1.55;

  /* Shared form components (test-gate; style-guide.md, Forms and Chip): text input, chip, checkbox
     row, field and form messages, the inactive primary button. The message line height is a raw value
     like the heading line heights above */
  --field-gap: var(--gap-tight);
  --field-label-font-size: var(--fs-body-sm);
  --input-height: 52px;
  --input-padding-inline: var(--space-control-x);
  --input-border-width: 1.5px;
  --input-border: var(--input-line);
  --input-border-invalid: var(--error);
  --input-radius: var(--radius-input);
  --input-bg: var(--surface);
  --input-text: var(--ink);
  --input-font-size: var(--fs-body-lg);
  /* Text area (writing-sample; style-guide.md, Forms; forms.css): TEXTAREA_MIN_LINES of data-model.md,
     6 x 1.5 x 17 px + 28 px padding + 3 px border = 184 px on phones, 230 px from BREAKPOINT_DESKTOP */
  --text-area-min-height: 184px;
  --text-area-min-height-desktop: 230px;
  --text-area-padding: 14px;
  --text-area-border: var(--input-line);
  --text-area-radius: var(--radius-input);
  --text-area-bg: var(--surface);
  --text-area-text: var(--ink);
  --text-area-font-size: var(--fs-body-lg);
  --text-area-line-height: var(--lh-body);
  --chip-height: var(--tap-min);
  --chip-padding-inline: var(--space-md);
  --chip-gap: var(--tap-gap);
  --chip-legend-gap: var(--space-xs);
  --chip-border-width: 1.5px;
  --chip-radius: var(--radius-pill);
  --chip-font-size: var(--fs-body-sm);
  --chip-bg: var(--surface);
  --chip-border: var(--line-strong);
  --chip-text: var(--ink);
  --chip-bg-selected: var(--primary-soft);
  --chip-border-selected: var(--primary);
  --chip-text-selected: var(--primary);
  --checkbox-size: 22px;
  --checkbox-gap: var(--space-sm);
  --checkbox-offset-top: 2px;
  --checkbox-accent: var(--primary);
  --checkbox-label-color: var(--ink-2);
  --checkbox-label-font-size: var(--fs-meta);
  --checkbox-link-color: var(--primary);
  --checkbox-row-min-height: var(--tap-min);
  /* Inline padding grows the link's hit area to TAP_MIN without moving the lines of the label */
  --checkbox-link-padding-block: calc((var(--tap-min) - 1em) / 2);
  --message-color: var(--error);
  --message-font-size: var(--fs-meta);
  --message-line-height: 1.45;
  --message-gap: var(--space-xs);
  --message-icon-size: 16px;
  --message-icon-offset-top: 2px;
  --button-bg-inactive: var(--surface-muted);
  --button-text-inactive: var(--ink-2);

  /* Gate page (test-gate ui.md, boards F2 and F2a): panel, form stack, button and hint */
  --gate-panel-bg: var(--pastel-peach);
  --gate-panel-radius: var(--radius-frame);
  --gate-panel-padding-block: 22px;
  --gate-panel-padding-inline: 20px;
  --gate-panel-gap: var(--gap-stack);
  --gate-panel-margin-top: var(--space-md);
  --gate-form-padding-top: 20px;
  --gate-form-gap: 18px;
  --gate-reason-color: var(--ink-2);
  --gate-no-script-margin-top: 20px;
  --gate-no-script-color: var(--ink);
  --gate-honeypot-offset: -10000px;
  --gate-start-margin-top: var(--gap-tight);
  --gate-hint-margin-top: calc(-1 * var(--space-xs));
  --gate-hint-color: var(--ink-2);
  --gate-hint-font-size: var(--fs-small);

  /* Test controls (adaptive-stage-one; style-guide.md, Test controls and Labels; test-controls.css) */
  --option-height: 60px;
  --option-padding-inline: var(--space-md);
  --option-gap: var(--space-sm);
  --option-radius: var(--radius-card);
  --option-border-width: 1.5px;
  --option-border-width-selected: 2px;
  --option-bg: var(--surface);
  --option-border: var(--option-line);
  --option-text: var(--ink);
  --option-font-size: var(--fs-item);
  --option-bg-selected: var(--primary);
  --option-border-selected: var(--primary);
  --option-text-selected: var(--on-primary);
  --option-stack-gap: var(--gap-stack);
  --option-mark-size: 30px;
  --option-mark-radius: var(--radius-pill);
  --option-mark-bg: var(--surface);
  --option-mark-bg-selected: var(--on-primary);
  --option-tick: var(--primary);
  --option-tick-size: 16px;
  --option-tick-scale-from: 0.95;
  --option-tick-duration: var(--dur-select);
  --option-tick-easing: var(--ease-toggle);
  --option-focus-ring: var(--focus-ring);
  --level-pill-font-size: var(--fs-small);
  --level-pill-padding-block: var(--gap-tight);
  --level-pill-padding-inline: var(--space-sm);
  --level-pill-radius: var(--radius-pill);
  --level-pill-bg: var(--primary-soft);
  /* --ink in both schemes: a dark-only --primary text would need a component branch (frontend.md) */
  --level-pill-text: var(--ink);
  --progress-header-gap: var(--space-sm);
  --progress-counter-font-size: var(--fs-small);
  --progress-counter-color: var(--ink-2);
  --progress-height: 8px;
  --progress-radius: var(--radius-pill);
  --progress-track: var(--primary-soft);
  --progress-fill: var(--primary);
  --completion-bar-height: 6px;
  --completion-bar-radius: var(--radius-pill);
  --completion-bar-color: var(--ok);
  --mono-label-font: var(--font-mono);
  --mono-label-font-size: var(--fs-label);
  --mono-label-tracking: var(--tracking-label);
  --mono-label-color: var(--ink-2);
  --mono-label-color-ok: var(--ok);
  --step-of-color: var(--ink-3);
  --stage-note-font-size: var(--fs-small);
  --stage-note-color: var(--ink-2);
  --stage-note-margin-top: var(--gap-stack);

  /* Stage one page (adaptive-stage-one; ui.md Component Catalog; stage-one.css) */
  --stage-top-padding: 18px;
  --stage-bottom-padding: var(--space-screen-bottom);
  --stage-actions-gap: var(--space-sm);
  --item-fade-duration: var(--dur-select);
  --item-fade-easing: var(--ease-toggle);
  --item-note-font-size: var(--fs-small);
  --item-note-color: var(--ink-2);
  --item-note-margin-top: var(--gap-stack);
  --item-resume-gap: var(--space-xs);
  --item-resume-font-size: var(--fs-meta);
  --item-resume-color: var(--ink-2);
  --item-resume-icon: var(--primary);
  --item-resume-icon-size: 16px;
  --item-instruction-margin-top: var(--space-xl);
  --item-instruction-font-size: var(--fs-body-sm);
  --item-instruction-color: var(--ink-2);
  --item-stem-margin-top: var(--space-sm);
  --item-stem-font: var(--font-display);
  --item-stem-font-size: var(--fs-stem);
  --item-stem-line-height: 1.25;
  --item-stem-tracking: var(--tracking-tight);
  --item-stem-color: var(--ink);
  --item-options-margin-top: 28px;
  --band-header-gap: var(--gap-stack);
  --band-display-margin-top: 40px;
  --band-display-gap: var(--gap-loose);
  --band-heading-font-size: var(--fs-body-sm);
  --band-heading-color: var(--ink-2);
  --band-level-font: var(--font-display);
  --band-level-font-size: var(--fs-band);
  --band-level-tracking: var(--tracking-display);
  --band-level-color: var(--primary);
  --band-range-font-size: var(--fs-headline);
  --band-range-line-height: var(--lh-title);
  --band-range-color: var(--ink);
  --band-line-font-size: var(--fs-body);
  --band-line-color: var(--ink-2);
  --band-zones-margin-top: 28px;
  --band-zones-gap: var(--space-xs);
  --band-caveat-margin-top: var(--space-2xs);
  --band-caveat-font-size: var(--fs-body-sm);
  --band-caveat-color: var(--ink-2);
  --zone-row-bg: var(--surface);
  --zone-row-border: var(--line);
  --zone-row-radius: var(--radius-sm);
  --zone-row-padding-block: var(--space-sm);
  --zone-row-padding-inline: var(--space-control-x);
  --zone-row-gap: var(--gap-stack);
  --zone-row-font-size: var(--fs-body);
  --zone-row-text: var(--ink);
  --zone-row-dot-size: 10px;
  --zone-row-dot-radius: var(--radius-pill);
  --zone-row-dot-1: var(--zone-1);
  --zone-row-dot-2: var(--zone-2);
  --zone-row-dot-3: var(--zone-3);
  --band-c1-margin-top: 28px;
  --band-c1-padding: var(--space-md);
  --band-c1-radius: var(--radius-card);
  --band-c1-bg: var(--primary-soft);
  --band-c1-font-size: var(--fs-body-sm);
  --band-c1-color: var(--ink-2);
  --stage-notice-margin-top: 40px;
  --stage-notice-gap: var(--space-lg);
  --stage-notice-color: var(--ink);
  --stage-no-script-margin-top: 40px;
  --stage-no-script-color: var(--ink);

  /* Choice card (reading-listening-stage; style-guide.md, Test controls; test-controls.css) */
  --choice-card-bg: var(--surface);
  --choice-card-border-width: 1.5px;
  --choice-card-border: var(--line);
  --choice-card-radius: var(--radius-card);
  --choice-card-shadow: var(--shadow-card);
  --choice-card-padding-block: 18px;
  --choice-card-padding-inline: var(--space-control-x);
  --choice-card-gap: var(--space-sm);
  --choice-card-min-height: var(--tap-min);
  --choice-card-tile-size: 44px;
  --choice-card-tile-radius: var(--radius-sm);
  --choice-card-icon-size: 20px;
  --choice-card-tile-reading: var(--zone-1);
  --choice-card-tile-reading-bg: var(--zone-1-soft);
  --choice-card-tile-listening: var(--zone-2);
  --choice-card-tile-listening-bg: var(--pastel-sand);
  --choice-card-title-font-size: var(--fs-card-title);
  --choice-card-title-color: var(--ink);
  --choice-card-title-line-height: var(--lh-title);
  --choice-card-meta-font-size: var(--fs-meta);
  --choice-card-meta-color: var(--ink-2);
  --choice-card-focus-ring: var(--focus-ring);
  /* Choice card states and topic box (writing-sample; style-guide.md N8, Test controls; test-controls.css) */
  --choice-card-tile-writing: var(--zone-1);
  --choice-card-tile-writing-bg: var(--zone-1-soft);
  /* speaking-sample ui.md SpeakingCard active */
  --choice-card-tile-speaking: var(--record);
  --choice-card-tile-speaking-bg: var(--record-soft);
  --choice-card-unavailable-border: var(--line);
  --choice-card-unavailable-opacity: 0.9;
  --choice-card-unavailable-tile-bg: var(--surface-muted);
  --choice-card-unavailable-icon: var(--ink-3);
  --choice-card-note-font-size: var(--fs-small);
  --choice-card-note-line-height: 1.4;
  --choice-card-note-color: var(--record);
  --choice-card-only-border-width: 2px;
  --choice-card-only-border: var(--primary);
  --topic-box-bg: var(--primary-soft);
  --topic-box-radius: var(--radius-sm);
  --topic-box-padding-block: 14px;
  --topic-box-padding-inline: 16px;
  --topic-box-color: var(--ink);
  --topic-box-font-size: var(--fs-body);
  --topic-box-line-height: var(--lh-body);
  --topic-box-margin-top: var(--space-md);
  --topic-box-compact-padding-block: 12px;
  --topic-box-compact-padding-inline: 14px;
  --topic-box-compact-font-size: var(--fs-body-sm);
  /* Stage three page (writing-sample; ui.md Component Catalog; stage-three.css) */
  --writing-field-margin-top: var(--space-md);
  --writing-label-font-size: var(--fs-body-sm);
  --writing-label-color: var(--ink);
  --writing-footer-gap: var(--space-xs);
  --writing-footer-margin-top: var(--space-xs);
  --writing-hint-font-size: var(--fs-small);
  --writing-hint-color: var(--ink-2);
  --writing-cap-font-size: var(--fs-meta);
  --writing-cap-line-height: 1.45;
  --writing-cap-color: var(--ink-2);
  --writing-cap-margin-top: var(--space-xs);
  --writing-actions-margin-top: var(--space-lg);
  --writing-actions-gap: var(--space-sm);
  --writing-short-margin-top: var(--space-md);
  --writing-short-enter-duration: var(--dur-state);
  --writing-short-enter-easing: var(--ease-enter);
  --analysis-steps-margin-top: var(--space-lg);
  --analysis-steps-gap: var(--gap-loose);
  --analysis-step-gap: var(--gap-loose);
  --analysis-step-padding-block: 14px;
  --analysis-step-padding-inline: 16px;
  --analysis-step-bg: var(--surface);
  --analysis-step-border: var(--line);
  --analysis-step-radius: var(--radius-sm);
  --analysis-step-label-font-size: var(--fs-body);
  --analysis-step-label-color: var(--ink-2);
  --analysis-step-active-label-color: var(--ink);
  --analysis-step-active-border: var(--primary);
  --analysis-mark-size: 32px;
  --analysis-mark-done-bg: var(--ok-soft);
  --analysis-mark-done-tick: var(--ok);
  --analysis-mark-ring: var(--primary-soft);
  --analysis-mark-arc: var(--primary);
  --analysis-mark-pending: var(--line-strong);
  --analysis-tick-duration: var(--dur-state);
  --analysis-tick-easing: var(--ease-enter);
  --analysis-tick-reduced-duration: var(--dur-select);
  --analysis-next-margin-top: var(--space-lg);
  --analysis-note-font-size: var(--fs-body-sm);
  --analysis-note-color: var(--ink-2);

  /* Record and offer views (speaking-sample; ui.md Component Catalog and tokens; stage-three-speaking.css) */
  --meter-bar-width: 6px;
  --meter-bar-gap: 5px;
  --meter-height: 72px;
  --meter-bar-radius: 3px;
  --meter-bar-spoken: var(--record);
  --meter-bar-rest: var(--line);
  /* METER_BAR_MIN_PX / METER_HEIGHT_PX of data-model.md: 14 / 72 */
  --meter-bar-rest-scale: 0.1944;
  --meter-bar-duration: var(--dur-select);
  --meter-bar-easing: var(--ease-toggle);
  --meter-margin-top: var(--space-lg);
  --review-bar-width: 4px;
  --review-bar-gap: 4px;
  --review-height: 36px;
  --review-bar-radius: 2px;
  --review-bar-color: var(--record);
  --review-bar-flat: var(--line-strong);
  /* 4 px of REVIEW_BARS' 36 px */
  --review-bar-flat-scale: 0.1111;
  --record-button-size: 84px;
  --record-button-bg: var(--record);
  --record-button-color: var(--on-record);
  --record-button-shadow: var(--shadow-record);
  --record-button-radius: var(--radius-pill);
  --record-button-icon-size: 32px;
  --record-button-pressed-duration: var(--dur-select);
  --record-stop-size: 30px;
  --record-stop-radius: 6px;
  --record-dot-size: 8px;
  --record-dot-ring: 1.5px;
  --record-dot-color: var(--record);
  --record-dot-gap: var(--space-xs);
  --record-label-color: var(--record);
  --record-label-plain-color: var(--ink-2);
  --record-meta-color: var(--ink-2);
  --record-timer-font: var(--font-display);
  --record-timer-font-size: var(--fs-timer);
  --record-timer-review-font-size: var(--fs-timer-review);
  --record-timer-color: var(--ink);
  --record-timer-idle-color: var(--ink-2);
  --record-timer-margin-top: var(--space-xl);
  --record-status-font-size: var(--fs-body-sm);
  --record-status-color: var(--ink-2);
  --record-status-margin-top: var(--space-md);
  --record-caption-font-size: var(--fs-body);
  --record-caption-color: var(--ink);
  --record-caption-margin-top: var(--space-sm);
  --record-links-gap: 18px;
  --record-links-margin-top: var(--space-md);
  --record-actions-gap: var(--space-sm);
  --record-actions-margin-top: var(--space-lg);
  --record-browser-line-font-size: var(--fs-body-sm);
  --record-browser-line-color: var(--ink-2);
  --record-topic-plain-font-size: var(--fs-body-lg);
  --record-topic-plain-color: var(--ink);
  --record-callout-margin-top: var(--space-md);
  --record-callout-heading-font: var(--font-display);
  --record-callout-heading-font-size: var(--fs-step-title);
  --record-callout-heading-tracking: var(--tracking-display);
  --record-callout-heading-color: var(--ink);
  --record-callout-line-font-size: var(--fs-body);
  --record-callout-line-color: var(--ink-2);
  --record-callout-line-margin-top: var(--space-xs);
  --record-callout-enter-duration: var(--dur-state);
  --record-callout-enter-easing: var(--ease-enter);
  --record-privacy-margin-top: var(--space-md);
  --offer-done-margin-top: var(--space-md);
  --offer-heading-margin-top: var(--space-lg);
  --offer-topic-margin-top: var(--space-md);
  --offer-actions-gap: var(--space-sm);
  --offer-actions-padding-top: var(--space-lg);

  /* Stage two page (reading-listening-stage; ui.md Component Catalog; stage-two.css) */
  --stage-title-font: var(--font-display);
  --stage-title-font-size: var(--fs-title);
  --stage-title-line-height: var(--lh-title);
  --stage-title-tracking: var(--tracking-display);
  --stage-title-color: var(--ink);
  --stage-title-margin-top: var(--space-lg);
  --stage-line-font-size: var(--fs-body-sm);
  --stage-line-line-height: var(--lh-body);
  --stage-line-color: var(--ink-2);
  --stage-line-margin-top: var(--space-xs);
  --choice-cards-gap: var(--space-sm);
  --choice-cards-margin-top: var(--space-lg);
  --choice-recommend-margin-top: var(--space-md);
  --step-header-gap: var(--space-sm);
  --stage-exit-min-height: var(--tap-min);
  --stage-exit-padding-inline: var(--space-sm);
  --stage-exit-font-size: var(--fs-body-sm);
  --stage-exit-color: var(--ink-2);
  --stage-exit-focus-ring: var(--focus-ring);
  --reading-passage-bg: var(--surface);
  --reading-passage-border: var(--line);
  --reading-passage-radius: var(--radius-card);
  --reading-passage-padding: var(--space-md);
  --reading-passage-font-size: var(--fs-body-lg);
  --reading-passage-line-height: var(--lh-body);
  --reading-passage-color: var(--ink);
  --reading-passage-margin-top: var(--space-md);
  --question-fade-duration: var(--dur-select);
  --question-fade-easing: var(--ease-toggle);
  --task-question-font: var(--font-display);
  --task-question-font-size: var(--fs-stem-long);
  --task-question-line-height: 1.25;
  --task-question-tracking: var(--tracking-tight);
  --task-question-color: var(--ink);
  --task-question-margin-top: var(--space-xs);
  --task-options-margin-top: 20px;
  --task-instruction-margin-top: var(--space-lg);
  --task-instruction-font-size: var(--fs-body-sm);
  --task-instruction-color: var(--ink-2);
  --task-resume-gap: var(--space-xs);
  --task-resume-font-size: var(--fs-meta);
  --task-resume-color: var(--ink-2);
  --task-resume-icon: var(--primary);
  --task-resume-icon-size: 16px;
  --option-long-font-size: var(--fs-option-long);
  --audio-player-bg: var(--surface);
  --audio-player-border: var(--line);
  --audio-player-radius: var(--radius-card);
  --audio-player-padding-block: 18px;
  --audio-player-padding-inline: var(--space-md);
  --audio-player-gap: var(--gap-loose);
  --audio-player-margin-top: var(--space-md);
  --audio-player-play-size: 64px;
  --audio-player-play-radius: var(--radius-pill);
  --audio-player-play-bg: var(--primary);
  --audio-player-play-color: var(--on-primary);
  --audio-player-play-bg-disabled: var(--surface-muted);
  --audio-player-play-color-disabled: var(--ink-3);
  --audio-player-icon-size: 28px;
  --audio-player-time-font: var(--font-mono);
  --audio-player-time-font-size: var(--fs-meta);
  --audio-player-time-color: var(--ink);
  --audio-player-bar-height: 6px;
  --audio-player-bar-radius: var(--radius-pill);
  --audio-player-bar-track: var(--primary-soft);
  --audio-player-bar-fill: var(--primary);
  --audio-player-replay-min-height: var(--tap-min);
  --audio-player-replay-font-size: var(--fs-small);
  --audio-player-replay-color: var(--primary);
  --audio-player-replay-color-disabled: var(--ink-2);
  --audio-player-disclosure-font-size: var(--fs-small);
  --audio-player-disclosure-color: var(--ink-2);
  --audio-player-focus-ring: var(--focus-ring);
  --player-notice-margin-top: var(--space-sm);
  --player-notice-font-size: var(--fs-meta);
  --player-notice-line-height: 1.45;
  --player-notice-color: var(--ink);
  --reading-offer-gap: var(--space-sm);
  --reading-offer-margin-top: var(--space-sm);
  --audio-unavailable-margin-top: var(--space-lg);
  --audio-unavailable-font-size: var(--fs-body);
  --audio-unavailable-line-height: var(--lh-body);
  --audio-unavailable-color: var(--ink);
  --transcript-turn-gap: var(--space-xs);
  /* Result page (results-page plan.md Theme tokens; ui.md Component Catalog; style-guide.md Results;
     result.css): light cards on the pastels by position (ND-1, F8), dark system A in the block below */
  --result-ring: var(--pastel-peach);
  --result-ring-c1: var(--ok-soft);
  --result-ring-size: 96px;
  --result-ring-disc-size: 74px;
  --result-ring-disc: var(--surface);
  --result-ring-level-color: var(--primary);
  --result-ring-level-font-size: var(--fs-band-ring);
  --result-band-gap: var(--space-md);
  --result-headline-font-size: var(--fs-headline);
  --result-headline-line-height: var(--lh-display);
  --result-note-font-size: var(--fs-meta);
  --result-note-color: var(--ink-2);
  --result-note-margin-top: var(--space-2xs);
  --result-heading-font-size: var(--fs-meta);
  --result-heading-color: var(--ink-2);
  --result-section-gap: var(--space-lg);
  --result-card-1-bg: var(--pastel-peach);
  --result-card-2-bg: var(--pastel-blue);
  --result-card-3-bg: var(--pastel-sand);
  --result-card-1-border: transparent;
  --result-card-2-border: transparent;
  --result-card-3-border: transparent;
  --result-card-border-width: 1.5px;
  --result-card-radius: var(--radius-panel);
  --result-card-padding: var(--space-md);
  --result-card-gap: var(--gap-stack);
  --result-cards-gap: var(--gap-stack);
  --result-card-title-font-size: var(--fs-card-title);
  --result-card-title-line-height: var(--lh-title);
  --result-card-title-tracking: var(--tracking-tight);
  --result-card-title-color: var(--ink);
  --result-card-meaning-font-size: var(--fs-body-sm);
  --result-card-meaning-color: var(--ink-2);
  --result-badge-size: 32px;
  --result-badge-gap: var(--gap-stack);
  --result-badge-1-bg: var(--surface);
  --result-badge-2-bg: var(--surface);
  --result-badge-3-bg: var(--surface);
  --result-badge-ink: var(--ink);
  --result-badge-font-size: var(--fs-meta);
  --result-probable-color: var(--ink-2);
  --result-correction-bg: var(--surface);
  --result-correction-rule-1: transparent;
  --result-correction-rule-2: transparent;
  --result-correction-rule-3: transparent;
  --result-correction-rule-width: 3px;
  --result-correction-radius: var(--radius-input);
  --result-correction-padding: var(--space-sm);
  --result-correction-gap: var(--gap-tight);
  --result-corrections-gap: var(--space-xs);
  --result-correction-original-font-size: var(--fs-body);
  --result-correction-original-color: var(--ink-2);
  --result-correction-corrected-font-size: var(--fs-body-lg);
  --result-correction-corrected-color: var(--ink);
  --result-correction-why-font-size: var(--fs-meta);
  --result-correction-why-color: var(--ink-2);
  --result-correction-standalone-bg: var(--surface);
  --result-correction-standalone-border: var(--line);
  --result-callout-bg: var(--primary-soft);
  --result-callout-color: var(--ink);
  --result-callout-radius: var(--radius-card);
  --result-callout-padding: var(--space-md);
  --result-method-font-size: var(--fs-meta);
  --result-method-color: var(--ink-2);
  --result-doors-gap: var(--space-sm);
  --result-small-font-size: var(--fs-small);
  --result-small-color: var(--ink-2);
  --result-press-duration: var(--dur-select);
  --result-press-easing: var(--ease-toggle);
  --result-lead-font-size: var(--fs-body-lg);
  --result-lead-color: var(--ink);
  --result-instagram-height: 48px;
  --result-link-title-font-size: var(--fs-h1);
  --result-link-body-font-size: var(--fs-body-lg);
  --result-link-body-color: var(--ink-2);
  --result-loading-ring-size: 40px;
  --result-loading-ring-width: 4px;
  --result-loading-track: var(--primary-soft);
  --result-loading-arc: var(--primary);
  --result-loading-duration: 900ms;
  --result-loading-font-size: var(--fs-body-lg);
  --result-loading-color: var(--ink);
  --result-error-color: var(--ink);

  /* Trainer (trainer-rework data-model.md: RECORD_CONTROL_SIZE, FLOW_ROW_MS, FLOW_STAGGER_MS) */
  --trainer-record-size: 72px;
  --trainer-flow-row-duration: 600ms;
  --trainer-flow-stagger: 40ms;
}

/* Result page in dark, system A (style-guide.md Dark Theme; boards D3, D13, D24): --surface cards with
   --zone-N frames, filled --zone-N badges and left rules on --bg corrections */
@media (prefers-color-scheme: dark) {
  :root {
    --result-ring: var(--primary-soft);
    --result-ring-c1: var(--primary-soft);
    --result-card-1-bg: var(--surface);
    --result-card-2-bg: var(--surface);
    --result-card-3-bg: var(--surface);
    --result-card-1-border: var(--zone-1);
    --result-card-2-border: var(--zone-2);
    --result-card-3-border: var(--zone-3);
    --result-badge-1-bg: var(--zone-1);
    --result-badge-2-bg: var(--zone-2);
    --result-badge-3-bg: var(--zone-3);
    --result-badge-ink: var(--on-zone);
    --result-correction-bg: var(--bg);
    --result-correction-rule-1: var(--zone-1);
    --result-correction-rule-2: var(--zone-2);
    --result-correction-rule-3: var(--zone-3);
  }
}
/* tool-scope:start (test-redesign) */
/* Tool scope (test-redesign contracts.md section 2): new primitives on :root, every other value under
   [data-tool]; a page without data-tool computes exactly what it computes without this block. */
/* layer: primitive */
:root {
  /* Board D5 dark ground and inks (data-model.md Palette) */
  --ink-black-950: #111014;
  --ink-black-900: #1C1A20;
  --ink-black-800: #2A2730;
  --ink-black-700: #3A3641;
  --ink-black-500: #78738A;
  --plum-25: #F5F4F8;
  --plum-200: #B9B4C7;
  --mint-200: #A9E0D6;
  --teal-300-a12: rgba(142, 210, 198, 0.12);
  --teal-300-a16: rgba(142, 210, 198, 0.16);
  /* Board warn */
  --rust-700: #9A3B1E;
  --rust-50: #FBEAE3;
  --coral-200: #F2B8A2;
  --coral-200-a12: rgba(242, 184, 162, 0.12);
  /* Trainer dark accent set, used by no page in this feature */
  --purple-200: #D9BEE6;
  --purple-300-a13: rgba(195, 155, 214, 0.13);
  --purple-300-a16: rgba(195, 155, 214, 0.16);
}

/* layer: semantic */
/* TOOL_ACCENT_SETS: the accent tells the two tools apart (test green, trainer purple) */
[data-tool="test"] {
  --tool-accent: var(--teal-700);
  --tool-accent-soft: var(--teal-50);
  --tool-accent-ink: var(--teal-700);
  --on-tool-accent: var(--white);
  --tool-accent-ring: var(--teal-50);
  --tool-tint: var(--teal-50);
  --selected-bg: var(--teal-50);
  --selected-line: var(--teal-700);
  --selected-ink: var(--plum-900);
  --selected-mark: var(--teal-700);
}

[data-tool="trainer"] {
  --tool-accent: var(--purple-700);
  --tool-accent-soft: var(--purple-100);
  --tool-accent-ink: var(--purple-700);
  --on-tool-accent: var(--white);
  --tool-accent-ring: var(--purple-100);
  --tool-tint: var(--purple-100);
  --selected-bg: var(--purple-100);
  --selected-line: var(--purple-700);
  --selected-ink: var(--purple-700);
  --selected-mark: var(--purple-700);
}

@media (prefers-color-scheme: dark) {
  [data-tool="trainer"] {
    --tool-accent: var(--purple-300);
    --tool-accent-soft: var(--purple-300-a16);
    --tool-accent-ink: var(--purple-200);
    --on-tool-accent: var(--ink-black-950);
    --tool-accent-ring: var(--ink-black-800);
    --tool-tint: var(--purple-300-a13);
    --selected-bg: var(--white);
    --selected-line: var(--white);
    --selected-ink: var(--ink-black-950);
    --selected-mark: var(--ink-black-950);
  }
}

@media (prefers-color-scheme: dark) {
  [data-tool="test"] {
    --tool-accent: var(--teal-300);
    --tool-accent-soft: var(--teal-300-a16);
    --tool-accent-ink: var(--mint-200);
    --on-tool-accent: var(--ink-black-950);
    --tool-accent-ring: var(--teal-900);
    --tool-tint: var(--teal-300-a12);
    --selected-bg: var(--white);
    --selected-line: var(--white);
    --selected-ink: var(--ink-black-950);
    --selected-mark: var(--ink-black-950);
  }
}

/* TEST_SEMANTIC_OVERRIDES: control lines at CONTROL_LINE (KD-20), board warn (KD-26), zones in ZONE_TINT_ORDER,
   the record family on the tool accent (KD-27) */
:root[data-tool="test"] {
  --option-line: var(--sand-600);
  --error: var(--rust-700);
  --zone-1: var(--terracotta-700);
  --zone-2: var(--blue-700);
  --zone-3: var(--amber-700);
  --zone-1-soft: var(--peach-100);
  --zone-2-soft: var(--blue-50);
  --zone-3-soft: var(--amber-50);
  --record: var(--teal-700);
  --record-soft: var(--teal-50);
  --on-record: var(--white);
}

/* The dark side of the same overrides, so no light value leaks into dark (brought forward from IMPL-010) */
@media (prefers-color-scheme: dark) {
  :root[data-tool="test"] {
    /* D5 ground, surfaces and inks; the pastels become the one tool tint */
    --bg: var(--ink-black-950);
    --surface: var(--ink-black-900);
    --surface-muted: var(--ink-black-800);
    --line: var(--ink-black-800);
    --line-strong: var(--ink-black-700);
    --ink: var(--plum-25);
    --ink-2: var(--plum-200);
    --ink-3: var(--ink-black-500);
    --on-primary: var(--ink-black-950);
    --primary-soft: var(--teal-300-a16);
    --pastel-peach: var(--teal-300-a12);
    --pastel-blue: var(--teal-300-a12);
    --pastel-sand: var(--teal-300-a12);
    --ok: var(--teal-300);
    --ok-soft: var(--teal-300-a16);
    --option-line: var(--night-500);
    --error: var(--coral-200);
    --zone-1: var(--mint-200);
    --zone-2: var(--mint-200);
    --zone-3: var(--mint-200);
    --zone-1-soft: var(--teal-300-a12);
    --zone-2-soft: var(--teal-300-a12);
    --zone-3-soft: var(--teal-300-a12);
    --record: var(--teal-300);
    --record-soft: var(--teal-300-a16);
    --on-record: var(--ink-black-950);
  }
}

/* TRAINER_SEMANTIC_OVERRIDES (trainer-redesign data-model.md Palette, KD-T03, KD-T18): the primary family, the
   pastels, the zones and the record family on the trainer accent; control lines at CONTROL_LINE; board warn */
:root[data-tool="trainer"] {
  --primary: var(--purple-700);
  --on-primary: var(--white);
  --primary-soft: var(--purple-100);
  --focus-ring: var(--purple-700);
  --pastel-peach: var(--purple-100);
  --pastel-blue: var(--purple-100);
  --pastel-sand: var(--purple-100);
  --zone-1: var(--purple-700);
  --zone-2: var(--purple-700);
  --zone-3: var(--purple-700);
  --zone-1-soft: var(--purple-100);
  --zone-2-soft: var(--purple-100);
  --zone-3-soft: var(--purple-100);
  --error: var(--rust-700);
  --option-line: var(--sand-600);
  --record: var(--purple-700);
  --record-soft: var(--purple-100);
  --on-record: var(--white);
}

/* The dark side of the same overrides, so no light value leaks into dark (brought forward from IMPL-008, as the
   test did): D5 ground, surfaces and inks; the lilac accent family */
@media (prefers-color-scheme: dark) {
  :root[data-tool="trainer"] {
    --bg: var(--ink-black-950);
    --surface: var(--ink-black-900);
    --surface-muted: var(--ink-black-800);
    --line: var(--ink-black-800);
    --line-strong: var(--ink-black-700);
    --ink: var(--plum-25);
    --ink-2: var(--plum-200);
    --ink-3: var(--ink-black-500);
    --primary: var(--purple-300);
    --on-primary: var(--ink-black-950);
    --primary-soft: var(--purple-300-a16);
    --focus-ring: var(--purple-300);
    --pastel-peach: var(--purple-300-a13);
    --pastel-blue: var(--purple-300-a13);
    --pastel-sand: var(--purple-300-a13);
    --zone-1: var(--purple-200);
    --zone-2: var(--purple-200);
    --zone-3: var(--purple-200);
    --zone-1-soft: var(--purple-300-a13);
    --zone-2-soft: var(--purple-300-a13);
    --zone-3-soft: var(--purple-300-a13);
    --ok: var(--purple-300);
    --ok-soft: var(--purple-300-a16);
    --error: var(--coral-200);
    --option-line: var(--night-500);
    --record: var(--purple-300);
    --record-soft: var(--purple-300-a16);
    --on-record: var(--ink-black-950);
  }
}

/* layer: component */
/* Type (data-model.md Type), controls and surfaces (Controls and surfaces), result (Result) */
[data-tool="test"] {
  --test-h1-size: 1.875rem;
  --test-h1-size-result: 1.875rem;
  --test-h1-size-compact: 1.875rem;
  --test-h1-line-height: 1.15;
  --test-h2-size: 1.375rem;
  --test-lead-size: 1rem;
  --test-lead-line-height: 1.55;
  --test-label-size: 0.75rem;
  --test-label-tracking: var(--tracking-label);
  --test-hero-en-size: 2.125rem;
  --test-hero-en-line-height: 1.18;
  --test-timer-size: 3.5rem;
  --test-option-text-size: 1.25rem;
  --test-option-small-text-size: 1.0625rem;
  --test-option-min-height: 60px;
  --test-option-small-min-height: 52px;
  --test-option-radius: 16px;
  --test-option-dot-size: 22px;
  --test-option-dot-ring: 7px;
  --test-button-min-height: 56px;
  --test-button-result-min-height: 64px;
  --test-button-padding-x: 32px;
  --test-secondary-min-height: 44px;
  --test-secondary-footer-min-height: 56px;
  --test-input-min-height: 56px;
  --test-input-radius: 14px;
  --test-choice-card-radius: 20px;
  --test-choice-card-padding: 20px;
  --test-choice-tile-size: 52px;
  --test-card-radius: 24px;
  --test-panel-padding: 24px;
  --test-checkbox-size: 24px;
  --test-checkbox-radius: 7px;
  --test-progress-height: 6px;
  --test-note-rule-width: 3px;
  --test-zone-badge-size: 30px;
  --test-zone-gap: 14px;
  --test-result-ring-size: 132px;
  --test-result-ring-width: 12px;
  --test-result-ring-text: 2.875rem;
  /* Frame (kit.py .btn, .ghost, .link, .panel, .plain; test_frame.py phone) */
  --test-status-size: 0.875rem;
  --test-status-padding-top: 16px;
  --test-button-font-size: 1.125rem;
  --test-button-inactive-opacity: 0.4;
  --test-secondary-border-width: 1.5px;
  --test-secondary-line: var(--line-strong);
  --test-secondary-font-size: 0.9375rem;
  --test-link-font-size: 0.9375rem;
  --test-link-underline-offset: 3px;
  --test-plain-bg: var(--surface);
  --test-plain-line: var(--surface-muted);
  --test-plain-border-width: 1.5px;
  --test-panel-radius: 24px;
  --test-heading-tracking: -0.015em;
  /* Gate (test_screens.py gate_phone, gate_desk; kit.py .field, .input, .chip, .check, .err-line) */
  --test-hero-bg: var(--pastel-peach);
  --test-hero-padding-top: 24px;
  --test-hero-padding-bottom: 24px;
  --test-hero-padding-inline: 24px;
  --test-hero-rule-width: 0px;
  --test-hero-rule-line: var(--tool-accent);
  --test-hero-radius: var(--radius-frame);
  --test-hero-gap: var(--space-sm);
  --test-hero-margin-top: 20px;
  --test-form-gap: var(--space-lg);
  --test-form-margin-top: 28px;
  --test-field-label-size: 0.9375rem;
  --test-legend-gap: 10px;
  --test-control-line: var(--input-line);
  --test-control-border-width: 1.5px;
  --test-input-padding-x: var(--space-md);
  --test-input-font-size: 1.0625rem;
  --test-chip-radius: var(--radius-pill);
  --test-chip-font-size: 1rem;
  --test-chip-padding-x: var(--space-md);
  /* LEVEL_TILE_GAP_PX is 6 on the board; TAP_GAP (UX-005) wins, as contrast wins in KD-20 */
  --test-level-tile-gap: var(--tap-gap);
  --test-tile-radius: 16px;
  --test-tile-gap: var(--space-2xs);
  --test-tile-padding-top: var(--space-xs);
  --test-tile-padding-bottom: 10px;
  --test-tile-font-size: 0.875rem;
  --test-tile-small-font-size: 0.75rem;
  --test-level-mark-size: 36px;
  --test-level-mark-on: var(--tool-accent);
  --test-avatar-size: 44px;
  --test-avatar-bg: var(--tool-accent-soft);
  --test-avatar-chip-padding-block: 6px;
  --test-avatar-chip-padding-start: 6px;
  --test-avatar-chip-gap: 10px;
  --test-checkbox-border-width: 2px;
  --test-checkbox-tick-width: 6px;
  --test-checkbox-tick-height: 11px;
  --test-checkbox-tick-stroke: 2.5px;
  --test-consent-size: 0.9375rem;
  --test-error-line-size: 0.9375rem;
  --test-error-icon-size: 18px;
  /* Test controls (kit.py .opt, .bar, .pill, .meta, .quiet; test_screens.py item_phone) */
  --test-option-gap: 14px;
  --test-option-padding-x: 20px;
  --test-option-stack-gap: 10px;
  --test-option-dot-border: 2px;
  --test-counter-size: 0.9375rem;
  --test-pill-size: 0.8125rem;
  --test-pill-padding-block: 7px;
  --test-pill-padding-inline: var(--space-sm);
  --test-progress-gap: 14px;
  --test-progress-track: var(--line);
  --test-note-size: 0.875rem;
  --test-instruction-size: 0.9375rem;
  --test-stem-margin-top: 44px;
  --test-options-margin-top: 36px;
  --test-option-bg: var(--surface);
  --test-option-ink: var(--ink);
  --test-option-line: var(--option-line);
  --test-option-selected-bg: var(--selected-bg);
  --test-option-selected-line: var(--selected-line);
  --test-option-selected-ink: var(--selected-ink);
  --test-option-selected-mark: var(--selected-mark);
  --test-pill-bg: var(--tool-accent-soft);
  --test-pill-ink: var(--tool-accent-ink);
  --test-progress-fill: var(--tool-accent);
  --test-note-ink: var(--ink-2);
  --test-stem-ink: var(--ink);
  --test-instruction-ink: var(--ink);
  /* Stage titles and choice cards (kit.py .label, .h1, .choice; test_screens.py choice2_phone) */
  --test-label-font: var(--font-body);
  --test-label-ink: var(--ink-2);
  --test-title-ink: var(--ink);
  --test-title-margin-top: var(--space-sm);
  --test-label-margin-top: 28px;
  --test-choice-card-bg: var(--surface);
  --test-choice-card-line: var(--line-strong);
  --test-choice-card-gap: var(--space-md);
  --test-choice-cards-gap: var(--space-sm);
  --test-choice-cards-margin-top: var(--space-xl);
  --test-choice-tile-radius: 16px;
  --test-choice-icon-size: 26px;
  --test-choice-title-font: var(--font-display);
  --test-choice-title-size: 1.25rem;
  --test-choice-only-line: var(--tool-accent);
  --test-choice-only-border-width: 2px;
  --test-choice-title-ink: var(--ink);
  --test-choice-meta-size: 0.9375rem;
  --test-choice-meta-ink: var(--ink-2);
  --test-tile-reading-bg: var(--pastel-blue);
  --test-tile-reading-ink: var(--zone-2);
  --test-tile-listening-bg: var(--pastel-sand);
  --test-tile-listening-ink: var(--zone-3);
  /* Stage two (test_screens.py reading_phone, listening_phone; kit.py .passage, .q, .play, .time) */
  --test-passage-size: 1.0625rem;
  --test-passage-line-height: 1.7;
  --test-passage-ink: var(--ink);
  --test-question-size: 1.25rem;
  --test-question-ink: var(--ink);
  --test-play-bg: var(--tool-accent);
  --test-play-ink: var(--on-tool-accent);
  --test-player-track: var(--line);
  --test-player-fill: var(--tool-accent);
  --test-player-link-ink: var(--tool-accent-ink);
  --test-time-size: 0.9375rem;
  --test-time-ink: var(--ink-2);
  --test-block-margin-top: var(--space-lg);
  /* Stage three writing (test_screens.py _task, _production_cards, _writing_box; kit.py .card, .task, .textarea,
     .count). The card ground, line and radius take their dark values in cycle 10 (no card, rule above) */
  --test-card-bg: var(--surface);
  --test-card-line: var(--surface-muted);
  --test-card-border-width: 1.5px;
  --test-card-padding: 24px;
  --test-card-top-width: 1.5px;
  --test-card-top-line: var(--surface-muted);
  --test-rule-gap: 0px;
  --test-task-gap: 10px;
  --test-task-indent: 22px;
  --test-task-size: 1.0625rem;
  --test-task-compact-size: 1rem;
  --test-task-ink: var(--ink);
  --test-task-marker-ink: var(--tool-accent-ink);
  --test-tile-voice-bg: var(--pastel-peach);
  --test-tile-voice-ink: var(--zone-1);
  --test-tile-writing-bg: var(--pastel-blue);
  --test-tile-writing-ink: var(--zone-2);
  --test-text-area-radius: 16px;
  --test-text-area-padding: var(--space-md);
  --test-text-area-size: 1.0625rem;
  /* The board's 1.6 would grow the six-row field past WRITING_BLOCK_MAX_PX (writing-sample); the built 1.5 stays */
  --test-text-area-line-height: var(--lh-body);
  --test-count-font: var(--font-mono);
  --test-count-size: 0.8125rem;
  --test-count-ink: var(--ink-2);
  --test-hint-size: 0.8125rem;
  --test-hint-ink: var(--ink-2);
  --test-field-label-ink: var(--ink);
  /* Speaking surfaces (test_screens_two.py _record_label, _mic, _recorder; kit.py .timer, .levels, .wave) */
  --test-record-size: 88px;
  --test-record-bg: var(--tool-accent);
  --test-record-ink: var(--on-tool-accent);
  --test-record-dot-size: 10px;
  --test-record-label-ink: var(--ink-2);
  /* RecordButton motion (data-model.md Record and waiting, Motion): the ring, its pulse, the press, the dots */
  --test-record-ring-width: 8px;
  --test-record-ring-reach: 20px;
  --test-record-footer-gap: 20px;
  --test-record-footer-margin-top: 28px;
  --test-review-primary-padding-x: 32px;
  --test-review-secondary-padding-x: 18px;
  --test-record-ring-bg: var(--tool-accent-soft);
  --test-ring-recording-scale: 1.231;
  --test-record-pulse-duration: 1600ms;
  --test-record-pulse-opacity-end: 0.35;
  --test-press-scale: 0.97;
  --test-press-duration: var(--dur-select);
  --test-state-duration: var(--dur-state);
  --test-exit-duration: var(--dur-exit);
  --test-wait-dot-size: 7px;
  --test-wait-dot-gap: 5px;
  --test-wait-dot-ink: var(--tool-accent);
  --test-wait-dots-cycle: 1200ms;
  --test-wait-dot-step: 400ms;
  --test-wait-dot-opacity-2: 0.6;
  --test-wait-dot-opacity-3: 0.3;
  --test-reduced-fade: 150ms;
  /* Notice icons (ux.md Error Presentation; board RX13): masks drawn in the element's own colour token */
  --test-icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
  --test-icon-speaker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7'/%3E%3C/svg%3E");
  --test-notice-icon-size: 18px;
  --test-notice-icon-ink: var(--error);
  --test-speaker-icon-size: 22px;
  --test-speaker-icon-ink: var(--ink-2);
  --test-notice-icon-gap: 10px;
  --test-notice-icon-offset: 2px;
  /* GooseFigure (data-model.md Goose): GOOSE_DRAWN_HEIGHTS per place, GOOSE_MAX_WIDTH as a ratio of the height */
  --test-goose-max-ratio: 1.5;
  --test-goose-analysis-height: 210px;
  --test-goose-loading-height: 200px;
  --test-goose-lost-height: 170px;
  --test-goose-margin-top: 12px;
  --test-loading-gap: 20px;
  --test-note-rule-gap: 16px;
  --test-timer-ink: var(--ink);
  --test-timer-tracking: -0.02em;
  --test-meter-height: 44px;
  --test-meter-bar-width: 4px;
  --test-meter-bar-gap: 4px;
  --test-meter-bar-radius: 3px;
  --test-meter-rest: var(--line);
  --test-waveform-height: 44px;
  --test-waveform-bar-width: 3px;
  --test-waveform-bar-gap: 3px;
  --test-caption-size: 1rem;
  --test-caption-ink: var(--ink);
  /* Analysis and offer (test_screens_two.py _analysis, _offer; kit.py .astep, .tick) */
  --test-step-gap: 20px;
  --test-step-mark-gap: 14px;
  --test-step-mark-size: 32px;
  --test-step-mark-border: 2px;
  --test-step-size: 1.0625rem;
  --test-step-ink: var(--ink-2);
  --test-step-current-ink: var(--ink);
  --test-step-done-bg: var(--tool-accent);
  --test-step-done-ink: var(--on-tool-accent);
  --test-step-ring: var(--tool-accent);
  --test-step-pending-ring: var(--line-strong);
  --test-tick-ink: var(--ok);
  --test-tick-size: 0.9375rem;
  --test-note-body-ink: var(--ink);
  /* Result (test_screens.py _band, _zone, _zones, _doors; kit.py .ring, .badge, .inset, .fix) */
  --test-ring-line: var(--pastel-peach);
  --test-ring-ink: var(--tool-accent-ink);
  --test-band-gap: 20px;
  --test-band-text-gap: var(--space-xs);
  --test-zone-1-bg: var(--zone-1-soft);
  --test-zone-2-bg: var(--zone-2-soft);
  --test-zone-3-bg: var(--zone-3-soft);
  --test-zone-padding: 24px;
  --test-zone-inner-gap: var(--space-sm);
  --test-zone-title-size: 1.125rem;
  --test-zone-title-ink: var(--ink);
  --test-zone-meaning-size: 0.9375rem;
  --test-zone-meaning-ink: var(--ink-2);
  --test-zone-badge-bg: var(--surface);
  --test-zone-badge-ink: var(--ink);
  --test-zone-badge-text: 0.875rem;
  --test-inset-bg: var(--surface);
  --test-inset-radius: 16px;
  --test-inset-padding-block: var(--space-md);
  --test-inset-padding-inline: 18px;
  --test-inset-gap: 6px;
  --test-original-ink: var(--ink-2);
  --test-original-size: 1rem;
  --test-fix-ink: var(--tool-accent-ink);
  --test-fix-size: 1rem;
  --test-zones-heading-ink: var(--ink);
  --test-result-lead-ink: var(--ink);
  --test-door-gap: var(--space-sm);
  --test-door-primary-size: 1.1875rem;
  --test-door-secondary-size: 1.0625rem;
  /* TestRail (test_frame.py _rail; kit.py .steps, .step) */
  --test-rail-mark-size: 28px;
  --test-rail-item-gap: 20px;
  --test-rail-mark-gap: var(--space-sm);
  --test-rail-size: 0.9375rem;
  --test-rail-number-size: 0.8125rem;
  --test-rail-ink: var(--ink-2);
  --test-rail-current-ink: var(--ink);
  --test-rail-mark-bg: var(--surface-muted);
  --test-rail-mark-ink: var(--ink-2);
  --test-rail-done-bg: var(--tool-accent-soft);
  --test-rail-done-ink: var(--tool-accent-ink);
  --test-rail-current-bg: var(--tool-accent);
  --test-rail-current-mark-ink: var(--on-tool-accent);
  /* Desktop grid (test_frame.py desk; data-model.md Layout): header row, rail, main at TEST_MAIN_WIDTHS, side */
  --test-header-height: 72px;
  --test-header-line: var(--surface-muted);
  --test-wordmark-size: 1.25rem;
  --test-layout-inner: 1244px;
  --test-layout-padding-x: 48px;
  --test-layout-padding-top: 56px;
  --test-layout-padding-bottom: 48px;
  --test-layout-gap: 56px;
  --test-rail-width: 220px;
  --test-rail-padding-top: var(--space-xs);
  --test-side-width: 380px;
  --test-main-width-default: 760px;
  --test-main-width-gate: 640px;
  --test-main-width-wide: 1000px;
  --test-main-width-sample: 640px;
  --test-main-width-result: 800px;
  --test-main-width-loading: 1200px;
  --test-gate-form-max: 600px;
  --test-button-min-width: 240px;
  --test-options-grid-gap: 14px;
  /* COR-3 and COR-4 (boards RX02 to RX07 desktop): the footer row gap; the side label and its gap to the card */
  --test-footer-gap: var(--space-lg);
  --test-side-label-gap: 20px;
  --test-reading-gap: 40px;
  --test-listening-gap: 28px;
  --test-band-row-gap: var(--space-xl);
  --test-door-card-bg: var(--surface);
  --test-door-card-line: var(--surface-muted);
  --test-door-card-padding: 24px;
  --test-door-sticky-top: var(--space-lg);
  --test-door-padding-x: var(--space-lg);
}

@media (min-width: 64rem) {
  [data-tool="test"] {
    --test-h1-size: 3.25rem;
    --test-h1-size-result: 3rem;
    --test-h1-size-compact: 2.75rem;
    --test-lead-size: 1.125rem;
    --test-hero-en-size: 3.25rem;
    --test-hero-en-line-height: 1.15;
    --test-button-padding-x: 44px;
    --test-h1-line-height: 1.08;
    --test-hero-padding-top: 36px;
    --test-hero-padding-bottom: 36px;
    --test-hero-padding-inline: 40px;
    --test-choice-cards-gap: var(--space-md);
    --test-passage-size: 1.125rem;
    --test-question-size: 1.5rem;
    --test-result-ring-size: 168px;
    --test-result-ring-width: 10px;
    --test-result-ring-text: 3.75rem;
    --test-goose-analysis-height: 420px;
    --test-goose-lost-height: 220px;
  }
}
/* Dark component values (after the desktop block, so dark wins at every width): D5 cards and rules, the result
   in dark (board RX08 dark: accent badges with the dark numeral, insets on the ground, the accent ring) */
@media (prefers-color-scheme: dark) {
  [data-tool="test"] {
    /* D5: no cards; a DARK_RULE (2 px accent, 22 px gap) marks a section, chips at CHIP_RADIUS_DARK_PX */
    --test-card-radius: 0px;
    --test-card-bg: transparent;
    --test-card-border-width: 0px;
    --test-card-top-width: 2px;
    --test-card-top-line: var(--tool-accent);
    --test-rule-gap: 22px;
    --test-card-padding: 0px;
    --test-chip-radius: 10px;
    --test-plain-border-width: 0px;
    /* COR-1 (board RX01 dark): the hero panel keeps its radius and padding on the one tool tint, no rule */
    --test-hero-bg: var(--tool-tint);
    --test-ring-line: var(--tool-accent);
    --test-ring-ink: var(--ink);
    --test-zone-badge-bg: var(--tool-accent);
    --test-zone-badge-ink: var(--on-tool-accent);
    --test-inset-bg: var(--bg);
  }
}

/* Trainer component tokens (trainer-redesign data-model.md Layout, Type, Controls and surfaces, Record; kit.py,
   trainer_frame.py): phone values here, desktop and dark values in the two queries below */
[data-tool="trainer"] {
  --tx-padding-top: 16px;
  --tx-padding-inline: var(--gutter-phone);
  --tx-padding-bottom: 28px;
  --tx-main-max: 760px;
  --tx-h1-size: 1.875rem;
  --tx-h1-size-stage: 1.875rem;
  --tx-h1-line-height: 1.15;
  --tx-heading-tracking: -0.015em;
  --tx-chooser-h1-size: 1.625rem;
  --tx-part-title-size: 1.0625rem;
  --tx-part-title-weight: 600;
  --tx-hero-en-size: 1.125rem;
  --tx-hero-en-line-height: 1.18;
  --tx-en-list-size: 1.125rem;
  --tx-en-list-line-height: 1.25;
  --tx-uk-size: 1rem;
  --tx-uk-line-height: 1.55;
  --tx-h2-size: 1.375rem;
  --tx-lead-size: 1rem;
  --tx-lead-line-height: 1.55;
  --tx-label-size: 0.75rem;
  --tx-label-tracking: var(--tracking-label);
  --tx-tiny-size: 0.875rem;
  --tx-tiny-line-height: 1.45;
  --tx-meta-size: 0.875rem;
  --tx-stat-size: 1.875rem;
  --tx-timer-size: 3.5rem;
  --tx-button-min-height: 56px;
  --tx-button-font-size: 1.125rem;
  --tx-button-padding-x: 32px;
  --tx-button-padding-x-stage: 32px;
  --tx-secondary-min-height: 44px;
  --tx-secondary-footer-min-height: 56px;
  --tx-secondary-border-width: 1.5px;
  --tx-pick-radius: 20px;
  --tx-pick-padding: 14px;
  --tx-pick-border-width: 1.5px;
  --tx-level-mark-size: 52px;
  --tx-level-line-mark-size: 22px;
  --tx-sphere-avatar-size: 64px;
  --tx-chip-min-height: 44px;
  --tx-chip-radius: var(--radius-pill);
  --tx-card-radius: 24px;
  --tx-card-padding: 24px;
  --tx-plain-radius: 24px;
  --tx-plain-padding: 18px 20px;
  --tx-plain-border-width: 1.5px;
  --tx-play-size: 56px;
  --tx-part-segment-height: 4px;
  --tx-part-segment-gap: 6px;
  --tx-step-row-gap: 14px;
  --tx-step-row-padding-y: 10px;
  --tx-pill-size: 36px;
  --tx-record-size: 76px;
  --tx-wait-dot-size: 8px;
  --tx-wait-dot-gap: 6px;
  --tx-level-bar-width: 4px;
  --tx-level-bar-gap: 4px;
  /* Record control and waiting (trainer_frame.py mic_dock, kit.py .mic, .levels, .dots; data-model.md Record) */
  --tx-record-ring-ready: 8px;
  --tx-record-ring-reach: 20px;
  --tx-ring-recording-scale: 1.261;
  --tx-record-ring-bg: var(--tool-accent-soft);
  --tx-record-pulse-duration: 1600ms;
  --tx-record-pulse-opacity-end: 0.35;
  --tx-record-glyph-size: 30px;
  --tx-level-bars-height: 30px;
  --tx-wait-dots-cycle: 1200ms;
  --tx-wait-dot-step: 400ms;
  --tx-wait-dot-opacity-2: 0.6;
  --tx-wait-dot-opacity-3: 0.3;
  --tx-press-scale: 0.97;
  --tx-press-duration: var(--dur-select);
  --tx-state-duration: var(--dur-state);
  --tx-exit-duration: var(--dur-exit);
  --tx-reduced-fade: 150ms;
  /* PartnerAvatar thinking (trainer-talk ui.md: partner-listening at reduced opacity) */
  --tx-avatar-thinking-opacity: 0.6;
  /* GooseFigure (data-model.md TX_GOOSE_DRAWN_HEIGHTS, TX_GOOSE_DRAWN_RULE) */
  --tx-goose-ready-height: 88px;
  --tx-goose-week-height: 112px;
  --tx-goose-offline-height: 112px;
  --tx-goose-card-height: 150px;
  --tx-goose-done-height: 96px;
  /* ComeBackGoose (trainer-comeback data-model.md TX_GOOSE_COMEBACK_HEIGHT) */
  --tx-goose-comeback-height: 132px;
  --tx-goose-max-ratio: 1.5;
  --tx-record-disabled-opacity: 0.4;
  --tx-built-gap-width: 3em;
  /* Desktop frame and stage (trainer_frame.py desk, trainer_desk_stage.py) */
  --tx-header-height: 72px;
  --tx-header-padding-x: 48px;
  --tx-header-line: var(--surface-muted);
  --tx-wordmark-size: 1.25rem;
  --tx-layout-max: 1300px;
  --tx-main-wide: 1000px;
  --tx-stage-width: 1172px;
  --tx-stage-row: 960px;
  --tx-stage-gap: 18px;
  --tx-card-row-gap: 12px;
  --tx-pill-gap: 10px;
  --tx-week-card-padding: 16px;
  /* Frame (kit.py .ghost, .link, .card, .plain) */
  --tx-secondary-font-size: 0.9375rem;
  --tx-link-font-size: 0.9375rem;
  --tx-link-underline-offset: 3px;
  --tx-plain-bg: var(--surface);
  --tx-plain-line: var(--surface-muted);
  --tx-card-bg: var(--surface);
  --tx-card-line: var(--surface-muted);
  --tx-card-border-width: 1.5px;
  --tx-card-top-width: 1.5px;
  --tx-card-top-line: var(--surface-muted);
  --tx-rule-width: 1.5px;
  --tx-rule-line: var(--surface-muted);
  --tx-rule-gap: 24px;
  --tx-notice-icon-size: 18px;
  --tx-notice-icon-gap: 10px;
  --tx-notice-icon-offset: 2px;
  /* Choosers (kit.py .pick; trainer_screens_start.py): the chosen card's inks follow --selected-* in dark */
  --tx-pick-gap: 12px;
  --tx-pick-tick-room: 28px;
  --tx-pick-gap-inner: 14px;
  --tx-pick-title-line-height: 1.3;
  --tx-pick-selected-ink: var(--ink);
  --tx-pick-selected-label: var(--tool-accent-ink);
  --tx-pick-selected-muted: var(--ink-2);
  /* Parts (kit.py .part, .chip; KD-T16) */
  --tx-part-title-line-height: 1.3;
  --tx-part-tile-size: 44px;
  --tx-part-tile-radius: 14px;
  --tx-chip-tick-size: 16px;
  --tx-chip-tick-gap: 6px;
  --tx-hero-en-tracking: -0.015em;
  --tx-icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E");
  --tx-zone-badge-size: 22px;
  /* Week (trainer_screens.py _path, .day) */
  --tx-counter-size: 56px;
  --tx-counter-ring-width: 3px;
  --tx-step-row-line-height: 1.35;
  --tx-step-heading-offset: 8px;
  --tx-pill-number-size: 0.875rem;
  --tx-pill-tick-size: 16px;
  --tx-pill-tick-stroke: 3;
  --tx-icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
}

/* Desktop trainer component values (data-model.md Layout, Type and Controls desktop columns; trainer_frame.py desk,
   trainer_desk_stage.py): the column padding becomes TX_LAYOUT_PADDING; before the dark block, so dark wins */
@media (min-width: 64rem) {
  [data-tool="trainer"] {
    --tx-padding-top: 48px;
    --tx-padding-inline: 64px;
    --tx-padding-bottom: 48px;
    --tx-h1-size: 3.25rem;
    --tx-h1-size-stage: 3.5rem;
    --tx-chooser-h1-size: 3rem;
    --tx-h1-line-height: 1.08;
    --tx-hero-en-size: 1.25rem;
    --tx-en-list-size: 1.25rem;
    --tx-hero-en-line-height: 1.14;
    --tx-uk-size: 1.1875rem;
    --tx-lead-size: 1.125rem;
    --tx-stat-size: 2.5rem;
    --tx-button-padding-x: 40px;
    --tx-button-padding-x-stage: 56px;
    --tx-pick-padding: 20px;
    --tx-level-mark-size: 64px;
    --tx-sphere-avatar-size: 96px;
    --tx-goose-ready-height: 185px;
    --tx-goose-week-height: 180px;
    --tx-goose-offline-height: 164px;
    --tx-goose-card-height: 185px;
    --tx-goose-done-height: 187px;
    --tx-goose-comeback-height: 236px;
  }
}

/* Dark trainer component values (data-model.md TX_CARD_RADIUS_PX, TX_CARD_PADDING, TX_DARK_RULE, TX_CHIP_RADIUS,
   TX_PLAIN_CARD; kit.py dark): no card, a 1 px --line top rule and top padding only; ruled sections take a 2 px
   accent rule and a 22 px gap; chips at 10 px; the chosen card's inks on the white selected ground */
@media (prefers-color-scheme: dark) {
  [data-tool="trainer"] {
    --tx-card-radius: 0px;
    --tx-card-padding: 20px 0 0;
    --tx-card-bg: transparent;
    --tx-card-border-width: 0px;
    --tx-card-top-width: 1px;
    --tx-card-top-line: var(--line);
    --tx-rule-width: 2px;
    --tx-rule-line: var(--tool-accent);
    --tx-rule-gap: 22px;
    --tx-chip-radius: 10px;
    --tx-plain-border-width: 0px;
    --tx-record-ring-bg: var(--surface-muted);
    --tx-pick-selected-ink: var(--selected-ink);
    --tx-pick-selected-label: var(--selected-ink);
    --tx-pick-selected-muted: var(--selected-ink);
  }
}

/* tool-scope:end */
