/* ==========================================================================
   expertchecker UI  ·  public/design/ui.css
   Shared visual system for the Technology Assessment Engine.

   Order: tokens, dark theme, motion, base styles, layout, then components.
   Every class and custom property carries the prefix "x-" so the sheet can
   sit beside a page's existing styles while it is adopted.
   Typeface: IBM Plex Sans (Google Fonts) with a system fallback; code uses
   the system monospace stack. Pages add the font link themselves:

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap">
     <link rel="stylesheet" href="/design/ui.css">
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Typeface */
  --x-font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --x-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Type scale (rem on a 16px root) */
  --x-fs-2xs: 0.6875rem;   /* 11px  eyebrows, table headers */
  --x-fs-xs: 0.75rem;      /* 12px  pills, hints, timestamps */
  --x-fs-sm: 0.84375rem;   /* 13.5px table cells, labels, buttons */
  --x-fs-md: 0.9375rem;    /* 15px  body */
  --x-fs-lg: 1.0625rem;    /* 17px  card titles */
  --x-fs-xl: 1.25rem;      /* 20px  section titles */
  --x-fs-2xl: 1.5rem;      /* 24px  page titles */
  --x-fs-3xl: 1.875rem;    /* 30px  landing title */
  --x-lh-tight: 1.25;
  --x-lh-base: 1.5;
  --x-lh-loose: 1.65;
  --x-track-caps: 0.08em;

  /* Spacing */
  --x-sp-1: 4px;
  --x-sp-2: 8px;
  --x-sp-3: 12px;
  --x-sp-4: 16px;
  --x-sp-5: 20px;
  --x-sp-6: 24px;
  --x-sp-8: 32px;
  --x-sp-10: 40px;
  --x-sp-12: 48px;
  --x-sp-16: 64px;
  --x-gutter: 16px;

  /* Radii */
  --x-r-sm: 4px;
  --x-r-md: 6px;
  --x-r-lg: 10px;
  --x-r-xl: 14px;
  --x-r-pill: 999px;

  /* Borders */
  --x-bw: 1px;
  --x-border: var(--x-bw) solid var(--x-line);

  /* Shadows */
  --x-sh-1: 0 1px 2px rgb(20 30 43 / 0.06);
  --x-sh-2: 0 2px 6px rgb(20 30 43 / 0.08), 0 8px 24px rgb(20 30 43 / 0.06);
  --x-sh-3: 0 12px 40px rgb(20 30 43 / 0.20);

  /* Focus ring: two rings so it is visible on any background */
  --x-focus-ring: 0 0 0 2px var(--x-surface), 0 0 0 4px var(--x-accent);

  /* Motion */
  --x-dur-1: 120ms;
  --x-dur-2: 200ms;
  --x-dur-3: 320ms;
  --x-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Colour, light theme. Deep blue accent, cool neutrals. */
  --x-bg: #f4f6f9;
  --x-surface: #ffffff;
  --x-sunk: #eceff4;
  --x-line: #d6dbe3;
  --x-line-strong: #aeb7c4;
  --x-line-input: #7d8a9c;
  --x-ink: #141e2b;
  --x-ink-2: #4a5767;
  --x-ink-3: #5f6d82;
  --x-code-bg: #f0f3f7;
  --x-overlay: rgb(20 30 43 / 0.45);

  --x-accent: #1e4d8b;
  --x-accent-hover: #173d70;
  --x-accent-soft: #e3ecf8;
  --x-accent-ink: #1b4479;
  --x-on-accent: #ffffff;

  --x-good: #1b7a47;
  --x-good-soft: #dcf2e4;
  --x-good-ink: #146038;
  --x-on-good: #ffffff;

  --x-warn: #955600;
  --x-warn-soft: #fbeed2;
  --x-warn-ink: #744300;
  --x-on-warn: #ffffff;

  --x-bad: #b3261e;
  --x-bad-soft: #fae0dd;
  --x-bad-ink: #8e1d17;
  --x-on-bad: #ffffff;

  /* Grades 1 to 4: below the bar, developing, meets, strong */
  --x-grade-1: var(--x-bad);
  --x-grade-1-soft: var(--x-bad-soft);
  --x-grade-1-ink: var(--x-bad-ink);
  --x-grade-2: var(--x-warn);
  --x-grade-2-soft: var(--x-warn-soft);
  --x-grade-2-ink: var(--x-warn-ink);
  --x-grade-3: var(--x-accent);
  --x-grade-3-soft: var(--x-accent-soft);
  --x-grade-3-ink: var(--x-accent-ink);
  --x-grade-4: var(--x-good);
  --x-grade-4-soft: var(--x-good-soft);
  --x-grade-4-ink: var(--x-good-ink);

  /* Select chevron, drawn in ink-2 */
  --x-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234a5767' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   2. Dark theme: follows the system unless the page sets data-theme (screen only: print is always light)
   -------------------------------------------------------------------------- */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --x-bg: #0e131a;
    --x-surface: #161d26;
    --x-sunk: #1e2733;
    --x-line: #2d3947;
    --x-line-strong: #465569;
    --x-line-input: #66778d;
    --x-ink: #e7ecf2;
    --x-ink-2: #a6b1be;
    --x-ink-3: #8b99a9;
    --x-code-bg: #111820;
    --x-overlay: rgb(0 0 0 / 0.6);
    --x-accent: #8ab6ec;
    --x-accent-hover: #a6c8f2;
    --x-accent-soft: #1c3251;
    --x-accent-ink: #b1cff5;
    --x-on-accent: #0e131a;
    --x-good: #5fcb8c;
    --x-good-soft: #15321f;
    --x-good-ink: #8fdcae;
    --x-on-good: #0e131a;
    --x-warn: #e5b45c;
    --x-warn-soft: #3a2c10;
    --x-warn-ink: #f1cb7d;
    --x-on-warn: #0e131a;
    --x-bad: #f3918a;
    --x-bad-soft: #44201d;
    --x-bad-ink: #f7aea7;
    --x-on-bad: #0e131a;
    --x-sh-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --x-sh-2: 0 2px 6px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
    --x-sh-3: 0 12px 40px rgb(0 0 0 / 0.6);
    --x-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23a6b1be' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --x-bg: #0e131a;
  --x-surface: #161d26;
  --x-sunk: #1e2733;
  --x-line: #2d3947;
  --x-line-strong: #465569;
  --x-line-input: #66778d;
  --x-ink: #e7ecf2;
  --x-ink-2: #a6b1be;
  --x-ink-3: #8b99a9;
  --x-code-bg: #111820;
  --x-overlay: rgb(0 0 0 / 0.6);
  --x-accent: #8ab6ec;
  --x-accent-hover: #a6c8f2;
  --x-accent-soft: #1c3251;
  --x-accent-ink: #b1cff5;
  --x-on-accent: #0e131a;
  --x-good: #5fcb8c;
  --x-good-soft: #15321f;
  --x-good-ink: #8fdcae;
  --x-on-good: #0e131a;
  --x-warn: #e5b45c;
  --x-warn-soft: #3a2c10;
  --x-warn-ink: #f1cb7d;
  --x-on-warn: #0e131a;
  --x-bad: #f3918a;
  --x-bad-soft: #44201d;
  --x-bad-ink: #f7aea7;
  --x-on-bad: #0e131a;
  --x-sh-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --x-sh-2: 0 2px 6px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  --x-sh-3: 0 12px 40px rgb(0 0 0 / 0.6);
  --x-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23a6b1be' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   3. Motion: every transition reads a duration token, so one rule stops them
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --x-dur-1: 0ms;
    --x-dur-2: 0ms;
    --x-dur-3: 0ms;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   4. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--x-bg);
  color: var(--x-ink);
  font-family: var(--x-font-sans);
  font-size: var(--x-fs-md);
  line-height: var(--x-lh-base);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern";
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: var(--x-lh-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--x-ink);
}
h1 { font-size: var(--x-fs-2xl); font-weight: 700; }
h2 { font-size: var(--x-fs-xl); font-weight: 600; }
h3 { font-size: var(--x-fs-lg); font-weight: 600; }
h4 { font-size: var(--x-fs-md); font-weight: 600; }

