/* Axyrion, round 3, design B "Nocturne". No build step; fonts self-hosted (SIL OFL 1.1).
   Tokens: _build-notes/10-design-system.md s4 + B deltas (12-three-directions.md s4.3). Dark is the default;
   the theme switch sets data-theme="light" for this visit only. */

/* ---------- Fonts (latin subset; Irish fadas included) ---------- */
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  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: "Source Serif 4";
  src: url("../fonts/source-serif-4/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
  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: "IBM Plex Sans";
  src: url("../fonts/ibm-plex/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
  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: "IBM Plex Mono";
  src: url("../fonts/ibm-plex/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  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;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, Cambria, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --brand-slate: #1E3A4A;
  --brand-teal: #14B8A6;
  --brand-tint: #E6F7F5;

  --bg-page: #0A151B;
  --bg-sunken: #060E13;
  --bg-surface: #13252F;
  --bg-raised: #1A3140;
  --bg-overlay: #1E3A4A;
  --bg-inverse: #1E3A4A;
  --bg-tint: #12343A;
  --bg-tint-soft: #10262E;

  --text-strong: #EEF4F6;
  --text-body: #E7EEF1;
  --text-muted: #A3B4BD;
  --text-subtle: #93A5AE;
  --text-disabled: #5F7884;
  --text-on-solid: #0E1B22;
  --text-link: #5EEAD4;
  --text-link-hover: #99F6E4;
  --text-on-inverse: #E6F7F5;
  --text-on-inverse-strong: #FFFFFF;
  --text-on-inverse-muted: #B5C4CB;
  --text-on-inverse-link: #5EEAD4;

  --border-subtle: #1F3744;
  --border-default: #2A4452;
  --border-control: #6B8591;
  --border-strong: #A3B4BD;
  --border-inverse: rgb(230 247 245 / 0.12);
  --border-inverse-control: rgb(230 247 245 / 0.45);

  --accent: #2DD4BF;
  --accent-ink: #5EEAD4;
  --accent-ink-strong: #99F6E4;
  --accent-subtle: #12343A;
  --accent-subtle-border: rgb(45 212 191 / 0.35);
  --chip-neutral-bg: #22333C;
  --chip-neutral-text: #C9D5DB;
  --art-line: #4A6573;

  --selected-bg: #1E3A4A;
  --selected-text: #EEF4F6;
  --selected-ring: #5EEAD4;

  --action-bg: #2DD4BF;
  --action-bg-hover: #5EEAD4;
  --action-bg-active: #14B8A6;
  --action-text: #0E1B22;
  --action-inverse-bg: #14B8A6;
  --action-inverse-bg-hover: #2DD4BF;
  --action-inverse-text: #0E1B22;
  --disabled-bg: #1A2C36;
  --disabled-border: #2A4452;

  --focus-ring: #5EEAD4;
  --focus-ring-inverse: #5EEAD4;
  --focus-width: 2px;
  --focus-offset: 2px;

  --success-text: #4ADE80;
  --success-bg: #11362B;
  --warning-text: #FBBF24;
  --warning-bg: #3A2A0B;
  --info-text: #8EC5EA;
  --info-bg: #13293A;
  --danger-text: #F87171;
  --danger-bg: #3B1D1F;

  --scrim: rgb(0 0 0 / 0.5);
  --logo-ink: #E6F7F5;
  --logo-accent: #14B8A6;

  --elev-0: none;
  --elev-1: 0 1px 2px rgb(0 0 0 / 0.35);
  --elev-2: 0 1px 2px rgb(0 0 0 / 0.35), 0 12px 28px -12px rgb(0 0 0 / 0.55);
  --elev-3: 0 2px 4px rgb(0 0 0 / 0.30), 0 28px 56px -24px rgb(0 0 0 / 0.60);
  --elev-sheet: 0 -1px 0 var(--border-default);
  --band-ring: 0 0 0 1px rgb(230 247 245 / 0.08);

  --caption-idle: #5F7884;

  --dev-bezel: linear-gradient(180deg, #6B7C86 0%, #3E4F59 40%, #2A3943 100%);
  --dev-edge: rgb(230 247 245 / 0.10);
  --dev-highlight: rgb(255 255 255 / 0.22);
  --dev-glass: #05090B;
  --dev-camera: #141C21;
  --dev-camera-ring: #26323A;
  --dev-floor: rgb(0 0 0 / 0.40);
  --dev-shadow: 0 1px 1px rgb(0 0 0 / 0.50), 0 24px 48px -16px rgb(0 0 0 / 0.55), 0 56px 96px -40px rgb(0 0 0 / 0.65);
  --dev-shadow-hover: 0 1px 1px rgb(0 0 0 / 0.50), 0 24px 48px -16px rgb(0 0 0 / 0.62), 0 56px 96px -40px rgb(0 0 0 / 0.72);
  --dev-rim: 3px;
  --dev-glass-pad: clamp(12px, calc(0.75rem + 0.5vw), 20px);
  --dev-screen-r: 16px;
  --dev-glass-r: calc(var(--dev-screen-r) + var(--dev-glass-pad));
  --dev-rim-r: calc(var(--dev-glass-r) + var(--dev-rim));


  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --gutter: clamp(1rem, 0.6667rem + 1.4815vw, 2rem);
  --section-y: clamp(4rem, 2.8333rem + 5.1852vw, 7.5rem);
  --section-y-sm: clamp(3rem, 2.3333rem + 2.9630vw, 5rem);
  --section-head: clamp(2rem, 1.5rem + 2.2222vw, 3.5rem);
  --stack-lg: clamp(1.5rem, 1.1667rem + 1.4815vw, 2.5rem);
  --card-pad: clamp(1.25rem, 1rem + 1.1111vw, 2rem);
  --hero-top: clamp(3rem, 1.6667rem + 5.9259vw, 7rem);
  --hero-bottom: clamp(2rem, 1.6667rem + 1.4815vw, 3rem);
  --band-pad-y: clamp(2.5rem, 1.6667rem + 3.7037vw, 5rem);
  --band-pad-x: clamp(1.5rem, 0.3333rem + 5.1852vw, 5rem);
  --stage-gap: clamp(2rem, 5.5vw - 1.75rem, 4rem);

  --fs-display: clamp(2.5rem, 2.125rem + 3.333vw, 5.125rem);
  --fs-band: clamp(2.1875rem, 1.75rem + 1.9444vw, 3.5rem);
  --fs-h2: clamp(2.125rem, 1.583rem + 2.407vw, 3.75rem);
  --fs-h3-lg: clamp(1.75rem, 1.333rem + 1.852vw, 3rem);
  --fs-h3: clamp(1.25rem, 1.1667rem + 0.3704vw, 1.5rem);
  --fs-lede: clamp(1.125rem, 1.0625rem + 0.2778vw, 1.3125rem);
  --fs-body: clamp(1.0625rem, 1.0417rem + 0.0926vw, 1.125rem);
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;
  --fs-2xs: 0.75rem;

  --lh-display: 1.04;
  --lh-band: 1.08;
  --lh-h2: 1.12;
  --lh-h3: 1.3;
  --lh-lede: 1.5;
  --lh-body: 1.6;
  --lh-small: 1.5;
  --lh-ui: 1.2;

  --ls-display: -0.022em;
  --ls-h2: -0.015em;
  --ls-h3: -0.005em;
  --ls-label: 0.08em;

  --measure: 66ch;

  --container: 1360px;
  --container-narrow: 46rem;
  --header-h: 64px;
  --header-offset: var(--header-h);
  --tour-step: 60vh;
  --tour-release: 40vh;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 999px;

  --app-r-control: 0.5em;
  --app-r-btn: 0.625em;
  --app-r-card: 0.875em;
  --app-r-sheet: 1.5em;

  --dur-micro: 100ms;
  --dur-fast: 160ms;
  --dur-base: 240ms;
  --dur-slow: 400ms;
  --dur-slower: 600ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
  --ease-move: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-linear: linear;
  --shift-press: 1px;
  --shift-hover: 2px;
  --shift-reveal: 16px;
  --shift-slide: 32px;
  --shift-panel: 6px;
  --stagger: 60ms;

  --z-below: -1;
  --z-base: 0;
  --z-raised: 1;
  --z-badge: 2;
  --z-sticky: 50;
  --z-scrim: 80;
  --z-menu: 90;
  --z-skip: 100;
}

@media (min-width: 720px) {
  :root { --header-h: 72px; }
}
/* Large desktops (1920 x 1080 and up): a wider stage, so the tablet grows to about 900 px and its text to about 16 px */
@media (min-width: 1680px) {
  :root { --container: 1600px; }
}

/* ---------- Light (theme switch, this visit only): the plan's light values ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-page: #F2F5F6;
  --bg-sunken: #E9EEF0;
  --bg-surface: #FFFFFF;
  --bg-raised: #FFFFFF;
  --bg-overlay: #FFFFFF;
  --bg-inverse: #1E3A4A;
  --bg-tint: #E6F7F5;
  --bg-tint-soft: #EEF8F6;

  --text-strong: #1E3A4A;
  --text-body: #1F2933;
  --text-muted: #4B5B64;
  --text-subtle: #5E6E77;
  --text-disabled: #8796A0;
  --text-on-solid: #FFFFFF;
  --text-link: #0F766E;
  --text-link-hover: #115E59;

  --border-subtle: #E4EBEE;
  --border-default: #D5DEE2;
  --border-control: #74858E;
  --border-strong: #1E3A4A;

  --accent: #14B8A6;
  --accent-ink: #0F766E;
  --accent-ink-strong: #115E59;
  --accent-subtle: #E6F7F5;
  --accent-subtle-border: rgb(20 184 166 / 0.35);
  --chip-neutral-bg: #EEF2F4;
  --chip-neutral-text: #4B5B64;
  --art-line: #9DB0B8;

  --selected-bg: #1E3A4A;
  --selected-text: #FFFFFF;
  --selected-ring: transparent;

  --action-bg: #1E3A4A;
  --action-bg-hover: #142B37;
  --action-bg-active: #0E1F28;
  --action-text: #FFFFFF;
  --disabled-bg: #E9EEF0;
  --disabled-border: #D5DEE2;

  --focus-ring: #0F766E;

  --success-text: #166534;
  --success-bg: #E7F5EC;
  --warning-text: #8A4B08;
  --warning-bg: #FDF3E1;
  --info-text: #1D5478;
  --info-bg: #E8F1F7;
  --danger-text: #B42318;
  --danger-bg: #FDECEA;

  --scrim: rgb(14 27 34 / 0.35);
  --logo-ink: #1E3A4A;

  --elev-1: 0 1px 2px rgb(16 42 56 / 0.06), 0 1px 1px rgb(16 42 56 / 0.04);
  --elev-2: 0 1px 2px rgb(16 42 56 / 0.05), 0 8px 24px -12px rgb(16 42 56 / 0.18);
  --elev-3: 0 2px 4px rgb(16 42 56 / 0.04), 0 24px 48px -24px rgb(16 42 56 / 0.24);
  --elev-sheet: 0 -1px 0 var(--border-subtle), 0 -16px 40px rgb(16 42 56 / 0.06);
  --band-ring: none;

  --caption-idle: #76868F;

  --dev-bezel: linear-gradient(180deg, #E3E8EB 0%, #C9D2D7 45%, #B3BEC4 100%);
  --dev-edge: rgb(16 42 56 / 0.18);
  --dev-highlight: rgb(255 255 255 / 0.55);
  --dev-glass: #0B1215;
  --dev-camera: #1C262C;
  --dev-camera-ring: #2E3A41;
  --dev-floor: rgb(16 42 56 / 0.16);
  --dev-shadow: 0 1px 1px rgb(16 42 56 / 0.10), 0 6px 12px -6px rgb(16 42 56 / 0.12), 0 24px 48px -16px rgb(16 42 56 / 0.20), 0 56px 96px -40px rgb(16 42 56 / 0.28);
  --dev-shadow-hover: 0 1px 1px rgb(16 42 56 / 0.10), 0 6px 12px -6px rgb(16 42 56 / 0.12), 0 24px 48px -16px rgb(16 42 56 / 0.24), 0 56px 96px -40px rgb(16 42 56 / 0.34);
}

/* Dark only: the tablet's screen is lit (one step above the page), so the device reads as a display, not a cut-out */
:root:not([data-theme="light"]) .dev-screen {
  --bg-page: #0F1E27;
  --bg-sunken: #0B1820;
  --bg-surface: #172C37;
  --border-default: #2C4856;
  --border-subtle: #213B48;
}
/* Only where the glass keeps its radius (720 px and up): below that the glass is square and borderless, so a hairline would draw a square box round the rounded card */
@media (min-width: 720px) {
  :root:not([data-theme="light"]) .dev-glass { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.05); }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    --shift-press: 0px;
    --shift-hover: 0px;
    --shift-reveal: 0px;
    --shift-slide: 0px;
    --shift-panel: 0px;
  }
}

/* ---------- Scroll offset and focus ---------- */
html { scroll-padding-top: calc(var(--header-offset) + 16px); }
[hidden] { display: none !important; }
:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
}
.contact { --focus-ring: var(--focus-ring-inverse); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg-page);
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; color: var(--text-strong); text-wrap: balance; }
h1, h2 { font-family: var(--font-serif); font-weight: 500; }
p { text-wrap: pretty; }
strong, b { font-weight: 600; }
abbr[title] { text-decoration: underline dotted 1px; text-underline-offset: 0.18em; cursor: help; }
button { font: inherit; color: inherit; }

