/*
  One stylesheet for the whole site. No framework, no build step, no inline styles anywhere (CSP: style-src 'self').
  Themes are custom properties: light (the default for everyone, whatever the system setting) and dark. The theme button sets
  data-theme="dark" on <html> (theme.js); light has no attribute.
  Mobile first: the base rules target a 360 px wide phone, media queries add room.

  Look: "clinical calm" (cool off-white, deep teal primary, hairline borders). Every colour lives in the theme blocks below; components use the tokens only.
  The text/background pairs are contrast-checked (WCAG 2.2 AA): do not pair tokens in new ways without checking them.
*/

/* ---------- Font (self-hosted Inter, variable weight, latin subset; licence in /fonts/Inter-OFL.txt) ---------- */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-wght-8e433c0592f77beb6dc527d7b90be120.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens that do not change with the theme ---------- */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Fluid type scale (360 px phone to wide desktop). */
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.35rem);
  --step-2: clamp(1.44rem, 1.3rem + 0.7vw, 1.75rem);
  --step-3: clamp(1.73rem, 1.5rem + 1.1vw, 2.25rem);
  --step-4: clamp(2.07rem, 1.7rem + 1.8vw, 3rem);

  /* Fluid space. */
  --space-2xs: 0.25rem;
  --space-xs: clamp(0.5rem, 0.45rem + 0.25vw, 0.625rem);
  --space-s: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --space-m: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  --space-l: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --space-xl: clamp(2rem, 1.6rem + 2vw, 3rem);
  --space-2xl: clamp(3rem, 2.4rem + 3vw, 4.5rem);

  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  /* Buttons and other controls: squared-off, not pills. */
  --radius-control: 8px;
  --radius-pill: 999px;

  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-overshoot: cubic-bezier(0.34, 1.56, 0.64, 1);

  --measure: 68ch;
  --control-h: 2.75rem;
  --control-h-small: 2.5rem;
  --control-h-tight: 2.25rem;
}

/* ---------- Theme tokens ----------
   Light is the default (no data-theme); the dark block overrides it. There is no system-setting block on purpose: everyone starts
   light. */

:root {
  color-scheme: light;
  --bg: #F5F8F8;
  --surface: #FFFFFF;
  --surface-strong: #EAF0EF;
  --text: #10201F;
  --muted: #4C605E;
  --primary: #0F6E6A;
  --primary-hover: #0B5753;
  --on-primary: #FFFFFF;
  --link: #0F6E6A;
  --border: #D9E2E1;
  --border-strong: #7A8C8A;
  --focus: #2357C6;
  --danger: #B42318;
  --danger-bg: #FDECEA;
  --success: #1E6B3A;
  --success-bg: #E4F2E8;
  --warning-bg: #FDF3DC;
  --warning-border: #9A6700;
  --info-bg: #E8F1F3;
  --accent-bg: #E1F0EE;
  /* Decoration derived from the tokens above (no text sits on these alone). */
  --header-bg: color-mix(in srgb, var(--bg) 85%, transparent);
  --header-filter: saturate(1.4) blur(12px);
  /* Flat by default: a hairline of shadow on controls, a real shadow only for what floats (menus, sheets, dialogs). */
  --shadow-1: 0 1px 1px rgb(16 32 31 / 0.04);
  --shadow-2: 0 12px 32px -12px rgb(16 32 31 / 0.22), 0 2px 6px rgb(16 32 31 / 0.06);
  --shadow-sheet: 0 -8px 24px -8px rgb(16 32 31 / 0.16);
  --backdrop: rgb(16 32 31 / 0.5);
  /* Pulse (U10): decoration only. The glows tint the home hero's aurora, the ECG trace, the live dot and the far end of bar gradients
     (no text sits on them); --grad-2 and --grad-3 are the headline gradient's middle stops (large text, at least 3:1 on --bg, checked);
     the aurora's strength; the soft primary-tinted shadow of what floats in the Pulse look; and the white of a sheen or a glare
     (the same in both themes). */
  --glow: #19A79B;
  --glow-2: #3F7FE0;
  --grad-2: #128A80;
  --grad-3: #2E6BD0;
  --aurora-opacity: 0.36;
  --shadow-glow: 0 28px 60px -28px rgb(15 110 106 / 0.4), 0 2px 8px rgb(16 32 31 / 0.06);
  --shine: #FFFFFF;
  /* The brand mark's trace, the part of its line before the P: decoration on --primary (4.0:1 on it; dark 4.2:1). */
  --brand-trace: #8FE0D8;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1615;
  --surface: #15201F;
  --surface-strong: #1C2A28;
  --text: #E4EEEC;
  --muted: #9DB2AF;
  --primary: #5CC8BE;
  --primary-hover: #7FD6CE;
  --on-primary: #062421;
  --link: #6FD3C9;
  --border: #26332F;
  --border-strong: #6C807D;
  --focus: #F2C46B;
  --danger: #FF9A8A;
  --danger-bg: #3A1F1B;
  --success: #8FD19A;
  --success-bg: #1A2E22;
  --warning-bg: #33290F;
  --warning-border: #D9A441;
  --info-bg: #182628;
  --accent-bg: #173431;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow-2: 0 8px 24px -10px rgb(0 0 0 / 0.35), 0 2px 6px rgb(0 0 0 / 0.25);
  --shadow-sheet: 0 -8px 24px -8px rgb(0 0 0 / 0.35);
  --backdrop: rgb(0 0 0 / 0.6);
  --glow: #5CC8BE;
  --glow-2: #4F8DF0;
  --grad-2: #A5EDE5;
  --grad-3: #9CC0FF;
  --aurora-opacity: 0.24;
  --shadow-glow: 0 28px 70px -28px rgb(92 200 190 / 0.3), 0 2px 8px rgb(0 0 0 / 0.4);
  --brand-trace: #0B5753;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* In-page targets (#main, #q12) are not hidden under the sticky header. */
  scroll-padding-top: var(--space-2xl);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  font-weight: 400;
  font-feature-settings: "cv11", "ss01";
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--primary);
  color: var(--on-primary);
}

main {
  flex: 1 0 auto;
  outline: none;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 1.6em 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-3);
  margin-top: 0.4em;
}

h2 {
  font-size: var(--step-2);
}

h3 {
  font-size: var(--step-1);
}

h4 {
  font-size: var(--step-0);
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

/* Prose keeps a readable measure; components (cards, options, tables) take the width they need. */
main p:not([class]),
main ul:not([class]) > li,
main ol:not([class]) > li,
main dd {
  max-width: var(--measure);
}

ul,
ol {
  padding-left: 1.4em;
}

li + li {
  margin-top: 0.25em;
}

li::marker {
  color: var(--muted);
}

dt {
  font-weight: 600;
}

dd {
  margin: 0 0 var(--space-xs) var(--space-m);
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-thickness var(--dur-fast) var(--ease);
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-l) 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface-strong);
  overflow-wrap: anywhere;
}

pre {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  background: var(--surface-strong);
  border-radius: var(--radius-s);
  padding: var(--space-s);
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: none;
}

strong,
b {
  font-weight: 650;
}

small {
  font-size: var(--step--1);
}

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

.container {
  width: min(100% - 2 * var(--space-m), 72rem);
  margin-inline: auto;
}

/* viewport-fit=cover (layout.tsx) lets the page reach under the notch and rounded corners, so the page keeps its content out of the side
   insets itself (a notched phone in landscape: 44-59 px each side). Fixed elements (the tab bar) pad for them on their own. */
body {
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}

.narrow {
  max-width: 34rem;
}

.page {
  padding-top: var(--space-l);
  padding-bottom: var(--space-2xl);
}

.skip-link {
  position: absolute;
  left: var(--space-xs);
  top: -4rem;
  z-index: 30;
  padding: 0.6rem 1.1rem;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-control);
  font-weight: 550;
  text-decoration: none;
}

/* The shadow only while shown: off-screen, its blur still reached into the top-left corner of every page. */
.skip-link:focus {
  top: var(--space-xs);
  box-shadow: var(--shadow-2);
}

/* ---------- Header and navigation ---------- */

/* One row at every width: the brand on the left, the navigation and the avatar menu (signed in) or a visitor's links on the right.
   Signed in, the main navigation sits in this row on wide screens and becomes a tab bar at the foot of the screen on phones. */
:root {
  --header-h: 3.5rem;
  --tab-bar-h: 3.75rem;
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

/* The translucent, blurred background is drawn by a pseudo-element: a backdrop-filter on the header itself would make the header the
   containing block of the fixed tab bar inside it, and the bar would stick to the header instead of the screen. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--header-bg);
  -webkit-backdrop-filter: var(--header-filter);
  backdrop-filter: var(--header-filter);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--header-h);
}

/* A visitor's "Log in" for the phone's header row (layout.tsx): hidden here, shown under 48rem where the row's navigation is hidden. */
.header-inner > .header-login {
  display: none;
}

/* `isolation` keeps the mark's square (z-index -1, below) inside the brand: the wordmark's letters are drawn over the square's beat ring. */
.brand {
  position: relative;
  isolation: isolate;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: var(--control-h-small);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

/* The mark before the wordmark (U10): a teal rounded square (::before) with the brand's line on it (::after, the line of
   /images/brand-pulse.svg used as a mask, so it takes the theme's colours): a pulse trace that runs on as the bar of a P, round its bowl
   and down its stem, in one stroke. The trace is in --brand-trace and turns to the on-primary colour where it meets the stem (a gradient
   over the on-primary background, in the rule with the mask; its stops are the trace's middle and the stem's left edge in the mark's
   box). Decoration only: empty content, nothing is read out. It beats on every page with the site header (U13, below); the exam bar's
   small mark is the same, still (U12, below). */
.brand::before,
.brand::after {
  content: "";
  width: 1.3em;
  height: 1.3em;
  flex: none;
}

.brand::before {
  z-index: -1;
  border-radius: 0.32em;
  background: var(--primary);
}

.brand::after {
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -0.65em;
  background: var(--on-primary);
}

.brand::after,
.exam-brand-mark::after {
  background-image: linear-gradient(to right, var(--brand-trace) 31%, transparent 46.6%);
  -webkit-mask: url("/images/brand-pulse-dea24d814c771ebfdb7d3ba8b5011060.svg") center / 70% no-repeat;
  mask: url("/images/brand-pulse-dea24d814c771ebfdb7d3ba8b5011060.svg") center / 70% no-repeat;
}

/* The beat (U13), one loop of 2.4 s on every page with the site header, visitor or signed in, both themes. The line draws from left to
   right at an even pace in the first 45% (brand-draw), as a monitor's trace; the trace's spike is drawn by 20% and the P from 21% on, and the square and the line beat
   together right after it, as the heart contracts after the trace's R wave: a larger beat and a smaller one (brand-beat: lub 1.14 at
   21%, dub 1.07 at 33%, 0.29 s apart). With the first, a ring leaves the square in the primary colour and fades (brand-ring, a
   box-shadow, drawn under the wordmark's letters). The line holds, fades in the last tenth, and the loop begins again. Only transform,
   opacity, clip-path and box-shadow move: no box changes size, so the header and the wordmark never shift. On screen only, so print shows
   the mark still and whole; still under reduced motion (the stylesheet's reduced-motion rule at its end) and in the exam player, whose
   mark is .exam-brand-mark. Forced colours drop the ring (Forced colours). */
@media screen and (prefers-reduced-motion: no-preference) {
  .brand::before {
    animation: brand-beat 2.4s infinite, brand-ring 2.4s infinite;
  }

  .brand::after {
    animation: brand-draw 2.4s infinite, brand-beat 2.4s infinite;
  }
}

/* Uncovered from the left at an even pace: brand-pulse.svg's trace ends its spike at 45% of the mark's width and the P's stem begins at
   47% (its 24-unit box drawn at 70%), so the spike is drawn by 20% of the loop and the P from 21% to 37%. */
@keyframes brand-draw {
  0% {
    clip-path: inset(0 100% 0 0);
    animation-timing-function: linear;
  }

  45% {
    clip-path: inset(0);
    opacity: 1;
  }

  90% {
    clip-path: inset(0);
    opacity: 1;
    animation-timing-function: ease-in;
  }

  100% {
    clip-path: inset(0);
    opacity: 0;
  }
}

/* Lub, dub: each a quick rise and a softer fall, the second smaller. */
@keyframes brand-beat {
  0%,
  16%,
  27%,
  39%,
  100% {
    transform: none;
    animation-timing-function: cubic-bezier(0.3, 0, 0.2, 1);
  }

  21% {
    transform: scale(1.14);
    animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
  }

  33% {
    transform: scale(1.07);
    animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
  }
}

/* The ring: no spread (so hidden under the square) until the first beat, then out to 0.55em, fading as it goes. */
@keyframes brand-ring {
  0%,
  21% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent);
    animation-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);
  }

  52%,
  100% {
    box-shadow: 0 0 0 0.55em color-mix(in srgb, var(--primary) 0%, transparent);
  }
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  margin: 0;
  flex: none;
}

.site-nav a:not(.button) {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: var(--control-h-small);
  padding: 0 0.75rem;
  border-radius: var(--radius-s);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease);
}

.site-nav a:not(.button):hover {
  background: var(--surface-strong);
}

.site-nav a:not(.button)[aria-current="page"] {
  font-weight: 600;
}

/* The current section: a primary-coloured underline under the label (the tab bar moves it to the top edge). */
.site-nav a:not(.button)[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.2rem;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.app-nav .icon {
  display: none;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
}

/* Disclosure menus (<details>): the avatar's account menu, and a visitor's links on phones. They work without JavaScript; theme.js
   adds Escape and a click outside to close them. */
.menu {
  position: relative;
  flex: none;
}

.menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.avatar {
  width: var(--control-h-small);
  height: var(--control-h-small);
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color var(--dur-fast) var(--ease);
}

.menu-button {
  width: var(--control-h-small);
  height: var(--control-h-small);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease);
}

.menu-button .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* The theme button (theme.js shows it): round, like the avatar, with a moon in light and a sun in dark drawn on top of each other. The
   one for the other theme is turned away and shrunk to nothing; switching turns it in (Motion). */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--control-h-small);
  height: var(--control-h-small);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease);
}

.theme-toggle .icon {
  grid-area: 1 / 1;
  width: 1.25rem;
  height: 1.25rem;
}

.theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: none;
}

.avatar:hover,
.menu-button:hover,
.theme-toggle:hover,
.menu[open] > summary {
  border-color: var(--text);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 30;
  width: min(19rem, calc(100vw - 2 * var(--space-m)));
  padding: var(--space-2xs);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  transform-origin: top right;
}

.menu-name {
  margin: 0;
  padding: var(--space-xs) var(--space-xs) var(--space-xs);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.menu-links,
.menu-nav ul {
  list-style: none;
  margin: 0;
  padding: var(--space-2xs) 0;
  border-block: 1px solid var(--border);
}

.menu-nav ul {
  border-block: 0;
}

.menu-links li,
.menu-nav li {
  margin: 0;
}

.menu-links a,
.menu-nav a:not(.button),
.menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--control-h-small);
  padding: 0 var(--space-xs);
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-links a:hover,
.menu-nav a:not(.button):hover,
.menu-item:hover {
  background: var(--surface-strong);
}

.menu-links a[aria-current="page"],
.menu-nav a:not(.button)[aria-current="page"] {
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--primary);
}

.menu-nav .button {
  width: 100%;
  margin-top: var(--space-2xs);
}

.menu-logout {
  margin: 0;
  padding-top: var(--space-2xs);
  border-top: 1px solid var(--border);
}

.inline-form {
  display: inline;
  margin: 0;
}

/* Phones: a visitor's links fold into the menu button; signed in, the main navigation is a tab bar fixed at the foot of the screen,
   an icon over each label, clear of the home indicator (safe area). The page keeps room for it below its last line. The player of
   an attempt in progress (chrome-focus) has its own bar there and shows no tab bar. */
@media (max-width: 47.99rem) {
  .public-nav {
    display: none;
  }

  /* "Log in" stays in the header row on a phone, before the menu button: it is a visitor's only way to an account. */
  .header-inner > .header-login {
    display: inline-flex;
    flex: none;
  }

  /* The visitor's menu opens under the right end of the header row, not under its button: the theme button stands right of it, and a
     panel anchored to the menu button would run off the left of a phone. */
  .header-inner {
    position: relative;
  }

  .visitor-menu {
    position: static;
  }

  body.signed-in {
    padding-bottom: calc(var(--tab-bar-h) + env(safe-area-inset-bottom));
  }

  /* The body already clears the tab bar and the home indicator: the footer need not pad for the indicator again. */
  body.signed-in .site-footer {
    padding-bottom: var(--space-xl);
  }

  .app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  .app-nav ul {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }

  .app-nav a:not(.button) {
    flex-direction: column;
    justify-content: center;
    gap: 0.125rem;
    width: 100%;
    /* With the bar's top border, the bar is exactly --tab-bar-h tall (the room the page keeps for it). */
    min-height: calc(var(--tab-bar-h) - 1px);
    padding: 0.25rem;
    border-radius: 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.2;
  }

  .app-nav a:not(.button):hover {
    background: var(--surface-strong);
  }

  .app-nav a:not(.button)[aria-current="page"] {
    color: var(--link);
  }

  .app-nav a:not(.button)[aria-current="page"]::after {
    top: 0;
    bottom: auto;
    left: 30%;
    right: 30%;
    height: 3px;
    border-radius: 0 0 3px 3px;
  }

  .app-nav .icon {
    display: block;
  }

  body.chrome-focus {
    padding-bottom: 0;
  }

  body.chrome-focus .app-nav {
    display: none;
  }
}

/* Wide screens: the header stays at the top while the page scrolls, and a visitor's links stand in the row. */
@media (min-width: 48rem) {
  .site-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    gap: var(--space-s);
  }

  .visitor-menu {
    display: none;
  }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: var(--control-h);
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-size: var(--step-0);
  font-weight: 550;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.button:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-1);
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.button-secondary:hover {
  background: var(--surface-strong);
  border-color: var(--text);
}

.button-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.button-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

.button-small {
  min-height: var(--control-h-small);
  padding: 0.35rem 0.95rem;
  font-size: var(--step--1);
}

/* A toggle that is switched on (Flag for review). */
.button[aria-pressed="true"] {
  background: var(--accent-bg);
  color: var(--text);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* The primary button in the Pulse look (U10), site-wide except the exam player (chrome-focus), whose buttons keep their hover: a soft
   primary-tinted shadow, and on hover a lift of 1 px and a light sheen that sweeps across once. The sheen is a band of the button's own
   background, moved by background-position: no pseudo-element, no overflow clipping, so the focus ring and the content are untouched.
   It moves on the way in only (leaving, it jumps back unseen). Secondary, danger, pressed and disabled buttons keep their look. */
body:not(.chrome-focus) .button:not(.button-secondary, .button-danger, [aria-pressed="true"], :disabled, [aria-disabled="true"]) {
  background-image: linear-gradient(110deg, transparent 40%, color-mix(in srgb, var(--shine) 30%, transparent) 50%, transparent 60%);
  background-repeat: no-repeat;
  background-size: 250% 100%;
  background-position: 100% 0;
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--primary) 80%, transparent);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  body:not(.chrome-focus) .button:not(.button-secondary, .button-danger, [aria-pressed="true"], :disabled, [aria-disabled="true"]):hover {
    transform: translateY(-1px);
    background-position: 0 0;
    box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--primary) 90%, transparent);
    transition:
      background-color var(--dur-fast) var(--ease),
      border-color var(--dur-fast) var(--ease),
      box-shadow var(--dur) var(--ease),
      transform var(--dur-fast) var(--ease),
      background-position 700ms var(--ease);
  }

  body:not(.chrome-focus) .button:not(.button-secondary, .button-danger, [aria-pressed="true"], :disabled, [aria-disabled="true"]):active {
    transform: scale(0.985);
  }
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin: var(--space-m) 0;
}