p { margin: 0 0 var(--x-sp-3); }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 var(--x-sp-3); padding-left: 22px; }
li { margin: 2px 0; }
hr { border: 0; border-top: var(--x-border); margin: var(--x-sp-6) 0; }
small { font-size: var(--x-fs-sm); }
strong, b { font-weight: 600; }

a {
  color: var(--x-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  text-decoration-color: color-mix(in srgb, var(--x-accent) 45%, transparent);
  transition: color var(--x-dur-1) var(--x-ease), text-decoration-color var(--x-dur-1) var(--x-ease);
}
a:hover { color: var(--x-accent-hover); text-decoration-color: currentColor; }

code, kbd, pre, samp {
  font-family: var(--x-font-mono);
  font-size: 0.92em;
}
code {
  background: var(--x-sunk);
  border-radius: var(--x-r-sm);
  padding: 1px 5px;
}
pre { margin: 0; }
pre code { background: none; padding: 0; font-size: inherit; }

table { border-collapse: collapse; border-spacing: 0; }
th { text-align: left; }

img, svg { display: inline-block; vertical-align: middle; }
svg { fill: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--x-ink-3); opacity: 1; }
::selection { background: var(--x-accent-soft); color: var(--x-ink); }

/* Keyboard focus is always visible. Mouse focus is quiet. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--x-accent);
  outline-offset: 2px;
  border-radius: var(--x-r-sm);
}

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   5. Layout
   -------------------------------------------------------------------------- */
.x-page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(var(--x-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--x-gutter), env(safe-area-inset-right, 0px));
  padding-top: var(--x-sp-6);
  padding-bottom: var(--x-sp-16);
}
.x-page-narrow { max-width: 760px; }
.x-page-reading { max-width: 860px; }

.x-auth {
  max-width: 460px;
  margin: 0 auto;
  padding: clamp(24px, 8vh, 72px) max(var(--x-gutter), env(safe-area-inset-left, 0px)) var(--x-sp-16);
}

.x-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-sp-2); }
.x-row-gap-3 { gap: var(--x-sp-3); }
.x-spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--x-sp-3); }
.x-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--x-sp-4); }
.x-stack-sm { gap: var(--x-sp-2); }
.x-stack-lg { gap: var(--x-sp-6); }
.x-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--x-sp-4);
  align-items: start;
}
.x-grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .x-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* Utilities */
.x-muted { color: var(--x-ink-2); }
.x-quiet { color: var(--x-ink-3); }
.x-small { font-size: var(--x-fs-sm); }
.x-xs { font-size: var(--x-fs-xs); }
.x-num { font-variant-numeric: tabular-nums; }
.x-right { text-align: right; }
.x-center { text-align: center; }
.x-nowrap { white-space: nowrap; }
.x-nocopy { user-select: none; -webkit-user-select: none; }
.x-mt-4 { margin-top: var(--x-sp-4); }
.x-mt-6 { margin-top: var(--x-sp-6); }
.x-mb-4 { margin-bottom: var(--x-sp-4); }
.x-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.x-code { font-family: var(--x-font-mono); font-size: 0.92em; background: var(--x-sunk); border-radius: var(--x-r-sm); padding: 1px 5px; }

.x-eyebrow {
  font-size: var(--x-fs-2xs);
  font-weight: 600;
  letter-spacing: var(--x-track-caps);
  text-transform: uppercase;
  color: var(--x-ink-2);
}

/* Page or report header */
.x-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--x-sp-3) var(--x-sp-6);
  margin-bottom: var(--x-sp-6);
}
.x-head-main { display: grid; gap: var(--x-sp-1); min-width: 0; }
.x-head-title { font-size: var(--x-fs-2xl); font-weight: 700; }
.x-head-actions { display: flex; flex-wrap: wrap; gap: var(--x-sp-2); align-items: center; }
.x-head-lead { color: var(--x-ink-2); max-width: 64ch; }

.x-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--x-sp-1) var(--x-sp-5);
  margin: 0;
  color: var(--x-ink-2);
  font-size: var(--x-fs-sm);
}
.x-meta-item { display: inline-flex; gap: 6px; align-items: baseline; margin: 0; }
.x-meta-item dt, .x-meta-label { color: var(--x-ink-3); font-weight: 400; }
.x-meta-item dd, .x-meta-value { margin: 0; color: var(--x-ink); font-weight: 500; }

.x-footer {
  margin-top: var(--x-sp-12);
  padding-top: var(--x-sp-4);
  border-top: var(--x-border);
  font-size: var(--x-fs-sm);
  color: var(--x-ink-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--x-sp-2) var(--x-sp-5);
  justify-content: space-between;
}

/* --------------------------------------------------------------------------
   6. Navigation: masthead and tab rail
   -------------------------------------------------------------------------- */
.x-nav {
  background: var(--x-surface);
  border-bottom: var(--x-border);
}
.x-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 56px;
  padding: var(--x-sp-2) max(var(--x-gutter), env(safe-area-inset-left, 0px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--x-sp-2) var(--x-sp-6);
}
.x-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--x-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--x-fs-md);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.x-nav-brand:hover { color: var(--x-ink); }
.x-nav-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--x-accent);
  color: var(--x-on-accent);
  display: inline-grid;
  place-items: center;
  flex: none;
}
.x-nav-mark svg { width: 18px; height: 18px; }
.x-nav-brand small { font-weight: 400; color: var(--x-ink-2); font-size: var(--x-fs-sm); }
.x-nav-links {
  display: flex;
  gap: var(--x-sp-1);
  margin: 0; padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
}
.x-nav-links::-webkit-scrollbar { display: none; }
/* With many links the list scrolls sideways rather than pushing the user menu onto a second line. */
.x-nav-inner > nav { flex: 1 1 0; min-width: 0; }
@media (max-width: 1360px) { .x-nav-brand small { display: none; } }
.x-nav-links a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--x-r-md);
  color: var(--x-ink-2);
  font-weight: 500;
  font-size: var(--x-fs-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--x-dur-1) var(--x-ease), color var(--x-dur-1) var(--x-ease);
}
.x-nav-links a:hover { background: var(--x-sunk); color: var(--x-ink); }
.x-nav-links a[aria-current="page"] { background: var(--x-accent-soft); color: var(--x-accent-ink); }
.x-nav-user {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--x-sp-3);
  color: var(--x-ink-2);
  font-size: var(--x-fs-sm);
}
.x-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--x-accent-soft);
  color: var(--x-accent-ink);
  display: inline-grid;
  place-items: center;
  font-size: var(--x-fs-xs);
  font-weight: 600;
  flex: none;
}
@media (max-width: 640px) {
  /* Links drop to their own row, whether the list sits directly in the bar or inside a nav element */
  .x-nav-inner > nav, .x-nav-inner > .x-nav-links { order: 3; flex-basis: 100%; min-width: 0; }
  .x-nav-links { margin: 0 calc(-1 * var(--x-gutter)); padding: 0 var(--x-gutter); }
  /* Fade the right edge so a menu wider than the screen reads as scrollable */
  .x-nav-links { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .x-nav-links li:last-child { padding-right: 24px; }
  .x-nav-inner { gap: var(--x-sp-2) var(--x-sp-3); }
  .x-nav-brand small, .x-nav-user .x-nav-user-name { display: none; }
}

.x-tabs {
  display: flex;
  gap: var(--x-sp-1);
  border-bottom: var(--x-border);
  margin-bottom: var(--x-sp-5);
  overflow-x: auto;
  scrollbar-width: none;
}
.x-tabs::-webkit-scrollbar { display: none; }
.x-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 12px;
  color: var(--x-ink-2);
  font-weight: 500;
  font-size: var(--x-fs-sm);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: color var(--x-dur-1) var(--x-ease), border-color var(--x-dur-1) var(--x-ease);
}
.x-tab:hover { color: var(--x-ink); }
.x-tab[aria-selected="true"], .x-tab[aria-current="page"] { color: var(--x-ink); border-bottom-color: var(--x-accent); }
.x-tab:focus-visible { outline-offset: -2px; border-radius: var(--x-r-sm); }
.x-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: var(--x-r-pill);
  background: var(--x-sunk);
  color: var(--x-ink-2);
  font-size: var(--x-fs-2xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.x-tab[aria-selected="true"] .x-tab-count { background: var(--x-accent-soft); color: var(--x-accent-ink); }

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.x-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: var(--x-bw) solid var(--x-line-input);
  border-radius: var(--x-r-md);
  background: var(--x-surface);
  color: var(--x-ink);
  font-size: var(--x-fs-sm);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--x-dur-1) var(--x-ease), border-color var(--x-dur-1) var(--x-ease), color var(--x-dur-1) var(--x-ease), box-shadow var(--x-dur-1) var(--x-ease);
}
.x-btn svg { width: 16px; height: 16px; flex: none; }
.x-btn:hover { background: var(--x-sunk); border-color: var(--x-ink-3); color: var(--x-ink); }
.x-btn:active { background: var(--x-line); }
.x-btn:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
.x-btn:disabled, .x-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.x-btn-primary { background: var(--x-accent); border-color: var(--x-accent); color: var(--x-on-accent); }
.x-btn-primary:hover { background: var(--x-accent-hover); border-color: var(--x-accent-hover); color: var(--x-on-accent); }
.x-btn-primary:active { background: var(--x-accent-hover); }