a {
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--text-link-hover); text-decoration-thickness: 2px; }

::selection { background: var(--bg-tint); color: var(--text-strong); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.js .nojs-only { display: none !important; }
@media (scripting: enabled) { .nojs-only { display: none !important; } }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -200px;
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--action-bg);
  color: var(--action-text);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--space-3); color: var(--action-text); }

.section { padding-block: var(--section-y); }
.section-surface { background: var(--bg-surface); border-block: 1px solid var(--border-subtle); }

.h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--ls-h2);
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font: 600 1rem/1.2 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-standard), border-color var(--dur-micro) var(--ease-standard), color var(--dur-micro) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(var(--shift-press)); }
.btn .icon { width: 18px; height: 18px; transition: transform var(--dur-fast) var(--ease-standard); }
.btn > .icon:first-child { margin-left: calc(-1 * var(--space-1)); }
.btn > .icon:last-child { margin-right: calc(-1 * var(--space-1)); }
.btn-primary { background: var(--action-bg); color: var(--action-text); }
.btn-primary:hover { background: var(--action-bg-hover); color: var(--action-text); }
.btn-primary:active { background: var(--action-bg-active); }
.btn-secondary { background: transparent; color: var(--text-strong); border-color: var(--border-control); }
.btn-secondary:hover { background: var(--bg-surface); border-color: var(--border-strong); color: var(--text-strong); }
.btn-secondary:active { background: var(--bg-sunken); }
@media (hover: hover) {
  .btn:hover .icon-arrow-down { transform: translateY(var(--shift-hover)); }
  .btn:hover .icon-arrow-right { transform: translateX(var(--shift-hover)); }
}
.btn-sm { min-height: 40px; padding: 0 var(--space-4); font-size: 0.9375rem; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 0;
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-standard);
}
.icon-btn:hover { background: var(--bg-surface); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 28px;
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font: 500 var(--fs-xs)/1.2 var(--font-sans);
  white-space: nowrap;
}
.chip .icon { width: 14px; height: 14px; stroke-width: 2; }
.chip-outline { color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--border-control); padding-left: var(--space-3); }
.chip-success { background: var(--success-bg); color: var(--success-text); }
.chip-warning { background: var(--warning-bg); color: var(--warning-text); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--bg-page);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms var(--ease-standard);
}
.site-header.is-scrolled { border-bottom-color: var(--border-default); }

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: auto;
  color: var(--logo-ink);
  border-radius: var(--radius-sm);
}
.logo { height: 28px; width: auto; aspect-ratio: 711.42 / 169.87; color: var(--logo-ink); }
@media (min-width: 720px) { .logo { height: 30px; } }

.nav-desktop { display: none; }
.nav-desktop ul { display: flex; gap: var(--space-1); }
.nav-desktop a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--dur-micro) var(--ease-standard);
}
.nav-desktop a::after {
  content: "";
  position: absolute;
  left: var(--space-3); right: var(--space-3); bottom: var(--space-2);
  height: 2px;
  border-radius: 2px;
  background: var(--accent-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-standard);
}
.nav-desktop a:hover { color: var(--text-strong); }
.nav-desktop a.is-active { color: var(--text-strong); }
.nav-desktop a.is-active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }
.header-cta { display: none; }
@media (min-width: 480px) { .header-cta { display: inline-flex; } }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }

.nav-mobile summary { list-style: none; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile .icon-close { display: none; }
.nav-mobile[open] .icon-close { display: block; }
.nav-mobile[open] .icon-menu { display: none; }
.nav-mobile[open] > summary { background: var(--bg-surface); }
.nav-mobile-panel {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: var(--z-menu);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: var(--space-2) var(--gutter) var(--space-6);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-default);
  box-shadow: var(--elev-2);
}
.nav-mobile[open] .nav-mobile-panel { animation: menu-in var(--dur-base) var(--ease-enter); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.nav-mobile[open]::before {
  content: "";
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: var(--z-scrim);
  background: var(--scrim);
}
.nav-mobile-panel li + li { border-top: 1px solid var(--border-subtle); }
.nav-mobile-panel a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 52px;
  color: var(--text-strong);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-mobile-panel .btn { width: 100%; margin-top: var(--space-4); }

@media (min-width: 720px) {
  .nav-desktop { display: block; }
  .nav-mobile { display: none; }
}

/* ---------- The stage ---------- */
.stage {
  position: relative;
  overflow-x: clip;
  padding-top: var(--hero-top);
  padding-bottom: var(--section-y);
}
.stage-grid { display: flex; flex-direction: column; gap: var(--stack-lg); }
@media (max-width: 719.98px) {
  .stage { padding-top: var(--space-8); }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}
.hero-status {
  font: 400 var(--fs-xs)/1.3 var(--font-mono);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.display {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  max-width: 18ch;
}
.display-line { display: block; }
.display-em { font-style: italic; color: var(--accent-ink); }
/* Dark: a calmer teal for the headline's second line (10.84:1 on #0A151B, saturation 0.44); #5EEAD4 stays for links, focus and selection */
:root:not([data-theme="light"]) .display-em { color: #8FD3C8; }
.lede {
  max-width: 30ch;
  font-size: var(--fs-lede);
  line-height: var(--lh-lede);
  color: var(--text-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); }
@media (max-width: 479.98px) {
  .hero-actions { align-self: stretch; gap: var(--space-2); }
  /* Side by side from 360 px (so the tablet starts in the first screen); they wrap at 320 */
  .hero-actions .btn { flex: 1 1 auto; padding-inline: var(--space-4); }
  .contact-actions .btn { flex: 1 1 100%; }
}

/* ---------- The tour (#product) ---------- */
.tour { position: relative; isolation: isolate; }
.skip-tour { left: 0; top: 0; }
.skip-tour:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tour-release { display: none; }

.tour-captions { display: grid; gap: var(--space-3); }
.tour-caption-text { font-size: var(--fs-body); color: var(--text-body); }
.tour-caption-text b { color: var(--text-strong); }

@media (scripting: enabled) {
  .tour-captions { gap: 0; }
  .tour-caption { grid-area: 1 / 1; }
  .tour-caption:not(:first-child) { opacity: 0; visibility: hidden; }
  .tour-caption-text {
    font: 500 var(--fs-h3)/1.3 var(--font-serif);
    letter-spacing: var(--ls-h3);
    color: var(--text-strong);
  }
}
.js .tour-caption { opacity: 0; visibility: hidden; transition: opacity var(--dur-fast) var(--ease-exit), visibility 0s linear var(--dur-fast); }
.js .tour-caption.is-active { opacity: 1; visibility: visible; transition: opacity var(--dur-fast) var(--ease-enter), visibility 0s; }

.tour-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-1);
  width: var(--dev-w, 100%);
  max-width: 100%;
  padding: var(--space-1);
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
  box-shadow: inset 0 0 0 1px var(--border-default);
}
/* Reserve the tab bar's space before the script shows it (no shift) */
@media (scripting: enabled) {
  .tour-tabs[hidden] { display: grid !important; visibility: hidden; }
}
.tour-thumb {
  position: absolute;
  top: var(--space-1);
  bottom: var(--space-1);
  left: 0;
  width: var(--seg-w, 0px);
  transform: translateX(var(--seg-x, 0px));
  border-radius: var(--radius-full);
  background: var(--selected-bg);
  box-shadow: inset 0 0 0 1px var(--selected-ring), var(--elev-1);
}
.tour-tabs.is-ready .tour-thumb { transition: transform var(--dur-base) var(--ease-move), width var(--dur-base) var(--ease-move); }
.tour-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-width: 0;
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font: 500 0.875rem/1.2 var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-micro) var(--ease-standard);
}
.tour-tab .icon { width: 18px; height: 18px; color: var(--text-subtle); transition: color var(--dur-micro) var(--ease-standard); }
.tour-tab:hover { color: var(--text-strong); }
.tour-tab[aria-selected="true"] { color: var(--selected-text); }
.tour-tab[aria-selected="true"] .icon { color: var(--accent); }
.tour-tab:focus-visible { outline-offset: 2px; }
.tour-tab-label { overflow: hidden; text-overflow: ellipsis; }
@media (pointer: coarse) { .tour-tab { min-height: 44px; } }

.tour-progress {
  position: absolute;
  left: var(--space-5); right: var(--space-5);
  bottom: calc(-1 * var(--space-3));
  height: 2px;
  border-radius: 2px;
  background: var(--border-default);
  overflow: hidden;
  opacity: 0;
}
.tour-progress > span {
  display: block;
  height: 100%;
  background: var(--accent-ink);
  transform: scaleX(0);
  transform-origin: left center;
}

@media (max-width: 719.98px) {
  .tour-tabs {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .tour-thumb { display: none; }
  .tour-tab {
    justify-content: flex-start;
    min-height: 44px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: inset 0 0 0 1px var(--border-default);
  }
  .tour-tab[aria-selected="true"] { background: var(--selected-bg); box-shadow: inset 0 0 0 1px var(--selected-ring); }
}

/* ---------- Stacked modes (below 1000 px): hero copy, then tabs, device, caption ---------- */
@media (max-width: 999.98px) {
  .tour { display: flex; flex-direction: column; gap: var(--space-4); }
  .tour-stage, .tour-pin { display: contents; }
  .tour-tabs { order: 1; }
  .dev-settle { order: 3; margin-top: var(--space-2); }
  .tour-captions { order: 4; }   /* chips, tablet, then its caption: the product comes straight after the hero */
  .tour { --dev-w: min(100%, 880px); }
}
@media (min-width: 720px) and (max-width: 999.98px) {
  .dev-settle { margin-top: var(--space-6); }
}

/* ---------- Split stage (1000+): words left 4, tablet right 8, chosen by CSS at first paint ---------- */
@media (min-width: 1000px) {
  .stage { padding-top: var(--space-12); padding-bottom: var(--section-y-sm); }
  .stage-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(656px, 8fr);
    grid-template-rows: auto auto auto;
    column-gap: var(--stage-gap);
    row-gap: 0;
  }
  .hero-copy {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    position: relative;
    z-index: var(--z-raised);
    container-type: inline-size;
    padding-block: var(--space-8);
  }
  .display { font-size: min(var(--fs-display), 15cqi, 10.5svh); max-width: none; }
  .tour {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    grid-template-rows: subgrid;
    pointer-events: none;
  }
  .tour > * { pointer-events: auto; }
  .tour-stage { grid-column: 2; grid-row: 1 / -1; min-width: 0; }
  .tour-pin {
    --dev-w: min(100%, 980px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-4);
  }

  .tour-pin > .dev-settle { order: 1; }
  .tour-pin > .tour-tabs { order: 2; }
  .tour-captions { grid-column: 1; grid-row: 2; align-self: start; padding-top: var(--space-8); max-width: 34rem; }
  .tour-release { grid-column: 1; grid-row: 3; }
}

@media (min-width: 1000px) and (height < 700px) {
  .stage { padding-top: var(--space-4); }
  .tour-pin { gap: var(--space-2); }
  /* Set on .tour too, so the caption slot under the tablet is exactly the tablet's width */
  .tour, .tour-pin { --dev-w: min(100%, max(656px, calc((100svh - var(--header-offset) - 120px) * 4 / 3)), 980px); }
}
@media (scripting: enabled) and (min-width: 1000px) and (height < 700px) {
  .tour-stage { grid-row: 1; }
  .tour-captions { grid-column: 2; grid-row: 2; justify-self: end; width: var(--dev-w); padding-top: var(--space-6); max-width: none; }
}

/* Pinned mode (1000 x 700+, scripting): row 1 fills the first screen; site.js adds .is-armed, and only then does the pin stick and do the caption blocks get heights. */
@media (scripting: enabled) and (min-width: 1000px) and (min-height: 700px) {
  .stage { padding-block: 0; }
  .stage-grid { grid-template-rows: minmax(calc(100svh - var(--header-offset)), auto) auto auto; }
  .tour-pin {
    --dev-w: min(100%, max(656px, calc((100svh - var(--header-offset) - 128px) * 4 / 3)), 980px);
    min-height: calc(100svh - var(--header-offset));
    justify-content: center;
    padding-block: var(--space-5) var(--space-4);
    gap: var(--space-2);
  }
  .tour-captions {
    container-type: inline-size;
    gap: var(--space-12);
    padding-top: 0;
    padding-bottom: var(--section-y-sm);
  }
  .tour-caption,
  .tour-caption:not(:first-child),
  .js .tour-caption { grid-area: auto; opacity: 1; visibility: visible; }
  .tour-caption-text {
    font: 500 min(var(--fs-h2), 11cqi)/var(--lh-h2) var(--font-serif);
    letter-spacing: var(--ls-h2);
    color: var(--caption-idle);
    transition: color var(--dur-base) var(--ease-standard);
  }
  .tour-caption.is-active .tour-caption-text { color: var(--text-strong); }

  .tour.is-armed .tour-pin { position: sticky; top: var(--header-offset); }
  .tour.is-armed .tour-captions { gap: 0; padding-bottom: 0; }
  .tour.is-armed .tour-caption { display: flex; align-items: center; min-height: var(--tour-step); }
  .tour.is-armed .tour-caption:last-child { min-height: calc(var(--tour-step) * 0.6); }

  .tour.is-armed .tour-release { display: block; height: calc(var(--tour-release) + 50vh); }
  /* Only here does the section slide over the pinned tablet, so only here is it a sheet with a rounded top */
  .is-tour-armed .ai {
    margin-top: calc(-1 * var(--tour-release));
    border-top-color: transparent;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    box-shadow: var(--elev-sheet);
  }
}