/* ---------- Notices ---------- */

.notices {
  padding-top: var(--space-s);
}

.notices:empty {
  padding-top: 0;
}

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
  padding: var(--space-s) var(--space-m);
  margin: 0 0 var(--space-s);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-s);
  background: var(--info-bg);
  color: var(--text);
}

/* A notice that is itself a paragraph holds running text with inline links: keep it in one flow, not one flex item per word group. */
p.notice {
  display: block;
}

.notice p {
  margin: 0;
  max-width: var(--measure);
}

.notice-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}

.notice-success {
  background: var(--success-bg);
  border-color: var(--success);
}

.notice-error {
  background: var(--danger-bg);
  border-color: var(--danger);
}

.notice-info {
  background: var(--info-bg);
  border-color: var(--border);
  border-left-color: var(--primary);
}

/* ---------- Forms ---------- */

.form {
  display: grid;
  gap: var(--space-m);
  margin: var(--space-m) 0 var(--space-l);
}

.field {
  display: grid;
  align-content: start;
  gap: 0.35rem;
}

.field label,
.field-label {
  font-weight: 550;
}

.hint {
  color: var(--muted);
  font-size: var(--step--1);
  margin: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

input[type="number"] {
  width: 6rem;
  font-variant-numeric: tabular-nums;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

:is(input, select, textarea):hover {
  border-color: var(--text);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

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

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.check label,
.field .check label {
  font-weight: 400;
}

.check input[type="checkbox"],
.check input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.2rem 0 0;
  flex: none;
}

.error {
  color: var(--danger);
  font-size: var(--step--1);
  font-weight: 600;
  margin: 0;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-m);
  margin: 0;
  min-width: 0;
}

legend {
  font-weight: 650;
  padding: 0 0.4rem;
}

/* ---------- Cards, grids, tables ---------- */

.hero {
  padding: var(--space-xl) 0 var(--space-l);
}

.hero h1 {
  font-size: var(--step-4);
  letter-spacing: -0.03em;
  margin-top: 0;
  max-width: 22ch;
}

.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--muted);
  max-width: 42rem;
}

.grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: 1fr;
  margin: var(--space-m) 0 var(--space-xl);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-m) var(--space-m);
  margin: 0 0 var(--space-m);
  box-shadow: var(--shadow-1);
  min-width: 0;
}

/* Kept next to .card, ahead of every component card (.error-card, .player-card, .attempts-card, .auth-card ...): written at the end of
   the file it outranked their own padding from 40rem up. */
@media (min-width: 40rem) {
  .card {
    padding: var(--space-m) var(--space-l);
  }
}

.grid > .card {
  margin: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card h2 {
  font-size: var(--step-1);
}

.card h3 {
  font-size: var(--step-0);
}

.card-featured {
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-2);
}

.price {
  font-size: var(--step-4);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0.25rem 0 var(--space-s);
  font-variant-numeric: tabular-nums;
}

.price small {
  font-size: var(--step-0);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

.table-wrap {
  /* Positioned so that visually hidden text inside a cell is contained here and cannot widen the page on a phone. */
  position: relative;
  overflow-x: auto;
  margin: 0 0 var(--space-l);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  /* Scores, counts, weights and dates line up in their columns. */
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

tr:last-child > th,
tr:last-child > td {
  border-bottom: 0;
}

thead th,
table > tr:first-child > th[scope="col"],
tbody > tr > th[scope="col"] {
  background: var(--surface-strong);
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
}

thead tr:last-child > th {
  border-bottom: 1px solid var(--border);
}

tbody th {
  font-weight: 600;
}

tbody tr {
  transition: background-color var(--dur-fast) var(--ease);
}

tbody tr:hover > th:not([scope="col"]),
tbody tr:hover > td {
  background: var(--surface-strong);
}

.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.4rem;
}

.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--success);
}

.checklist .no::before {
  content: "\2013";
  color: var(--muted);
}

pre.message-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--step--1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: var(--space-m);
}

/* ---------- Details and summary ---------- */

details > summary {
  cursor: pointer;
  font-weight: 550;
  border-radius: var(--radius-s);
}

details > summary::marker {
  color: var(--primary);
}

details[open] > summary {
  margin-bottom: var(--space-xs);
}

/* ---------- Assessment: shared bits ---------- */

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 550;
  line-height: 1.6;
  letter-spacing: 0;
  vertical-align: middle;
  white-space: nowrap;
}

.badge-ok {
  border-color: var(--success);
  color: var(--success);
  background: var(--success-bg);
}

.badge-bad {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}

.badge-warn {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.score {
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* Native <progress>: a rounded track with a clay fill. */
.bar {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 6rem;
  height: 0.65rem;
  margin-top: 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  overflow: hidden;
  accent-color: var(--primary);
}

.bar::-webkit-progress-bar {
  background: var(--surface-strong);
  border-radius: var(--radius-pill);
}

.bar::-webkit-progress-value {
  background: var(--primary);
  border-radius: var(--radius-pill);
}

.bar::-moz-progress-bar {
  background: var(--primary);
  border-radius: var(--radius-pill);
}

.mock-card h3 {
  margin-top: 0;
}

.upgrade p {
  margin-bottom: 0.5rem;
}

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

/* ---------- Review ---------- */

/* The way back to the result, above the heading. */
.back-link-row {
  margin: 0 0 var(--space-2xs);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.5rem;
  font-weight: 550;
}

.back-link .icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* The filters: a row of chips with their counts that wraps on a narrow screen; the current one is filled. */
.review-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: var(--space-m) 0 var(--space-s);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.2rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.chip:hover {
  border-color: var(--text);
}

.chip[aria-current="page"] {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 650;
}

.chip-count {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

/* A question card: "Question n" and its status on one line, the topic under it. */
.review-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-s);
  margin-bottom: var(--space-2xs);
}

.review-item-head h2 {
  margin: 0;
}

.review-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
}

.review-topic {
  margin: 0 0 var(--space-s);
  font-size: var(--step--1);
}

/* The status: words and an icon in a pill with a border in its own colour, so it reads without the fill. */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.05rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 650;
  line-height: 1.6;
  white-space: nowrap;
}

.status-pill .icon {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.5;
}

.status-pill.is-correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.status-pill.is-incorrect {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.status-pill.is-unanswered {
  border-color: var(--warning-border);
  background: var(--warning-bg);
}

.review-stem {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: var(--measure);
}

.review-lead {
  max-width: var(--measure);
}

/* A question that was withdrawn after review and did not count: a note under the heading, not only a colour. */
.review-unscored {
  margin: 0 0 var(--space-s);
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-s);
  background: var(--info-bg);
  font-weight: 600;
}

.explanation {
  max-width: var(--measure);
  overflow-wrap: anywhere;
}

.explanation p:last-child {
  margin-bottom: 0;
}

.review-references {
  overflow-wrap: anywhere;
}

/* The explanation, references and rationales: a disclosure, open when the page loads. */
.review-explanation {
  margin: var(--space-s) 0;
  padding-top: var(--space-s);
  border-top: 1px solid var(--border);
}

.review-explanation > summary {
  font-size: var(--step-0);
  font-weight: 650;
}

/* Report an issue: a link-like summary that opens the form below it. */
.report > summary {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  color: var(--link);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* ---------- Exam player ---------- */

.player {
  --player-text: var(--step-1);
}

.player.fs-0 { --player-text: 1rem; }
.player.fs-1 { --player-text: 1.1rem; }
.player.fs-2 { --player-text: 1.25rem; }
.player.fs-3 { --player-text: 1.45rem; }
.player.fs-4 { --player-text: 1.7rem; }
/* The text-size steps above stay fixed sizes on purpose: the person chooses them with A- / A+, so they must not drift with the viewport. */

/* Focus mode: the exam bar takes the site header's place, full width and stuck to the top. The brand mark (always there, the way back
   to the dashboard) comes first; the player's own bar fills the rest once the attempt has loaded. */
.exam-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-s);
  min-height: 3.5rem;
  padding: 0.4rem var(--space-m);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.exam-brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-h-small);
  height: var(--control-h-small);
  margin-left: -0.5rem;
  border-radius: var(--radius-control);
}

.exam-brand:hover {
  background: var(--surface-strong);
}

/* The pulse mark of the site header's brand (U12): the teal rounded square with the pulse line in the on-primary colour on it (::after,
   the header's mask), in the header mark's proportions; still, as everything in the player's chrome. Decoration: the link's name is in
   its aria-label. */
.exam-brand-mark {
  position: relative;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: calc(1.5rem * 0.32 / 1.3);
  background: var(--primary);
}

/* background-color, not the shorthand: the trace's colour run comes from the header's rule with the mask. */
.exam-brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--on-primary);
}

/* How far through the block: a thin line along the foot of the bar (aria-hidden; the bar says it in words). */
.exam-line {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  display: block;
  width: 100%;
  height: 3px;
  border: 0;
  background: transparent;
  accent-color: var(--primary);
}

.exam-line::-webkit-progress-bar {
  background: transparent;
}

.exam-line::-webkit-progress-value {
  background: var(--primary);
}

.exam-line::-moz-progress-bar {
  background: var(--primary);
}

.player-bar {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
}

.player-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

#player-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-title .badge {
  flex: none;
  color: var(--muted);
  border-color: transparent;
}

.player-progress {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--muted);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-wrap: balance;
}

.player-clock {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--surface-strong);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.player-clock .icon {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--muted);
}

.player-clock.is-warning {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger);
}

.player-clock.is-warning .icon {
  color: inherit;
}

.player-pause {
  flex: none;
}

.player-pause .icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* A square button holding one icon; its name is in hidden text or aria-label. */
.icon-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-h-small);
  height: var(--control-h-small);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 650;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.icon-button:hover {
  background: var(--surface-strong);
  border-color: var(--text);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.icon-button[aria-expanded="true"] {
  background: var(--accent-bg);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.icon-button .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* In the exam bar the theme button takes the bar's square-button shape (round is the site header's, beside the round avatar). */
.exam-bar .theme-toggle {
  border-color: var(--border-strong);
  border-radius: var(--radius-control);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.exam-bar .theme-toggle:hover {
  background: var(--surface-strong);
  border-color: var(--text);
}

/* The two sheet buttons are for narrow screens, and only while a question is on screen (not on a break or paused); the grid's
   button only when the attempt has a grid (a linear mock has none). */
.player-questions-toggle,
.player-tools-toggle {
  display: none;
}

.player-layout {
  display: grid;
  gap: var(--space-l);
}

.player-main {
  min-width: 0;
  max-width: 48rem;
}

.player-stem,
.player-lead {
  font-size: var(--player-text);
  line-height: 1.65;
}

.player-stem {
  white-space: pre-wrap;
}

.player-lead {
  margin: var(--space-m) 0 0;
  font-weight: 650;
}

/* Highlighter: a tinted band with a clay underline, so it shows on every surface. */
.player-stem mark {
  background: var(--accent-bg);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--primary);
  padding: 0 0.1em;
  border-radius: 0.15em;
}

.player-options {
  border: 0;
  padding: 0;
  margin: var(--space-m) 0;
  display: grid;
  gap: var(--space-xs);
}

/* An option is a card: the letter in a disc, the text, and (while it can be chosen) the strike button. The radio button lies, unseen,
   over the disc; the disc shows its state. */
.option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 3rem;
  box-shadow: var(--shadow-1);
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

/* A press on an answer row (a transform, so nothing around it moves); not on a checked question, where nothing can be chosen. */
.option:active:not(:has(input:disabled)) {
  transform: scale(0.985);
}

.option:hover:not(:has(input:disabled)) {
  border-color: var(--border-strong);
}

.option:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.option.is-selected {
  border-color: var(--primary);
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.option.is-struck .option-text {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  color: var(--muted);
}

.option.is-key {
  border-color: var(--success);
  background: var(--success-bg);
  box-shadow: inset 0 0 0 1px var(--success);
}

.option.is-wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.option label {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: var(--player-text);
  line-height: 1.5;
}

.option input[type="radio"] {
  position: absolute;
  top: var(--space-s);
  left: var(--space-m);
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.option input[type="radio"]:disabled {
  cursor: default;
}

/* The letter disc. The full stop after the letter stays in the text (the radio's name reads "A. ...") but takes no room. */
.option-letter {
  flex: none;
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: calc((1.5 * var(--player-text) - 1.75rem) / 2);
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 0;
  line-height: calc(1.75rem - 3px);
  text-align: center;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.option-letter > span {
  font-size: 0.875rem;
  font-weight: 650;
}

.option.is-selected .option-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.option.is-key .option-letter {
  background: var(--success);
  border-color: var(--success);
  color: var(--success-bg);
}

.option.is-wrong .option-letter {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-bg);
}

/* After the answer is checked: a tag on your wrong answer and on the key (decoration with empty alternative text: the reveal's heading
   says it in words). */
.option.is-wrong::after,
.option.is-key::after {
  flex: none;
  align-self: center;
  padding: 0.05rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: 650;
  line-height: 1.5;
}

.option.is-wrong::after {
  content: "Yours";
  content: "Yours" / "";
  color: var(--danger);
}

.option.is-key::after {
  content: "Correct";
  content: "Correct" / "";
  color: var(--success);
}

/* Strike / Restore: an icon button; its name is in aria-label ("Strike out option A"), the word stays in the button but takes no room. */
.option-strike {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-height: 0;
  margin: calc((1.5 * var(--player-text) - 2.25rem) / 2) -0.4rem 0 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--muted);
  font-size: 0;
  box-shadow: none;
}

.option-strike:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--text);
}

.option-strike::before {
  content: "";
  width: 1.2rem;
  height: 1.2rem;
  background: currentColor;
  -webkit-mask: var(--icon-strike) center / contain no-repeat;
  mask: var(--icon-strike) center / contain no-repeat;
}

.option-strike[aria-pressed="true"] {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text);
}

.option-strike[aria-pressed="true"]::before {
  -webkit-mask-image: var(--icon-restore);
  mask-image: var(--icon-restore);
}

.player {
  /* Tabler "strikethrough", "arrow-back-up" and "flag" (MIT), drawn as masks in the text colour. */
  --icon-strike: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l14 0'/%3E%3Cpath d='M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5'/%3E%3C/svg%3E");
  --icon-restore: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14l-4 -4l4 -4'/%3E%3Cpath d='M5 10h11a4 4 0 1 1 0 8h-1'/%3E%3C/svg%3E");
  --icon-flag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5a5 5 0 0 1 7 0a5 5 0 0 0 7 0v9a5 5 0 0 1 -7 0a5 5 0 0 0 -7 0v-9z'/%3E%3Cpath d='M5 21v-7'/%3E%3C/svg%3E");
  --icon-flag-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5a5 5 0 0 1 7 0a5 5 0 0 0 7 0v9a5 5 0 0 1 -7 0a5 5 0 0 0 -7 0v-9z'/%3E%3Cpath d='M5 21v-7'/%3E%3C/svg%3E");
}

/* "Saving..." / "Saved" keeps its line when empty: an empty line let the margins around it collapse, so the buttons around it moved
   when it filled. A zero-width character, not a min-height, so the empty line is exactly as tall as a line of text. */
#player-saved:empty::before {
  content: "\200b";
}

/* One action row: Previous, the saved status, Flag, Next (or Check answer), Submit; Report an issue on a line of its own below. */
.player-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  margin: var(--space-m) 0;
  padding-top: var(--space-m);
  border-top: 1px solid var(--border);
}

.player-actions::after {
  content: "";
  order: 1;
  flex-basis: 100%;
}

.player-actions-bar {
  display: contents;
}

.player-prev .icon {
  width: 1.15rem;
  height: 1.15rem;
  margin-left: -0.35rem;
}

.player-saved {
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.player-flag::before {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  background: currentColor;
  -webkit-mask: var(--icon-flag) center / contain no-repeat;
  mask: var(--icon-flag) center / contain no-repeat;
}

.player-flag[aria-pressed="true"]::before {
  -webkit-mask-image: var(--icon-flag-on);
  mask-image: var(--icon-flag-on);
}

/* Report an issue: a quiet link-style button. */
.player-report {
  order: 2;
  min-height: 1.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--step--1);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.player-report:hover {
  color: var(--text);
  text-decoration-thickness: 2px;
}

/* The explanation: a card with a success-coloured edge. */
.player-reveal {
  margin: var(--space-m) 0;
  padding: var(--space-m) var(--space-l);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-s) var(--radius) var(--radius) var(--radius-s);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.player-reveal h3 {
  margin: var(--space-m) 0 var(--space-2xs);
  font-size: var(--step-0);
}

.player-reveal h3:first-child {
  margin-top: 0;
  font-size: var(--step-1);
}

.player-reveal .explanation > :last-child,
.player-reveal ul:last-child {
  margin-bottom: 0;
}

/* The side column: the question grid and the tools, each a panel. */
.player-panel {
  padding: var(--space-m);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.player-panel-title {
  margin: 0 0 var(--space-xs);
  font-size: var(--step--1);
  font-weight: 650;
  line-height: 1.4;
}

/* A linear mock has no grid: the panel goes with it. */
.player-grid:has(#player-nav[hidden]) {
  display: none;
}

.player-nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr));
  gap: 0.35rem;
}

.player-nav li {
  margin: 0;
}

.nav-cell {
  position: relative;
  min-height: 2.25rem;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.nav-cell:hover {
  border-color: var(--text);
}

/* Answered: a tint with a primary edge. */
.nav-cell.is-answered {
  background: var(--accent-bg);
  border-color: var(--primary);
  color: var(--link);
  font-weight: 650;
}

/* Flagged: a dot in the corner. */
.nav-cell.is-flagged::after,
.legend-flagged::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--warning-border);
}

/* The question on screen: a ring outside the cell, so it reads differently from the fill of an answered one. */
.nav-cell.is-current {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
  font-weight: 750;
}

.player-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-s);
  margin: var(--space-s) 0 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.player-legend span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-answered::before,
.legend-current::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 3px;
}

.legend-answered::before {
  background: var(--accent-bg);
  border: 1px solid var(--primary);
}

.legend-current::before {
  border: 1px solid var(--border);
  box-shadow: 0 0 0 2px var(--primary);
}

.legend-flagged::before {
  position: static;
}

.player-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--space-s);
}

.player-tools-size {
  display: inline-flex;
  gap: 0.4rem;
}

.player-tools .hint {
  margin: 0 0 var(--space-xs);
}

.player-tools .hint:last-child {
  margin-bottom: 0;
}

/* Break, paused and submitted: one centred card. */
.player-card {
  max-width: 34rem;
  margin: var(--space-xl) auto;
  padding: var(--space-l);
  text-align: center;
}

.player-card h2 {
  margin-top: 0;
}

#player-break-clock {
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
}

.player-dialog {
  width: min(32rem, calc(100vw - 2rem));
  max-width: min(32rem, calc(100vw - 2rem));
  padding: var(--space-l);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-2);
}

.player-dialog h2 {
  margin-top: 0;
  font-size: var(--step-1);
}

.player-dialog .field {
  margin-bottom: var(--space-m);
}

.player-dialog .button-row {
  justify-content: flex-end;
  margin-bottom: 0;
}

.player-dialog::backdrop {
  background: var(--backdrop);
}