.x-btn-danger { color: var(--x-bad); border-color: var(--x-bad); background: var(--x-surface); }
.x-btn-danger:hover { background: var(--x-bad-soft); border-color: var(--x-bad); color: var(--x-bad-ink); }
.x-btn-danger:focus-visible { box-shadow: 0 0 0 2px var(--x-surface), 0 0 0 4px var(--x-bad); }

.x-btn-ghost { border-color: transparent; background: transparent; color: var(--x-ink-2); }
.x-btn-ghost:hover { background: var(--x-sunk); border-color: transparent; color: var(--x-ink); }

.x-btn-link {
  border: 0; background: none; min-height: 0; padding: 0;
  color: var(--x-accent); font-weight: 500; text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--x-accent) 45%, transparent);
  text-underline-offset: 0.15em; border-radius: var(--x-r-sm);
}
.x-btn-link:hover { background: none; color: var(--x-accent-hover); text-decoration-color: currentColor; }

.x-btn-sm { min-height: 30px; padding: 3px 10px; font-size: var(--x-fs-xs); }
.x-btn-lg { min-height: 44px; padding: 10px 18px; font-size: var(--x-fs-md); }
.x-btn-block { width: 100%; }
.x-btn-icon { padding: 6px; width: 36px; }
.x-btn-icon.x-btn-sm { width: 30px; padding: 3px; }

/* Busy: the label dims and a ring spins in its place */
.x-btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.x-btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-color: var(--x-ink-3) var(--x-ink-3) transparent;
  border-radius: 50%;
  animation: x-spin 0.8s linear infinite;
}
.x-btn-primary[aria-busy="true"]::after { border-color: var(--x-on-accent) var(--x-on-accent) transparent; }
@keyframes x-spin { to { transform: rotate(360deg); } }

/* Comfortable targets on touch screens */
@media (pointer: coarse) {
  .x-btn { min-height: 40px; }
  .x-btn-sm { min-height: 34px; }
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */
/* align-content: start keeps label, control and hint at their natural height when a grid row is taller */
.x-field { display: grid; gap: var(--x-sp-1); min-width: 0; align-content: start; }
.x-label { font-size: var(--x-fs-sm); font-weight: 500; color: var(--x-ink); }
.x-label-optional { color: var(--x-ink-3); font-weight: 400; }
.x-hint { font-size: var(--x-fs-xs); color: var(--x-ink-2); }
.x-error { font-size: var(--x-fs-sm); color: var(--x-bad); display: flex; gap: 6px; align-items: flex-start; }
.x-error svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.x-error:empty { display: none; }

.x-input, .x-select, .x-textarea {
  appearance: none;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: var(--x-bw) solid var(--x-line-input);
  border-radius: var(--x-r-md);
  background: var(--x-surface);
  color: var(--x-ink);
  font-size: var(--x-fs-md);
  line-height: 1.4;
  transition: border-color var(--x-dur-1) var(--x-ease), box-shadow var(--x-dur-1) var(--x-ease), background var(--x-dur-1) var(--x-ease);
}
.x-input:hover, .x-select:hover, .x-textarea:hover { border-color: var(--x-ink-3); }
.x-input:focus-visible, .x-select:focus-visible, .x-textarea:focus-visible {
  outline: none;
  border-color: var(--x-accent);
  box-shadow: var(--x-focus-ring);
}
.x-input:disabled, .x-select:disabled, .x-textarea:disabled,
.x-input[readonly] { background: var(--x-sunk); color: var(--x-ink-2); cursor: not-allowed; }
.x-input[aria-invalid="true"], .x-select[aria-invalid="true"], .x-textarea[aria-invalid="true"] { border-color: var(--x-bad); }
.x-input[aria-invalid="true"]:focus-visible, .x-textarea[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 2px var(--x-surface), 0 0 0 4px var(--x-bad); }

.x-select {
  padding-right: 34px;
  background-image: var(--x-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.x-select[multiple] { background-image: none; padding-right: 10px; }

.x-textarea { min-height: 120px; resize: vertical; line-height: var(--x-lh-base); }
.x-textarea-code {
  font-family: var(--x-font-mono);
  font-size: var(--x-fs-sm);
  min-height: 240px;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 4;
  line-height: 1.5;
}
.x-input-code {
  font-family: var(--x-font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.x-input-sm { min-height: 30px; padding: 3px 8px; font-size: var(--x-fs-sm); }
.x-input-inline { width: auto; }
.x-select.x-input-sm { padding-right: 30px; background-position: right 8px center; }

/* Access code, shown once when a test is issued: large, monospace, selected whole with one click */
.x-access-code {
  display: inline-block;
  font-family: var(--x-font-mono);
  font-size: var(--x-fs-2xl);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  padding: 10px 16px;
  border: var(--x-bw) dashed var(--x-accent);
  border-radius: var(--x-r-lg);
  background: var(--x-surface);
  color: var(--x-ink);
  user-select: all;
  -webkit-user-select: all;
}

/* Disclosure: a brief or an event list the reviewer opens when needed */
.x-details {
  border: var(--x-border);
  border-radius: var(--x-r-md);
  background: var(--x-surface);
}
.x-details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
  font-size: var(--x-fs-sm);
  font-weight: 500;
  color: var(--x-ink-2);
  border-radius: var(--x-r-md);
  transition: background var(--x-dur-1) var(--x-ease), color var(--x-dur-1) var(--x-ease);
}
.x-details > summary::-webkit-details-marker { display: none; }
.x-details > summary::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  margin-left: 2px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--x-dur-1) var(--x-ease);
}
.x-details > summary:hover { background: var(--x-sunk); color: var(--x-ink); }
.x-details > summary:focus-visible { outline-offset: -2px; }
.x-details[open] > summary { color: var(--x-ink); border-bottom: var(--x-border); border-radius: var(--x-r-md) var(--x-r-md) 0 0; }
.x-details[open] > summary::before { transform: rotate(45deg); }
.x-details-body { padding: var(--x-sp-4); }

.x-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--x-fs-md);
  cursor: pointer;
}
.x-check input {
  width: 18px; height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--x-accent);
}
.x-check input:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; }

.x-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--x-sp-4);
  align-items: start;
}
.x-span-all { grid-column: 1 / -1; }
.x-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--x-sp-2);
  align-items: center;
  justify-content: flex-end;
  padding-top: var(--x-sp-2);
}

/* --------------------------------------------------------------------------
   9. Cards
   -------------------------------------------------------------------------- */
.x-card {
  background: var(--x-surface);
  border: var(--x-border);
  border-radius: var(--x-r-lg);
  padding: var(--x-sp-5);
  min-width: 0;
  box-shadow: var(--x-sh-1);
}
.x-card-flush { padding: 0; overflow: hidden; }
.x-card-flush > .x-card-header, .x-card-flush > .x-card-footer { padding: var(--x-sp-4) var(--x-sp-5); }
.x-card-sunk { background: var(--x-sunk); box-shadow: none; }
.x-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--x-sp-2) var(--x-sp-4);
  margin-bottom: var(--x-sp-4);
}
.x-card-flush > .x-card-header { margin-bottom: 0; border-bottom: var(--x-border); }
.x-card-title { font-size: var(--x-fs-lg); font-weight: 600; margin: 0; }
.x-card-sub { color: var(--x-ink-2); font-size: var(--x-fs-sm); margin: 2px 0 0; }
.x-card-footer {
  margin-top: var(--x-sp-4);
  padding-top: var(--x-sp-4);
  border-top: var(--x-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--x-sp-2);
  align-items: center;
  justify-content: space-between;
}
.x-card-flush > .x-card-footer { margin-top: 0; border-top: var(--x-border); }
@media (max-width: 480px) {
  .x-card { padding: var(--x-sp-4); border-radius: var(--x-r-md); }
}