/* Progress line: each caption block's view timeline is inset to the middle line; the line shows only while its block crosses it (not in Firefox). */
@supports (animation-timeline: view()) and (timeline-scope: --a) {
  @media (prefers-reduced-motion: no-preference) and (scripting: enabled) and (min-width: 1000px) and (min-height: 700px) {
    .tour { timeline-scope: --tc0, --tc1, --tc2, --tc3; }
    .tour.is-armed .tour-caption:nth-child(1) { view-timeline: --tc0 block; view-timeline-inset: 50% 50%; }
    .tour.is-armed .tour-caption:nth-child(2) { view-timeline: --tc1 block; view-timeline-inset: 50% 50%; }
    .tour.is-armed .tour-caption:nth-child(3) { view-timeline: --tc2 block; view-timeline-inset: 50% 50%; }
    .tour.is-armed .tour-caption:nth-child(4) { view-timeline: --tc3 block; view-timeline-inset: 50% 50%; }
    .tour.is-armed .tour-tab[aria-selected="true"] .tour-progress { animation: tour-track linear both; animation-range: cover 0% cover 100%; }
    .tour.is-armed .tour-tab[aria-selected="true"] .tour-progress > span { animation: tour-fill linear both; animation-range: cover 0% cover 100%; }
    .tour.is-armed .tour-tab:nth-of-type(1) .tour-progress,
    .tour.is-armed .tour-tab:nth-of-type(1) .tour-progress > span { animation-timeline: --tc0; }
    .tour.is-armed .tour-tab:nth-of-type(2) .tour-progress,
    .tour.is-armed .tour-tab:nth-of-type(2) .tour-progress > span { animation-timeline: --tc1; }
    .tour.is-armed .tour-tab:nth-of-type(3) .tour-progress,
    .tour.is-armed .tour-tab:nth-of-type(3) .tour-progress > span { animation-timeline: --tc2; }
    .tour.is-armed .tour-tab:nth-of-type(4) .tour-progress,
    .tour.is-armed .tour-tab:nth-of-type(4) .tour-progress > span { animation-timeline: --tc3; }
  }
}
@keyframes tour-track { 0% { opacity: 0; } 0.5% { opacity: 1; } 100% { opacity: 1; } }
@keyframes tour-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- The tablet (device frame) ---------- */
.dev-settle { width: 100%; display: flex; justify-content: flex-end; }
@media (max-width: 999.98px) { .dev-settle { justify-content: flex-start; } }
.dev {
  position: relative;
  isolation: isolate;
  width: var(--dev-w, min(100%, 880px));
  max-width: 100%;
}
.dev-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  z-index: var(--z-badge);
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--border-default), var(--elev-1);
  color: var(--text-strong);
  font: 600 var(--fs-2xs)/1.2 var(--font-sans);
  letter-spacing: 0.01em;
}
.dev-bezel {
  position: relative;
  padding: var(--dev-rim);
  border-radius: var(--dev-rim-r);
  background: var(--dev-bezel);
  box-shadow: inset 0 1px 0 var(--dev-highlight), 0 0 0 1px var(--dev-edge), var(--dev-shadow);
}
.dev-glass {
  padding: var(--dev-glass-pad);
  border-radius: var(--dev-glass-r);
  background: var(--dev-glass);
}
.dev-camera {
  position: absolute;
  top: calc(var(--dev-rim) + var(--dev-glass-pad) / 2 - 3px);
  left: 50%;
  width: 6px; height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--dev-camera);
  box-shadow: 0 0 0 1px var(--dev-camera-ring);
}
.dev::after {
  content: "";
  position: absolute;
  left: 12.5%; right: 12.5%;
  bottom: -18px;
  height: 24px;
  z-index: var(--z-below);
  background: radial-gradient(closest-side, var(--dev-floor), transparent);
}
.dev-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--dev-screen-r);
  clip-path: inset(0 round var(--dev-screen-r));
  overflow: clip;
  background: var(--bg-page);
  container: tour-screen / inline-size;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .dev-settle { animation: dev-settle linear both; animation-timeline: view(); animation-range: entry 0% entry 50%; }
  }
}
@keyframes dev-settle {
  from { transform: perspective(1600px) rotateX(4deg) scale(0.98) translateY(8px); }
  to { transform: none; }
}

@media (max-width: 719.98px) {
  .dev { display: flex; flex-direction: column; width: 100%; }
  .dev-badge { position: static; width: fit-content; margin: 0 0 var(--space-2) auto; }
  .dev-bezel { padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .dev-glass { padding: 0; border-radius: 0; background: none; }
  .dev-camera, .dev::after { display: none; }
  .dev-screen {
    aspect-ratio: auto;
    border-radius: var(--radius-lg);
    clip-path: none;
    border: 1px solid var(--border-default);
    box-shadow: var(--elev-2);
  }
}

/* ---------- The app inside the tablet ---------- */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-size: clamp(0.6875rem, 1.786cqw, 1rem);
  line-height: 1.45;
  color: var(--text-body);
  text-align: left;
}
.tour-panels { flex: 1; min-height: 0; display: grid; }
.tour-panel { grid-area: 1 / 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.js .tour-panel { opacity: 0; visibility: hidden; transition: opacity var(--dur-fast) var(--ease-exit), visibility 0s linear var(--dur-fast); }
.js .tour-panel.is-active { opacity: 1; visibility: visible; transition: opacity var(--dur-fast) var(--ease-enter), visibility 0s; }

.app-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.75em;
  min-height: 3.25em;
  padding: 0.5em 1.5em;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.app-mark { width: 1.5em; height: 1.5em; color: var(--logo-ink); }
.app-title { margin-right: auto; font: 600 1em/1.2 var(--font-sans); color: var(--text-strong); }
.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.25em 0.75em;
  border-radius: var(--radius-full);
  font: 600 max(0.8125em, 12px)/1.2 var(--font-sans);
  white-space: nowrap;
}
.app-chip-outline { color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--border-control); }
.app-chip-neutral { color: var(--chip-neutral-text); background: var(--chip-neutral-bg); box-shadow: inset 0 0 0 1px var(--border-default); }
.app-chip-accent { color: var(--accent-ink-strong); background: var(--accent-subtle); }

.app-body { flex: 1; min-height: 0; padding: 1.5em; }
.app-card {
  min-width: 0;
  padding: 1.25em;
  border: 1px solid var(--border-default);
  border-radius: var(--app-r-card);
  background: var(--bg-surface);
  box-shadow: var(--elev-1);
}
.app-h { font: 600 1em/1.3 var(--font-sans); color: var(--text-strong); }
.app-tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.75em;
  padding: 0.25em 0.75em;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent-ink-strong);
  font: 600 max(0.8125em, 12px)/1.2 var(--font-sans);
  white-space: nowrap;
}
.app-label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.375em;
  font-size: max(0.875em, 12px);
  line-height: 1.35;
  color: var(--text-muted);
}
.app-label .icon { width: 1.15em; height: 1.15em; margin-top: 0.05em; color: var(--accent-ink); stroke-width: 1.8; }
.kicker {
  font: 600 max(0.8125em, 12px)/1.3 var(--font-sans);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}
.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: max(2.375em, 26px);
  padding: 0 1em;
  border: 1px solid transparent;
  border-radius: var(--app-r-btn);
  background: var(--action-bg);
  color: var(--action-text);
  font: 600 0.9375em/1.2 var(--font-sans);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.app-btn:hover { background: var(--action-bg-hover); }
.app-btn:active { transform: translateY(var(--shift-press)); }
.app-btn:disabled { cursor: default; background: var(--disabled-bg); border-color: var(--disabled-border); color: var(--text-disabled); }
.app-btn-secondary { background: transparent; color: var(--text-strong); border-color: var(--border-control); }
.app-btn-secondary:hover { background: var(--bg-surface); border-color: var(--border-strong); }
.app-btn-sm { min-height: max(2.25em, 26px); font-size: 0.875em; }
.app-btn .icon, .app-btn-quiet .icon { width: 1.2em; height: 1.2em; }
.app-btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 0.375em;
  min-height: max(2.375em, 26px);
  padding: 0 0.75em;
  border: 1px solid transparent;
  border-radius: var(--app-r-btn);
  background: transparent;
  color: var(--text-link);
  font: 600 0.9375em/1.2 var(--font-sans);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-standard), border-color var(--dur-micro) var(--ease-standard);
}
.app-btn-quiet:hover { background: var(--bg-tint-soft); border-color: var(--border-default); }
.app-icon-btn {
  display: inline-grid;
  place-items: center;
  width: max(2.25em, 26px);
  height: max(2.25em, 26px);
  padding: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-strong);
  cursor: pointer;
}
.app-icon-btn .icon { width: 1.25em; height: 1.25em; }
.app-icon-btn[aria-disabled="true"] { color: var(--text-disabled); cursor: default; }
.letter {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.5em;
  height: 1.5em;
  border: 1px solid var(--border-control);
  border-radius: var(--app-r-control);
  font: 400 0.875em/1 var(--font-mono);
  color: var(--text-strong);
}
@container tour-screen (max-width: 640px) {
  .app-body { padding: 1.25em; }
}
.app [data-scroll-region] { overflow-y: auto; overscroll-behavior-y: auto; scrollbar-width: thin; scrollbar-color: var(--border-control) transparent; }
.app :focus-visible { outline-offset: 1px; }