/* Narrow screens (below 48rem): the grid and the tools are bottom sheets opened from the exam bar (FR-ENG-6), and Previous, the saved
   status, Flag and Next are a bar pinned to the foot of the screen, clear of the home indicator. The page keeps room below its last
   line for that bar, so nothing ends up behind it. */
@media (max-width: 47.99rem) {
  html:has(.player-page) {
    scroll-padding-top: 4.5rem;
    scroll-padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }

  main.player-page {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }

  .exam-bar {
    gap: var(--space-xs);
    padding-inline: var(--space-s);
  }

  .exam-brand {
    margin-left: -0.25rem;
  }

  .player-bar {
    gap: var(--space-xs);
  }

  .player-questions-toggle,
  .player-tools-toggle {
    display: inline-flex;
  }

  body:has(#player-nav[hidden]) .player-questions-toggle,
  body:has(#player-layout[hidden]) :is(.player-questions-toggle, .player-tools-toggle) {
    display: none;
  }

  .player-pause {
    width: var(--control-h-small);
    padding: 0;
  }

  .player-pause-text,
  .player-prev-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .player-actions {
    border-top: 0;
    padding-top: 0;
  }

  .player-actions-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.5rem calc(var(--space-s) + env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom))
      calc(var(--space-s) + env(safe-area-inset-left));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-sheet);
  }

  .player-prev {
    width: var(--control-h);
    padding: 0;
  }

  .player-prev .icon {
    margin: 0;
  }

  .player-flag {
    width: var(--control-h);
    padding: 0;
    font-size: 0;
  }

  .player-flag::before {
    width: 1.25rem;
    height: 1.25rem;
  }

  .player-actions::after {
    display: none;
  }

  .player-finish {
    order: 0;
  }

  .player-report {
    order: 0;
    margin-left: auto;
  }

  .player-grid,
  .player-tools {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    max-height: 75vh;
    overflow-y: auto;
    padding: var(--space-m) calc(var(--space-m) + env(safe-area-inset-right)) calc(var(--space-l) + env(safe-area-inset-bottom))
      calc(var(--space-m) + env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--border-strong);
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    box-shadow: var(--shadow-sheet);
    transform: translateY(110%);
    visibility: hidden;
  }

  /* A sheet is in place as soon as it opens (its buttons can be reached at once) and fades in; it does not slide. */
  .player-grid.is-open,
  .player-tools.is-open {
    transform: none;
    visibility: visible;
    animation: sheet-in var(--dur) var(--ease);
  }

  .player-nav ol {
    grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr));
  }

  .nav-cell {
    min-height: var(--control-h-small);
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
  }
}

/* 48rem and up: two columns, the question with a wide reading measure and a side column with the grid and the tools. */
@media (min-width: 48rem) {
  .player-layout {
    grid-template-columns: minmax(0, 48rem) 16rem;
    justify-content: center;
    column-gap: var(--space-xl);
  }

  .player-side {
    position: sticky;
    top: calc(3.5rem + var(--space-m));
    align-self: start;
    display: grid;
    gap: var(--space-m);
    max-height: calc(100vh - 3.5rem - 2 * var(--space-m));
    overflow-y: auto;
    /* Room for the focus rings of the cells and buttons at the edges of the scrolling column. */
    padding: 4px;
    margin: -4px;
  }

  .player-nav ol {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ---------- Page layouts (U2) ---------- */

/* A small label line above a title ("01", a section name). Decoration: the pages mark it aria-hidden. */
.eyebrow {
  margin: 0 0 var(--space-2xs);
  color: var(--primary);
  font-size: var(--step--1);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* A card whose last item (its call to action) sits at the bottom, so cards in a row line their buttons up. */
.card-stack {
  display: flex;
  flex-direction: column;
}

.card-stack > .card-action {
  margin-top: auto;
  padding-top: var(--space-xs);
}

/* Page header row: title and greeting on the left, the page's actions on the right (stacked on phones). */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0 var(--space-l);
  margin-bottom: var(--space-m);
}

.page-head-text {
  min-width: 0;
}

.page-head .lead {
  margin-bottom: 0;
}

.page-head .button-row {
  margin-bottom: 0;
}

/* ---- Home (U4; U10, the Pulse look) ----
   The page is not a container: the hero is as wide as the page, so its backdrop (aurora, dot grid, ECG trace) reaches both edges without
   100vw and without a sideways scroll, while every block's content sits in a .container of its own. home.js plays the motion; without it,
   and under reduced motion, the page is complete and still (nothing is hidden by the stylesheet alone). The hero's running loops play only
   while it carries .is-running (home.js: on screen, tab visible, motion allowed); the entrances, the hover effects and the loops are in
   Motion. */

.home-page {
  padding-top: 0;
}

.home-banner {
  padding-top: var(--space-m);
}

.home-banner .mock-day-banner {
  margin: 0;
}

.home-hero {
  position: relative;
  isolation: isolate;
  /* The tilted preview and its chips may reach past the page's edges: clipped there, never a sideways scroll. Clip, not hidden: the hero
     does not become a scroll container, and the card's shadow and chips still fall below it. */
  overflow-x: clip;
  padding: var(--space-xl) 0 clamp(6rem, 4.5rem + 5vw, 9.5rem);
}

/* The backdrop, behind the hero's content and as wide as the page: decoration only (aria-hidden, no pointer events). */
.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* The aurora: three soft shapes (a radial fade, no filter) at the theme's aurora strength. They drift by transform only (Motion). */
.hero-aurora {
  position: absolute;
  inset: -10% -10% 0;
  opacity: var(--aurora-opacity);
}

.hero-aurora > span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow) 30%, transparent);
}

.hero-aurora > :nth-child(1) {
  width: max(46vw, 20rem);
  height: max(46vw, 20rem);
  left: 50%;
  top: -14%;
}

.hero-aurora > :nth-child(2) {
  width: max(34vw, 15rem);
  height: max(34vw, 15rem);
  left: 72%;
  top: 32%;
  background-image: radial-gradient(closest-side, var(--glow-2) 30%, transparent);
}

.hero-aurora > :nth-child(3) {
  width: max(30vw, 14rem);
  height: max(30vw, 14rem);
  left: -10%;
  top: 44%;
  opacity: 0.55;
}

/* In one column the text lies over the shapes (on wide screens they sit mostly behind the card): fainter, and the second one lower,
   behind the card, so the muted text keeps 4.5:1 over them wherever they drift. */
@media (max-width: 59.99rem) {
  .hero-aurora {
    opacity: calc(var(--aurora-opacity) * 0.7);
  }

  .hero-aurora > :nth-child(2) {
    top: 60%;
  }
}

/* A dot grid that fades out towards the edges (the mask's colour does not matter, only its alpha). */
.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1.4px);
  background-size: 24px 24px;
  opacity: 0.3;
  -webkit-mask-image: radial-gradient(60% 70% at 74% 42%, #000, transparent 75%);
  mask-image: radial-gradient(60% 70% at 74% 42%, #000, transparent 75%);
}

/* The ECG trace along the hero's foot: drawn faintly (it draws itself once, Motion), with a bright segment that runs along it in a loop
   (hidden when it does not run). pathLength 1, so the dashes are fractions of the trace. */
.hero-ecg {
  position: absolute;
  left: 0;
  bottom: 0.5rem;
  width: 100%;
  max-width: none;
  height: clamp(5rem, 4rem + 3vw, 7rem);
  color: var(--glow);
}

.hero-ecg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.hero-ecg-base {
  opacity: 0.38;
  stroke-dasharray: 1;
}

.hero-ecg-run {
  stroke-width: 2.6;
  stroke-dasharray: 0.045 0.955;
  stroke-dashoffset: 1;
  opacity: 0;
  filter: drop-shadow(0 0 6px currentColor);
}

.hero-split {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

.hero-split .button-row {
  margin-bottom: 0;
}

/* The exam facts above the headline, as a pill (a border too, so forced colours keep its outline), with a live dot and its ping ring. */
.hero-eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 var(--space-s);
  padding: 0.2rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--accent-bg);
  color: var(--primary);
  font-size: var(--step--1);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.hero-eyebrow::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--glow);
}

/* The ring is centred on the dot (the pill's padding plus half the dot); it shows only while it pings. */
.hero-eyebrow::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border: 2px solid var(--glow);
  border-radius: 50%;
  opacity: 0;
}

/* The headline: larger in the Pulse look, each word in a span of its own (it rises in, Motion); "real conditions" carries the gradient
   (primary, --grad-2, --grad-3: every stop at least 3:1 on --bg for large text), which sweeps slowly. */
.home-hero h1 {
  max-width: none;
  margin-bottom: var(--space-m);
  font-size: clamp(2.25rem, 1.5rem + 3.6vw, 4.25rem);
  font-weight: 680;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero-word {
  display: inline-block;
}

.hero-grad .hero-word {
  background-image: linear-gradient(100deg, var(--primary) 20%, var(--grad-2) 42%, var(--grad-3) 55%, var(--primary) 80%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Browsers print without backgrounds by default, which would leave these words invisible: in print they are plain text in the heading's
   colour. */
@media print {
  .hero-grad .hero-word {
    background: none;
    color: inherit;
  }
}

.home-hero .lead {
  max-width: 34rem;
}

/* The exam's facts under the calls to action, and the question bank's in its section (`bank-facts`): the figure drawn above its label
   (the label is the term, first in the markup). */
.hero-facts,
.bank-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) clamp(1.25rem, 3vw, 2.5rem);
  margin: var(--space-l) 0 0;
  padding-top: var(--space-m);
  border-top: 1px solid var(--border);
}

.hero-fact {
  display: flex;
  flex-direction: column-reverse;
  min-width: 0;
}

.hero-fact dt {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 400;
}

.hero-fact dd {
  max-width: none;
  margin: 0;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.hero-fact dd small {
  margin-left: 0.15em;
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 600;
  letter-spacing: 0;
}

/* The live preview of the player beside the hero text, drawn with its own pieces: the exam bar's progress and clock, the progress line,
   the option cards with their letter discs, a foot row with a Next pill, two chips floating over its corners. aria-hidden, nothing in it
   can be focused or pressed; the wrapper (.hero-preview) takes the pointer for the tilt. The three questions share one grid cell, so the
   card keeps the height of the longest and nothing moves when they change; only the current one is shown. */
.hero-preview {
  position: relative;
  margin-top: var(--space-m);
  perspective: 1200px;
}

.preview-stage {
  position: relative;
  max-width: 30rem;
  margin-inline: auto;
  user-select: none;
  pointer-events: none;
}

.preview-card {
  --player-text: var(--step-0);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-glow);
}

/* A soft glare over the card, which follows the pointer while the card tilts (home.js sets --glare-x and --glare-y). */
.preview-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(28rem circle at var(--glare-x, 75%) var(--glare-y, 0%), color-mix(in srgb, var(--shine) 55%, transparent), transparent 55%);
  opacity: 0.45;
  mix-blend-mode: soft-light;
}

.preview-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-s);
  padding: var(--space-xs) var(--space-m);
  border-bottom: 1px solid var(--border);
}

.preview-progress {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.preview-body {
  display: grid;
  padding: var(--space-m);
}

.preview-question {
  grid-area: 1 / 1;
  min-width: 0;
}

.preview-question:not(.is-current) {
  visibility: hidden;
}

.preview-stem {
  margin-bottom: var(--space-xs);
  line-height: 1.55;
}

.preview-lead {
  margin-bottom: var(--space-s);
  font-weight: 650;
}

.preview-options {
  display: grid;
  gap: var(--space-xs);
}

.preview-options .option {
  align-items: center;
  gap: 0.75rem;
  min-height: 0;
  padding: var(--space-xs) var(--space-m);
  font-size: var(--player-text);
  line-height: 1.5;
}

.preview-options .option-letter {
  margin-top: 0;
}

.preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: var(--space-xs) var(--space-m);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--1);
}

/* Next, as a pill: not a button (a border too, so forced colours keep its outline). Pressed by home.js. */
.preview-next {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.125rem;
  padding: 0 0.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  transition: transform 150ms var(--ease);
}

.preview-next .icon {
  width: 1rem;
  height: 1rem;
}

.preview-next.is-pressed {
  transform: scale(0.92);
}

.preview-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-glow);
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
}

.preview-chip .icon {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--primary);
}

.preview-chip-pace {
  left: 0.6rem;
  top: -2.2rem;
}

.preview-chip-topics {
  right: 0.6rem;
  bottom: -1.9rem;
}

.preview-chip-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 1rem;
}

.preview-chip-bars > i {
  width: 4px;
  border-radius: 2px;
  background: var(--primary);
  transform-origin: bottom;
}

.preview-chip-bars > :nth-child(1) { height: 45%; }
.preview-chip-bars > :nth-child(2) { height: 100%; }
.preview-chip-bars > :nth-child(3) { height: 65%; }

/* The blocks under the hero. */
.home-section {
  padding-top: var(--space-2xl);
}

.home-section h2 {
  margin: 0 0 var(--space-xs);
  font-size: var(--step-3);
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.home-sub {
  max-width: 38rem;
  margin: 0;
  color: var(--muted);
}

.home-section .features {
  margin: var(--space-l) 0 0;
}

/* The feature cards: an icon in a tinted tile above the title, and a soft spotlight that follows the pointer (home.js sets --spot-x and
   --spot-y; at rest it sits above the card's top edge). They lift on hover and their icons move (Motion). */
.features > .feature {
  background:
    radial-gradient(26rem circle at var(--spot-x, 50%) var(--spot-y, -60%), color-mix(in srgb, var(--glow) 14%, transparent), transparent 62%),
    var(--surface);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--space-s);
  border-radius: var(--radius);
  background: var(--accent-bg);
  color: var(--primary);
}

.feature-icon .icon {
  width: 1.4rem;
  height: 1.4rem;
}

/* A result you can act on: the text and ticks beside a sample result (two columns from 60rem). */
.home-result {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

.home-ticks {
  display: grid;
  gap: var(--space-xs);
  margin: var(--space-m) 0 var(--space-l);
  padding: 0;
  list-style: none;
}

.home-ticks li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0;
}

.home-ticks .icon {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  padding: 3px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--primary);
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--control-h-tight);
  font-weight: 600;
  text-decoration: none;
}

.home-link:hover {
  text-decoration: underline;
}

.home-link .icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

/* The sample result: the result page's pieces in small (gauge, number correct, percentile, patient groups with their bars). Decoration,
   aria-hidden; the visible tag says it is a sample. The server draws the final state; when it rises in (home.js) the gauge sweeps, the
   figure counts up and the bars grow (Motion). */
.sample-result {
  position: relative;
  min-width: 0;
  padding: var(--space-m);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-glow);
}

.sample-tag {
  display: inline-block;
  margin-bottom: var(--space-s);
  padding: 0.05rem 0.45rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-s);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.sample-top {
  display: grid;
  justify-items: center;
  gap: var(--space-s) var(--space-l);
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.sample-gauge {
  position: relative;
  width: 11.875rem;
}

.sample-gauge-svg {
  display: block;
  width: 100%;
  height: auto;
}

.sample-gauge-svg path {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
}

.sample-gauge-track {
  stroke: var(--surface-strong);
}

.sample-stop-start {
  stop-color: var(--primary);
}

.sample-stop-end {
  stop-color: var(--glow);
}

.sample-gauge-figure {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.sample-gauge-figure small {
  color: var(--muted);
  font-size: 0.5em;
  font-weight: 650;
}

.sample-score {
  margin: 0 0 0.25rem;
  font-size: var(--step-1);
}

.sample-score strong {
  font-weight: 700;
}

.sample-percentile {
  margin: 0;
  color: var(--muted);
  font-size: var(--step--1);
}

.sample-percentile strong {
  color: var(--text);
}

.sample-groups {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A patient group: its name (and Weak), its percent, and the bar under them on phones; three columns from 40rem. */
.sample-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 0;
  padding: 0.4rem 0;
  font-size: var(--step--1);
}

.sample-group-name {
  min-width: 0;
}

.sample-bar {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  width: 100%;
  height: 0.5rem;
  overflow: hidden;
}

.sample-bar-track {
  fill: var(--surface-strong);
}

.sample-group.is-weak .sample-bar-fill {
  fill: var(--warning-border);
}

.sample-group-pct {
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* What to know before you start: one quiet strip, an icon per note. */
.home-notes {
  padding-top: var(--space-xl);
}

.notes-strip {
  margin: 0;
  padding: var(--space-m) var(--space-l);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
}

.notes-strip h2 {
  margin: 0 0 var(--space-s);
  color: var(--text);
  font-size: var(--step-0);
}

.notes-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-s) var(--space-l);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  line-height: 1.5;
}

.notes-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  margin: 0;
}

.notes-list .icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
}

/* Blocks below the fold wait out of sight (home.js marks only those outside the viewport when it runs) and rise in when they come into
   view (Motion); the cards and the sample result follow their neighbour. Printing shows them all. */
[data-reveal].reveal-pending {
  opacity: 0;
  transform: translateY(24px);
}

.features > :nth-child(2) { --reveal-order: 1; }
.features > :nth-child(3) { --reveal-order: 2; }
.home-result > .sample-result { --reveal-order: 1; }

@media print {
  [data-reveal].reveal-pending {
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 40rem) {
  .notes-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sample-result {
    padding: var(--space-l);
  }

  .sample-tag {
    position: absolute;
    top: var(--space-s);
    right: var(--space-s);
    margin: 0;
  }

  .sample-top {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    text-align: left;
  }

  .sample-group {
    grid-template-columns: minmax(0, 12.5rem) minmax(0, 1fr) 2.75rem;
  }

  .sample-bar {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (min-width: 60rem) {
  .hero-split {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }

  .hero-preview {
    margin-top: 0;
  }

  .preview-stage {
    margin-inline: auto 0;
  }

  .home-result {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

/* From 80rem the page's margin has room for the chips to hang outside the card's corners; below, they stay inside its edges. */
@media (min-width: 80rem) {
  .preview-chip-pace {
    left: -1.7rem;
    top: -2.3rem;
  }

  .preview-chip-topics {
    right: -1.3rem;
  }
}

/* ---- Ready check (U8, U9a): the question of the day ----
   The hero card is a teaser with no question in it (its button is stretched over the card and goes to /question-of-the-day; ready-check.js
   opens the ready check instead, which loads the question, or this network's answer of today). The ready check dims the page and slams the card in with a small shake of the page behind it, two ripples and two
   counter-rotating dashed rings; on phones it rises as a bottom sheet without rings; with reduced motion it only fades. Flat teal, no
   glow. The countdown bar and the split bars' delays are set through CSSOM by the script. */

:root {
  /* The rings and ripples: the dark theme's primary teal in both themes (decoration only, no text on it). */
  --ready-ring: #5CC8BE;
}

.ready-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  margin: 0;
}

.ready-clock {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

:is(.ready-clock, .ready-title) .icon,
.ready-actions .button .icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
}

.ready-bar {
  height: 4px;
  margin: var(--space-xs) 0 var(--space-s);
  overflow: hidden;
  border-radius: 2px;
  background: var(--primary);
}

.ready-lead {
  margin: 0 0 var(--space-xs);
  font-weight: 650;
}

/* The letter disc of an option (ready check, the no-script page). */
.ready-letter {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 650;
}

/* The ready check: a layer over the whole screen; the page behind is inert and does not scroll. */
html.ready-check-open {
  overflow: hidden;
}

.ready-check {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-m);
  overflow: hidden;
}

.ready-dim {
  position: absolute;
  inset: 0;
  background: rgb(6 18 17 / 0.62);
}

.ready-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  fill: none;
  stroke: var(--ready-ring);
  pointer-events: none;
}

.ready-ring {
  transform-origin: 320px 320px;
}

.ready-ring-outer circle {
  stroke-width: 1.5;
  stroke-dasharray: 3 11;
  opacity: 0.75;
}

.ready-ring-inner circle {
  stroke-width: 3;
  stroke-dasharray: 84 48 18 48;
  opacity: 0.6;
}

.ready-frame {
  position: relative;
  z-index: 1;
  width: min(32rem, 100%);
}

.ready-ripple {
  position: absolute;
  inset: -1px;
  border: 2px solid var(--ready-ring);
  border-radius: calc(var(--radius-l) + 1px);
  opacity: 0;
  pointer-events: none;
}

.ready-card {
  max-height: calc(100dvh - 2 * var(--space-m));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-m);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-l);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-2);
}