/* --------------------------------------------------------------------------
   10. Tables
   -------------------------------------------------------------------------- */
.x-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: var(--x-border);
  border-radius: var(--x-r-lg);
  background: var(--x-surface);
}
.x-card-flush > .x-table-wrap, .x-card-flush > .x-table { border: 0; border-radius: 0; }
.x-table {
  width: 100%;
  font-size: var(--x-fs-sm);
  font-variant-numeric: tabular-nums;
}
.x-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--x-sunk);
  color: var(--x-ink-2);
  font-size: var(--x-fs-2xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: var(--x-border);
  white-space: nowrap;
}
.x-table td {
  padding: 10px 12px;
  border-bottom: var(--x-border);
  vertical-align: top;
  color: var(--x-ink);
}
.x-table tbody tr:last-child td { border-bottom: 0; }
.x-table-dense th, .x-table-dense td { padding: 6px 10px; }
.x-table-hover tbody tr:hover td { background: var(--x-sunk); }
.x-table-link tbody tr { cursor: pointer; }
.x-table-link tbody tr:focus-within td { background: var(--x-accent-soft); }
.x-table-link tbody tr:hover td { background: var(--x-sunk); }
.x-th-num, .x-td-num { text-align: right; }
.x-td-actions { text-align: right; white-space: nowrap; }
.x-td-primary { font-weight: 500; }
.x-td-sub { display: block; color: var(--x-ink-2); font-size: var(--x-fs-xs); font-weight: 400; margin-top: 1px; }
.x-td-sub.x-nowrap, .x-td-date { white-space: nowrap; }
.x-table .x-tr-flag td { background: var(--x-warn-soft); }
.x-table .x-tr-muted td { color: var(--x-ink-3); }
.x-table tfoot td { background: var(--x-sunk); font-weight: 500; border-top: var(--x-border); }

/* Stacked rows on phones: give each td a data-label */
@media (max-width: 640px) {
  .x-table-stack thead { display: none; }
  .x-table-stack tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    padding: var(--x-sp-3) var(--x-sp-4);
    border-bottom: var(--x-border);
  }
  .x-table-stack tbody tr:last-child { border-bottom: 0; }
  .x-table-stack td { display: flex; align-items: baseline; gap: var(--x-sp-3); padding: 2px 0; border: 0; text-align: left; min-width: 0; }
  .x-table-stack td::before {
    content: attr(data-label);
    color: var(--x-ink-3);
    font-size: var(--x-fs-xs);
    font-weight: 500;
    flex: none;
    width: 7.5em;
  }
  .x-table-stack td:not([data-label])::before { content: none; }
  .x-table-stack .x-td-num { text-align: left; }
  .x-table-stack .x-td-actions { justify-content: flex-end; padding-top: var(--x-sp-2); }
  /* The primary cell becomes the card title: no label, sub-line underneath */
  .x-table-stack .x-td-primary { display: block; font-size: var(--x-fs-md); margin-bottom: 4px; overflow-wrap: anywhere; }
  .x-table-stack .x-td-primary::before { content: none; }
  .x-table-stack .x-td-primary .x-td-sub { font-size: var(--x-fs-sm); }
  /* Row tones colour the whole card, not each cell */
  .x-table-stack .x-tr-flag { background: var(--x-warn-soft); }
  .x-table-stack .x-tr-flag td { background: transparent; }
  .x-table-stack .x-table-hover tbody tr:hover td, .x-table-stack.x-table-hover tbody tr:hover td { background: transparent; }
  .x-table-stack.x-table-hover tbody tr:hover, .x-table-stack.x-table-link tbody tr:hover { background: var(--x-sunk); }
  .x-table-stack.x-table-link tbody tr:focus-within { background: var(--x-accent-soft); }
  .x-table-stack.x-table-link tbody tr:focus-within td { background: transparent; }
}

/* --------------------------------------------------------------------------
   11. Pills: statuses, recommendations and tones
   -------------------------------------------------------------------------- */
.x-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  min-height: 22px;
  border-radius: var(--x-r-pill);
  background: var(--x-sunk);
  color: var(--x-ink-2);
  font-size: var(--x-fs-xs);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
}
.x-pill-dot::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.x-pill-neutral { background: var(--x-sunk); color: var(--x-ink-2); }
.x-pill-info, .x-pill-accent { background: var(--x-accent-soft); color: var(--x-accent-ink); }
.x-pill-good { background: var(--x-good-soft); color: var(--x-good-ink); }
.x-pill-warn { background: var(--x-warn-soft); color: var(--x-warn-ink); }
.x-pill-bad { background: var(--x-bad-soft); color: var(--x-bad-ink); }
.x-pill-outline { background: transparent; border: var(--x-bw) solid var(--x-line-strong); color: var(--x-ink-2); }

/* Invitation status */
.x-pill-sent { background: var(--x-sunk); color: var(--x-ink-2); }
.x-pill-opened { background: var(--x-accent-soft); color: var(--x-accent-ink); }
.x-pill-submitted { background: var(--x-warn-soft); color: var(--x-warn-ink); }
.x-pill-reviewed { background: var(--x-good-soft); color: var(--x-good-ink); }
.x-pill-cancelled { background: transparent; border: var(--x-bw) dashed var(--x-line-strong); color: var(--x-ink-3); }

/* Recommendation */
.x-pill-proceed { background: var(--x-good-soft); color: var(--x-good-ink); }
.x-pill-hold { background: var(--x-warn-soft); color: var(--x-warn-ink); }
.x-pill-do-not-proceed { background: var(--x-bad-soft); color: var(--x-bad-ink); }

/* Email outbox */
.x-pill-queued { background: var(--x-sunk); color: var(--x-ink-2); }
.x-pill-failed { background: var(--x-bad-soft); color: var(--x-bad-ink); }

/* Test status */
.x-pill-active { background: var(--x-good-soft); color: var(--x-good-ink); }
.x-pill-archived { background: transparent; border: var(--x-bw) dashed var(--x-line-strong); color: var(--x-ink-3); }

.x-pill-lg { font-size: var(--x-fs-sm); padding: 4px 12px; min-height: 28px; }

/* --------------------------------------------------------------------------
   12. Grades 1 to 4
   -------------------------------------------------------------------------- */