/* ---------- 01 Exam practice ---------- */
.exam {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 1.25em;
}
.exam-q { display: flex; flex-direction: column; gap: 0.75em; }
.exam-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 0.75em; }
.exam-stem { display: grid; gap: 0.5em; font-size: 1em; line-height: 1.5; color: var(--text-body); }
.exam-ask { font-weight: 600; color: var(--text-strong); }
.exam-options, .exam-choices { display: grid; gap: 0.5em; }
.exam-option summary,
.exam-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75em;
  min-height: max(2.75em, 30px);
  padding: 0.5em 0.75em;
  border: 1px solid var(--border-control);
  border-radius: var(--app-r-btn);
  background: var(--bg-surface);
  color: var(--text-body);
  font-size: 0.9375em;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
  transition: border-color var(--dur-micro) var(--ease-standard), background-color var(--dur-micro) var(--ease-standard), color var(--dur-micro) var(--ease-standard);
}
.exam-option summary::-webkit-details-marker { display: none; }
.opt-text { min-width: 0; }
.opt-why { padding: 0.5em 0.75em 0.25em 3em; font-size: 0.875em; line-height: 1.45; }
.exam-answer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: max(2.375em, 26px);
  font: 600 0.9375em/1.2 var(--font-sans);
  color: var(--text-link);
  cursor: pointer;
  list-style: none;
}
.exam-answer > summary::-webkit-details-marker { display: none; }
.exam-answer .chev { width: 1.2em; height: 1.2em; transition: transform var(--dur-base) var(--ease-standard); }
.exam-answer[open] .chev { transform: rotate(180deg); }
.exam-answer-body { display: grid; gap: 0.5em; padding-top: 0.75em; font-size: 0.9375em; }
.exam-source { display: flex; gap: 0.5em; align-items: flex-start; font-size: max(0.875em, 12px); color: var(--text-muted); }
.exam-source .icon { width: 1.15em; height: 1.15em; margin-top: 0.1em; color: var(--accent-ink); }
html:not(.js) .exam-q { overflow-y: auto; }

.exam-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 0.75em; }
.exam-fieldset > legend { padding: 0; margin-bottom: 0.75em; float: left; width: 100%; }
.exam-fieldset > legend + * { clear: both; }
.exam-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.exam-radio:focus-visible + .exam-label { outline: var(--focus-width) solid var(--focus-ring); outline-offset: 1px; }
@media (hover: hover) {
  .exam:not(.is-answered) .exam-label:hover,
  .exam-option summary:hover { border-color: var(--accent-ink); background: var(--bg-tint-soft); }
}
.exam-choice.is-selected .exam-label { border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
.exam-choice.is-selected .letter { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--text-on-solid); }
.exam.is-answered .exam-label { cursor: default; color: var(--text-muted); }
.exam-choice.is-correct .exam-label { border-color: var(--success-text); box-shadow: inset 0 0 0 1px var(--success-text); background: var(--success-bg); color: var(--text-strong); }
.exam-choice.is-correct.is-missed .exam-label { border-style: dashed; box-shadow: inset 0 0 0 0.5px var(--success-text); background: var(--bg-surface); }
.exam-choice.is-wrong .exam-label { border-color: var(--danger-text); box-shadow: inset 0 0 0 1px var(--danger-text); background: var(--danger-bg); color: var(--text-strong); }
.exam-choice.is-correct .letter { border-color: var(--success-text); color: var(--success-text); }
.exam-choice.is-wrong .letter { border-color: var(--danger-text); color: var(--danger-text); }
/* The verdict is a small tag clipped onto the option's top border, so the option text never wraps.
   Once answered the options move apart, so each tag has room above its own option. */
.exam.is-answered .exam-choices { gap: 0.8125em; }
.exam.is-answered .exam-actions { margin-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  .exam.is-enhanced .exam-choices { transition: gap var(--dur-base) var(--ease-move); }
}
.exam-verdict {
  position: absolute;
  top: 0;
  right: 0.75em;
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.125em 0.5em;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  font: 600 max(0.8125em, 12px)/1 var(--font-sans);
  white-space: nowrap;
  transform: translateY(-50%);
}
.exam-verdict .icon { width: 1em; height: 1em; stroke-width: 2.4; }
.is-correct .exam-verdict { color: var(--success-text); background: var(--success-bg); box-shadow: inset 0 0 0 1px var(--success-text); }
.is-wrong .exam-verdict { color: var(--danger-text); background: var(--danger-bg); box-shadow: inset 0 0 0 1px var(--danger-text); }
.exam-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75em; margin-top: 0.25em; }
.exam-message { font-size: 0.875em; color: var(--text-muted); }

.exam-why { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: clip; }
/* Without the script the card holds the plain <details>, which has no padding of its own */
.exam:not(.is-enhanced) .exam-why { padding: 1.25em; }
.exam-why-body { display: grid; align-content: start; gap: 0.75em; min-height: 0; padding: 1.25em; }
.exam-result {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.75em;
  padding: 0.5em 0.75em;
  border-radius: var(--app-r-btn);
  font: 600 1em/1.3 var(--font-sans);
}
.exam-result.is-right { background: var(--success-bg); color: var(--success-text); }
.exam-result.is-wrong { background: var(--danger-bg); color: var(--danger-text); }
.exam-result-ic { display: inline-grid; place-items: center; flex: none; width: 1.5em; height: 1.5em; border-radius: 50%; background: currentColor; }
.exam-result-ic .icon { width: 1em; height: 1em; color: var(--bg-surface); stroke-width: 2.6; }
.exam-point { font-size: 0.9375em; line-height: 1.5; color: var(--text-strong); }
.exam-whys { display: grid; border-top: 1px solid var(--border-subtle); }
.why { border-bottom: 1px solid var(--border-subtle); }
.why > summary {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.5em;
  padding: 0.25em 0.25em;
  color: var(--text-link);
  font: 500 0.875em/1.2 var(--font-sans);
  cursor: pointer;
  list-style: none;
}
.why > summary::-webkit-details-marker { display: none; }
.why > summary .letter { font-size: 0.9286em; }
.why > summary .chev { width: 1.2em; height: 1.2em; margin-left: auto; transition: transform var(--dur-base) var(--ease-standard); }
.why[open] > summary .chev { transform: rotate(180deg); }
.why > p { padding: 0 0.75em 0.75em 2.75em; font-size: 0.875em; line-height: 1.45; color: var(--text-body); }

@media (scripting: enabled) and (min-width: 720px) {
  .exam:not(.is-answered) .exam-q { transform: translateX(calc(40% + 0.625em)); }
  .exam:not(.is-answered) .exam-why { visibility: hidden; opacity: 0; transform: translateX(var(--shift-slide)); }
}
.exam.is-enhanced .exam-q { transition: transform var(--dur-base) var(--ease-move); }
.exam.is-enhanced .exam-why { transition: opacity var(--dur-fast) var(--ease-exit), transform var(--dur-fast) var(--ease-exit), visibility 0s linear var(--dur-fast); }
.exam.is-enhanced.is-answered .exam-q { transform: none; }
.exam.is-enhanced.is-answered .exam-why { visibility: visible; opacity: 1; transform: none; transition: opacity var(--dur-base) var(--ease-enter), transform var(--dur-base) var(--ease-enter), visibility 0s; }

/* ---------- 02 AI patient ---------- */
.pt { display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr); padding: 0; }
.pt-stage {
  position: relative;
  min-height: 0;
  padding: 1.5em;
  background: var(--bg-sunken);
  border-right: 1px solid var(--border-default);
}
.pt-live-stage { display: flex; flex-direction: column; gap: 1.25em; height: 100%; }
.pt-clock {
  position: absolute;
  top: 1.25em;
  right: 1.25em;
  padding: 0.25em 0.75em;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  font: 400 max(0.8125em, 12px)/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-strong);
}
.pt-who { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75em; padding-top: 1.75em; }
.pt-id { display: grid; gap: 0.25em; }
.pt-disc {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(4em / 1.625);
  height: calc(4em / 1.625);
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--accent-ink-strong);
  font: 600 1.625em/1 var(--font-serif);
}
.pt-disc::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-standard);
}
.pt-disc.is-speaking::after { opacity: 1; }
.pt-name { font: 600 1.0625em/1.3 var(--font-sans); color: var(--text-strong); }
.pt-meta { font-size: max(0.875em, 12px); color: var(--text-muted); }
.pt-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.25em 0.75em 0.25em 0.5em;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--border-default);
  font: 500 max(0.8125em, 12px)/1.3 var(--font-sans);
  color: var(--text-strong);
}
.pt-status-dot { width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--accent); }
.pt-status.is-replying .pt-status-dot { background: var(--text-subtle); }
.pt-status.is-ended .pt-status-dot { background: var(--border-control); }
.pt-brief-sum { display: none; }
.pt-brief { display: grid; margin: 0; }
.pt-brief > div { display: grid; gap: 0.125em; padding: 0.5em 0; border-top: 1px solid var(--border-subtle); }
.pt-brief > div:last-child { border-bottom: 1px solid var(--border-subtle); }
.pt-brief dt { font-size: max(0.8125em, 12px); color: var(--text-subtle); }
.pt-brief dd { margin: 0; font-size: max(0.875em, 12px); color: var(--text-body); }   /* never smaller than its 12 px label */
.pt-end { margin-top: auto; align-self: flex-start; }
.pt-result { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75em; height: 100%; }
.pt-ended { font: 400 max(0.8125em, 12px)/1.2 var(--font-mono); color: var(--text-muted); }
.pt-summary { font: 400 1.0625em/1.5 var(--font-serif); color: var(--text-strong); }
.pt-reset { margin-top: auto; margin-left: -0.75em; }