.ready-card:focus {
  outline: none;
}

.ready-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: var(--primary);
  font-size: var(--step-0);
  font-weight: 650;
}

/* While GET /samples/today is out (and where it says there is no question). */
.ready-loading {
  margin: 0 0 var(--space-xs);
}

/* Nothing of the question shows before it has loaded. */
.ready-loading:not([hidden]) ~ :is(.ready-stem, .ready-lead, .ready-options) {
  display: none;
}

.ready-bar > i {
  display: block;
  height: 100%;
  background: var(--primary);
  transform-origin: left;
  /* The script shortens it once a second; this smooths the steps (reduced motion keeps the steps). */
  transition: transform 1s linear;
}

.ready-bar {
  background: var(--surface-strong);
}

.ready-stem {
  margin: 0 0 var(--space-xs);
  line-height: 1.55;
}

.ready-lab {
  margin-bottom: var(--space-xs);
  font-size: var(--step--1);
}

.ready-options {
  display: grid;
  gap: var(--space-2xs);
}

.ready-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--control-h-tight);
  margin: 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ready-option:hover:not([aria-disabled="true"]),
.ready-option:has(input:checked) {
  border-color: var(--primary);
}

.ready-option[aria-disabled="true"] {
  cursor: default;
}

.ready-option-text {
  flex: 1;
}

.ready-tag {
  margin-left: auto;
  font-size: var(--step--1);
  font-style: normal;
  font-weight: 650;
}

.ready-tag:empty {
  display: none;
}

.ready-option.is-correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.ready-option.is-wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.ready-option:is(.is-correct, .is-wrong) .ready-letter {
  border-color: currentColor;
  color: inherit;
}

.ready-timeup {
  margin: var(--space-xs) 0 0;
  color: var(--text);
  font-size: var(--step--1);
}

.ready-timeup::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--warning-border);
}

.ready-error {
  margin: var(--space-xs) 0 0;
  color: var(--danger);
  font-size: var(--step--1);
}

.ready-explain {
  margin-top: var(--space-s);
  padding: var(--space-2xs) var(--space-s);
  border-left: 2px solid var(--primary);
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.55;
}

.ready-explain p {
  margin: 0 0 var(--space-2xs);
}

.ready-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: var(--space-xs) 0 0;
}

.ready-chip {
  padding: 0.05rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 600;
}

.ready-chip:empty {
  display: none;
}

.ready-split {
  margin-top: var(--space-s);
  font-size: var(--step--1);
}

.ready-split > p {
  margin: 0 0 var(--space-2xs);
}

.ready-split-row {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) 2.75rem;
  gap: var(--space-xs);
  align-items: center;
  margin: 0.2rem 0;
  font-variant-numeric: tabular-nums;
}

.ready-split-row.is-key {
  color: var(--success);
  font-weight: 650;
}

.ready-split-bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: var(--surface-strong);
  transform-origin: left;
  appearance: none;
}

.ready-split-bar::-webkit-progress-bar {
  background: var(--surface-strong);
}

.ready-split-bar::-webkit-progress-value {
  border-radius: 3px;
  background: var(--border-strong);
}

.ready-split-bar::-moz-progress-bar {
  border-radius: 3px;
  background: var(--border-strong);
}

.is-key .ready-split-bar::-webkit-progress-value {
  background: var(--success);
}

.is-key .ready-split-bar::-moz-progress-bar {
  background: var(--success);
}

.ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
  margin-top: var(--space-s);
}

/* The Close button's row: shown in the phone layout only (below), where the card is a bottom sheet with little room outside it to
   tap. Elsewhere a click outside the card or Escape closes it. */
.ready-foot {
  display: none;
}

/* The page without JavaScript, under its band (U12): the question in a reading column of its own, at the band's left edge. */
.qotd-page .pulse-body > * {
  max-width: 40rem;
}

.qotd-options {
  display: grid;
  gap: var(--space-2xs);
  margin: 0 0 var(--space-s);
  padding: 0;
  border: 0;
  list-style: none;
}

.qotd-options .ready-option input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  accent-color: var(--primary);
}

/* The console's "Public sample" switch on the item page: a submit button with role="switch", its state in words beside the track. */
.sample-switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-m);
}

.sample-switch-row h3 {
  margin: 0 0 var(--space-2xs);
}

.sample-switch-stats {
  margin: var(--space-s) 0 0;
  padding-top: var(--space-s);
  border-top: 1px solid var(--border);
}

.switch {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--control-h-tight);
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.switch::before {
  content: "";
  flex: none;
  width: 2.5rem;
  height: 1.4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: radial-gradient(circle at 0.7rem 50%, var(--border-strong) 0.5rem, transparent 0.55rem) var(--surface);
}

.switch[aria-checked="true"]::before {
  border-color: var(--primary);
  background: radial-gradient(circle at 1.8rem 50%, var(--on-primary) 0.5rem, transparent 0.55rem) var(--primary);
}

/* Phones: a bottom sheet, no rings. */
@media (max-width: 47.99rem) {
  .ready-check {
    align-items: flex-end;
    padding: 0;
  }

  .ready-frame {
    width: 100%;
  }

  .ready-card {
    max-height: 90dvh;
    padding-bottom: calc(var(--space-m) + env(safe-area-inset-bottom));
    border-bottom: 0;
    border-radius: var(--radius-l) var(--radius-l) 0 0;
  }

  .ready-card::before {
    content: "";
    display: block;
    width: 2.25rem;
    height: 4px;
    margin: 0 auto var(--space-xs);
    border-radius: 2px;
    background: var(--border);
  }

  .ready-ripple {
    border-radius: calc(var(--radius-l) + 1px) calc(var(--radius-l) + 1px) 0 0;
  }

  .ready-rings {
    display: none;
  }

  .ready-foot {
    display: flex;
    margin-top: var(--space-s);
    padding-top: var(--space-s);
    border-top: 1px solid var(--border);
  }

  .ready-foot .button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .ready-check.is-open .ready-dim {
    animation: ready-fade 180ms ease both;
  }

  .ready-check.is-open .ready-rings {
    animation: ready-fade 500ms ease 300ms both;
  }

  .ready-check.is-open .ready-ring-outer {
    animation: ready-spin 24s linear infinite;
  }

  .ready-check.is-open .ready-ring-inner {
    animation: ready-spin 16s linear infinite reverse;
  }

  .ready-check.is-open .ready-frame {
    animation: ready-slam 460ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
  }

  .ready-check.is-open .ready-ripple {
    animation: ready-ripple 700ms ease-out 220ms both;
  }

  .ready-check.is-open .ready-ripple-late {
    animation-delay: 360ms;
  }

  main.ready-shake {
    animation: ready-shake 180ms linear 220ms;
  }

  .ready-split-bar {
    animation: ready-grow 600ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
  }

  @media (max-width: 47.99rem) {
    .ready-check.is-open .ready-frame {
      animation-name: ready-rise;
    }
  }
}

/* Reduced motion: the dialog fades in; nothing slams, shakes, ripples or turns. The fade is the one animation kept against the
   stylesheet's reduced-motion rule at its end (which stops every animation with !important): the approved design asks for it. */
@media (prefers-reduced-motion: reduce) {
  .ready-check.is-open :is(.ready-dim, .ready-frame) {
    animation: ready-fade 200ms ease both !important;
  }

  .ready-rings,
  .ready-ripple {
    display: none;
  }
}

/* Forced colours: the dialog, the options and the bars keep visible edges. */
@media (forced-colors: active) {
  .ready-card,
  .ready-option,
  .ready-split-bar {
    border: 1px solid CanvasText;
  }

  .ready-option.is-correct,
  .ready-option.is-wrong {
    border-width: 2px;
  }

  /* The countdown bar: an outlined track with a system-colour fill (both would otherwise turn Canvas and vanish). */
  .ready-bar {
    outline: 1px solid CanvasText;
  }

  .ready-bar > i {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

@keyframes ready-fade {
  from { opacity: 0; }
}

@keyframes ready-slam {
  0% { opacity: 0; transform: scale(1.5); }
  50% { opacity: 1; transform: scale(0.95); }
  72% { transform: scale(1.015); }
  100% { transform: none; }
}

@keyframes ready-rise {
  0% { opacity: 0; transform: translateY(100%); }
  55% { opacity: 1; transform: translateY(-3%); }
  75% { transform: translateY(1%); }
  100% { transform: none; }
}

@keyframes ready-ripple {
  0% { opacity: 0.85; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.2); }
}

@keyframes ready-shake {
  25% { transform: translate(-4px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, 1px); }
}

@keyframes ready-spin {
  to { transform: rotate(360deg); }
}

@keyframes ready-grow {
  from { transform: scaleX(0); }
}

/* ---- Exam page ---- */

/* A two-column key/value table inside a card needs no frame of its own. */
.table-plain {
  border: 0;
  background: none;
}

.table-keyvalue th[scope="row"] {
  width: 32%;
  padding-left: 0;
  color: var(--muted);
  font-weight: 550;
}

/* The exam pages: the facts and the notes as cards; their prose keeps the reading measure. */
.exam-pages .card h2 {
  margin-bottom: var(--space-s);
}

.exam-pages .card .table-wrap {
  margin-bottom: 0;
}

.prose > :is(p, ul) {
  max-width: var(--measure);
}

/* ---- Legal pages: one narrow reading column ---- */

.legal {
  max-width: var(--measure);
}

.legal h2 {
  font-size: var(--step-1);
}

/* The parts of a section (the terms' "Plans and payments", L2): a step below the section's heading. */
.legal h3 {
  font-size: var(--step-0);
  margin-top: 1.2em;
}

/* ---- Pricing ---- */

.plans {
  align-items: stretch;
}

.plan {
  display: flex;
  flex-direction: column;
}

.plan .checklist {
  margin-bottom: var(--space-m);
}

/* The call to action sits at the bottom of each plan card, full width. */
.plan-cta {
  margin-top: auto;
  padding-top: var(--space-xs);
}

.plan-cta form,
.plan-option form {
  margin: 0;
}

.plan :is(.plan-cta, .plan-option) .button {
  width: 100%;
}

.plan-cta .hint {
  display: block;
  margin-top: var(--space-xs);
}

/* "Coming soon" at the foot of a priced card while nothing can be bought, where the buy button will be and as tall as the Free card's
   button beside it: a monitor strip. A flat line, a heartbeat, the pill with its live dot (the eyebrow's look), a heartbeat, a flat
   line. The lines take what width the card leaves; the beats and the pill keep their size. Still, it is complete (the motion is under
   "Motion"). */
.plan-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding-top: 0;
}

.plan-soon-line {
  flex: 1;
  height: 1.5px;
  border-radius: 1px;
  background: var(--glow);
  opacity: 0.45;
}

.plan-soon-beat {
  flex: none;
  width: 3rem;
  height: 2rem;
  overflow: visible;
  color: var(--glow);
}

.plan-soon-beat path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.45;
}

/* The bright segment: a third of the beat long, parked before the trace's start (so it is not drawn) until it runs. */
.plan-soon-beat .plan-soon-run {
  stroke-width: 2.25;
  stroke-dasharray: 0.35 2;
  stroke-dashoffset: 0.45;
  opacity: 1;
  filter: drop-shadow(0 0 4px currentColor);
}

.plan-soon-pill {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--accent-bg);
  color: var(--primary);
  font-size: var(--step--1);
  font-weight: 650;
  white-space: nowrap;
}

.plan-soon-pill::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--glow);
}

/* The ring is centred on the dot (the pill's padding plus half the dot); it shows only while it pings. */
.plan-soon-pill::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border: 2px solid var(--glow);
  border-radius: 50%;
  opacity: 0;
}

.plan-option {
  padding: var(--space-s) 0;
  border-bottom: 1px solid var(--border);
}

.plan-option:first-of-type {
  padding-top: 0;
}

.plan-option .price {
  font-size: var(--step-3);
}

.plan-notes {
  margin-top: var(--space-m);
}

/* Plan features: a check icon for what is included, a dash for what is not (the shared checklist's glyph is replaced here). */
.pricing-page .checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding-left: 0;
}

.pricing-page .checklist li::before {
  content: none;
}

.pricing-page .checklist .icon {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2em;
  color: var(--primary);
  stroke-width: 2.25;
}

.pricing-page .checklist .no {
  color: var(--muted);
}

.pricing-page .checklist .no .icon {
  color: var(--muted);
}

/* A pass's price per month, from the price data. */
.price-per-month {
  margin: calc(-1 * var(--space-xs)) 0 var(--space-xs);
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* One card per row until three fit side by side (60rem): two columns would leave the passes alone on a row. */
@media (max-width: 59.99rem) {
  .grid-3.plans {
    grid-template-columns: minmax(0, 1fr);
    max-width: 36rem;
  }
}

/* The single mock: one card under the plans, the offer on the left and its price and button on the right; stacked when the plans are. */
.single-mock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
  gap: var(--space-l);
  align-items: center;
  margin-top: var(--space-l);
}

.single-mock h2 {
  margin-top: 0;
}

.single-mock .checklist {
  margin-bottom: 0;
}

.single-mock-buy form {
  margin: 0;
}

.single-mock-buy .button {
  width: 100%;
}

.single-mock-buy .hint {
  display: block;
  margin-top: var(--space-xs);
}

@media (max-width: 59.99rem) {
  .single-mock {
    grid-template-columns: minmax(0, 1fr);
    max-width: 36rem;
  }
}

/* A discount code: the full price struck through beside what is paid first, and the code field under the plans. */
.price-was {
  font-size: var(--step-1);
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
}

/* What the amounts are for sits on a line of its own under them: beside two amounts it would wrap raggedly in a narrow card. */
.price-cut small {
  display: block;
  margin-top: 0.2rem;
  line-height: 1.4;
}

.code-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-s);
  margin-top: var(--space-l);
}

.code-form .field {
  flex: 0 1 20rem;
  margin: 0;
}

/* The invite page: the link in a field that shows all of it. */
.invite-link {
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.invite-code {
  letter-spacing: 0.08em;
}

/* Forced colours draw every border alike: the featured plan keeps a thicker Highlight border. */
@media (forced-colors: active) {
  .plans .card-featured {
    border: 3px solid Highlight;
  }
}

/* ---- Dashboard ---- */

.stat-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-l);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
}

.stat {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-2xs);
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  min-width: 0;
}

li.stat + li.stat {
  margin-top: 0;
}

.stat-label {
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 550;
  line-height: 1.3;
}

.stat-value {
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat-of {
  color: var(--muted);
  font-size: var(--step-0);
  font-weight: 500;
  letter-spacing: 0;
}

.stat-value-muted {
  color: var(--muted);
  font-size: var(--step-1);
  font-weight: 600;
}

.dash-grid {
  display: grid;
  gap: 0 var(--space-m);
  align-items: start;
}

.dash-main,
.dash-side {
  min-width: 0;
}

/* The page's source order is the phone's reading order: greeting, resume, figures, Start practice, patient groups, trend, outcome,
   plan, mocks, recent. From 48rem the head carries Start practice and Take a mock, and the trend goes above the groups. */

.dash-exam {
  margin-top: var(--space-2xs);
  font-size: var(--step-0);
}

.dash-actions-wide {
  display: none;
}

.dash-actions-phone {
  margin: 0 0 var(--space-m);
}

.dash-actions-phone .button {
  width: 100%;
  justify-content: center;
}

.dash .card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-s);
  margin-bottom: var(--space-xs);
}

.dash .card-head h2 {
  margin: 0;
}

.dash .card-head > a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
}

.dash-main,
.dash-side {
  display: flex;
  flex-direction: column;
}

/* Resume: the most recent unfinished attempt, marked by a bar of the primary colour down its left side. */
.resume-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
  border-left: 4px solid var(--primary);
}

.resume-main {
  flex: 1 1 12rem;
  min-width: 0;
}

.resume-card h2 {
  margin: 0 0 var(--space-2xs);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 550;
}