.x-grade {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: var(--x-r-md);
  font-size: var(--x-fs-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: var(--x-sunk);
  color: var(--x-ink-2);
  border: var(--x-bw) solid transparent;
  flex: none;
  vertical-align: middle;
}
.x-grade-1 { background: var(--x-grade-1); color: var(--x-on-bad); }
.x-grade-2 { background: var(--x-grade-2); color: var(--x-on-warn); }
.x-grade-3 { background: var(--x-grade-3); color: var(--x-on-accent); }
.x-grade-4 { background: var(--x-grade-4); color: var(--x-on-good); }
.x-grade-none { background: transparent; border-color: var(--x-line-strong); color: var(--x-ink-3); }
.x-grade-soft.x-grade-1 { background: var(--x-grade-1-soft); color: var(--x-grade-1-ink); }
.x-grade-soft.x-grade-2 { background: var(--x-grade-2-soft); color: var(--x-grade-2-ink); }
.x-grade-soft.x-grade-3 { background: var(--x-grade-3-soft); color: var(--x-grade-3-ink); }
.x-grade-soft.x-grade-4 { background: var(--x-grade-4-soft); color: var(--x-grade-4-ink); }
.x-grade-lg { width: 40px; height: 40px; font-size: var(--x-fs-xl); border-radius: var(--x-r-lg); }
.x-grade-sm { width: 22px; height: 22px; font-size: var(--x-fs-xs); border-radius: var(--x-r-sm); }

/* Grade with its name beside it */
.x-grade-with-label { display: inline-flex; align-items: center; gap: 8px; }
.x-grade-name { font-size: var(--x-fs-sm); font-weight: 500; }

/* Coloured text only (table cells) */
.x-grade-text-1 { color: var(--x-grade-1); font-weight: 600; }
.x-grade-text-2 { color: var(--x-grade-2); font-weight: 600; }
.x-grade-text-3 { color: var(--x-grade-3); font-weight: 600; }
.x-grade-text-4 { color: var(--x-grade-4); font-weight: 600; }

/* Legend */
.x-grade-scale { display: flex; flex-wrap: wrap; gap: var(--x-sp-2) var(--x-sp-5); margin: 0; padding: 0; list-style: none; }
.x-grade-scale li { display: inline-flex; align-items: center; gap: 8px; font-size: var(--x-fs-sm); color: var(--x-ink-2); }
.x-grade-scale li b { color: var(--x-ink); font-weight: 500; }

/* Picker: four buttons, one pressed */
.x-grade-pick {
  display: inline-flex;
  border: var(--x-bw) solid var(--x-line-input);
  border-radius: var(--x-r-md);
  overflow: hidden;
  background: var(--x-surface);
}
.x-grade-pick button {
  appearance: none;
  border: 0;
  border-left: var(--x-bw) solid var(--x-line);
  background: transparent;
  color: var(--x-ink-2);
  width: 38px; height: 34px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: background var(--x-dur-1) var(--x-ease), color var(--x-dur-1) var(--x-ease);
}
.x-grade-pick button:first-child { border-left: 0; }
.x-grade-pick button:hover { background: var(--x-sunk); color: var(--x-ink); }
.x-grade-pick button:focus-visible { outline-offset: -3px; border-radius: var(--x-r-sm); }
.x-grade-pick button[aria-pressed="true"].x-grade-1 { background: var(--x-grade-1); color: var(--x-on-bad); }
.x-grade-pick button[aria-pressed="true"].x-grade-2 { background: var(--x-grade-2); color: var(--x-on-warn); }
.x-grade-pick button[aria-pressed="true"].x-grade-3 { background: var(--x-grade-3); color: var(--x-on-accent); }
.x-grade-pick button[aria-pressed="true"].x-grade-4 { background: var(--x-grade-4); color: var(--x-on-good); }
.x-grade-pick button:disabled { cursor: default; opacity: 0.6; }
.x-grade-pick button[aria-pressed="true"]:disabled { opacity: 1; }
@media (pointer: coarse) { .x-grade-pick button { width: 44px; height: 40px; } }

/* Report header strip: exercise title over its grade */
.x-grade-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--x-sp-3) var(--x-sp-6);
  margin: 0; padding: 0;
  list-style: none;
}
.x-grade-cell { display: grid; gap: 6px; min-width: 0; }
.x-grade-cell-label { font-size: var(--x-fs-xs); color: var(--x-ink-2); max-width: 14em; line-height: 1.3; }

/* --------------------------------------------------------------------------
   13. Stats strip
   -------------------------------------------------------------------------- */
.x-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--x-line);
  border: var(--x-border);
  border-radius: var(--x-r-lg);
  overflow: hidden;
}
.x-stat { background: var(--x-surface); padding: var(--x-sp-3) var(--x-sp-4); display: grid; gap: 2px; min-width: 0; }
.x-stat-label { font-size: var(--x-fs-2xs); font-weight: 600; letter-spacing: var(--x-track-caps); text-transform: uppercase; color: var(--x-ink-2); }
.x-stat-value { font-size: var(--x-fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.01em; }
.x-stat-note { font-size: var(--x-fs-xs); color: var(--x-ink-2); }
.x-stat-good .x-stat-value { color: var(--x-good); }
.x-stat-warn .x-stat-value { color: var(--x-warn); }
.x-stat-bad .x-stat-value { color: var(--x-bad); }
@media (max-width: 480px) {
  .x-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-stat:last-child:nth-child(odd) { grid-column: span 2; }
}

/* --------------------------------------------------------------------------
   14. Banner: inline message that stays on the page
   -------------------------------------------------------------------------- */
.x-banner {
  display: flex;
  gap: var(--x-sp-3);
  align-items: flex-start;
  padding: var(--x-sp-3) var(--x-sp-4);
  border: var(--x-border);
  border-left-width: 3px;
  border-left-color: var(--x-ink-3);
  border-radius: var(--x-r-md);
  background: var(--x-sunk);
  color: var(--x-ink);
  font-size: var(--x-fs-sm);
}
.x-banner-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--x-ink-2); }
.x-banner-body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.x-banner-title { font-weight: 600; }
.x-banner-text { color: var(--x-ink-2); }
.x-banner-text a { color: inherit; font-weight: 500; }
.x-banner-actions { display: flex; flex-wrap: wrap; gap: var(--x-sp-2); margin-top: var(--x-sp-2); }
.x-banner-close { margin-left: auto; align-self: flex-start; }
.x-banner-info { background: var(--x-accent-soft); border-left-color: var(--x-accent); }
.x-banner-info .x-banner-icon { color: var(--x-accent); }
.x-banner-info .x-banner-text { color: var(--x-ink-2); }
.x-banner-good { background: var(--x-good-soft); border-left-color: var(--x-good); }
.x-banner-good .x-banner-icon { color: var(--x-good); }
.x-banner-warn { background: var(--x-warn-soft); border-left-color: var(--x-warn); }
.x-banner-warn .x-banner-icon { color: var(--x-warn); }
.x-banner-bad { background: var(--x-bad-soft); border-left-color: var(--x-bad); }
.x-banner-bad .x-banner-icon { color: var(--x-bad); }
.x-banner-bad .x-banner-title { color: var(--x-bad-ink); }

/* --------------------------------------------------------------------------
   15. Toast: short confirmation, bottom centre
   -------------------------------------------------------------------------- */
.x-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--x-sp-4) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(480px, calc(100vw - 2 * var(--x-gutter)));
  padding: 10px 14px;
  border-radius: var(--x-r-md);
  background: var(--x-ink);
  color: var(--x-bg);
  font-size: var(--x-fs-sm);
  font-weight: 500;
  box-shadow: var(--x-sh-3);
  animation: x-toast-in var(--x-dur-3) var(--x-ease);
}
.x-toast::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--x-ink-3);
  flex: none;
}
.x-toast-good::before { background: var(--x-good); }
.x-toast-bad::before { background: var(--x-bad); }
.x-toast-warn::before { background: var(--x-warn); }
.x-toast .x-btn-link { color: inherit; text-decoration-color: currentColor; margin-left: 4px; }
@keyframes x-toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* --------------------------------------------------------------------------
   16. Timeline: integrity events, invitation history
   -------------------------------------------------------------------------- */
.x-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 22px;
  position: relative;
  display: grid;
  gap: var(--x-sp-3);
}
.x-timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--x-line);
  border-radius: 1px;
}
.x-timeline-item { position: relative; display: grid; gap: 1px; min-width: 0; }
.x-timeline-item::before {
  content: "";
  position: absolute;
  left: -22px; top: 5px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--x-surface);
  border: 2px solid var(--x-ink-3);
  box-sizing: border-box;
}
.x-timeline-item-good::before { border-color: var(--x-good); background: var(--x-good); }
.x-timeline-item-info::before { border-color: var(--x-accent); background: var(--x-accent); }
.x-timeline-item-warn::before { border-color: var(--x-warn); background: var(--x-warn); }
.x-timeline-item-bad::before { border-color: var(--x-bad); background: var(--x-bad); }
.x-timeline-time { font-size: var(--x-fs-xs); color: var(--x-ink-3); font-variant-numeric: tabular-nums; }
.x-timeline-title { font-size: var(--x-fs-sm); font-weight: 500; color: var(--x-ink); }
.x-timeline-item-warn .x-timeline-title { color: var(--x-warn-ink); }
.x-timeline-item-bad .x-timeline-title { color: var(--x-bad-ink); }
.x-timeline-detail { font-size: var(--x-fs-sm); color: var(--x-ink-2); }

/* --------------------------------------------------------------------------
   17. Empty and error states
   -------------------------------------------------------------------------- */