.pt-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-page); }
.pt-live { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 1.25em 1.5em 1em; gap: 0.75em; }
.pt-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.75em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2em);
  mask-image: linear-gradient(to bottom, transparent 0, #000 2em);
}
.pt-sys { align-self: center; font-size: max(0.8125em, 12px); color: var(--text-subtle); }
.pt-you {
  align-self: flex-end;
  max-width: 85%;
  padding: 0.5em 0.75em;
  border-radius: 0.75em 0.75em 0.25em 0.75em;
  background: var(--bg-tint);
  color: var(--text-body);
  font-size: 0.9375em;
  line-height: 1.45;
}
.pt-her { align-self: flex-start; max-width: 88%; font: 400 1.0625em/1.6 var(--font-serif); color: var(--text-strong); }
.pt-new { animation: pt-in var(--dur-fast) var(--ease-enter); }
@keyframes pt-in { from { opacity: 0; } to { opacity: 1; } }
.pt-dots { display: inline-flex; gap: 0.25em; align-self: flex-start; padding: 0.5em 0; }
.pt-dots i { width: 0.375em; height: 0.375em; border-radius: 50%; background: var(--text-subtle); }
@media (prefers-reduced-motion: no-preference) {
  .pt-dots i { animation: pt-dot 1200ms var(--ease-standard) infinite; }
  .pt-dots i:nth-child(2) { animation-delay: 200ms; }
  .pt-dots i:nth-child(3) { animation-delay: 400ms; }
}
@keyframes pt-dot { 0%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.pt-composer { display: flex; align-items: center; gap: 0.5em; }
.pt-field {
  flex: 1;
  min-width: 0;
  min-height: 2.75em;
  display: flex;
  align-items: center;
  padding: 0.5em 1em;
  border: 1px solid var(--border-control);
  border-radius: 1.375em;
  background: var(--bg-surface);
  font-size: 0.875em;
  line-height: 1.35;
  color: var(--text-body);
}
.pt-field.is-empty { color: var(--text-disabled); border-color: var(--border-default); }
.pt-send {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.75em;
  height: 2.75em;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--action-bg);
  color: var(--action-text);
  cursor: pointer;
}
.pt-send .icon { width: 1.25em; height: 1.25em; stroke-width: 2; }
.pt-send:disabled { background: var(--disabled-bg); color: var(--text-disabled); box-shadow: inset 0 0 0 1px var(--disabled-border); cursor: default; }
.pt-note { font-size: max(0.8125em, 12px); color: var(--text-subtle); }

.pt-review { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 1.25em 1.5em 1em; gap: 1em; }
.seg {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-self: flex-start;
  gap: 0.25em;
  padding: 0.25em;
  border-radius: var(--radius-full);
  background: var(--bg-sunken);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}
.seg-thumb {
  position: absolute;
  top: 0.25em; bottom: 0.25em; left: 0;
  width: var(--seg-w, 0px);
  transform: translateX(var(--seg-x, 0px));
  border-radius: var(--radius-full);
  background: var(--selected-bg);
  box-shadow: inset 0 0 0 1px var(--selected-ring), var(--elev-1);
}
.seg.is-ready .seg-thumb { transition: transform var(--dur-base) var(--ease-move), width var(--dur-base) var(--ease-move); }
.seg-btn {
  position: relative;
  z-index: 1;
  min-height: max(2.25em, 26px);
  padding: 0 1em;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font: 500 0.875em/1.2 var(--font-sans);
  cursor: pointer;
}
.seg-btn[aria-selected="true"] { color: var(--selected-text); }
.pt-views { flex: 1; min-height: 0; display: grid; }
.pt-view { grid-area: 1 / 1; min-height: 0; padding-right: 0.25em; }
.fb-group { display: grid; gap: 0.5em; padding: 0.75em 0; border-top: 1px solid var(--border-default); }
.fb-group:first-child { border-top: 0; padding-top: 0; }
.fb-group-h { font: 600 max(0.8125em, 12px)/1.3 var(--font-sans); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-muted); }
.fb-rows { display: grid; gap: 0.25em; }
.fb-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; align-items: center; gap: 0.5em; min-height: 2.25em; }
.fb-status { display: inline-flex; align-items: center; gap: 0.375em; font: 600 max(0.875em, 12px)/1.2 var(--font-sans); }
.fb-status .icon { width: 1.25em; height: 1.25em; stroke-width: 2; }
.fb-status.is-done { color: var(--success-text); }
.fb-status.is-partly { color: var(--warning-text); }
.fb-item { font: 500 max(0.9375em, 12px)/1.3 var(--font-sans); color: var(--text-strong); }
.fb-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  min-height: max(2em, 24px);
  padding: 0 0.5em;
  border: 0;
  border-radius: var(--app-r-control);
  background: transparent;
  color: var(--text-link);
  font: 400 max(0.8125em, 12px)/1 var(--font-mono);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.fb-time .icon { width: 1.1em; height: 1.1em; }
.fb-time:hover { background: var(--bg-tint-soft); }
.fb-try { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5em; padding-left: 7em; }
.fb-try-line { font: italic 400 1em/1.4 var(--font-serif); color: var(--text-strong); }
.fb-foot { padding-top: 0.75em; border-top: 1px solid var(--border-default); font-size: max(0.8125em, 12px); color: var(--text-subtle); }
.tr-lines { display: grid; gap: 0.25em; }
.tr-line { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 0.5em; padding: 0.375em 0.5em; border-radius: var(--app-r-control); outline: 2px solid transparent; outline-offset: -2px; transition: outline-color var(--dur-base) var(--ease-standard); }
.tr-t { font: 400 max(0.8125em, 12px)/1.6 var(--font-mono); color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.tr-line p { font-size: max(0.875em, 12px); line-height: 1.45; color: var(--text-body); }
.tr-line.is-her p { font-family: var(--font-serif); font-size: max(0.9375em, 12.5px); color: var(--text-strong); }
.tr-line.is-sys p { color: var(--text-subtle); font-size: max(0.8125em, 12px); }
.tr-who { display: block; font: 600 max(0.8125em, 12px)/1.4 var(--font-sans); color: var(--text-muted); }
.tr-line.is-flash { outline-color: var(--accent-ink); background: var(--bg-tint-soft); }

/* ---------- 03 Progress ---------- */
.prog { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25em; align-items: stretch; }
.prog-due { display: flex; flex-direction: column; gap: 0.75em; }
.prog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5em; }
.prog-count { font: 400 max(0.8125em, 12px)/1.2 var(--font-mono); color: var(--text-muted); white-space: nowrap; }
.prog-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 14em;
  gap: 0.75em;
  margin: 0 -1.25em;
  padding: 0.25em 1.25em;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1.25em;
  scrollbar-width: none;
}
.prog-rail::-webkit-scrollbar { display: none; }
/* A soft edge where cards run on (a deliberate peek, not a cut); site.js drops the fade at either end */
.prog-rail {
  --fade-l: 1.25em;
  --fade-r: 2.5em;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}
.prog-rail.at-start { --fade-l: 0px; }
.prog-rail.at-end { --fade-r: 0px; }
.prog-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
  padding: 1em;
  border: 1px solid var(--border-default);
  border-radius: 0.75em;
  background: var(--bg-page);
}
.prog-title { font: 600 max(0.9375em, 12px)/1.35 var(--font-sans); color: var(--text-strong); }
.prog-when { display: inline-flex; align-items: center; gap: 0.25em; font-size: max(0.875em, 12px); color: var(--text-muted); }
.prog-when .icon { width: 1.2em; height: 1.2em; stroke-width: 2; }
.prog-when.is-done { color: var(--success-text); }
.prog-when.is-again { color: var(--warning-text); }
.prog-card .app-btn { margin-top: 0.25em; }
.prog-rail-btns { display: flex; justify-content: flex-end; gap: 0.5em; }
.prog-detail { display: grid; gap: 0.5em; padding: 1em; border-radius: 0.75em; background: var(--bg-sunken); }
.prog-detail-h { font: 600 0.9375em/1.4 var(--font-sans); color: var(--text-strong); }
.prog-detail-why { font-size: 0.875em; color: var(--text-body); }
.prog-actions { display: flex; flex-wrap: wrap; gap: 0.5em; margin-top: 0.25em; }
.prog-topics { display: flex; flex-direction: column; gap: 0.5em; }
.prog-meters { flex: 1; display: grid; grid-auto-rows: minmax(2.75em, 1fr); }
.prog-meters li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 7.5em;
  align-items: center;
  gap: 0.75em;
  min-height: 2.75em;
  border-top: 1px solid var(--border-subtle);
}
.prog-topic { font-size: 0.9375em; color: var(--text-strong); }
.prog-state { font-size: max(0.875em, 12px); color: var(--text-muted); }
.meter { display: inline-flex; gap: 0.25em; }
.meter i { width: 1.5em; height: 0.375em; border-radius: var(--radius-full); background: var(--border-default); }
.meter i.on { background: var(--accent-ink); }