.resume-title {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.resume-bar {
  min-width: 0;
  max-width: 16rem;
  height: 0.5rem;
}

.resume-others {
  flex: 1 1 100%;
  margin: 0;
  padding: var(--space-xs) 0 0;
  list-style: none;
  border-top: 1px solid var(--border);
  font-size: var(--step--1);
}

.resume-others li {
  padding: var(--space-2xs) 0;
}

.resume-others li + li {
  margin-top: 0;
}

.stat-bar {
  min-width: 0;
  height: 0.5rem;
  margin-top: var(--space-2xs);
}

/* Accuracy over time: two SVGs drawn in px down and percent across, so their text keeps its size at any width: the axis labels in a
   column of their own (wider than "100%", 32 px at 11 px), the bars and their value labels in the rest. The breakpoints come from
   the label widths in Chromium at 11 px (0.6875rem): "100.0" 31.4 px, "100.0%" 42.5 px, with at least 2 px between labels, for the
   twelve weeks the trend shows by default (app.insights.trend-weeks; a shorter trend has wider slots). With F the figure's width,
   each of the 12 slots is 0.97 x (F - 36 px) / 12 wide, and
   - below 28.25rem only the weeks with a date label keep their value (every other week, so 2 slots apart; `trend-pct-minor` goes),
     without its percent sign below 19.5rem (2 slots fit "100.0%" from F = 311 px); below 19.5rem every other date label goes too
     (`trend-week-label-minor`: a date such as "28 Sept" is up to 42 px, 2 slots fit two of them from F = 308 px);
   - from 28.25rem every week has its value (1 slot fits "100.0" from F = 450 px), without the percent sign below 36.75rem
     (1 slot fits "100.0%" from F = 587 px).
   The visually hidden table keeps every value. */
.trend-figure {
  container-type: inline-size;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  margin-top: var(--space-s);
}

.trend-scale,
.trend-chart {
  display: block;
  overflow: visible;
}

.trend-figure text {
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.trend-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.trend-axis,
.trend-week-label {
  fill: var(--muted);
}

.trend-chart .trend-pct {
  fill: var(--text);
  font-weight: 600;
}

.trend-bar-empty {
  fill: var(--border-strong);
}

@container (width < 28.25rem) {
  .trend-pct-minor {
    display: none;
  }
}

@container (width < 19.5rem) {
  .trend-week-label-minor {
    display: none;
  }
}

@container (width < 19.5rem) or ((width >= 28.25rem) and (width < 36.75rem)) {
  .trend-unit {
    display: none;
  }
}

/* Patient groups: one row per group that opens to its topics. On a wide card the rows line up under a column header line; on a
   narrow one the weight goes under the name with its label. */
.group-list {
  container-type: inline-size;
  margin-top: var(--space-s);
}

.group-cols,
.group-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 4.5rem minmax(3rem, 1fr) 4rem 1rem;
  grid-template-areas: "name weight bar pct chevron";
  align-items: center;
  gap: var(--space-xs);
}

.group-cols {
  padding-bottom: var(--space-2xs);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 550;
}

.group-cols > :nth-child(3) {
  grid-column: bar / chevron;
}

.group-row {
  border-top: 1px solid var(--border);
}

.group-row > summary {
  list-style: none;
  padding: var(--space-xs) 0;
  font-weight: 500;
}

.group-row > summary::-webkit-details-marker {
  display: none;
}

.group-row[open] > summary {
  margin-bottom: 0;
}

.group-name {
  grid-area: name;
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-weight {
  grid-area: weight;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.group-key {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.group-bar {
  grid-area: bar;
  min-width: 0;
  height: 0.5rem;
  margin: 0;
}

.group-pct {
  grid-area: pct;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.group-chevron {
  grid-area: chevron;
  justify-self: center;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}

.group-row[open] .group-chevron {
  margin-top: 0.2rem;
  transform: rotate(-135deg);
}

.group-body {
  padding: 0 0 var(--space-s);
  font-size: var(--step--1);
}

.group-body > p {
  margin: 0 0 var(--space-2xs);
}

.group-topics {
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-topic {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 4rem;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) 0 var(--space-2xs) var(--space-s);
}

.group-topic + .group-topic {
  margin-top: 0;
}

.group-topic-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-topic-pct {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@container (max-width: 30rem) {
  .group-cols {
    display: none;
  }

  .group-row > summary {
    grid-template-columns: minmax(0, 1fr) 4rem 3.75rem 1rem;
    grid-template-areas:
      "name bar pct chevron"
      "weight weight weight chevron";
    row-gap: 0;
  }

  .group-weight {
    font-size: var(--step--1);
  }

  .group-key {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}

/* Mocks and recent attempts: compact lists, a title with a line of detail under it and one link at the end. */
.dash-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  margin: 0;
  padding: var(--space-xs) 0;
  border-top: 1px solid var(--border);
}

.dash-list > li:first-child {
  padding-top: 0;
  border-top: 0;
}

.dash-list-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-list-title {
  font-weight: 550;
  overflow-wrap: anywhere;
}

.dash-list-meta {
  color: var(--muted);
  font-size: var(--step--1);
}

.dash-list-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
}

.readiness-note {
  margin-top: var(--space-s);
  font-size: var(--step--1);
}

@media (min-width: 48rem) {
  .dash-actions-wide {
    display: flex;
  }

  .dash-actions-phone {
    display: none;
  }

  .trend-card {
    order: -1;
  }
}

/* ---- Tables that become a list of small cards in a narrow box (a phone, or the dashboard's side column) ----
   The table keeps its semantics (explicit roles in the markup, a visually hidden header row); each row shows its title cell on a
   line of its own and the other cells as "label value" pairs from data-label. The label is decoration: assistive technology
   already has the column header, so the generated text carries an empty alternative. */

.table-wrap:has(> .table-stack) {
  container-type: inline-size;
}

@container (max-width: 32rem) {
  .table-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .table-stack,
  .table-stack tbody {
    display: block;
  }

  .table-stack tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.1rem var(--space-m);
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
  }

  .table-stack tbody:last-child > tr:last-child {
    border-bottom: 0;
  }

  .table-stack :is(th, td) {
    display: block;
    padding: 0;
    border: 0;
    background: none;
  }

  .table-stack tbody tr:hover > :is(th, td) {
    background: none;
  }

  .table-stack th[scope="row"] {
    flex: 1 1 100%;
    order: -1;
  }

  .table-stack td.indent {
    padding-left: var(--space-m);
  }

  .table-stack td[data-label]::before {
    content: attr(data-label) " ";
    content: attr(data-label) " " / "";
    color: var(--muted);
    font-size: var(--step--1);
    font-weight: 550;
  }

  /* An empty cell leaves the layout but stays in the accessibility tree, so the cells after it keep their column headers. */
  .table-stack td:empty {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .table-stack .cell-bar {
    flex: 1 1 100%;
  }

  .table-stack .cell-bar .bar {
    margin-top: 0.15rem;
  }
}

/* ---- Choice cards: real radio buttons and checkboxes with their labels, drawn as tappable cards ---- */

.choices {
  display: grid;
  gap: var(--space-xs);
}

.choices legend {
  margin-bottom: var(--space-2xs);
}

.choice,
.field .choice {
  font-weight: 400;
}

.choice {
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.choice:hover {
  border-color: var(--text);
}

.choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* A choice card's longer explanation under its short name (the mock conditions). */
.choice-detail {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.45;
}

/* Toggle chips: a real checkbox and its label in a pill (the practice form's difficulties and topics). Long names wrap inside the
   pill rather than push past a narrow screen. */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-xs);
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  min-height: 2.25rem;
  padding: 0.3rem 0.85rem 0.3rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 550;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.toggle-chip input {
  flex: none;
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.toggle-chip span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toggle-chip:hover {
  border-color: var(--text);
}

.toggle-chip:has(input:checked) {
  border-color: var(--primary);
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.toggle-chip:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Forced colours drop the tint and the inset ring: a ticked chip gets a Highlight outline (its checkbox shows the tick too). */
@media (forced-colors: active) {
  .toggle-chip:has(input:checked) {
    outline: 2px solid Highlight;
    outline-offset: 1px;
  }
}

/* ---- Mocks ---- */

.mock-exam + .mock-exam {
  margin-top: var(--space-l);
}

/* One card per row, two from 60rem; the cards of a row line their Start buttons up at the bottom. */
.mock-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-m);
  margin: var(--space-s) 0 var(--space-xl);
}

@media (min-width: 60rem) {
  .mock-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mock-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  margin: 0;
}

.mock-card > * {
  margin: 0;
}

/* The title with its kind badge on one line (the badge goes under a long title). */
.mock-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-s);
}

.card .mock-title {
  margin: 0;
  font-size: var(--step-1);
  overflow-wrap: anywhere;
}

/* Questions · minutes · navigation rule, each after an icon. */
.mock-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-m);
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 550;
}

.mock-facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.mock-facts .icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primary);
}

/* The last result (or "Not taken yet") in a tinted box; the transparent border shows in forced colours, where the tint is dropped. */
.mock-last {
  padding: var(--space-xs) var(--space-s);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: var(--accent-bg);
  font-size: var(--step--1);
  font-weight: 550;
}

.mock-locked .notice {
  margin: 0;
}

.mock-form {
  gap: var(--space-s);
  margin-top: auto;
}

.mock-conditions {
  padding: 0;
  border: 0;
}

.mock-start {
  justify-self: start;
}

/* ---- Practice form: a Topics card beside a sticky "Your set" card from 60rem, one column below ---- */

.practice-form {
  gap: var(--space-s);
  margin-top: 0;
}

.practice-exam {
  margin: 0;
}

.practice-layout {
  display: grid;
  gap: var(--space-m);
  align-items: start;
}

.practice-topics,
.practice-set {
  min-width: 0;
  margin: 0;
}

@media (min-width: 60rem) {
  .practice-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  }

  .practice-set {
    position: sticky;
    top: calc(var(--header-h) + var(--space-m));
  }
}

/* The Topics legend reads as the card's title, with "None ticked = all topics" at the other end of its line. */
.practice-topics > legend {
  float: left;
  margin: 0;
  padding: 0;
  font-size: var(--step-1);
  font-weight: 650;
}

.practice-topics-short {
  float: right;
  margin: 0.2rem 0 0;
  padding: 0.05rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 550;
}

.practice-topics > .hint {
  clear: both;
  padding-top: var(--space-2xs);
}

/* A row per patient group: its box and name on the left, "n topics" and the chevron (the disclosure's summary) on the right, and the
   group's topics as chips under the name when open. */
.topic-groups {
  margin: var(--space-s) 0 0;
  padding: 0;
  list-style: none;
}

.topic-group {
  position: relative;
  margin: 0;
  padding: var(--space-xs) 0;
  border-top: 1px solid var(--border);
}

.topic-group:last-child {
  padding-bottom: 0;
}

.topic-group-check {
  align-items: center;
  min-height: 2.25rem;
  padding-right: 7.5rem;
}

.field .topic-group-check,
.topic-group-check {
  font-weight: 600;
}

.topic-group-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.topic-details > summary {
  position: absolute;
  top: var(--space-xs);
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.25rem;
  padding: 0 0.4rem 0 0.6rem;
  color: var(--muted);
  font-size: var(--step--1);
  list-style: none;
  white-space: nowrap;
}

.topic-details > summary::-webkit-details-marker {
  display: none;
}

.topic-details > summary:hover {
  color: var(--text);
}

.topic-details > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.topic-count {
  font-variant-numeric: tabular-nums;
}

.topic-chevron {
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.topic-details[open] .topic-chevron {
  margin-top: 0.2rem;
  transform: rotate(-135deg);
}

.topic-chips {
  padding: var(--space-2xs) 0 var(--space-2xs) 1.85rem;
}

/* Forced colours: a group with some of its topics ticked gets a dashed outline round its box, beside the box's own dash. */
@media (forced-colors: active) {
  .topic-group-check input:indeterminate {
    outline: 2px dashed Highlight;
    outline-offset: 2px;
  }
}

/* Your set: the difficulty chips, the question choice cards, the number with − / +, the summary, then Start practice full width. */
.practice-set {
  display: grid;
  gap: var(--space-m);
}

.card .practice-set-title {
  margin: 0;
}

.practice-fieldset {
  padding: 0;
  border: 0;
}

.practice-fieldset > legend {
  padding: 0;
  margin-bottom: var(--space-2xs);
}

.practice-fieldset .hint {
  margin-bottom: var(--space-2xs);
}

.stepper {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.stepper input[type="number"] {
  width: 5.5rem;
  text-align: center;
}

.stepper-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.stepper-button:hover {
  border-color: var(--text);
  background: var(--surface-strong);
}

.stepper-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.stepper-button .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.practice-summary {
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  background: var(--surface-strong);
  font-size: var(--step--1);
  font-weight: 550;
}

.practice-actions {
  display: grid;
  gap: var(--space-xs);
}

/* ---- Attempts list: one row per attempt in a card ---- */

.attempts-card {
  padding-block: var(--space-2xs);
}

.attempt-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Phones: the icon beside the title and the line under it, the actions as small links below. */
.attempt-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon main"
    ". actions";
  gap: var(--space-2xs) var(--space-s);
  align-items: center;
  margin: 0;
  padding: var(--space-s) 0;
  border-top: 1px solid var(--border);
}

.attempt-row:first-child {
  border-top: 0;
}

.attempt-icon {
  grid-area: icon;
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-s);
  background: var(--accent-bg);
  color: var(--primary);
}

.attempt-icon-mock {
  background: var(--surface-strong);
  color: var(--text);
}

.attempt-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.attempt-main {
  grid-area: main;
  min-width: 0;
}

.attempt-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.4rem;
  margin: 0;
  font-weight: 600;
}

.attempt-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.attempt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.4rem;
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.attempt-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-m);
  font-size: var(--step--1);
  font-weight: 550;
}

.attempt-action {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
}

/* Wider: the actions at the end of the row, as small buttons (Resume in the primary colour). */
@media (min-width: 40rem) {
  .attempt-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon main actions";
  }

  .attempt-actions {
    justify-content: flex-end;
    gap: var(--space-xs);
  }

  .attempt-action {
    min-height: var(--control-h-tight);
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
  }

  .attempt-action:hover {
    border-color: var(--text);
    background: var(--surface-strong);
  }

  .attempt-action-primary {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--on-primary);
  }

  .attempt-action-primary:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
  }
}

/* ---- Result ---- */

.result-context {
  margin: calc(-1 * var(--space-xs)) 0 var(--space-s);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 550;
}

/* The score card: the ring, the result's centrepiece (U11, as drawn), above "n of N correct", the badges and the two actions, all centred,
   on phones; beside them from 40rem. Without a ring (nothing counted) the body keeps the card's left alignment. */
.score-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-s) 1.75rem;
}

.score-main:has(> .score-ring) {
  justify-items: center;
  text-align: center;
}

.score-main:has(> .score-ring) :is(.result-badges, .score-actions) {
  justify-content: center;
}

.score-body {
  min-width: 0;
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 8.5rem;
  height: 8.5rem;
}

@media (min-width: 40rem) {
  .score-main:has(> .score-ring) {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    text-align: left;
  }

  .score-main:has(> .score-ring) :is(.result-badges, .score-actions) {
    justify-content: flex-start;
  }

  .score-ring {
    width: 10.5rem;
    height: 10.5rem;
  }
}

.score-ring-svg {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
}

.score-ring-track {
  stroke: var(--surface-strong);
}

/* The figure inside the ring: the number large, its sign small and muted (as drawn), sized so that even 100.0% stays inside the ring's
   track (2.4rem in the 10.5rem ring, 1.9rem in the 8.5rem one). */
.score-ring-value {
  grid-area: 1 / 1;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score-ring-value small {
  margin-left: 0.04em;
  color: var(--muted);
  font-size: 0.45em;
  font-weight: 650;
  letter-spacing: 0;
}

@media (min-width: 40rem) {
  .score-ring-value {
    font-size: 2.4rem;
  }
}

.score-headline {
  margin: 0 0 var(--space-xs);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.score-headline strong {
  font-weight: 700;
}

.result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0 0 var(--space-2xs);
}

.score-note {
  margin: 0;
}

.score-actions {
  margin: var(--space-s) 0 0;
}

.score-card > .notice {
  margin-top: var(--space-s);
}

.result-pair {
  display: grid;
  gap: var(--space-m);
  margin-bottom: var(--space-m);
}

.result-pair > .card {
  margin: 0;
}

/* Patient groups and topics as rows: a quiet header, a line between rows, the bar and the percent at the end. */
.result-rows :is(th, td) {
  vertical-align: middle;
}

.result-rows thead th {
  background: none;
  color: var(--muted);
  font-weight: 550;
}

.result-rows tbody tr:hover > :is(th, td) {
  background: none;
}

.result-rows tbody th {
  font-weight: 550;
}

.result-rows .cell-bar {
  width: 32%;
}

.result-rows .cell-bar .bar {
  margin-top: 0;
}

.result-rows .cell-percent {
  width: 4.5rem;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.result-rows td[data-label] {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.result-rows td[data-label="Weight"] {
  color: var(--muted);
}

.result-topics .cell-percent {
  width: 6rem;
}

/* Stacked on a phone (see "Tables that become a list of small cards"): the name, the figures, then the bar across the row. */
@container (max-width: 32rem) {
  .result-rows .cell-percent {
    width: auto;
    text-align: left;
  }

  .result-rows .cell-bar {
    width: auto;
    order: 1;
  }
}

/* ---- Review: the options read like the player's revealed state ---- */

.review-options {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-m);
  display: grid;
  gap: var(--space-xs);
}

/* An option: the letter in a disc, the text, then the Yours and Correct tags (words, so they need no colour to read). */
.review-option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0;
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  line-height: 1.5;
}

.review-letter {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1;
}

.review-option-text {
  flex: 1 1 8rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-option.is-key {
  border-color: var(--success);
  background: var(--success-bg);
  box-shadow: inset 0 0 0 1px var(--success);
}

.review-option.is-wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
  box-shadow: inset 0 0 0 1px var(--danger);
}

/* An answer a practice set never checked: chosen, but neither right nor wrong. */
.review-option.is-chosen {
  border-color: var(--primary);
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.review-option.is-key .review-letter {
  background: var(--success);
  border-color: var(--success);
  color: var(--success-bg);
}

.review-option.is-wrong .review-letter {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-bg);
}

.review-option.is-chosen .review-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.option-tag {
  flex: none;
  padding: 0.05rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: 650;
  line-height: 1.5;
}

.option-tag + .option-tag {
  margin-left: -0.35rem;
}

.tag-yours {
  color: var(--danger);
}

.is-key .tag-yours,
.tag-key {
  color: var(--success);
}

.is-chosen .tag-yours {
  color: var(--primary);
}

/* Forced colours drop the fills and the inset rings: the key gets a thick solid border and a filled letter, your wrong answer a
   dashed border and an outlined letter, the current filter chip Highlight. The tags and the pills keep their words and borders. */
@media (forced-colors: active) {
  .review-option.is-key {
    border: 3px solid CanvasText;
  }

  .review-option.is-key .review-letter {
    forced-color-adjust: none;
    background: CanvasText;
    border-color: CanvasText;
    color: Canvas;
  }

  .review-option.is-wrong,
  .review-option.is-chosen {
    border: 3px dashed CanvasText;
  }

  .review-option.is-wrong .review-letter,
  .review-option.is-chosen .review-letter {
    border: 3px double CanvasText;
  }

  .chip[aria-current="page"] {
    forced-color-adjust: none;
    background: Highlight;
    border-color: Highlight;
    color: HighlightText;
  }

  /* forced-color-adjust: none also stops the focus ring being forced: give it a system colour (CanvasText, as it sits on a Highlight chip). */
  .chip:focus-visible {
    outline-color: CanvasText;
  }

  .score-ring-svg {
    forced-color-adjust: none;
  }

  .score-ring-track {
    stroke: GrayText;
  }

  .score-ring-arc {
    stroke: CanvasText;
  }
}

/* ---- Sign-in and account flows: one centred card ----
   Log in, sign-up, password reset, email verification, onboarding and the checkout pages: one card in the middle of the page, the
   heading and its lead, the fields, a full-width primary button, and the secondary links under it. Sign-up (more fields) and the checkout
   consent page (more to read) take a wider card. */

.auth-page {
  display: grid;
  justify-items: center;
  align-content: start;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  padding: var(--space-l) var(--space-m);
  box-shadow: var(--shadow-2);
}

.auth-card-wide {
  max-width: 34rem;
}

.auth-card h1 {
  margin-top: 0;
  font-size: var(--step-2);
}

.auth-card .form {
  margin-bottom: var(--space-m);
}

/* The primary button takes the card's width; a second button or link stacks under it. */
.auth-card :is(.form-actions, .button-row) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.auth-card :is(.form-actions, .button-row) .button {
  width: 100%;
}

.auth-links {
  padding-top: var(--space-s);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: var(--step--1);
}

.auth-links p {
  margin: 0 auto var(--space-2xs);
}

/* A label with a link at its end ("Forgot your password?"): the link sits beside the label, not inside it. */
.field-label-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2xs) var(--space-s);
}

.field-label-row a {
  font-size: var(--step--1);
}

/* The card is narrow: a moderate padding on wide screens too (this overrides the generic one under "Larger screens"). */
@media (min-width: 40rem) {
  .auth-page .auth-card {
    padding: var(--space-l);
  }
}

/* Onboarding: a decorative progress line over the heading, and the exams as choice cards without the fieldset's own frame. */
.progress-line {
  display: flex;
  gap: var(--space-2xs);
  margin-bottom: var(--space-m);
}

.progress-line span {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--border);
}

.progress-line .is-done {
  background: var(--primary);
}

.auth-card fieldset.choices {
  border: 0;
  padding: 0;
}

.auth-card fieldset.choices legend {
  padding: 0;
  font-weight: 550;
}

.auth-card .choice {
  align-items: center;
}

/* S2: the QR code of the two-factor set-up page (inline SVG, one unit per module, the quiet zone inside the plate). A code is read dark on
   light, so its two colours are its own and the same in both themes (not theme tokens), kept under forced colours and in print. At least
   200 px wide, never wider than the card's column, sharp edges (shape-rendering on the element). */
.qr-code {
  --qr-light: #FFFFFF;
  --qr-dark: #000000;
  display: block;
  width: 100%;
  min-width: 200px;
  max-width: 18rem;
  height: auto;
  aspect-ratio: 1;
  margin: var(--space-s) 0;
  forced-color-adjust: none;
  print-color-adjust: exact;
}

.qr-code .qr-plate {
  fill: var(--qr-light);
}

.qr-code .qr-modules {
  fill: var(--qr-dark);
}