.x-empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--x-sp-2);
  padding: var(--x-sp-10) var(--x-sp-4);
  color: var(--x-ink-2);
  border: var(--x-bw) dashed var(--x-line-strong);
  border-radius: var(--x-r-lg);
  background: transparent;
}
.x-empty-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--x-sunk);
  color: var(--x-ink-2);
  margin-bottom: var(--x-sp-1);
}
.x-empty-icon svg { width: 20px; height: 20px; }
.x-empty-title { font-size: var(--x-fs-lg); font-weight: 600; color: var(--x-ink); }
.x-empty-text { max-width: 44ch; font-size: var(--x-fs-sm); }
.x-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--x-sp-2); margin-top: var(--x-sp-2); }
.x-empty-error { border-style: solid; border-color: var(--x-bad-soft); background: var(--x-bad-soft); }
.x-empty-error .x-empty-icon { background: var(--x-surface); color: var(--x-bad); }
.x-empty-error .x-empty-title { color: var(--x-bad-ink); }
.x-empty-plain { border: 0; padding: var(--x-sp-8) var(--x-sp-4); }

/* --------------------------------------------------------------------------
   18. Skeleton: loading placeholders
   -------------------------------------------------------------------------- */
.x-skeleton {
  display: block;
  background: linear-gradient(90deg, var(--x-sunk) 0%, var(--x-line) 50%, var(--x-sunk) 100%);
  background-size: 200% 100%;
  border-radius: var(--x-r-sm);
  animation: x-shimmer 1.4s linear infinite;
  color: transparent;
  user-select: none;
}
.x-skeleton-line { height: 12px; width: 100%; }
.x-skeleton-line + .x-skeleton-line { margin-top: 10px; }
.x-skeleton-text .x-skeleton-line:nth-child(2) { width: 92%; }
.x-skeleton-text .x-skeleton-line:nth-child(3) { width: 78%; }
.x-skeleton-text .x-skeleton-line:last-child { width: 55%; }
.x-skeleton-title { height: 20px; width: 40%; border-radius: var(--x-r-md); }
.x-skeleton-block { height: 120px; border-radius: var(--x-r-md); }
.x-skeleton-circle { width: 36px; height: 36px; border-radius: 50%; }
.x-skeleton-pill { height: 22px; width: 84px; border-radius: var(--x-r-pill); }
@keyframes x-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .x-skeleton { animation: none; background: var(--x-sunk); } }

/* --------------------------------------------------------------------------
   19. Timer and progress
   -------------------------------------------------------------------------- */
.x-timer {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.x-timer-value { font-size: var(--x-fs-lg); font-weight: 600; letter-spacing: 0.01em; color: var(--x-ink); }
.x-timer-guide { font-size: var(--x-fs-sm); color: var(--x-ink-2); }
.x-timer-over .x-timer-value { color: var(--x-warn); }
.x-timer-over .x-timer-guide { color: var(--x-warn); }
.x-timer-over .x-timer-guide::before { content: "over · "; }
.x-timer svg { width: 16px; height: 16px; align-self: center; color: var(--x-ink-2); }
.x-timer-over svg { color: var(--x-warn); }

.x-progress {
  width: 100%;
  height: 6px;
  border-radius: var(--x-r-pill);
  background: var(--x-sunk);
  overflow: hidden;
}
.x-progress-bar {
  height: 100%;
  width: 0;
  background: var(--x-accent);
  border-radius: inherit;
  transition: width var(--x-dur-3) var(--x-ease);
}
.x-progress-good .x-progress-bar { background: var(--x-good); }
/* Work in progress: a moving sheen so the bar is visibly alive even while it waits near the end. */
.x-ai-progress { display: grid; gap: var(--x-sp-2); }
.x-ai-progress-phase { font-weight: 600; color: var(--x-ink); }
.x-progress-live { height: 8px; }
.x-progress-live .x-progress-bar {
  transition: width 0.5s linear;
  background-image: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  background-size: 200% 100%;
  background-color: var(--x-accent);
  animation: x-sheen 1.6s linear infinite;
}
@keyframes x-sheen { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .x-progress-live .x-progress-bar { animation: none; transition: none; } }

/* --------------------------------------------------------------------------
   20. Brief: a rendered exercise brief (markdown)
   -------------------------------------------------------------------------- */
.x-brief {
  font-size: 1rem;
  line-height: var(--x-lh-loose);
  color: var(--x-ink);
}
.x-brief > :first-child { margin-top: 0; }
.x-brief > :last-child { margin-bottom: 0; }
.x-brief h2, .x-brief h3, .x-brief h4 { margin: var(--x-sp-5) 0 var(--x-sp-2); }
.x-brief h2 { font-size: var(--x-fs-lg); }
.x-brief h3 { font-size: var(--x-fs-md); }
.x-brief h4 { font-size: var(--x-fs-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--x-ink-2); }
.x-brief p { margin: 0 0 var(--x-sp-3); }
.x-brief ul, .x-brief ol { margin: 0 0 var(--x-sp-3); padding-left: 24px; }
.x-brief li { margin: 3px 0; }
.x-brief li::marker { color: var(--x-ink-3); }
.x-brief strong { font-weight: 600; }
.x-brief em { font-style: italic; }
.x-brief a { font-weight: 500; }
.x-brief hr { margin: var(--x-sp-5) 0; }
.x-brief blockquote {
  margin: var(--x-sp-3) 0;
  padding: var(--x-sp-1) var(--x-sp-4);
  border-left: 3px solid var(--x-accent);
  background: var(--x-accent-soft);
  border-radius: 0 var(--x-r-md) var(--x-r-md) 0;
  color: var(--x-ink);
}
.x-brief blockquote p { margin: var(--x-sp-1) 0; }
.x-brief code {
  font-family: var(--x-font-mono);
  font-size: 0.9em;
  background: var(--x-sunk);
  border-radius: var(--x-r-sm);
  padding: 1px 5px;
}
.x-brief pre {
  margin: var(--x-sp-3) 0;
  padding: var(--x-sp-3) var(--x-sp-4);
  background: var(--x-code-bg);
  border: var(--x-border);
  border-radius: var(--x-r-md);
  overflow-x: auto;
  font-size: var(--x-fs-sm);
  line-height: 1.55;
  tab-size: 4;
}
.x-brief pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.x-brief table {
  margin: var(--x-sp-3) 0;
  font-size: var(--x-fs-sm);
  font-variant-numeric: tabular-nums;
  border: var(--x-border);
  border-radius: var(--x-r-md);
  border-spacing: 0;
}
.x-brief th {
  background: var(--x-sunk);
  color: var(--x-ink-2);
  font-size: var(--x-fs-2xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 10px;
  border-bottom: var(--x-border);
  vertical-align: bottom;
}
.x-brief td { padding: 6px 10px; border-bottom: var(--x-border); vertical-align: top; }
.x-brief tbody tr:last-child td { border-bottom: 0; }
.x-brief th:first-child { border-top-left-radius: var(--x-r-md); }
.x-brief th:last-child { border-top-right-radius: var(--x-r-md); }
@media (max-width: 640px) {
  .x-brief table { display: block; width: max-content; max-width: 100%; overflow-x: auto; }
  .x-brief th, .x-brief td { padding-left: 8px; padding-right: 8px; }
}

/* --------------------------------------------------------------------------
   21. Question and choice
   -------------------------------------------------------------------------- */
.x-question {
  padding: var(--x-sp-5) 0;
  border-top: var(--x-border);
  display: grid;
  gap: var(--x-sp-3);
}
.x-question:first-child { border-top: 0; padding-top: 0; }
.x-question:last-child { padding-bottom: 0; }
.x-question-prompt {
  font-size: 1rem;
  font-weight: 500;
  line-height: var(--x-lh-base);
  color: var(--x-ink);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.x-question-num {
  flex: none;
  min-width: 26px; height: 26px;
  padding: 0 7px;
  border-radius: var(--x-r-md);
  background: var(--x-sunk);
  color: var(--x-ink-2);
  font-size: var(--x-fs-xs);
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.x-question-prompt code { font-size: 0.9em; }
.x-question-help { font-size: var(--x-fs-sm); color: var(--x-ink-2); }
.x-question-answer { display: grid; gap: var(--x-sp-2); }
.x-question-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--x-sp-2); font-size: var(--x-fs-xs); color: var(--x-ink-3); }
.x-question-save { font-size: var(--x-fs-sm); color: var(--x-ink-2); min-height: 1.4em; }
.x-question-save-error { color: var(--x-bad); }

.x-choice-list { display: grid; gap: var(--x-sp-2); margin: 0; padding: 0; list-style: none; }
.x-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: var(--x-bw) solid var(--x-line);
  border-radius: var(--x-r-md);
  background: var(--x-surface);
  font-size: 1rem;
  font-weight: 400;
  line-height: var(--x-lh-base);
  cursor: pointer;
  transition: border-color var(--x-dur-1) var(--x-ease), background var(--x-dur-1) var(--x-ease), box-shadow var(--x-dur-1) var(--x-ease);
}
.x-choice:hover { border-color: var(--x-line-input); background: var(--x-sunk); }
.x-choice input {
  width: 18px; height: 18px;
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--x-accent);
}
.x-choice input:focus-visible { outline: none; }
.x-choice:has(input:checked) { border-color: var(--x-accent); background: var(--x-accent-soft); }
.x-choice:has(input:focus-visible) { box-shadow: var(--x-focus-ring); border-color: var(--x-accent); }
.x-choice:has(input:disabled) { cursor: default; opacity: 0.8; }
.x-choice-key {
  flex: none;
  width: 22px; height: 22px;
  border-radius: var(--x-r-sm);
  background: var(--x-sunk);
  color: var(--x-ink-2);
  font-size: var(--x-fs-xs);
  font-weight: 600;
  display: inline-grid;
  place-items: center;
  margin-top: 1px;
}
.x-choice:has(input:checked) .x-choice-key { background: var(--x-accent); color: var(--x-on-accent); }
/* Marked answers on the report */
.x-choice-correct { border-color: var(--x-good); background: var(--x-good-soft); }
.x-choice-correct .x-choice-key { background: var(--x-good); color: var(--x-on-good); }
.x-choice-wrong { border-color: var(--x-bad); background: var(--x-bad-soft); }
.x-choice-wrong .x-choice-key { background: var(--x-bad); color: var(--x-on-bad); }
.x-choice-mark { margin-left: auto; font-size: var(--x-fs-xs); font-weight: 600; align-self: center; white-space: nowrap; }
.x-choice-correct .x-choice-mark { color: var(--x-good-ink); }
.x-choice-wrong .x-choice-mark { color: var(--x-bad-ink); }