/* ---------- 04 Revision cards ---------- */
.deck { display: flex; flex-direction: column; gap: 1em; }
.deck-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em 0.75em; }
.deck-count { font: 400 max(0.8125em, 12px)/1.2 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-muted); }
.deck-stage { display: grid; justify-items: center; margin-top: auto; padding-bottom: 0.75em; }
.deck-stack { position: relative; width: min(100%, 38em); }
.deck-stack::before,
.deck-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-default);
  border-radius: 1.25em;
  background: var(--bg-surface);
  z-index: 0;
}
.deck-stack::before { transform: translateY(0.375em) scale(0.98); }
.deck-stack::after { transform: translateY(0.75em) scale(0.96); z-index: -1; }
.deck-card {
  position: relative;
  z-index: 1;
  display: grid;
  transform-style: preserve-3d;
  perspective: 1200px;
}
.deck-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75em;
  min-height: 18em;
  padding: 2em 2.5em;
  border: 1px solid var(--border-default);
  border-radius: 1.25em;
  background: var(--bg-surface);
  box-shadow: var(--elev-2);
  backface-visibility: hidden;
  transition: transform 500ms var(--ease-standard), visibility 0s linear 250ms;
  cursor: pointer;
}
.deck-front { transform: perspective(1200px) rotateY(0deg); }
.deck-back { transform: perspective(1200px) rotateY(-180deg); visibility: hidden; }
.deck-card.is-flipped .deck-front { transform: perspective(1200px) rotateY(180deg); visibility: hidden; }
.deck-card.is-flipped .deck-back { transform: perspective(1200px) rotateY(0deg); visibility: visible; }
.deck-card.no-anim .deck-face { transition: none; }
.deck-kicker { font: 600 max(0.8125em, 12px)/1.3 var(--font-sans); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--accent-ink); }
.deck-q { font: 600 1.5em/1.3 var(--font-serif); color: var(--text-strong); text-wrap: balance; }
.deck-a { font-size: 1em; line-height: 1.55; color: var(--text-body); }
.deck-src { font-size: max(0.875em, 12px); color: var(--text-muted); }
.deck-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75em; margin-bottom: auto; padding-top: 0.75em; }

/* ---------- Compact card (below 720 px): rem text, nothing scrolls inside ---------- */
@media (max-width: 719.98px) {
  .app { font-size: 0.9375rem; }
  .js .tour-panel:not(.is-active) { display: none; }
  .app-bar { padding: 0.5em 1em; }
  .app-body { padding: 1em; }
  .app-btn, .app-btn-quiet, .app-icon-btn, .seg-btn, .fb-time { min-height: 44px; }
  .app-icon-btn, .pt-send { width: 44px; height: 44px; }
  .exam-option summary, .exam-label { min-height: 44px; }
  .exam { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .exam:not(.is-answered) .exam-why { display: none; }
  html:not(.js) .exam-why { display: block; }
  .exam-why-body { overflow: visible; }
  .why > summary { min-height: 44px; }
  .pt { grid-template-columns: minmax(0, 1fr); }
  .pt-stage { border-right: 0; border-bottom: 1px solid var(--border-default); padding: 1em; }
  .pt-live-stage { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 0.5em 0.75em; }
  .pt-who { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5em 0.75em; padding-top: 0; grid-column: 1; }
  .pt-disc { width: calc(2.5em / 1.625); height: calc(2.5em / 1.625); }
  .pt-clock { position: static; grid-column: 2; grid-row: 1; justify-self: end; align-self: start; margin-top: 0.5em; }
  .pt-brief-wrap { grid-column: 1; }
  .pt-brief-sum { display: flex; align-items: center; gap: 0.25em; min-height: 44px; font: 600 0.875em/1.2 var(--font-sans); color: var(--text-link); cursor: pointer; list-style: none; }
  .pt-brief-sum::-webkit-details-marker { display: none; }
  .pt-brief-sum::after { content: ""; width: 0.5em; height: 0.5em; margin-left: 0.25em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-0.15em) rotate(45deg); transition: transform var(--dur-base) var(--ease-standard); }
  .pt-brief-wrap[open] .pt-brief-sum::after { transform: translateY(0.1em) rotate(-135deg); }
  .pt-end { grid-column: 2; grid-row: 2; align-self: center; justify-self: end; margin-top: 0; }
  .pt-live, .pt-review { padding: 1em; }
  .pt-log { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .pt-view { overflow: visible; }
  .pt-views { display: block; }
  .fb-row { grid-template-columns: 5.25em minmax(0, 1fr) auto; gap: 0.5em; }
  .fb-try { padding-left: 0; }
  .prog { grid-template-columns: minmax(0, 1fr); }
  .prog-rail { margin: 0 -1em; padding-inline: 1em; scroll-padding-inline: 1em; --fade-l: 1em; }
  /* Phones: topic and state on one line, the meter under the topic (three columns left the topic only about 76 px, so Cardiovascular ran into its meter) */
  .prog-meters li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "topic state" "meter meter"; gap: 0.375em 0.75em; align-content: center; padding-block: 0.625em; }
  .prog-topic { grid-area: topic; }
  .prog-meters .meter { grid-area: meter; }
  .prog-state { grid-area: state; }
  .deck-face { min-height: 12em; padding: 1.5em; }
  .deck-q { font-size: 1.25em; }
}

/* ---------- AI feedback moment ---------- */
.ai {
  position: relative;
  z-index: var(--z-raised);
  padding-block: var(--section-y);
  background: var(--bg-surface);
  border-block: 1px solid var(--border-subtle);
  overflow-x: clip;
  container-type: inline-size;
}
#after-tour { position: absolute; top: 0; left: 0; width: 1px; height: 1px; outline: none; }
.ai-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-4) var(--space-6);
  margin-bottom: var(--section-head);
}
.ai-head .chip { transform: translateY(-0.2em); }
.ai-rail {
  --pad-l: max(var(--gutter), (100cqw - var(--container)) / 2);
  --card-w: min(46rem, calc(min(100cqw - 2 * var(--gutter), var(--container)) * 0.88));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--card-w);
  gap: var(--space-6);
  padding: var(--space-1) var(--pad-l) var(--space-4) var(--pad-l);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad-l);
  scrollbar-width: thin;
  scrollbar-color: var(--border-control) transparent;
}
.ai-rail:focus-visible { outline-offset: -2px; }
.js .ai-rail.has-controls { scrollbar-width: none; }
.js .ai-rail.has-controls::-webkit-scrollbar { display: none; }
.fb-card {
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-10);
  min-height: 15rem;
  padding: var(--card-pad);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
}
/* The last card aligns to the container's right edge, so the end mirrors the start (card 2 peeks on the left) */
.fb-card:last-child { scroll-snap-align: end; }
.fb-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.fb-card-skill { font: 600 var(--fs-sm)/1.3 var(--font-sans); color: var(--text-strong); }
.fb-card-time { margin-left: auto; font: 400 var(--fs-sm)/1.3 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-subtle); }
.fb-quote { margin: 0; align-self: end; }
.fb-quote p {
  max-width: 22ch;
  font: italic 400 var(--fs-h3-lg)/1.25 var(--font-serif);
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
/* The evidence mark: a highlighter band under the quoted words (not an underline, which is the site's link style).
   It fills in once, when the card is first seen. */
@property --mark { syntax: '<color>'; inherits: true; initial-value: transparent; }
.fb-mark {
  color: inherit;
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 88% / 100% 0.3em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: --mark var(--dur-slow) var(--ease-standard);
}
.fb-card.is-seen .fb-mark, html:not(.js) .fb-mark { --mark: var(--accent-subtle-border); }

.ai-controls { display: flex; align-items: center; gap: var(--space-6); margin-top: var(--space-6); }
/* The script shows the controls after load (at an idle moment); their space is kept from the start, so nothing shifts */
.js .ai-controls[hidden] { display: flex !important; visibility: hidden; }
.pager { position: relative; flex: 1; height: 44px; }
.pager-track { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border-default); }
.pager-fill { position: absolute; inset: 0; background: var(--accent-ink); transform: scaleX(var(--p, 0)); transform-origin: left center; transition: transform var(--dur-base) var(--ease-move); }
.pager-mark {
  position: absolute;
  top: 0;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pager-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--border-control);
  background: var(--bg-surface);
  transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.pager-mark:hover .pager-dot { border-color: var(--accent-ink); }
.pager-mark[aria-current="true"] .pager-dot { background: var(--accent-ink); border-color: var(--accent-ink); box-shadow: 0 0 0 2px var(--bg-surface); }
.rail-arrows { display: inline-flex; flex: none; border-radius: var(--radius-full); background: var(--bg-page); box-shadow: inset 0 0 0 1px var(--border-default); }
.rail-arrow {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
}
.rail-arrow[aria-disabled="true"] { color: var(--text-disabled); cursor: default; }
@media (hover: hover) { .rail-arrow:not([aria-disabled="true"]):hover { background: var(--bg-surface); } }