/* ---- Account page: a section nav beside the section cards (a chip row above them on phones) ---- */

.account-layout {
  display: grid;
  gap: var(--space-m);
}

.account-side,
.account-sections {
  min-width: 0;
}

.account-side h1 {
  margin-top: 0;
}

.account-nav ul {
  display: flex;
  gap: var(--space-2xs);
  margin: 0;
  /* Room for the chips' focus ring (2px + 2px offset): the scroll box would clip it at the top and left. */
  padding: 4px 4px var(--space-2xs);
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.account-nav li {
  flex: none;
  margin: 0;
}

.account-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}

.account-nav a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.account-nav .account-nav-danger {
  color: var(--danger);
}

/* An anchor's section lands below the sticky header, with a little room. */
.account-sections > section {
  scroll-margin-top: calc(var(--header-h) + var(--space-m));
}

.field-pair {
  display: grid;
  gap: var(--space-m);
}

/* A short sentence and its button on one line when there is room. */
.card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-m);
}

.card-row p {
  margin: 0;
}

/* Delete account: a danger border and heading; the form inside is the ordinary one. */
.card-danger {
  border: 2px solid var(--danger);
}

.card-danger h2 {
  color: var(--danger);
}

@media (min-width: 40rem) {
  .field-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 48rem) {
  .account-layout {
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: var(--space-l);
    align-items: start;
  }

  .account-side h1 {
    font-size: var(--step-2);
  }

  .account-side {
    position: sticky;
    top: calc(var(--header-h) + var(--space-m));
  }

  .account-nav ul {
    flex-direction: column;
    gap: 2px;
    overflow: visible;
    padding: 0;
  }

  .account-nav a {
    display: flex;
    min-height: 2.25rem;
    border-color: transparent;
    border-radius: var(--radius-s);
    background: none;
    color: var(--muted);
    font-size: var(--step-0);
    font-weight: 500;
  }

  .account-nav a:hover {
    border-color: transparent;
    background: var(--accent-bg);
    color: var(--primary);
  }
}

/* ---- Billing page: the access, subscription and pass history cards in a reading column ---- */

.billing-page {
  max-width: 48rem;
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-2xs) var(--space-m);
}

.facts dt {
  color: var(--muted);
  font-weight: 500;
}

.facts dd {
  margin: 0;
}

/* Forced colours drop fills and shadows: the picked choice card gets a Highlight outline, the danger card a thicker border. */
@media (forced-colors: active) {
  /* Every choice card (onboarding, the practice form's mode cards): the picked one is outlined, not only tinted. */
  .choice:has(input:checked) {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  .progress-line .is-done {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .card-danger {
    border: 3px solid CanvasText;
  }
}

/* ---- Mock day (M1): the announcement card, the public page, the block on a sitting's result ---- */

/* The announcement on the dashboard and the mocks page: like the resume card, marked by a bar of the primary colour down its left. */
.mock-day-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-m);
  border-left: 4px solid var(--primary);
}

.mock-day-card-main {
  flex: 1 1 14rem;
  min-width: 0;
}

.mock-day-card h2 {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin: 0 0 var(--space-2xs);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 550;
}

.mock-day-card-title {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.mock-day-card-when {
  margin: var(--space-2xs) 0 0;
  font-size: var(--step--1);
}

.mock-day-banner {
  margin-bottom: var(--space-l);
}

/* Under its band (U12), the page's blocks keep the column they had, at the band's left edge. */
.mock-day-page .pulse-body > * {
  max-width: 48rem;
}

.mock-day-last {
  font-weight: 600;
}

.mock-day-event {
  border-left: 4px solid var(--primary);
}

.mock-day-event h2 {
  margin-top: 0;
  overflow-wrap: anywhere;
}

.mock-day-state {
  margin: 0 0 var(--space-xs);
}

.mock-day-times {
  margin: var(--space-s) 0;
  font-variant-numeric: tabular-nums;
}

.mock-day-next {
  margin-top: var(--space-m);
  padding-top: var(--space-s);
  border-top: 1px solid var(--border);
}

.mock-day-next > :last-child,
.mock-day-start > :last-child {
  margin-bottom: 0;
}

.mock-day-result .button-row {
  margin-bottom: 0;
}

.review-closed {
  margin-top: var(--space-m);
}

/* ---- Error pages ---- */

.error-page {
  display: grid;
  justify-items: center;
  align-content: start;
}

.error-card {
  width: 100%;
  max-width: 36rem;
  padding: var(--space-xl) var(--space-l);
  text-align: center;
}

.error-card .button-row {
  justify-content: center;
}

.error-card p:not([class]) {
  margin-inline: auto;
}

.error-code {
  margin: 0;
  color: var(--primary);
  font-size: var(--step-4);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---- Player: a compact bar on phones ----
   One row: the brand mark, the progress, the clock and the icon buttons (Pause, Questions, Tools). A practice set (no clock) keeps its
   title, truncated; a timed mock's title and its kind badge stay in the bar for screen readers only, as the row has no room for them
   (the page title names the form). */

@media (max-width: 39.99rem) {
  .player-title .badge,
  .player-bar:has(#player-clock:not([hidden])) .player-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  /* With the title gone, the progress takes the room on the left and the clock and the buttons go to the right edge. */
  .player-bar:has(#player-clock:not([hidden])) .player-progress {
    flex: 1 1 auto;
  }

  /* The title takes only the room the progress and the buttons leave (truncated if it must be); the progress wraps only when it is
     long (a block: "Block 2 of 3, Question 42 of 150"). */
  .player-title {
    flex: 1 1 0;
  }

  #player-title,
  .player-progress {
    font-size: var(--step--1);
  }

  .exam-brand {
    width: 2rem;
  }

  .player-clock {
    padding: 0.15rem 0.5rem;
    gap: 0.25rem;
  }
}

/* Below 23rem (a 360 px phone and smaller) a flexible timed mock fills the row: brand, progress, clock, Pause, Questions, Tools and the
   theme button. The gaps and the side padding tighten, the square buttons shrink a little (still well over the 24 px target size) and
   the clock drops its icon (its time and its hidden "Time remaining" stay), so the progress keeps room for its words. */
@media (max-width: 22.99rem) {
  .exam-bar,
  .player-bar {
    gap: var(--space-2xs);
  }

  .exam-bar {
    padding-inline: var(--space-xs);
  }

  .exam-bar :is(.icon-button, .player-pause, .theme-toggle) {
    width: var(--control-h-tight);
    height: var(--control-h-tight);
    min-height: 0;
  }

  .player-clock {
    padding: 0.15rem 0.4rem;
  }

  .player-clock .icon {
    display: none;
  }
}

/* Below 21.25rem (a 320 px phone) a mock with Pause and a clock still has too little room: the brand mark gives way (the way back is
   back after a tap on Pause: a paused attempt has no Pause button, so the mark returns). */
@media (max-width: 21.24rem) {
  .exam-bar:has(#player-pause:not([hidden])):has(#player-clock:not([hidden])) .exam-brand {
    display: none;
  }
}

/* The site footer's notices on the in-progress player (focus mode has no footer). */
.player-notice {
  max-width: var(--measure);
  margin: var(--space-xl) 0 0;
  padding-top: var(--space-s);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: var(--step--1);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  /* viewport-fit=cover (layout.tsx): the page pads for the home indicator itself. */
  padding: var(--space-l) 0 calc(var(--space-xl) + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: var(--step--1);
}

.site-footer p {
  margin-bottom: 0.5rem;
  max-width: var(--measure);
}

/* The footer's links, above its notes. */
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-s) var(--space-l);
  margin-bottom: var(--space-m);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-m);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  font-weight: 500;
}

/* ---------- Operator console: content pipeline ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pre-wrap {
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0.5rem 0;
}

details.fold {
  margin: 0.5rem 0;
}

details.fold > summary {
  cursor: pointer;
  font-weight: 550;
}

/* ---------- Console and admin: quality, issues, users ---------- */

.text-bad {
  color: var(--danger);
  font-weight: 700;
}

/* An issue report that has waited past the triage limit, or a week above the error threshold. Colour is not the only cue: the row also carries a badge. */
.row-overdue th,
.row-overdue td,
tbody tr.row-overdue:hover > th,
tbody tr.row-overdue:hover > td {
  background: var(--danger-bg);
}

.trigger-banner {
  border-width: 2px;
  border-left-width: 6px;
}

.trigger-banner ul {
  margin: 0.4rem 0 0;
}

td.indent {
  padding-left: 2rem;
}

blockquote.report-text {
  margin: 0 0 var(--space-l);
  padding: var(--space-s) var(--space-m);
  border-left: 4px solid var(--border-strong);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  background: var(--surface-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.option-list {
  list-style: none;
  padding: 0;
}

.option-list li {
  margin-bottom: 0.6rem;
}

details.card > summary {
  cursor: pointer;
}

.inline-form input[type="text"] {
  max-width: 14rem;
}

/* ---- The console and admin frame (U6): the title, the sections as a tab row, dense tables, compact forms ----
   Every console and admin page carries .console-page on its main element; the dev mailbox and dev billing pages carry .utility-page.
   Tables, badges and forms there share one look; nothing here reaches a learner page. */

.console-page > h1 {
  margin: 0 0 var(--space-xs);
  font-size: var(--step-2);
}

/* The sections: tabs on a hairline, the current one underlined in the primary colour. The row scrolls on its own on a phone; its
   padding leaves room for the focus ring. The way to the other console (Admin, Operator console) is a small button at the end. */
.tab-row {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  margin: 0 0 var(--space-l);
  padding: 4px 4px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  /* The hairline is drawn inside the box, under the tabs' underline (a border would sit outside the scroll box's clip). */
  box-shadow: inset 0 -1px 0 var(--border);
}

.tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  min-height: var(--control-h-tight);
  padding: 0.3rem 0.8rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.tab:hover {
  color: var(--text);
  border-bottom-color: var(--border-strong);
}

.tab[aria-current="page"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 650;
}

.tab:focus-visible {
  outline-offset: -2px;
}

.tab-row .tab-aside {
  flex: none;
  margin: 0 0 var(--space-2xs) auto;
}

/* A section's own sections (the pipeline's): a smaller row of squared chips under the tabs. */
.subtab-row {
  display: flex;
  gap: var(--space-2xs);
  margin: calc(-1 * var(--space-s)) 0 var(--space-l);
  padding: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.subtab {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--control-h-tight);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}

.subtab:hover {
  border-color: var(--border-strong);
}

.subtab[aria-current="page"] {
  border-color: var(--primary);
  background: var(--accent-bg);
  color: var(--primary);
  font-weight: 650;
}

/* One dense table style: smaller type, tighter cells, a muted header row, numbers right-aligned in their columns. */
:is(.console-page, .utility-page) .table-wrap {
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

:is(.console-page, .utility-page) :is(th, td) {
  padding: 0.45rem 0.75rem;
  font-size: var(--step--1);
}

:is(.console-page, .utility-page) :is(thead th, table > tr:first-child > th[scope="col"], tbody > tr > th[scope="col"]) {
  color: var(--muted);
}

:is(.console-page, .utility-page) :is(th, td).num {
  text-align: right;
  white-space: nowrap;
}

/* C2: the reviewer's before and after on a revised version's page. The changed words keep their line, struck through when removed and
   underlined when added, so a change is never told by colour alone; behind them the soft tints of the error and success notices (the
   text on both is checked at 4.5:1 in scripts/contrast-check.mjs). Forced colours and print keep the lines and drop the tint. */
.diff-text :is(del, ins) {
  color: var(--text);
  padding: 0 0.1em;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.diff-text del {
  background: var(--danger-bg);
  text-decoration: line-through;
}

.diff-text ins {
  background: var(--success-bg);
  text-decoration: underline;
}

@media (forced-colors: active) {
  .diff-text :is(del, ins) {
    background: none;
  }
}

@media print {
  .diff-text :is(del, ins) {
    background: none;
  }
}

/* Inside a table: a cell's small form (reinstate, retry, dismiss) on one line when there is room. */
.console-page td .inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
}

.console-page td > * + .inline-form {
  margin-top: var(--space-2xs);
}

/* Compact forms and filters: the U5 fields at the small control height; a filter form is a card. */
.console-page .form {
  gap: var(--space-s);
}

.console-page .form > .grid {
  gap: var(--space-s);
  margin: 0;
}

.console-page .form > .button-row {
  margin: 0;
}

.console-page :is(input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], select) {
  min-height: var(--control-h-small);
  padding-block: 0.35rem;
}

/* An informational badge, beside the neutral (.badge), success (.badge-ok), warning (.badge-warn) and danger (.badge-bad) ones. */
.badge-info {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--info-bg);
}

/* The dev mailbox and the fake provider's pages: one centred card (or a centred column of cards). */
.utility-page {
  display: grid;
  justify-items: center;
  align-content: start;
}

.utility-page > * {
  width: 100%;
  max-width: 52rem;
}

.utility-page > .utility-card-narrow {
  max-width: 30rem;
}

.utility-card > h1 {
  margin-top: 0;
  font-size: var(--step-2);
}

/* Forced colours drop fills: the badge kinds differ by their border, a danger button has a heavier one, the current tab a Highlight
   underline. */
@media (forced-colors: active) {
  :is(.console-page, .utility-page) .badge {
    border: 1px solid CanvasText;
  }

  :is(.console-page, .utility-page) .badge-ok {
    border: 2px solid CanvasText;
  }

  :is(.console-page, .utility-page) .badge-info {
    border: 2px dotted CanvasText;
  }

  :is(.console-page, .utility-page) .badge-warn {
    border: 2px dashed CanvasText;
  }

  :is(.console-page, .utility-page) .badge-bad {
    border: 3px double CanvasText;
  }

  :is(.console-page, .utility-page) .button-danger {
    border-width: 3px;
  }

  .tab {
    forced-color-adjust: none;
    color: LinkText;
    border-bottom-color: Canvas;
  }

  /* .tab:hover (0,2,0) would otherwise paint the theme's colours, unforced, over the Canvas. */
  .tab:hover {
    color: LinkText;
    border-bottom-color: CanvasText;
  }

  /* With forced-color-adjust: none the ring would keep the theme's --focus colour, which can vanish on a light Canvas. */
  .tab:focus-visible {
    outline-color: Highlight;
  }

  .tab[aria-current="page"] {
    color: CanvasText;
    border-bottom: 3px solid Highlight;
  }

  .subtab[aria-current="page"] {
    outline: 2px solid Highlight;
    outline-offset: 1px;
  }
}

/* ---- Pulse inside (U11): pricing and the exam page loud, the dashboard and the result quiet ----
   Pricing and the exam page (`main.pulse-page`) are not containers: a short band as wide as the page carries the home hero's backdrop
   (`.hero-backdrop`, two aurora shapes here), its eyebrow with the live dot and an `h1` with a gradient on its key words; the rest sits
   in a `.container`, the first cards or tiles overlapping the band's foot from 60rem. The dashboard and the result keep their layout: the
   bars and the ring take the primary-to-glow gradient, the cards a spotlight. pulse.js plays the motion (below, and in Motion); without
   it every page is complete and still. Text over the band's backdrop keeps 4.5:1 (3:1 for the heading) wherever the shapes drift, in
   both themes from 320 px up (measured over the rendered page). */

.pulse-page {
  padding-top: 0;
}

.pulse-band {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding: clamp(2.25rem, 1.4rem + 3.5vw, 3.75rem) 0 clamp(4rem, 3rem + 4vw, 5.5rem);
}

/* Two shapes and the dot grid to the right of the text on wide screens, clear of it wherever the shapes drift (the third shape, which
   sits at the left of the home hero, would lie behind the heading). In one column the text spans the band: the shapes are small, faint
   and in its top-right corner, the dots only there. Measured over the rendered band (pulse-inside.spec.ts), the heading's gradient words
   keep 3:1 and the lead 4.5:1 in both themes from 360 px up. */
.pulse-band .hero-aurora {
  inset: -30% -10% 0;
  opacity: calc(var(--aurora-opacity) * 0.45);
  /* The shapes fade out before the band's foot (U12 review), whatever the band's height and wherever they drift: a short band (the
     question of the day's has no lead) would otherwise cut them in a straight edge there. Only the shapes: the trace along the foot and
     the dots keep their own drawing. */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 7rem), transparent calc(100% - 1rem));
  mask-image: linear-gradient(to bottom, #000 calc(100% - 7rem), transparent calc(100% - 1rem));
}

.pulse-band .hero-aurora > :nth-child(1) {
  width: 62vw;
  height: 62vw;
  left: auto;
  right: -34%;
  top: -40%;
}

.pulse-band .hero-aurora > :nth-child(2) {
  width: 44vw;
  height: 44vw;
  left: auto;
  right: -14%;
  top: 40%;
}

.pulse-band .hero-dots {
  opacity: 0.2;
  -webkit-mask-image: radial-gradient(30% 45% at 100% 0%, #000, transparent 75%);
  mask-image: radial-gradient(30% 45% at 100% 0%, #000, transparent 75%);
}

@media (min-width: 60rem) {
  .pulse-band .hero-aurora {
    opacity: calc(var(--aurora-opacity) * 0.85);
  }

  .pulse-band .hero-aurora > :nth-child(1) {
    width: 30vw;
    height: 30vw;
    right: 14%;
    top: -30%;
  }

  .pulse-band .hero-aurora > :nth-child(2) {
    width: 22vw;
    height: 22vw;
    right: 4%;
    top: 30%;
  }

  .pulse-band .hero-dots {
    opacity: 0.3;
    -webkit-mask-image: radial-gradient(30% 75% at 88% 35%, #000, transparent 75%);
    mask-image: radial-gradient(30% 75% at 88% 35%, #000, transparent 75%);
  }
}

.pulse-band .hero-ecg {
  bottom: 0.375rem;
  height: clamp(3.5rem, 3rem + 2vw, 4.5rem);
}

.pulse-band .hero-eyebrow {
  margin-bottom: 0;
}

/* The heading: the band's size (smaller than the home hero's), the gradient on its key words (primary, --grad-2, --grad-3: every stop
   at least 3:1 on --bg for large text), which sweeps slowly while the band runs. */
.pulse-band h1 {
  max-width: 18ch;
  margin: var(--space-s) 0 var(--space-s);
  font-size: clamp(2rem, 1.35rem + 2.7vw, 3.3rem);
  font-weight: 680;
  line-height: 1.06;
  letter-spacing: -0.033em;
}

.pulse-grad {
  background-image: linear-gradient(100deg, var(--primary) 20%, var(--grad-2) 42%, var(--grad-3) 55%, var(--primary) 80%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.pulse-band .lead {
  max-width: 36rem;
  margin-bottom: 0;
}

.pulse-band .notice {
  max-width: 44rem;
  margin: var(--space-m) 0 0;
}

.pulse-band .button-row {
  margin: var(--space-m) 0 0;
}

/* The first cards or tiles under the band: above it (positioned, after it), and over its foot from 60rem. */
.pulse-overlap {
  position: relative;
  z-index: 1;
}

@media (min-width: 60rem) {
  .pulse-page .pulse-overlap {
    margin-top: -2.25rem;
  }
}

/* Cards with a spotlight (pulse.js moves --spot-x and --spot-y with the pointer; at rest it sits above the card's top edge), fainter on
   the quiet pages. */
[data-spot] {
  background:
    radial-gradient(26rem circle at var(--spot-x, 50%) var(--spot-y, -60%), color-mix(in srgb, var(--glow) 14%, transparent), transparent 62%),
    var(--surface);
}

:is(.dash, .result-page) [data-spot] {
  background:
    radial-gradient(26rem circle at var(--spot-x, 50%) var(--spot-y, -60%), color-mix(in srgb, var(--glow) 10%, transparent), transparent 62%),
    var(--surface);
}

/* Bars on these pages fill with the primary-to-glow gradient; a weak patient group's (the dashboard's Weak, the result's lowest) in the
   warning colour. Each engine's pseudo-element in a rule of its own: a selector one engine does not know drops the whole rule. */
:is(.pulse-page, .dash, .result-page) .bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--primary), var(--glow));
}

:is(.pulse-page, .dash, .result-page) .bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--glow));
}

:is(.pulse-page, .dash, .result-page) .bar.bar-weak::-webkit-progress-value {
  background: var(--warning-border);
}

:is(.pulse-page, .dash, .result-page) .bar.bar-weak::-moz-progress-bar {
  background: var(--warning-border);
}

/* Pricing: the featured plan (monthly) carries a moving gradient edge (a ring over its border, ::before), the glow shadow and a tag;
   the single mock an ECG trace along its foot; "Monthly or a pass?" three cards with an icon each. */
.pulse-page .plans .card-featured {
  position: relative;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.pulse-page .plans .card-featured::before {
  content: "";
  position: absolute;
  inset: -2px;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--glow-2), var(--glow), var(--primary));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.plan-tag {
  position: absolute;
  top: -0.8rem;
  left: var(--space-m);
  margin: 0;
  padding: 0.1rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
}

/* The trace runs in the card's foot, under its content. */
.single-mock {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-bottom: calc(var(--space-m) + 2.25rem);
}

.single-mock-trace {
  position: absolute;
  z-index: -1;
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  height: 2.5rem;
  color: var(--glow);
  pointer-events: none;
}

.single-mock-trace path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  vector-effect: non-scaling-stroke;
  opacity: 0.4;
}