/* The candidate's written answer as the reviewer sees it */
.x-answer {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: var(--x-sp-3) var(--x-sp-4);
  background: var(--x-sunk);
  border-radius: var(--x-r-md);
  border: var(--x-border);
  font-size: var(--x-fs-md);
  line-height: var(--x-lh-base);
}
.x-answer-code { font-family: var(--x-font-mono); font-size: var(--x-fs-sm); white-space: pre; overflow-x: auto; background: var(--x-code-bg); tab-size: 4; }
.x-answer-empty { color: var(--x-ink-3); font-style: italic; }

/* --------------------------------------------------------------------------
   22. Landing page: candidate-first hero with the sign-in card beside the copy
   -------------------------------------------------------------------------- */
.x-landing { padding-top: clamp(24px, 5vw, 56px); }
.x-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 420px);
  gap: var(--x-sp-10) var(--x-sp-12);
  align-items: start;
}
.x-hero-copy { display: grid; gap: var(--x-sp-4); min-width: 0; }
.x-hero-title {
  font-size: clamp(var(--x-fs-2xl), 2.4vw + 1rem, 2.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 18ch;
}
.x-hero-lead { color: var(--x-ink-2); font-size: var(--x-fs-lg); line-height: var(--x-lh-loose); max-width: 56ch; }
.x-hero-points { list-style: none; margin: var(--x-sp-2) 0 0; padding: 0; display: grid; gap: var(--x-sp-3); max-width: 56ch; }
.x-hero-points li { display: flex; gap: var(--x-sp-3); align-items: flex-start; color: var(--x-ink-2); font-size: var(--x-fs-md); }
.x-hero-points strong { color: var(--x-ink); font-weight: 600; }
.x-hero-point-icon {
  flex: none;
  width: 32px; height: 32px;
  border-radius: var(--x-r-md);
  background: var(--x-accent-soft);
  color: var(--x-accent-ink);
  display: inline-grid;
  place-items: center;
  margin-top: -2px;
}
.x-hero-point-icon svg { width: 18px; height: 18px; }

.x-signin { display: grid; gap: var(--x-sp-4); padding: var(--x-sp-6); box-shadow: var(--x-sh-2); }
.x-signin-head { display: grid; gap: var(--x-sp-1); }
.x-signin-foot { margin: 0; }

.x-landing-section { margin-top: clamp(48px, 8vw, 88px); }
.x-section-head { display: grid; gap: var(--x-sp-1); margin-bottom: var(--x-sp-5); }
.x-section-title { font-size: var(--x-fs-xl); font-weight: 700; letter-spacing: -0.01em; }

.x-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--x-sp-4); }
.x-step { display: grid; gap: var(--x-sp-2); align-content: start; }
.x-step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--x-accent);
  color: var(--x-on-accent);
  display: inline-grid;
  place-items: center;
  font-weight: 600;
  font-size: var(--x-fs-sm);
  font-variant-numeric: tabular-nums;
}
.x-step-title { font-size: var(--x-fs-lg); font-weight: 600; margin: var(--x-sp-1) 0 0; }
.x-step p { margin: 0; font-size: var(--x-fs-md); }

.x-expect { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--x-sp-4); }
.x-expect-card { display: grid; gap: var(--x-sp-2); align-content: start; }
.x-expect-card p { margin: 0; font-size: var(--x-fs-md); }

.x-help-card { padding: var(--x-sp-6); }
.x-help-list { margin: var(--x-sp-3) 0 0; padding-left: 1.2em; display: grid; gap: var(--x-sp-1); font-size: var(--x-fs-md); }
.x-footer a { color: var(--x-ink-2); }
.x-footer a:hover { color: var(--x-ink); }

@media (max-width: 900px) {
  .x-hero { grid-template-columns: minmax(0, 1fr); gap: var(--x-sp-6); }
  /* On one column the sign-in card follows the lead, ahead of the reassurance points */
  .x-hero-copy { display: contents; }
  .x-hero-copy > .x-eyebrow { order: 1; margin-bottom: calc(-1 * var(--x-sp-4)); }
  .x-hero-title { order: 2; }
  .x-hero-lead { order: 3; }
  .x-signin { order: 4; }
  .x-hero-points { order: 5; margin-top: 0; }
  .x-signin { max-width: 460px; }
  .x-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .x-expect { grid-template-columns: minmax(0, 1fr); }
  .x-signin { padding: var(--x-sp-5); }
  .x-hero-lead { font-size: var(--x-fs-md); }
}

/* Pipeline demo (admin portal): decision checks and the outcome line */
.x-pd-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--x-fs-sm); }
.x-pd-checks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; }
.x-pd-checks li > span:first-child { font-weight: 700; }
.x-pd-outcome { font-size: var(--x-fs-xl); font-weight: 700; }
.x-pd-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.x-pd-figs .x-stat { padding-left: var(--x-sp-3); padding-right: var(--x-sp-3); }
.x-pd-debrief td:last-child { min-width: 240px; }
.x-pd-debrief textarea { min-height: 56px; resize: vertical; }

/* Staff sign-in: the tour and architecture cards side by side, stacked on phones */
.x-auth-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--x-sp-3); }
.x-auth-link { text-decoration: none; color: inherit; align-content: start; }
.x-auth-link:hover { border-color: var(--x-accent); }
.x-auth-link-cta { color: var(--x-accent-ink); font-weight: 600; }
@media (max-width: 480px) { .x-auth-links { grid-template-columns: minmax(0, 1fr); } }