/* ---------- Built by a GP ---------- */
.about-grid { display: grid; gap: var(--stack-lg); align-items: center; }
.about-text { display: grid; gap: var(--space-5); align-content: center; }
.about-lede { max-width: 34em; }
.about-note { font-size: var(--fs-sm); color: var(--text-muted); max-width: 34em; }
.signature { display: grid; gap: var(--space-1); }
.sig-name { font: 600 var(--fs-h3)/var(--lh-h3) var(--font-serif); color: var(--text-strong); }
.sig-creds { font-size: var(--fs-sm); color: var(--text-muted); }
.sig-creds abbr { text-decoration-color: var(--text-subtle); }
.heart { margin: 0; width: 100%; max-width: 22rem; display: grid; gap: var(--space-3); }
.heart-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 480 / 620;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%);
}
.heart-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.turn-window { position: absolute; inset: 0; overflow: clip; }
.turn-strip { display: block; width: 1600%; max-width: none; height: 100%; opacity: 0; }
.heart.is-turning .turn-strip { opacity: 1; }
.heart.is-turning .heart-still { opacity: 0; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .turn-strip {
      animation: heart-turn linear both;
      animation-timeline: view();
      animation-range: cover 15% cover 85%;
      animation-timing-function: steps(16, jump-none);
    }
  }
}
/* 16 frames of 720 x 930 (-5 to 51.25 degrees; frame 9 is the still's 25 degrees) */
@keyframes heart-turn { from { transform: translateX(0); } to { transform: translateX(-93.75%); } }
.heart-credit { font-size: var(--fs-xs); line-height: 1.45; color: var(--text-subtle); }
.heart-credit a { color: var(--text-link); }
@media (min-width: 1000px) {
  .about-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--stage-gap); }
  .heart { grid-column: 1; grid-row: 1; max-width: 30rem; justify-self: end; }
  .about-text { grid-column: 2; grid-row: 1; }
}

/* ---------- Questions ---------- */
.faq-grid { display: grid; gap: var(--space-8); }
@media (min-width: 1000px) {
  .faq-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: var(--stage-gap); align-items: start; }
}
.faq-list { border-top: 1px solid var(--border-default); }
.faq-item { border-bottom: 1px solid var(--border-default); }
.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 64px;
  margin-inline: calc(-1 * var(--space-2));
  padding: var(--space-5) var(--space-2);
  border-radius: var(--radius-sm);
  font: 600 1.125rem/1.35 var(--font-sans);
  color: var(--text-strong);
  cursor: pointer;
  list-style: none;
  transition: color var(--dur-micro) var(--ease-standard);
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { color: var(--text-link); }
.plus {
  position: relative;
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  transition: transform var(--dur-base) var(--ease-standard), background-color var(--dur-micro) var(--ease-standard);
}
.plus::before,
.plus::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 1.75px;
  margin: -0.875px 0 0 -6px;
  border-radius: 2px;
  background: var(--text-strong);
}
.plus::after { transform: rotate(90deg); }
.faq-item[open] .plus { transform: rotate(45deg); background: var(--bg-tint); border-color: transparent; }
.faq-answer { max-width: 44rem; padding: 0 var(--space-12) var(--space-6) 0; color: var(--text-muted); }
@media (max-width: 639.98px) { .faq-answer { padding-right: 0; } }
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    :root { interpolate-size: allow-keywords; }
    .faq-item::details-content {
      height: 0;
      overflow: clip;
      transition: height var(--dur-base) var(--ease-standard), content-visibility var(--dur-base) allow-discrete;
    }
    .faq-item[open]::details-content { height: auto; }
  }
}

/* ---------- Contact band ---------- */
.contact-wrap { padding-bottom: var(--section-y-sm); }
.contact {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: var(--band-pad-y) var(--band-pad-x);
  border-radius: var(--radius-xl);
  background: var(--bg-inverse);
  box-shadow: var(--band-ring);
  color: var(--text-on-inverse);
}
.contact h2 {
  max-width: 14ch;
  font-size: var(--fs-band);
  font-weight: 500;
  line-height: var(--lh-band);
  letter-spacing: var(--ls-h2);
  color: var(--text-on-inverse-strong);
}
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-8); }
.btn-accent { background: var(--action-inverse-bg); color: var(--action-inverse-text); }
.btn-accent:hover { background: var(--action-inverse-bg-hover); color: var(--action-inverse-text); }
.btn-band { background: transparent; color: var(--text-on-inverse); border-color: var(--border-inverse-control); }
.btn-band:hover { border-color: var(--text-on-inverse); background: rgb(230 247 245 / 0.06); color: var(--text-on-inverse); }
.btn-band:active { background: rgb(230 247 245 / 0.10); }
.copy-status { font-size: var(--fs-sm); color: var(--text-on-inverse-link); }
/* "Copied" appears beside the address it copied, so the button row keeps no empty slot */
.contact-email { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); margin-top: var(--space-5); font-size: 1.0625rem; font-weight: 500; }
.contact-email a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-on-inverse-link); }
.contact-small { margin-top: var(--space-1); font-size: var(--fs-sm); color: var(--text-on-inverse-muted); }
/* Wide screens: the heading on the left, the actions, address and small print on the right, bottoms aligned */
@media (min-width: 1000px) {
  .contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: var(--space-16);
  }
  .contact-side .contact-actions { margin-top: 0; }
}

/* ---------- Footer ---------- */
.site-footer { padding: var(--space-2) 0 var(--space-10); color: var(--text-muted); font-size: var(--fs-sm); }
.footer-top { display: grid; gap: var(--space-4); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border-default); }
.footer-top .logo { height: 26px; }
@media (min-width: 720px) { .footer-top { grid-template-columns: 1fr auto; align-items: center; } }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-strong); font-weight: 500; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent-ink); }
.footer-legal { display: grid; gap: var(--space-2); padding-top: var(--space-6); font-size: 0.875rem; }
.legal-line { color: var(--text-strong); font-weight: 500; }
.legal-address:empty { display: none; }
.nowrap { white-space: nowrap; }

/* ---------- One-shot reveal (JavaScript only; never on anything visible at load) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal-pending { opacity: 0; transform: translateY(var(--shift-reveal)); }
  .reveal-run:not(.reveal-pending) {
    transition: opacity var(--dur-slow) var(--ease-enter), transform var(--dur-slow) var(--ease-enter);
    transition-delay: calc(var(--reveal-i, 0) * var(--stagger));
  }
}

/* ---------- Plain pages (privacy, credits, 404) ---------- */
.page-main { padding-block: var(--section-y-sm) var(--section-y); }
.prose { max-width: 44rem; }
.prose h1 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); }
.prose h2 { margin: var(--space-12) 0 var(--space-3); font: 600 clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem)/1.25 var(--font-serif); }
.prose p, .prose li { color: var(--text-body); }
.prose p + p { margin-top: var(--space-4); }
.prose ul { padding-left: 1.25em; list-style: disc; }
.prose li + li { margin-top: var(--space-2); }
.prose .eyebrow { margin-bottom: var(--space-4); font: 400 var(--fs-xs)/1.3 var(--font-mono); letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--text-muted); }
.prose .meta { margin-top: var(--space-4); color: var(--text-muted); font: 400 0.8125rem/1.4 var(--font-mono); letter-spacing: 0.04em; }
.summary-box {
  margin-top: var(--space-8);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}
.summary-box h2 { margin-top: 0; }
.back-link { margin-top: var(--space-12); }
.text-link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link .icon { width: 18px; height: 18px; }
.notfound { min-height: 60vh; display: grid; align-content: center; }
.section-intro { margin-top: var(--space-5); font-size: var(--fs-lede); color: var(--text-muted); max-width: 40rem; }
.credit-block { margin-top: var(--space-4); padding: var(--space-5) var(--space-6); border-radius: var(--radius-md); background: var(--bg-surface); border: 1px solid var(--border-default); overflow-wrap: anywhere; }

/* ---------- Theme switch: a 240 ms cross-fade (View Transitions; instant under reduced motion) ---------- */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--dur-base); animation-timing-function: var(--ease-standard); }

/* ---------- Reduced motion: every change is instant (safety net) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .tour-progress { display: none; }
  .deck-face { transition: visibility 0s; }
}

/* ---------- Forced colours (Windows high contrast) ---------- */
@media (forced-colors: active) {
  .tour-tab[aria-selected="true"],
  .exam-choice.is-selected .exam-label,
  .exam-choice.is-correct .exam-label,
  .exam-choice.is-wrong .exam-label,
  .seg-btn[aria-selected="true"] { outline: 3px solid Highlight; outline-offset: -3px; }
  .tour-progress, .tour-thumb, .seg-thumb { display: none; }
  .dev-bezel { border: 1px solid CanvasText; }
  .dev::after { display: none; }
  .ai { border-top: 1px solid CanvasText; }
  .pager-track { background: CanvasText; }
}
@media (forced-colors: active) and (max-width: 719.98px) {
  .dev-screen { border: 1px solid CanvasText; }
}

/* ---------- Print: the page reads as a document; the tour prints tab 01 only ---------- */
@media print {
  .site-header, .skip-link, .theme-toggle, .tour-tabs, .tour-captions, .exam-actions, .contact-actions, .ai-controls, .turn-window { display: none !important; }
  body, html { background: #FFFFFF; color: #000000; }
  .tour-panel:not(#tp-exam) { display: none !important; }
  .tour-panel { opacity: 1 !important; visibility: visible !important; }
  .tour.is-armed .tour-pin { position: static; }
  .dev::after, .dev-camera { display: none; }
  .dev-bezel, .dev-glass { padding: 0; background: none; box-shadow: none; }
  .dev-screen { border: 1px solid #000000; }
  .reveal-pending { opacity: 1 !important; transform: none !important; }
  .ai { margin-top: 0 !important; box-shadow: none; }
  .section, .section-surface, .ai { border: 0; padding-block: 24px; background: none; }
  .contact { background: none; color: #000000; border: 1px solid #000000; box-shadow: none; }
  .contact h2, .contact-small, .contact-email a { color: #000000; }
}