.choose {
  margin-top: var(--space-xl);
}

.choose h2 {
  margin-top: 0;
}

.choose-cards {
  display: grid;
  gap: var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

li.choose-card {
  margin: 0;
}

.choose-card p {
  margin: 0;
}

.choose-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--space-s);
  border-radius: var(--radius);
  background: var(--accent-bg);
  color: var(--primary);
}

.choose-icon .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.choose-note {
  max-width: var(--measure);
  margin: var(--space-m) 0 0;
}

@media (min-width: 48rem) {
  .choose-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The exam page: the format's figures as tiles (two by two, four in a row from 60rem), the figure above its label; a weight bar per
   patient group (the heaviest fills its track); our mock beside the real exam from 60rem, ours with a primary-tinted border. */
.exam-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-s);
  margin: var(--space-m) 0 var(--space-m);
}

.exam-fact {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  margin: 0;
}

.exam-fact dt {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: 500;
  line-height: 1.35;
}

.exam-fact dd {
  max-width: none;
  margin: 0;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.exam-fact dd small {
  margin-left: 0.2em;
  color: var(--muted);
  font-size: 0.5em;
  font-weight: 600;
  letter-spacing: 0;
}

.exam-covers td[data-label="Weight"] {
  min-width: 7rem;
}

.weight-bar {
  min-width: 0;
  max-width: 9rem;
  height: 0.5rem;
  margin-top: 0.4rem;
}

.exam-compare {
  display: grid;
  gap: var(--space-m);
  margin-bottom: var(--space-m);
}

.exam-compare > .card {
  margin: 0;
}

.exam-ours {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
}

@media (min-width: 60rem) {
  .exam-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-m);
  }

  .exam-compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* The dashboard's trend: its bars in the gradient (the markup's, lighter at the top). */
.trend-stop-top {
  stop-color: var(--glow);
}

.trend-stop-base {
  stop-color: var(--primary);
}

.trend-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

/* The result: the score card's glow shadow, the ring's gradient, the percentile's scale with its marker and its ends. */
.score-card {
  box-shadow: var(--shadow-glow);
}

.score-ring-stop-start {
  stop-color: var(--primary);
}

.score-ring-stop-end {
  stop-color: var(--glow);
}

.percentile-scale {
  max-width: 24rem;
  margin: var(--space-xs) 0 var(--space-m);
}

.percentile-scale-svg {
  display: block;
  width: 100%;
  height: 22px;
  overflow: visible;
}

.percentile-track {
  fill: var(--surface-strong);
  stroke: var(--border-strong);
  stroke-width: 1;
}

.percentile-marker {
  fill: var(--primary);
  stroke: var(--surface);
  stroke-width: 3;
}

.percentile-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* A figure counting up (pulse.js): its own text, unchanged, is drawn transparent and the running value is generated content over it,
   with an empty alternative text so that it is never read (only the text is). The running value is a box of no width in the figure's own
   line, right after its text, from which it overflows back over the text: it shares the text's baseline (so it lands on the same pixel
   row) and its end is the number's end, which stays put; nothing around it moves. On screen only. */
@media screen {
  [data-count].is-counting {
    white-space: nowrap;
    -webkit-text-fill-color: transparent;
  }

  [data-count].is-counting::after {
    content: attr(data-count-shown) / "";
    display: inline-flex;
    justify-content: flex-end;
    width: 0;
    white-space: nowrap;
    -webkit-text-fill-color: currentcolor;
    pointer-events: none;
  }
}

/* Waiting below the fold for their turn (pulse.js), bars are drawn empty, the trend chart flat, the ring at zero and the percentile's
   marker at 0, on screen only: the markup, print and assistive technology keep the final values. */
@media screen and (prefers-reduced-motion: no-preference) {
  :is(.pulse-page, .dash, .result-page) .bar.motion-pending::-webkit-progress-value {
    background: none;
  }

  :is(.pulse-page, .dash, .result-page) .bar.motion-pending::-moz-progress-bar {
    background: none;
  }

  .trend-chart.motion-pending .trend-bar {
    transform: scaleY(0);
  }

  .trend-chart.motion-pending .trend-pct {
    opacity: 0;
  }

  .score-ring.motion-pending .score-ring-arc {
    stroke-dasharray: 0 100;
  }

  .percentile-scale.motion-pending .percentile-marker {
    cx: 0;
  }
}

/* The order of the overlapping cards and tiles, the plans' checklist ticks and the exam's tiles, for their staggered entrances. */
.pulse-overlap > :nth-child(2) { --rise: 1; --reveal-order: 1; }
.pulse-overlap > :nth-child(3) { --rise: 2; --reveal-order: 2; }
.pulse-overlap > :nth-child(4) { --rise: 3; --reveal-order: 3; }
.plans .checklist > li:nth-child(2) { --tick: 1; }
.plans .checklist > li:nth-child(3) { --tick: 2; }
.plans .checklist > li:nth-child(4) { --tick: 3; }
.plans .checklist > li:nth-child(5) { --tick: 4; }
.plans .checklist > li:nth-child(6) { --tick: 5; }
.plans .checklist > li:nth-child(7) { --tick: 6; }
.plans .checklist > li:nth-child(8) { --tick: 7; }
.choose-cards > :nth-child(2) { --reveal-order: 1; }
.choose-cards > :nth-child(3) { --reveal-order: 2; }

@media print {
  /* The heading's gradient words would print invisible where backgrounds are not printed: plain text in the heading's colour, as on the
     home page. */
  .pulse-band .pulse-grad {
    background: none;
    color: inherit;
  }

  /* The backdrop's trace would print as a line across the head; the featured plan's edge is a background: a plain border instead, and
     the tag in the primary colour on the paper. */
  .pulse-band .hero-backdrop,
  .single-mock-trace,
  .pulse-page .plans .card-featured::before {
    display: none;
  }

  .pulse-page .plans .card-featured {
    border-color: var(--primary);
  }

  .plan-tag {
    border-color: currentColor;
    background: none;
    color: var(--primary);
  }
}

@media (forced-colors: active) {
  /* The band's backdrop goes with the home hero's (Forced colours); the single mock's trace would only lie over text, and the running
     figure is the text itself. The featured plan keeps its thicker Highlight border (Pricing). The trend's bars and the percentile's
     scale in system colours; the score ring's arc in Highlight over its GrayText track (Review's forced-colours rules set the rest). */
  .single-mock-trace {
    display: none;
  }

  .pulse-page .plans .card-featured {
    border-color: Highlight;
  }

  [data-count].is-counting {
    -webkit-text-fill-color: currentcolor;
  }

  [data-count].is-counting::after {
    content: none;
  }

  .trend-chart,
  .percentile-scale-svg {
    forced-color-adjust: none;
  }

  .score-ring-arc {
    stroke: Highlight;
  }

  .trend-bar:not(.trend-bar-empty) {
    fill: Highlight;
  }

  .trend-bar-empty {
    fill: GrayText;
  }

  .trend-chart .trend-pct,
  .trend-chart .trend-week-label {
    fill: CanvasText;
  }

  .trend-grid {
    stroke: GrayText;
  }

  .percentile-track {
    fill: Canvas;
    stroke: CanvasText;
  }

  .percentile-marker {
    fill: Highlight;
    stroke: Canvas;
  }
}

/* ---- The Pulse loose ends (U12): the band on /exams, the mock day and the question of the day; print ----
   The three pages carry U11's band (`main.pulse-page`, PulseBand, pulse.js): the band as wide as the page, then the page's blocks as
   before in a `.container.pulse-body`, each page keeping its own column (above) at the band's left edge; nothing overlaps the band's foot
   here. The first blocks rise in after the band's text, those below the fold when pulse.js reveals them (Motion). Their forced colours
   and print are the band's (U11). */
.pulse-body {
  padding-top: var(--space-s);
}

.pulse-band .mock-day-last {
  margin: var(--space-s) 0 0;
}

@media print {
  /* A primary button's teal is a background, which browsers leave out when they print: an outline in the primary colour and the label
     in the text colour instead, the same whether backgrounds are printed or not; disabled ones too. Site-wide except the exam player
     (chrome-focus), which U12 leaves as it is; the selector outweighs the Pulse button's (U10) sheen and shadow. */
  body:not(.chrome-focus) .button:not(.button-secondary, .button-danger, [aria-pressed="true"]) {
    border-color: var(--primary);
    background: none;
    color: var(--text);
    box-shadow: none;
  }

  /* The home page's hero starts on the first page: as a grid row its text and preview were carried to the second page together, so in
     print they are a column (the text first, then the preview card in one piece, room above and below it for the chips that hang over
     its corners, so they go with it); the backdrop is left out, as the band's is. */
  .hero-split {
    display: flex;
    flex-direction: column;
  }

  .hero-preview {
    padding-block: 2.5rem 2.25rem;
    break-inside: avoid;
  }

  .home-hero .hero-backdrop {
    display: none;
  }

  /* The eyebrow's ping ring is a border, so it would print around a dot that does not (a background), caught at whatever size it had. */
  .hero-eyebrow::after {
    display: none;
  }
}

/* ---------- Larger screens ---------- */

@media (min-width: 40rem) {
  .grid-2,
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (min-width: 50rem) {
  .stat-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .result-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Wide screens (the header's own rules are in the header section). */
@media (min-width: 60rem) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .dash-grid-split {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }

  /* The featured plan stands a little above the other two. */
  .plans .card-featured {
    transform: translateY(calc(-1 * var(--space-xs)));
  }
}

/* ---------- Motion ---------- */

/* Theme switch (theme.js): the new theme spreads over the page as a circle growing from the theme button, so components hold their own
   colour transitions meanwhile (all but the button's icon, which turns and swaps). */
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: none !important;
}

/* Moving between pages: a cross-document view transition cross-fades the page body. The header and the tab bar have names of their own,
   so they stay in place instead of fading out and in with the page. Only with scripting: a skipped transition rejects a promise, and
   only the page's script reads it (client/view-transitions.ts); without one the browser reports every skip as an uncaught error (Chromium
   skips the arriving page's transition whenever it drops the old picture before the new page has rendered, a test's key press included). */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  @view-transition {
    navigation: auto;
  }

  /* Only where the header is sticky (48rem and up): on phones it scrolls away, and a named header would slide in from above. */
  @media (min-width: 48rem) {
    .site-header {
      view-transition-name: site-header;
    }
  }

  .app-nav {
    view-transition-name: main-nav;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 160ms;
    animation-timing-function: var(--ease);
  }

  /* Switching theme: no cross-fade of the root (theme.js clips the new snapshot with the growing circle instead, over the old one left
     as it is), and no names on the header and the tab bar, so the circle reveals them with the rest of the page. */
  :root.theme-switching::view-transition-old(root),
  :root.theme-switching::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
  }

  :root.theme-switching .site-header,
  :root.theme-switching .app-nav {
    view-transition-name: none;
  }

  .theme-switching .theme-toggle .icon {
    transition: transform var(--dur-slow) var(--ease), opacity var(--dur-slow) var(--ease) !important;
  }

  .theme-toggle .icon {
    transition: transform var(--dur-slow) var(--ease), opacity var(--dur-slow) var(--ease);
  }
}

/* Player (exam-player.js puts .is-entering on the element for one play): a new question slides in, the chosen radio (and its letter disc) pops, a new
   "Saving..." / "Saved" fades in, the explanation drops in when the answer is checked, and a navigator cell pulses when its
   question becomes answered. Opacity and transform only, so nothing around them moves. */
@media (prefers-reduced-motion: no-preference) {
  .player-question.is-entering {
    animation: question-in 260ms var(--ease);
  }

  .option input[type="radio"].is-entering {
    animation: radio-pop var(--dur) var(--ease-overshoot);
  }

  /* The radio lies unseen over the letter disc, so the disc pops with it. */
  .option:has(input[type="radio"].is-entering) .option-letter {
    animation: radio-pop var(--dur) var(--ease-overshoot);
  }

  #player-saved.is-entering {
    animation: saved-in var(--dur) var(--ease);
  }

  .player-reveal.is-entering {
    animation: reveal-in 280ms var(--ease);
  }

  .nav-cell.is-entering {
    animation: cell-pulse 260ms var(--ease);
  }
}

@keyframes question-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}

@keyframes radio-pop {
  from {
    transform: scale(0.8);
  }
}

@keyframes saved-in {
  from {
    opacity: 0;
  }
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes cell-pulse {
  50% {
    transform: scale(1.15);
  }
}

/* Ordinary pages: the first blocks of <main> rise in on load, one after another, under the view transition's cross-fade. Fill mode
   backwards only, so a block that does not animate is never left hidden. The player, the home page and the pages with a Pulse band
   (pricing and the exam page, U11; /exams, the mock day and the question of the day, U12) have their own entrances. */
@media (prefers-reduced-motion: no-preference) {
  main.page:not(.player-page, .home-page, .pulse-page) > :nth-child(-n + 6) {
    animation: page-in var(--dur-slow) var(--ease) backwards;
  }

  main.page:not(.player-page) > :nth-child(2) { animation-delay: 40ms; }
  main.page:not(.player-page) > :nth-child(3) { animation-delay: 80ms; }
  main.page:not(.player-page) > :nth-child(4) { animation-delay: 120ms; }
  main.page:not(.player-page) > :nth-child(5) { animation-delay: 160ms; }
  main.page:not(.player-page) > :nth-child(6) { animation-delay: 200ms; }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* The home page in the Pulse look (U10). Entrances: the eyebrow fades in, the headline's words rise one after another (opacity, a short
   rise, a blur that clears), then the lead, the buttons and the facts; the preview card swings in. Every entrance has fill mode backwards
   only, so nothing is left hidden. Loops (the aurora's drift, the ECG trace's bright segment, the eyebrow's ping, the headline's sheen,
   the chips' bob and bars) play only while the hero has .is-running (home.js) and are paused at their start otherwise (the bright segment
   rests in its delay, so it is not drawn before it first runs); the ping is applied only while the hero runs, so at rest its ring is not
   drawn. Below the fold, blocks rise in when home.js reveals them; the sample result then sweeps its gauge and grows its bars. (The
   brand mark beats on every page: the header's rules, U13.) */
@media (prefers-reduced-motion: no-preference) {
  .home-hero .hero-eyebrow {
    animation: hero-fade 800ms var(--ease) backwards;
  }

  .hero-word {
    animation: hero-word-in 800ms var(--ease) backwards;
    animation-delay: calc(var(--word, 0) * 60ms + 100ms);
  }

  .hero-grad .hero-word {
    animation: hero-word-in 800ms var(--ease) backwards, hero-sheen 7s ease-in-out infinite;
    animation-delay: calc(var(--word, 0) * 60ms + 100ms), 1.6s;
  }

  .home-hero .lead {
    animation: hero-fade 900ms var(--ease) 550ms backwards;
  }

  .home-hero .button-row {
    animation: hero-fade 900ms var(--ease) 700ms backwards;
  }

  .hero-facts {
    animation: hero-fade 900ms var(--ease) 850ms backwards;
  }

  .preview-stage {
    animation: preview-card-in 1.1s var(--ease) 250ms backwards;
  }

  .hero-aurora > span {
    animation: hero-drift 18s ease-in-out infinite alternate;
  }

  .hero-aurora > :nth-child(2) {
    animation-duration: 23s;
    animation-direction: alternate-reverse;
  }

  .hero-aurora > :nth-child(3) {
    animation-duration: 27s;
  }

  .hero-ecg-base {
    animation: hero-ecg-draw 2.8s ease-out 500ms backwards;
  }

  .hero-ecg-run {
    animation: hero-ecg-run 5.5s linear 2.4s infinite;
  }

  /* The ring pings only while the hero (or a Pulse band, U11) runs: paused, it would rest on its first keyframe and be drawn around the
     dot. */
  :is(.home-hero, .pulse-band).is-running .hero-eyebrow::after {
    animation: hero-ping 1.8s ease-out infinite;
  }

  .preview-chip {
    animation: preview-bob 5s ease-in-out infinite;
  }

  .preview-chip-topics {
    animation-duration: 6.5s;
    animation-delay: -2s;
  }

  .preview-chip-bars > i {
    animation: preview-eq 1.6s ease-in-out infinite alternate;
  }

  .preview-chip-bars > :nth-child(2) { animation-delay: -0.5s; }
  .preview-chip-bars > :nth-child(3) { animation-delay: -1s; }

  :is(.home-hero, .pulse-band):not(.is-running) :is(.hero-aurora > span, .hero-ecg-run, .preview-chip, .preview-chip-bars > i) {
    animation-play-state: paused;
  }

  .home-hero:not(.is-running) .hero-grad .hero-word {
    animation-play-state: running, paused;
  }

  /* The preview playing the exam (home.js): the picked answer's letter disc pops, the question slides out and the next one in. */
  .preview-options .option.is-picked .option-letter {
    animation: preview-pop 400ms var(--ease-overshoot);
  }

  .preview-question.is-entering {
    animation: preview-in 500ms var(--ease);
  }

  .preview-question.is-leaving {
    animation: preview-out 300ms ease-in forwards;
  }

  [data-reveal].is-revealed {
    animation: home-reveal-in 800ms var(--ease) backwards;
    animation-delay: calc(var(--reveal-order, 0) * 100ms);
  }

  .sample-result.is-revealed .sample-gauge-value {
    animation: sample-sweep 1.7s var(--ease) 250ms backwards;
  }

  .sample-result.is-revealed .sample-bar-fill {
    transform-box: fill-box;
    transform-origin: left center;
    animation: sample-grow 1.2s var(--ease) backwards;
    animation-delay: calc(var(--row, 0) * 90ms + 350ms);
  }
}

/* The order of the headline's words (in their wrapper, then in the gradient's span) and of the sample's patient groups, for their
   staggered entrances. */
.hero-words > .hero-word:nth-child(2) { --word: 1; }
.hero-words > .hero-word:nth-child(3) { --word: 2; }
.hero-words > .hero-word:nth-child(4) { --word: 3; }
.hero-words > .hero-word:nth-child(5) { --word: 4; }
.hero-grad > .hero-word:nth-child(1) { --word: 5; }
.hero-grad > .hero-word:nth-child(2) { --word: 6; }
.sample-group:nth-child(2) { --row: 1; }
.sample-group:nth-child(3) { --row: 2; }
.sample-group:nth-child(4) { --row: 3; }
.sample-group:nth-child(5) { --row: 4; }
.sample-group:nth-child(6) { --row: 5; }

/* On hover-capable screens from 60rem the preview card rests at a slight tilt, its chips float above it, and it leans towards the pointer
   (home.js sets --tilt-x and --tilt-y, and the glare's --glare-x and --glare-y); on phones it is flat. */
@media (hover: hover) and (min-width: 60rem) and (prefers-reduced-motion: no-preference) {
  .preview-stage {
    transform: rotateX(var(--tilt-x, 3deg)) rotateY(var(--tilt-y, -7deg));
    transform-style: preserve-3d;
    transition: transform 350ms var(--ease);
  }

  .preview-chip {
    transform: translateZ(60px);
  }
}

/* The feature cards lift under the pointer with a primary-tinted shadow, and their icons move: the clock's hands turn once, the bulb's
   rays appear, the chart's bars grow. The icons are the shared Tabler shapes, so their parts are picked by order: the clock's hands are
   its second path, the bulb's rays its first, the chart's bars its first three (left, right, middle). */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .features > .feature {
    transition:
      transform 300ms var(--ease),
      border-color 300ms var(--ease),
      box-shadow 300ms var(--ease);
  }

  .features > .feature:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
    box-shadow: var(--shadow-glow);
  }

  /* Origins in the icons' own units (a 24-unit view box): the clock's centre, the bulb's middle, the chart's baseline. */
  .feature-icon .icon > path {
    transform-box: view-box;
  }

  .feature-icon-clock .icon > path:nth-child(2) {
    transform-origin: 12px 12px;
    transition: transform 1s var(--ease);
  }

  .feature:hover .feature-icon-clock .icon > path:nth-child(2) {
    transform: rotate(360deg);
  }

  .feature-icon-bulb .icon > path:nth-child(1) {
    opacity: 0;
    transform: scale(0.6);
    transform-origin: 12px 10px;
    transition: transform 500ms var(--ease), opacity 300ms var(--ease);
  }

  .feature:hover .feature-icon-bulb .icon > path:nth-child(1) {
    opacity: 1;
    transform: none;
  }

  .feature-icon-chart .icon > path:nth-child(-n + 3) {
    transform-origin: 12px 20px;
    transition: transform 500ms var(--ease);
  }

  .feature-icon-chart .icon > path:nth-child(3) { transition-delay: 80ms; }
  .feature-icon-chart .icon > path:nth-child(2) { transition-delay: 160ms; }

  .feature:hover .feature-icon-chart .icon > path:nth-child(-n + 3) {
    transform: scaleY(1.18);
  }

  .home-link .icon {
    transition: transform 250ms var(--ease);
  }

  .home-link:hover .icon {
    transform: translateX(4px);
  }
}