/* Fold: a summary first, the detail behind a section that opens and closes (report, CV review) */
.x-fold { border: var(--x-border); border-radius: var(--x-r-lg); background: var(--x-surface); box-shadow: var(--x-sh-1); }
.x-fold > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-sp-1) var(--x-sp-3);
  padding: var(--x-sp-4) var(--x-sp-5); cursor: pointer; list-style: none; border-radius: var(--x-r-lg);
}
.x-fold > summary::-webkit-details-marker { display: none; }
.x-fold > summary:hover { background: var(--x-sunk); }
.x-fold > summary:focus-visible { outline: none; box-shadow: var(--x-focus-ring); }
.x-fold-title { font-size: var(--x-fs-lg); font-weight: 600; color: var(--x-ink); }
.x-fold-meta { flex: 1 1 260px; min-width: 0; color: var(--x-ink-2); font-size: var(--x-fs-sm); }
.x-fold-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--x-fs-sm); font-weight: 600; color: var(--x-accent-ink); white-space: nowrap; }
.x-fold-toggle::before { content: "Show detail"; }
.x-fold[open] > summary .x-fold-toggle::before { content: "Hide detail"; }
.x-fold-toggle::after {
  content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform var(--x-dur-1) var(--x-ease);
}
.x-fold[open] > summary .x-fold-toggle::after { transform: rotate(-135deg) translate(-2px, -2px); }
.x-fold[open] > summary { border-bottom: var(--x-border); border-radius: var(--x-r-lg) var(--x-r-lg) 0 0; }
.x-fold-body { padding: var(--x-sp-5); display: grid; gap: var(--x-sp-4); min-width: 0; }
.x-fold-body > .x-card, .x-fold-body > form.x-card, .x-fold-body > section.x-card { border: 0; box-shadow: none; padding: 0; background: transparent; }
.x-fold-foot { display: flex; justify-content: flex-end; padding-top: var(--x-sp-4); border-top: var(--x-border); }
.x-fold-sm > summary { padding: var(--x-sp-3) var(--x-sp-4); }
.x-fold-sm .x-fold-title { font-size: var(--x-fs-md); }
.x-fold-sm { box-shadow: none; }
@media (max-width: 480px) {
  .x-fold > summary { padding: var(--x-sp-3) var(--x-sp-4); }
  .x-fold-body { padding: var(--x-sp-4); }
}

/* Report summary: the score from each stage at a glance */
.x-stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--x-sp-3); }
.x-stage { border: var(--x-border); border-radius: var(--x-r-md); padding: var(--x-sp-3) var(--x-sp-4); display: grid; gap: var(--x-sp-1); align-content: start; min-width: 0; }
.x-stage-value { font-size: var(--x-fs-xl); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--x-ink); }
@media (max-width: 760px) { .x-stage-grid { grid-template-columns: minmax(0, 1fr); } }

/* Candidates by vendor: one bar per vendor, split by where its candidates are. */
.x-vbars { display: grid; gap: var(--x-sp-3); }
.x-vbar { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr) 3rem; align-items: center; gap: var(--x-sp-3); }
.x-vbar-name { font-weight: 600; overflow-wrap: anywhere; }
.x-vbar-track { display: flex; height: 0.875rem; border-radius: var(--x-r-sm); background: var(--x-sunk); overflow: hidden; }
.x-vbar-seg { height: 100%; }
.x-vbar-seg-proceed { background: var(--x-good); }
.x-vbar-seg-done { background: var(--x-accent); }
.x-vbar-seg-open { background: var(--x-accent-soft); }
.x-vbar-seg-cancelled { background: var(--x-line-strong); }
.x-vbar-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.x-vbar-key { display: flex; flex-wrap: wrap; gap: var(--x-sp-3); font-size: var(--x-fs-sm); color: var(--x-ink-2, inherit); }
.x-vbar-key i { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; }
.x-score { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) { .x-vbar { grid-template-columns: minmax(0, 1fr) 3rem; } .x-vbar-track { grid-column: 1 / -1; grid-row: 2; } }

/* Staff development: released status, four summary tiles, learning lists and the catalogue picker. */
.x-pill-released { background: var(--x-good-soft); color: var(--x-good-ink); }
.x-stage-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .x-stage-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .x-stage-grid-4 { grid-template-columns: minmax(0, 1fr); } }
.x-dev-learn-list, .x-dev-pick { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--x-sp-3); }
.x-dev-learn { display: grid; gap: var(--x-sp-1); padding-bottom: var(--x-sp-3); border-bottom: var(--x-border); }
.x-dev-learn:last-child { border-bottom: 0; padding-bottom: 0; }
.x-dev-learn-list .x-spread, .x-dev-pick-item { gap: var(--x-sp-3); }
.x-dev-pick { max-height: 28rem; overflow-y: auto; }
.x-dev-pick-item { display: flex; justify-content: space-between; align-items: flex-start; padding: var(--x-sp-3); border: var(--x-border); border-radius: var(--x-r-md); background: var(--x-surface); }
.x-dev-pick-item > :first-child { min-width: 0; }
.x-dev-private { border-left: 3px solid var(--x-warn); padding-left: var(--x-sp-3); }
.x-dev-private .x-label { display: flex; flex-wrap: wrap; align-items: center; gap: var(--x-sp-2); }
@media (max-width: 480px) { .x-dev-pick-item { flex-direction: column; } }

/* --------------------------------------------------------------------------
   23. Print
   -------------------------------------------------------------------------- */
@media print {
  :root { --x-bg: #ffffff; --x-surface: #ffffff; }
  body { background: #fff; color: #000; }
  .x-nav, .x-tabs, .x-toast, .x-no-print, .x-head-actions, .x-form-actions { display: none !important; }
  .x-card, .x-table-wrap { box-shadow: none; break-inside: avoid; }
  .x-fold-toggle, .x-fold-foot { display: none !important; }
  /* Long cards such as the CV review flow across pages instead of leaving a blank page before them. */
  .x-card-breakable { break-inside: auto; }
  .x-page { padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
}

/* --------------------------------------------------------------------------
   24. Staff development report (candidate console, read-only)
   -------------------------------------------------------------------------- */
.x-steps-list { grid-template-columns: minmax(0, 1fr); }
.x-steps-list .x-step { grid-template-columns: 32px minmax(0, 1fr); column-gap: var(--x-sp-3); }
.x-steps-list .x-step-title { margin-top: 4px; }
.x-dr-level { display: grid; grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr); gap: var(--x-sp-5); align-items: start; }
.x-dr-level-tile { display: grid; gap: 2px; padding: var(--x-sp-4); border-radius: var(--x-r-md); border: var(--x-border); background: var(--x-sunk); }
.x-dr-level-good { background: var(--x-good-soft); border-color: var(--x-good); color: var(--x-good-ink); }
.x-dr-level-info { background: var(--x-accent-soft); border-color: var(--x-accent); color: var(--x-accent-ink); }
.x-dr-level-warn { background: var(--x-warn-soft); border-color: var(--x-warn); color: var(--x-warn-ink); }
.x-dr-level-label { font-size: var(--x-fs-2xs); font-weight: 600; letter-spacing: var(--x-track-caps); text-transform: uppercase; }
.x-dr-level-value { font-size: var(--x-fs-xl); font-weight: 700; line-height: 1.2; }
.x-dr-level-note { font-size: var(--x-fs-sm); }
.x-dr-level-summary p, .x-dr-prose p { margin: 0 0 var(--x-sp-2); }
.x-dr-level-summary p:last-child, .x-dr-prose p:last-child { margin-bottom: 0; }
.x-dr-bullets { margin: 0; padding-left: 1.2em; display: grid; gap: var(--x-sp-1); }
.x-dr-list { list-style: none; margin: 0; padding: 0; }
.x-dr-item { display: grid; gap: var(--x-sp-1); padding: var(--x-sp-3) 0; border-top: var(--x-border); min-width: 0; break-inside: avoid; }
.x-dr-item:first-child { border-top: 0; padding-top: 0; }
.x-dr-item:last-child { padding-bottom: 0; }
.x-dr-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--x-sp-2) var(--x-sp-3); }
.x-dr-item-title { margin: 0; font-size: var(--x-fs-md); font-weight: 600; overflow-wrap: anywhere; }
.x-dr-item-text { margin: 0; color: var(--x-ink-2); overflow-wrap: anywhere; }
.x-dr-item-text p { margin: 0 0 var(--x-sp-1); }
.x-dr-checkin { margin: 0; font-size: var(--x-fs-lg); font-weight: 600; }
@media (max-width: 640px) { .x-dr-level { grid-template-columns: minmax(0, 1fr); gap: var(--x-sp-3); } }
.x-dr-scale { padding-bottom: var(--x-sp-3); margin-bottom: var(--x-sp-3); border-bottom: var(--x-border); }
.x-steps-list .x-step-title { font-size: var(--x-fs-md); }