@keyframes hero-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes hero-word-in {
  from {
    opacity: 0;
    transform: translateY(0.45em);
    filter: blur(8px);
  }
}

@keyframes hero-sheen {
  0%,
  100% {
    background-position: 100% 0;
  }

  50% {
    background-position: 0 0;
  }
}

@keyframes hero-drift {
  to {
    transform: translate(-6vw, 5vw) scale(1.15);
  }
}

@keyframes hero-ecg-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes hero-ecg-run {
  from {
    stroke-dashoffset: 1;
    opacity: 1;
  }

  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes hero-ping {
  from {
    transform: scale(0.6);
    opacity: 0.9;
  }

  to {
    transform: scale(1.9);
    opacity: 0;
  }
}

@keyframes preview-card-in {
  from {
    opacity: 0;
    transform: translateY(46px) rotateX(16deg) rotateY(-20deg) scale(0.93);
  }
}

@keyframes preview-bob {
  50% {
    translate: 0 -8px;
  }
}

@keyframes preview-eq {
  to {
    transform: scaleY(0.55);
  }
}

@keyframes preview-pop {
  from {
    transform: scale(0.55);
  }
}

@keyframes preview-in {
  from {
    opacity: 0;
    transform: translateX(26px);
  }
}

@keyframes preview-out {
  to {
    opacity: 0;
    transform: translateX(-26px);
  }
}

@keyframes home-reveal-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes sample-sweep {
  from {
    stroke-dasharray: 0 100;
  }
}

@keyframes sample-grow {
  from {
    transform: scaleX(0);
  }
}

/* Pulse inside (U11). The band's entrances (the eyebrow fades in, the heading, the lead and what follows rise one after another), then
   the overlapping cards or tiles, and on pricing the checklist ticks pop in one after another; fill mode backwards only, so nothing is left
   hidden. The band's loops (the aurora's drift and the trace's bright segment are the home hero's rules; the ping above; the heading's
   sheen) and the featured plan's moving edge play only while pulse.js marks them running and rest at their start otherwise. Blocks below
   the fold rise in when pulse.js reveals them (the home page's rule); a plan's ticks and the single mock's trace play then. On the
   dashboard and the result: the trend chart's bars rise from the baseline one after another and their figures follow, the ring sweeps
   from zero, the percentile's marker slides from 0; cards lift on hover as they hold an action. */
@media (prefers-reduced-motion: no-preference) {
  .pulse-band .hero-eyebrow {
    animation: hero-fade 700ms var(--ease) backwards;
  }

  .pulse-band h1 {
    animation: pulse-rise 750ms var(--ease) 70ms backwards;
  }

  .pulse-band-inner > :nth-child(n + 3) {
    animation: pulse-rise 750ms var(--ease) 140ms backwards;
  }

  .pulse-band-inner > :nth-child(4) { animation-delay: 210ms; }
  .pulse-band-inner > :nth-child(5) { animation-delay: 280ms; }
  .pulse-band-inner > :nth-child(6) { animation-delay: 350ms; }

  .pulse-grad {
    animation: hero-sheen 7s ease-in-out 1.6s infinite;
  }

  .pulse-band:not(.is-running) .pulse-grad {
    animation-play-state: paused;
  }

  .pulse-overlap > :not(.reveal-pending, .is-revealed) {
    animation: pulse-rise 750ms var(--ease) backwards;
    animation-delay: calc(var(--rise, 0) * 70ms + 280ms);
  }

  .pulse-page .plans .card-featured::before {
    animation: pulse-edge 9s linear infinite;
  }

  .plans:not(.is-running) .card-featured::before {
    animation-play-state: paused;
  }

  /* "Coming soon": one heartbeat every 2.8 s, only while the plans run (without it nothing is animated, so nothing rests half-drawn).
     The beat crosses the left trace, the dot pings as it arrives, and it leaves through the right trace. The passes' strip beats half
     a cycle after the monthly plan's. */
  .plans.is-running .plan-soon-run {
    animation: soon-beat 2.8s linear infinite;
  }

  .plans.is-running .plan-soon-pill ~ .plan-soon-beat .plan-soon-run {
    animation-delay: 0.9s;
  }

  .plans.is-running .plan-soon-pill::after {
    animation: soon-ping 2.8s ease-out 0.7s infinite;
  }

  .plans.is-running .plan:last-child .plan-soon-run {
    animation-delay: 1.4s;
  }

  .plans.is-running .plan:last-child .plan-soon-pill ~ .plan-soon-beat .plan-soon-run {
    animation-delay: 2.3s;
  }

  .plans.is-running .plan:last-child .plan-soon-pill::after {
    animation-delay: 2.1s;
  }

  .plans > .plan:not(.reveal-pending) .checklist .icon {
    animation: pulse-tick 450ms var(--ease-overshoot) backwards;
    animation-delay: calc(var(--tick, 0) * 60ms + 600ms);
  }

  .single-mock:not(.reveal-pending) .single-mock-trace path {
    animation: hero-ecg-draw 2.4s ease-out 300ms backwards;
  }

  .trend-chart.is-growing .trend-bar {
    animation: trend-grow 1s var(--ease) backwards;
    animation-delay: calc(var(--week, 0) * 70ms + 200ms);
  }

  .trend-chart.is-growing .trend-pct {
    animation: trend-label-in 400ms var(--ease) backwards;
    animation-delay: calc(var(--week, 0) * 70ms + 750ms);
  }

  .score-ring.is-sweeping .score-ring-arc {
    animation: ring-sweep 1.6s var(--ease) 200ms backwards;
  }

  .percentile-scale.is-sliding .percentile-marker {
    animation: marker-slide 1.3s var(--ease) 300ms backwards;
  }
}

/* The pages with a band and no overlapping cards (U12: /exams, the mock day, the question of the day): the first two blocks under the band
   rise in after its text, one after the other, unless pulse.js holds them for the reveal on scroll. Fill mode backwards only. */
@media (prefers-reduced-motion: no-preference) {
  .pulse-body > :nth-child(-n + 2):not(.reveal-pending, .is-revealed) {
    animation: pulse-rise 750ms var(--ease) 280ms backwards;
  }

  .pulse-body > :nth-child(2):not(.reveal-pending, .is-revealed) {
    animation-delay: 350ms;
  }
}

/* Pricing's and the exam page's cards lift with the pointer's spotlight, as the home page's feature cards do (the featured plan from the
   height it stands at, its edge kept); on the dashboard and the result only the cards that hold the page's main action lift (resume,
   the score), a little, as actionable cards do elsewhere. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pulse-page [data-spot],
  :is(.resume-card, .score-card) {
    transition:
      transform 300ms var(--ease),
      border-color 300ms var(--ease),
      box-shadow 300ms var(--ease);
  }

  .pulse-page [data-spot]:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
    box-shadow: var(--shadow-glow);
  }

  .pulse-page .plans .card-featured:hover {
    border-color: transparent;
  }

  .resume-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
  }

  .score-card:hover {
    transform: translateY(-2px);
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) and (min-width: 60rem) {
  .pulse-page .plans .card-featured:hover {
    transform: translateY(calc(-1 * var(--space-xs) - 5px));
  }
}

@keyframes pulse-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

@keyframes pulse-edge {
  to {
    background-position: 300% 300%;
  }
}

@keyframes pulse-tick {
  from {
    transform: scale(0);
  }
}

/* The bright segment crosses its trace in the first third of the cycle, then waits past the trace's end. */
@keyframes soon-beat {
  from {
    stroke-dashoffset: 0.45;
  }

  30%,
  to {
    stroke-dashoffset: -1.1;
  }
}

@keyframes soon-ping {
  from {
    transform: scale(0.6);
    opacity: 0.9;
  }

  45%,
  to {
    transform: scale(1.9);
    opacity: 0;
  }
}

@keyframes trend-grow {
  from {
    transform: scaleY(0);
  }
}

@keyframes trend-label-in {
  from {
    opacity: 0;
  }
}

@keyframes ring-sweep {
  from {
    stroke-dasharray: 0 100;
  }
}

@keyframes marker-slide {
  from {
    cx: 0;
  }
}

/* Dialogs fade and scale in over a fading backdrop (@starting-style gives the state they open from; without it they open at once).
   They close at once: a fading exit needs display and overlay to transition, which not every browser does the same way. */
@media (prefers-reduced-motion: no-preference) {
  .player-dialog[open],
  .player-dialog[open]::backdrop {
    transition:
      opacity var(--dur) var(--ease),
      transform var(--dur) var(--ease);
  }

  @starting-style {
    .player-dialog[open],
    .player-dialog[open]::backdrop {
      opacity: 0;
    }

    .player-dialog[open] {
      transform: scale(0.97);
    }
  }
}

/* Cards that lead to one thing (an exam's page, starting a mock) lift under the pointer; information cards stay put. Transform and
   shadow only, so nothing around them moves. (Pricing's and the exam page's cards lift as the home page's feature cards do, and the
   dashboard's resume card and the result's score card, which hold the page's main action, lift a little: Pulse inside, U11.) */
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  :is(.exam-card, .mock-card) {
    transition:
      transform var(--dur) var(--ease),
      box-shadow var(--dur) var(--ease);
  }

  :is(.exam-card, .mock-card):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
  }
}

/* A <details> opens and closes smoothly where its content box can be styled (::details-content); elsewhere it opens at once. */
@media (prefers-reduced-motion: no-preference) {
  @supports selector(::details-content) {
    /* The content box clips while it opens, so a long unbroken word wraps instead of being cut off. */
    details {
      interpolate-size: allow-keywords;
      overflow-wrap: anywhere;
    }

    details::details-content {
      block-size: 0;
      opacity: 0;
      /* Clipped while the height moves, with room left for a focus ring (2px outline, 2px offset) at the edges. */
      overflow: clip;
      overflow-clip-margin: 4px;
      transition:
        block-size var(--dur) var(--ease),
        opacity var(--dur) var(--ease),
        content-visibility var(--dur) allow-discrete;
    }

    details[open]::details-content {
      block-size: auto;
      opacity: 1;
    }

    /* A header menu's panel floats over the page: its box takes no height to animate, and the panel itself fades in (below). */
    details.menu::details-content {
      block-size: auto;
      opacity: 1;
      overflow: visible;
      transition: none;
    }
  }
}

/* A header menu (account, a visitor's links) opens with a short fade and drop, opacity and transform only; it closes at once. */
@media (prefers-reduced-motion: no-preference) {
  .menu[open] > .menu-panel {
    animation: menu-in var(--dur-fast) var(--ease);
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Watermark (U9b) ----------
   The exam player, the result and the review carry the viewer's account code, the local date and the attempt's short id
   (`K7Q2-M9XD · 14 Oct 2026 · a3f9`) in a faint rotated grid. It lies over the page (the option cards are opaque and would hide it
   underneath) but takes no click and no selection, and it is the text colour at 7%: present on a screenshot or a photo, too faint to
   compete with the question. Above the page, the site header and exam bar (10), the player's action bar and sheets (15, 20) and the
   phone tab bar (20); below the menus (30), the guided tour (1000) and the modal dialogs (top layer). Printing keeps it: nothing hides
   it in print. */
.watermark {
  position: fixed;
  inset: 0;
  z-index: 25;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  color: color-mix(in srgb, var(--text) 7%, transparent);
}

.watermark-grid {
  position: absolute;
  inset: -50%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  transform: rotate(-24deg);
}

.watermark-line {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

/* The text comes from the line's data-mark (watermark.tsx says why). */
.watermark-line::before {
  content: attr(data-mark);
}

.watermark-line:nth-child(even) {
  transform: translateX(7rem);
}

/* Forced colours would paint the lines in full CanvasText, louder than the page. They keep the system text colour, at 10%: still
   there, never in the way of reading. */
@media (forced-colors: active) {
  .watermark {
    forced-color-adjust: none;
    color: CanvasText;
    opacity: 0.1;
  }
}

/* ---------- Forced colours (Windows contrast themes) ----------
   The browser repaints everything in a few system colours and drops box-shadows, so a state drawn only by a fill or a ring disappears.
   The player's states get a system-colour mark of their own: the selected option an outline and a Highlight disc; the masked icons
   (Strike, Restore, Flag), which a mask of currentColor would leave in Canvas, the button text colour; an answered cell a filled cell,
   the current one an outline, the flag dot a solid dot; an open sheet's button Highlight; a clock in its last minutes an outline; the
   brand mark LinkText. Struck options keep their line-through and the Yours / Correct tags their words, so those need nothing. */
@media (forced-colors: active) {
  .option.is-selected {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }

  .option.is-selected .option-letter {
    forced-color-adjust: none;
    background: Highlight;
    border-color: Highlight;
    color: HighlightText;
  }

  .option-strike::before,
  .player-flag::before {
    forced-color-adjust: none;
    background: ButtonText;
  }

  .nav-cell.is-answered,
  .legend-answered::before {
    forced-color-adjust: none;
    background: CanvasText;
    border-color: CanvasText;
    color: Canvas;
  }

  .nav-cell.is-current {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }

  .legend-current::before {
    outline: 2px solid Highlight;
    outline-offset: 1px;
  }

  .nav-cell.is-flagged::after,
  .legend-flagged::before {
    forced-color-adjust: none;
    background: CanvasText;
    box-shadow: 0 0 0 1.5px Canvas;
  }

  .nav-cell.is-answered.is-flagged::after {
    background: Canvas;
    box-shadow: 0 0 0 1.5px CanvasText;
  }

  .icon-button[aria-expanded="true"] {
    forced-color-adjust: none;
    background: Highlight;
    border-color: Highlight;
    color: HighlightText;
  }

  .player-clock.is-warning {
    outline: 2px solid CanvasText;
  }

  /* The brand mark is a filled square: in link colour, as it is the way back to the dashboard; its pulse line cut out in the page colour,
     as the header's (U12). */
  .exam-brand-mark {
    forced-color-adjust: none;
    background: LinkText;
  }

  .exam-brand-mark::after {
    forced-color-adjust: none;
    background: Canvas;
  }

  /* The header's brand mark (U10) likewise, its pulse line cut out in the page colour. It beats (U13) without its ring: the mode drops
     box-shadows, but not here (forced-color-adjust: none), where the ring would be drawn in the theme's teal; important, as an animated
     value outweighs a normal declaration. */
  .brand::before {
    forced-color-adjust: none;
    background: LinkText;
    box-shadow: none !important;
  }

  .brand::after {
    forced-color-adjust: none;
    background: Canvas;
  }

  /* The home page (U10): the hero's backdrop and the preview's glare would only lie over text, so they are off; the headline's gradient
     words are plain text in the system colour. */
  .hero-backdrop,
  .preview-card::after {
    display: none;
  }

  .hero-grad .hero-word,
  .pulse-grad {
    background: none;
    color: CanvasText;
  }
}

/* ---------- Guided tour ----------
   tour.js (U7): a dimmed layer with a hole where the step's element is (a clip-path the script sets) covers the page, which is inert
   meanwhile, so no click reaches it; a ring goes round the element and the popover sits beside it. Positions come from the script (CSSOM). The tour fades in (opacity) and the
   popover rises a little (transform), on the motion tokens, and not at all under reduced motion. In forced colours shadows are gone,
   so the ring is an outline and the popover a bordered box. */
.tour {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.tour-blocker {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
}

.tour.is-untargeted .tour-spot {
  display: none;
}

.tour-spot {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: var(--radius);
  box-shadow: 0 0 0 3px var(--primary);
  outline: 3px solid transparent;
  pointer-events: none;
}

.tour-popover {
  position: fixed;
  top: 0;
  left: 0;
  width: min(22rem, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 1rem 1.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-2);
}

/* The dialog itself takes the focus when it opens (so it is announced); its buttons carry the visible focus. */
.tour-popover:focus {
  outline: none;
}

.tour-count {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.tour-title {
  margin: 0 0 0.375rem;
  font-size: 1.0625rem;
}

.tour-text {
  margin: 0 0 1rem;
}

.tour-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tour-moves {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.tour-skip {
  min-height: 2.25rem;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.tour-skip:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  .tour {
    animation: tour-fade var(--dur) var(--ease);
  }

  .tour-popover {
    animation: tour-rise var(--dur) var(--ease);
  }
}

@keyframes tour-fade {
  from {
    opacity: 0;
  }
}

@keyframes tour-rise {
  from {
    transform: translateY(6px);
  }
}

@media (forced-colors: active) {
  .tour-spot {
    outline: 3px solid Highlight;
    outline-offset: 0;
  }

  .tour-popover {
    border: 2px solid CanvasText;
  }
}
