/* =============================================================================
   PVV Management System — Design System (Slice 0.5, premium pass, ADR-078)

   "Navy and paper": a deep PVV-navy navigation column beside a quiet, cool
   paper canvas. White surfaces hold the work. Typography carries hierarchy;
   colour is reserved for meaning.

   Brand source: policeveteransvic.org.au Elementor global kit.
     PVV blue  #08549C  primary actions, links, selection, focus
     PVV navy  #003160  navigation column, identity
     PVV orange #F9B61A  a single accent: the active-navigation mark, the
                         environment ribbon and small brand flourishes only

   Rules:
   - Templates consume tokens/components only. No hex values or ad-hoc spacing
     in templates, and no inline styles (strict CSP).
   - Hairlines and surface changes before shadows. Shadows are whisper-quiet
     on surfaces and stronger only on overlays.
   - Orange is never text, never a large surface, never a warning colour.
   - Red only for real error, destructive or high-risk states.
   - State is never colour alone: every status carries text.
   ========================================================================== */

@layer tokens, reset, base, layout, components, patterns, pages, utilities;

/* ================================================================ tokens == */
@layer tokens {
  @font-face {
    font-family: "Inter var";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-opsz-normal.4b73e2ff3024.woff2") format("woff2-variations"),
         url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2-variations");
  }
  @font-face {
    font-family: "Inter var";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-wght-italic.0a81fe197e0d.woff2") format("woff2-variations");
  }

  :root {
    /* --- Brand: PVV blue (source #08549C; navy #003160) --------------- */
    --blue-25: #f6f9fd;
    --blue-50: #eff5fc;
    --blue-75: #e7f0fa;
    --blue-100: #d9e7f7;
    --blue-200: #b7d0ee;
    --blue-300: #8bb2e0;
    --blue-400: #4c87c9;
    --blue-500: #2b78d0; /* focus ring */
    --blue-600: #08549c; /* PVV brand blue */
    --blue-700: #064680;
    --blue-800: #053a6b;
    --blue-900: #003160; /* PVV brand navy */
    --navy-950: #00213f; /* deepest navigation tone */

    /* --- Brand: PVV orange (source #F9B61A). Accent only. ------------- */
    --orange-50: #fff9eb;
    --orange-100: #fef0cc;
    --orange-200: #fde29c;
    --orange-300: #fbcd5f;
    --orange-400: #f9b61a; /* PVV brand orange */
    --orange-500: #e39d05;
    --orange-700: #875a00;

    /* --- Neutrals: cool slate, faintly blue to sit with PVV blue ------ */
    --gray-0: #ffffff;
    --gray-25: #fafbfc;
    --gray-50: #f5f7fa;
    --gray-75: #eff2f6;
    --gray-100: #e9edf2;
    --gray-150: #e1e6ec;
    --gray-200: #d3dae2;
    --gray-300: #b6c0cb;
    --gray-400: #8a94a2;
    --gray-500: #626e7d;
    --gray-600: #4a5565;
    --gray-700: #353f4c;
    --gray-800: #222a35;
    --gray-900: #151c26;

    /* --- Semantic -------------------------------------------------------- */
    --success-600: #12683c; --success-50: #edf7f1; --success-200: #c2e2ce; --success-dot: #1f9d5b;
    --warning-600: #7a4a00; --warning-50: #fff7e6; --warning-200: #f1d7a1; --warning-dot: #d98a00;
    --danger-600: #b0261e;  --danger-50: #fdf1f0;  --danger-200: #f2c6c2;  --danger-dot: #d9372c;
    --info-600: var(--blue-700); --info-50: var(--blue-50); --info-200: var(--blue-200); --info-dot: var(--blue-500);
    /* Protected (clinical): calm violet, distinct from brand and from semantic states */
    --protected-600: #553a9d; --protected-50: #f6f3fc; --protected-100: #ede7fa; --protected-200: #d9cff3; --protected-dot: #7b5fd1;
    --protected-700: #47308a;

    /* --- Roles ----------------------------------------------------------- */
    --surface: var(--gray-0);
    --surface-canvas: var(--gray-50);
    --surface-subtle: var(--gray-25);
    --surface-muted: var(--gray-75);
    --surface-sunken: var(--gray-75);
    --surface-hover: var(--blue-25);
    --surface-selected: var(--blue-50);
    --surface-sidebar: var(--blue-900);

    --text: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-500);
    --text-disabled: var(--gray-400);
    --text-inverse: var(--gray-0);
    --text-link: var(--blue-600);
    --text-link-hover: var(--blue-800);

    --border: var(--gray-150);        /* surfaces, dividers */
    --border-subtle: var(--gray-100); /* table row rules */
    --border-strong: var(--gray-200);
    --border-control: var(--gray-400);/* form controls: >= 3:1 (WCAG 1.4.11) */
    --border-control-hover: var(--gray-500);

    --accent: var(--blue-600);
    --accent-hover: var(--blue-700);
    --accent-subtle: var(--blue-50);
    --accent-strong-text: var(--blue-700);
    --brand-flourish: var(--orange-400);

    /* --- Navigation column (navy) -------------------------------------- */
    --nav-bg: linear-gradient(180deg, var(--blue-900) 0%, #002a52 55%, var(--navy-950) 100%);
    --nav-column: var(--navy-950);
    --nav-text: rgb(255 255 255 / 0.8);
    --nav-text-strong: var(--gray-0);
    --nav-text-muted: rgb(255 255 255 / 0.58);
    --nav-icon: rgb(255 255 255 / 0.62);
    --nav-hover: rgb(255 255 255 / 0.07);
    --nav-active: rgb(255 255 255 / 0.13);
    --nav-rule: rgb(255 255 255 / 0.1);
    --nav-protected: #c9bbf6;

    /* --- Typography ------------------------------------------------------ */
    --font-sans: "Inter var", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;

    --text-2xs: 0.6875rem;  /* 11 overline */
    --text-xs: 0.75rem;     /* 12 metadata */
    --text-sm: 0.8125rem;   /* 13 secondary, labels, tables */
    --text-base: 0.875rem;  /* 14 body */
    --text-md: 0.9375rem;   /* 15 lead, panel heading */
    --text-lg: 1.125rem;    /* 18 section heading */
    --text-xl: 1.875rem;    /* 30 page and record title */
    --text-2xl: 1.875rem;   /* 30 metric */
    --text-3xl: 2.5rem;     /* 40 lead figure */

    --leading-tight: 1.2;
    --leading-snug: 1.4;
    --leading-normal: 1.55;

    --weight-regular: 420;
    --weight-medium: 530;
    --weight-semibold: 620;
    --weight-bold: 680;

    --tracking-tight: -0.011em;
    --tracking-title: -0.024em;
    --tracking-figure: -0.032em;
    --tracking-caps: 0.075em;

    /* --- Spacing (4px base) --------------------------------------------- */
    --space-0: 0;
    --space-px: 1px;
    --space-0-5: 0.125rem; /* 2 */
    --space-1: 0.25rem;    /* 4 */
    --space-1-5: 0.375rem; /* 6 */
    --space-2: 0.5rem;     /* 8 */
    --space-2-5: 0.625rem; /* 10 */
    --space-3: 0.75rem;    /* 12 */
    --space-4: 1rem;       /* 16 */
    --space-5: 1.25rem;    /* 20 */
    --space-6: 1.5rem;     /* 24 */
    --space-7: 1.75rem;    /* 28 */
    --space-8: 2rem;       /* 32 */
    --space-10: 2.5rem;    /* 40 */
    --space-12: 3rem;      /* 48 */
    --space-16: 4rem;      /* 64 */

    --gutter: var(--space-10);        /* page side padding (desktop) */
    --section-gap: var(--space-10);   /* between page sections */
    --panel-pad: var(--space-5);      /* panel padding */
    --field-gap: var(--space-5);      /* between form fields */

    /* --- Geometry -------------------------------------------------------- */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 999px;

    --border-width: 1px;

    --shadow-xs: 0 1px 2px rgb(15 30 55 / 0.04);
    --shadow-sm: 0 1px 2px rgb(15 30 55 / 0.05), 0 2px 6px -2px rgb(15 30 55 / 0.06);
    --shadow-md: 0 1px 2px rgb(15 30 55 / 0.05), 0 8px 20px -8px rgb(15 30 55 / 0.14);
    --shadow-popover: 0 0 0 1px rgb(15 30 55 / 0.07), 0 12px 32px -8px rgb(15 30 55 / 0.18), 0 2px 6px -2px rgb(15 30 55 / 0.06);
    --shadow-dialog: 0 0 0 1px rgb(15 30 55 / 0.07), 0 28px 56px -16px rgb(15 30 55 / 0.3);

    /* --- Controls --------------------------------------------------------- */
    --control-sm: 1.875rem; /* 30 */
    --control-md: 2.25rem;  /* 36 */
    --control-lg: 2.625rem; /* 42 */
    --touch-min: 2.75rem;   /* 44 on touch layouts */

    /* --- Tables ----------------------------------------------------------- */
    --row-compact: 2.5rem;   /* 40 */
    --row-default: 3rem;     /* 48 */
    --row-comfortable: 3.5rem; /* 56 (two-line rows) */
    --cell-pad-x: 0.875rem;

    /* --- Shell ------------------------------------------------------------ */
    --sidebar-width: 16rem;
    --topbar-height: 3.5rem;
    --content-max: 92rem;
    --env-line: 3px;

    /* --- Environment indicator (non-production): PVV blue ribbon + badge --- */
    --env-ribbon: linear-gradient(90deg,
      var(--blue-900) 0%, var(--blue-700) 18%, var(--blue-600) 40%,
      var(--orange-400) 50%, var(--blue-600) 60%, var(--blue-700) 82%, var(--blue-900) 100%);
    --env-badge-bg: var(--blue-50);
    --env-badge-text: var(--blue-700);
    --env-badge-dot: var(--blue-600);
    --env-badge-border: var(--blue-100);

    /* Victoria Police checker, reduced to a quiet two-tone band */
    --checker: repeating-conic-gradient(rgb(255 255 255 / 0.24) 0 25%, transparent 0 50%) 0 0 / 6px 6px;

    /* --- Focus & motion --------------------------------------------------- */
    --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--blue-500);
    --focus-ring-inset: inset 0 0 0 2px var(--blue-500);
    --focus-ring-nav: 0 0 0 2px var(--orange-300);
    --ease: cubic-bezier(0.2, 0, 0, 1);
    --duration-fast: 100ms;
    --duration: 160ms;
    --duration-slow: 240ms;
  }
}

/* ================================================================= reset == */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd { margin: 0; }
  ul, ol { margin: 0; padding: 0; list-style: none; }
  img, svg { display: block; max-width: 100%; }
  button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
  button { cursor: pointer; }
  table { border-collapse: collapse; border-spacing: 0; width: 100%; }
  dialog { padding: 0; border: 0; color: inherit; }
  fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
  legend { padding: 0; }
  [hidden] { display: none !important; }
}

/* ================================================================== base == */
@layer base {
  html {
    font-family: var(--font-sans);
    font-size: 100%;
    font-optical-sizing: auto;
    font-feature-settings: "cv11", "ss03";
    line-height: var(--leading-normal);
    color: var(--text);
    background: var(--surface-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  body { font-size: var(--text-base); font-weight: var(--weight-regular); min-height: 100vh; }

  h1, h2, h3, h4 { color: var(--text); font-weight: var(--weight-semibold); line-height: var(--leading-tight); text-wrap: balance; }
  p { text-wrap: pretty; }
  strong, b { font-weight: var(--weight-semibold); }
  small { font-size: var(--text-xs); }

  a { color: var(--text-link); text-decoration: none; }
  a:hover { color: var(--text-link-hover); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

  :focus:not(:focus-visible) { outline: none; }
  /* The ring is a box-shadow; the transparent outline becomes the visible
     indicator in forced-colours (Windows High Contrast), which drops shadows. */
  :focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }

  code, kbd, samp { font-family: var(--font-mono); font-size: 0.875em; }
  ::selection { background: var(--blue-100); }

  .visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  }
}

/* ================================================================ layout == */
@layer layout {
  .skip-link {
    position: absolute; left: var(--space-4); top: -100px; z-index: 200;
    padding: var(--space-2) var(--space-4); border-radius: var(--radius);
    background: var(--surface); color: var(--accent-strong-text); font-weight: var(--weight-semibold);
    box-shadow: var(--shadow-popover);
  }
  .skip-link:focus { top: var(--space-3); }

  /* Environment: a narrow ribbon across the top + a quiet label in the header. */
  .env-line {
    position: fixed; inset: 0 0 auto 0; height: var(--env-line); z-index: 120;
    background: var(--env-ribbon);
  }

  .shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    /* The navy column continues below the sticky sidebar on long pages. */
    background: linear-gradient(90deg, var(--nav-column) 0, var(--nav-column) var(--sidebar-width), var(--surface-canvas) var(--sidebar-width));
  }
  .shell--env { padding-top: var(--env-line); }

  /* --- Sidebar (navy) ------------------------------------------------- */
  .sidebar {
    position: sticky; top: 0; align-self: start;
    display: flex; flex-direction: column;
    height: 100vh;
    background: var(--nav-bg);
    color: var(--nav-text);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgb(255 255 255 / 0.18) transparent;
  }
  .shell--env .sidebar { top: var(--env-line); height: calc(100vh - var(--env-line)); }

  .sidebar__brand {
    position: relative;
    display: flex; align-items: center; gap: var(--space-3);
    min-height: 4.25rem;
    padding: var(--space-4) var(--space-5) var(--space-5);
    color: var(--nav-text-strong); text-decoration: none;
  }
  /* The checker: a restrained echo of the Victoria Police band. */
  .sidebar__brand::after {
    content: ""; position: absolute; left: var(--space-5); right: var(--space-5); bottom: 0; height: 6px;
    background: var(--checker);
  }
  .sidebar__brand:hover { text-decoration: none; color: var(--nav-text-strong); }
  .sidebar__brand:focus-visible { box-shadow: var(--focus-ring-nav); border-radius: var(--radius); }
  .sidebar__logo { width: 2.375rem; height: 2.375rem; flex: none; }
  .sidebar__product { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
  .sidebar__product strong { font-size: var(--text-base); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); color: var(--nav-text-strong); }
  .sidebar__product span { margin-top: 2px; font-size: var(--text-xs); color: var(--nav-text-muted); }

  .sidebar__nav { padding: var(--space-4) var(--space-3) var(--space-4); }
  .sidebar__footer {
    margin-top: auto; padding: var(--space-4) var(--space-5) var(--space-5);
    border-top: var(--border-width) solid var(--nav-rule);
    font-size: var(--text-xs); color: var(--nav-text-muted);
  }
  .sidebar__footer p:first-child { font-weight: var(--weight-medium); color: var(--nav-text); letter-spacing: 0.01em; }
  .sidebar__footer p + p { margin-top: var(--space-0-5); }
  .sidebar__footer a, .sidebar__footer .link-quiet { color: var(--nav-text); text-decoration: underline; text-decoration-color: rgb(255 255 255 / 0.3); text-underline-offset: 3px; }
  .sidebar__footer a:hover { color: var(--nav-text-strong); }
  .sidebar__footer a:focus-visible { box-shadow: var(--focus-ring-nav); }

  /* --- Main column ------------------------------------------------------ */
  .main { display: flex; flex-direction: column; min-width: 0; }

  .topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: var(--space-4);
    height: var(--topbar-height);
    padding: 0 var(--gutter);
    background: rgb(255 255 255 / 0.9);
    backdrop-filter: saturate(170%) blur(10px);
    border-bottom: var(--border-width) solid var(--border);
  }
  .shell--env .topbar { top: var(--env-line); }
  /* .topbar__menu / .topbar__logo visibility lives in the pages layer (it must override .btn). */
  .topbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }

  .content {
    width: 100%; max-width: var(--content-max); margin: 0 auto;
    padding: var(--space-8) var(--gutter) var(--space-16);
  }

  /* Centered layout (sign-in, notices, errors) */
  .centered {
    min-height: 100vh; display: grid; place-items: center;
    padding: var(--space-12) var(--space-4);
    background:
      radial-gradient(60rem 30rem at 50% -10%, var(--blue-75), transparent 70%),
      var(--surface-canvas);
  }
  .centered--env { padding-top: calc(var(--space-12) + var(--env-line)); }

  /* --- Responsive shell -------------------------------------------------- */
  .scrim { display: none; }
  @media (max-width: 1280px) {
    :root { --gutter: var(--space-8); --section-gap: var(--space-8); }
  }
  @media (max-width: 1024px) {
    :root { --gutter: var(--space-6); --sidebar-width: 15rem; }
  }
  @media (max-width: 900px) {
    :root { --gutter: var(--space-5); }
    .shell { grid-template-columns: minmax(0, 1fr); background: var(--surface-canvas); }
    .sidebar {
      position: fixed; z-index: 100; top: 0; bottom: 0; left: 0;
      width: min(18rem, 86vw); height: 100dvh;
      transform: translateX(-102%); visibility: hidden;
      transition: transform var(--duration-slow) var(--ease), visibility 0s linear var(--duration-slow);
      box-shadow: var(--shadow-dialog);
    }
    .shell--env .sidebar { top: var(--env-line); height: calc(100dvh - var(--env-line)); }
    /* Closed drawer is hidden from keyboard/screen readers, not just moved off-screen. */
    .shell.is-nav-open .sidebar { transform: none; visibility: visible; transition: transform var(--duration-slow) var(--ease), visibility 0s; }
    .shell.is-nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 90; background: rgb(0 20 40 / 0.4); backdrop-filter: blur(2px); }
    .content { padding-top: var(--space-6); }
  }
  @media (max-width: 640px) {
    :root { --gutter: var(--space-4); --section-gap: var(--space-8); }
    .content { padding-top: var(--space-5); padding-bottom: var(--space-12); }
  }
}

/* ============================================================ components == */
@layer components {
  /* --- Icon --------------------------------------------------------------- */
  .icon {
    width: 1rem; height: 1rem; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  }
  .icon--sm { width: 0.875rem; height: 0.875rem; }
  .icon--lg { width: 1.25rem; height: 1.25rem; }

  /* --- Navigation (sidebar, on navy) -------------------------------------- */
  .nav-group + .nav-group { margin-top: var(--space-4); }
  .nav-group__label {
    padding: 0 var(--space-3) var(--space-1-5);
    font-size: var(--text-2xs); font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--nav-text-muted);
  }
  .nav-item {
    position: relative;
    display: flex; align-items: center; gap: var(--space-3);
    min-height: 2.125rem; padding: var(--space-1-5) var(--space-3);
    border-radius: var(--radius);
    font-size: 0.84375rem; font-weight: var(--weight-medium); color: var(--nav-text); line-height: 1.3;
    text-decoration: none;
    transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
  }
  .nav-item .icon { color: var(--nav-icon); }
  .nav-item:hover { background: var(--nav-hover); color: var(--nav-text-strong); text-decoration: none; }
  .nav-item:hover .icon { color: var(--nav-text-strong); }
  .nav-item:focus-visible { box-shadow: var(--focus-ring-nav); border-radius: var(--radius); }
  .nav-item[aria-current="page"] { background: var(--nav-active); color: var(--nav-text-strong); font-weight: var(--weight-semibold); }
  .nav-item[aria-current="page"] .icon { color: var(--nav-text-strong); }
  /* The one orange mark in the chrome: where you are. */
  .nav-item[aria-current="page"]::before {
    content: ""; position: absolute; left: calc(var(--space-3) * -1); top: 0.5rem; bottom: 0.5rem; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--brand-flourish);
  }
  .nav-item__end { margin-left: auto; display: inline-flex; color: var(--nav-text-muted); }
  .nav-item--protected .nav-item__end { color: var(--nav-protected); }

  /* --- Buttons ----------------------------------------------------------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    height: var(--control-md); padding: 0 var(--space-4);
    border: var(--border-width) solid transparent; border-radius: var(--radius);
    font-size: var(--text-sm); font-weight: var(--weight-medium); line-height: 1; white-space: nowrap;
    text-decoration: none; cursor: pointer; user-select: none;
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
  }
  .btn:hover { text-decoration: none; }
  .btn--primary {
    background: var(--accent); color: var(--text-inverse);
    box-shadow: 0 1px 2px rgb(0 49 96 / 0.24), inset 0 1px 0 rgb(255 255 255 / 0.12);
  }
  .btn--primary:hover { background: var(--accent-hover); color: var(--text-inverse); }
  .btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
  .btn--secondary:hover { background: var(--surface-subtle); border-color: var(--gray-300); color: var(--text); }
  .btn--ghost { background: transparent; color: var(--text-secondary); }
  .btn--ghost:hover { background: var(--gray-100); color: var(--text); }
  .btn--danger { background: var(--surface); color: var(--danger-600); border-color: var(--danger-200); }
  .btn--danger:hover { background: var(--danger-50); color: var(--danger-600); }
  .btn--protected { background: var(--protected-600); color: var(--text-inverse); box-shadow: 0 1px 2px rgb(71 48 138 / 0.24); }
  .btn--protected:hover { background: var(--protected-700); color: var(--text-inverse); }
  .btn--sm { height: var(--control-sm); padding: 0 var(--space-3); font-size: var(--text-xs); gap: var(--space-1-5); }
  .btn--lg { height: var(--control-lg); padding: 0 var(--space-5); font-size: var(--text-base); }
  .btn--block { width: 100%; }
  .btn--icon { width: var(--control-md); padding: 0; }
  .btn--icon.btn--sm { width: var(--control-sm); }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
  .btn-group { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

  .ms-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5px; width: 0.9375rem; height: 0.9375rem; flex: none; }
  .ms-mark span:nth-child(1) { background: #f25022; }
  .ms-mark span:nth-child(2) { background: #7fba00; }
  .ms-mark span:nth-child(3) { background: #00a4ef; }
  .ms-mark span:nth-child(4) { background: #ffb900; }

  /* --- Links -------------------------------------------------------------- */
  .link-quiet { color: var(--text-secondary); }
  .link-quiet:hover { color: var(--text); }
  .link-arrow { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); font-weight: var(--weight-medium); }
  .link-arrow .icon { transition: transform var(--duration) var(--ease); }
  .link-arrow:hover { text-decoration: none; }
  .link-arrow:hover .icon { transform: translateX(2px); }

  /* --- Avatar ------------------------------------------------------------- */
  .avatar {
    display: inline-grid; place-items: center; flex: none;
    width: 1.75rem; height: 1.75rem; border-radius: var(--radius-full);
    background: var(--blue-75); color: var(--blue-800);
    box-shadow: inset 0 0 0 1px rgb(8 84 156 / 0.08);
    font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: 0.02em;
  }
  .avatar--md { width: 2.25rem; height: 2.25rem; font-size: var(--text-xs); }
  .avatar--lg { width: 3.5rem; height: 3.5rem; font-size: var(--text-md); letter-spacing: 0.01em; }
  .avatar--muted { background: var(--gray-100); color: var(--gray-600); box-shadow: none; }

  /* --- Badges, tags, status -------------------------------------------- */
  /* Status = dot + text. The default way to show a state; never colour alone. */
  .status { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); white-space: nowrap; }
  .status::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: var(--radius-full); background: var(--gray-400); flex: none; box-shadow: 0 0 0 3px rgb(138 148 162 / 0.16); }
  .status--success::before { background: var(--success-dot); box-shadow: 0 0 0 3px rgb(31 157 91 / 0.14); }
  .status--warning::before { background: var(--warning-dot); box-shadow: 0 0 0 3px rgb(217 138 0 / 0.16); }
  .status--danger::before { background: var(--danger-dot); box-shadow: 0 0 0 3px rgb(217 55 44 / 0.14); }
  .status--info::before { background: var(--info-dot); box-shadow: 0 0 0 3px rgb(43 120 208 / 0.14); }
  .status--protected::before { background: var(--protected-dot); box-shadow: 0 0 0 3px rgb(123 95 209 / 0.14); }
  .status--brand::before { background: var(--brand-flourish); box-shadow: 0 0 0 3px rgb(249 182 26 / 0.2); }
  .status--muted { color: var(--text-tertiary); font-weight: var(--weight-regular); }

  /* Tag = small tinted label for categories/roles. Use sparingly. */
  .tag {
    display: inline-flex; align-items: center; gap: var(--space-1);
    height: 1.375rem; padding: 0 var(--space-2);
    border-radius: var(--radius-sm); border: var(--border-width) solid var(--border);
    background: var(--surface-subtle); color: var(--text-secondary);
    font-size: var(--text-xs); font-weight: var(--weight-medium); white-space: nowrap; line-height: 1;
  }
  .tag .icon { width: 0.75rem; height: 0.75rem; }
  .tag--accent { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
  .tag--success { background: var(--success-50); border-color: var(--success-200); color: var(--success-600); }
  .tag--warning { background: var(--warning-50); border-color: var(--warning-200); color: var(--warning-600); }
  .tag--danger { background: var(--danger-50); border-color: var(--danger-200); color: var(--danger-600); }
  .tag--protected { background: var(--protected-50); border-color: var(--protected-200); color: var(--protected-600); }
  .tag--outline { background: transparent; }
  .tags { display: flex; flex-wrap: wrap; gap: var(--space-1); }

  /* Clinical theme badges (ADR-108): muted tint, dark text, a dot and always the label (colour is
     never the only signal). Families and values mirror pvv.support.themes.PALETTE. */
  .theme { gap: 0.3rem; }
  .theme__dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; flex: none; background: var(--theme-dot); }
  .theme, .theme-swatch { background: var(--theme-bg); border-color: color-mix(in srgb, var(--theme-dot) 35%, transparent); color: var(--theme-text); }
  .theme-swatch { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 3px; border: var(--border-width) solid; background: var(--theme-dot); vertical-align: -0.1em; }
  .theme--lavender { --theme-bg: #f1eef8; --theme-text: #463a6b; --theme-dot: #8c7bb8; }
  .theme--teal { --theme-bg: #e8f3f2; --theme-text: #1d514d; --theme-dot: #5e9e98; }
  .theme--sage { --theme-bg: #edf3eb; --theme-text: #31503a; --theme-dot: #7fa383; }
  .theme--rose { --theme-bg: #f7ecee; --theme-text: #6a3542; --theme-dot: #b98390; }
  .theme--amber { --theme-bg: #f9f1e1; --theme-text: #62440f; --theme-dot: #c49a4a; }
  .theme--slate { --theme-bg: #ebeff5; --theme-text: #2c405c; --theme-dot: #6f86a6; }
  .theme--violet { --theme-bg: #f2edf7; --theme-text: #4e3866; --theme-dot: #9d86b5; }
  .theme--steel { --theme-bg: #eaf0f4; --theme-text: #2a4859; --theme-dot: #7193a8; }
  .theme--peach { --theme-bg: #faefe8; --theme-text: #683d27; --theme-dot: #d2a083; }
  .theme--grey { --theme-bg: #f0f1f2; --theme-text: #3b434c; --theme-dot: #8e959e; }
  .theme--coral { --theme-bg: #f7edeb; --theme-text: #6a3830; --theme-dot: #c78e84; }
  .theme--indigo { --theme-bg: #edeef8; --theme-text: #333a72; --theme-dot: #7f86c2; }
  .theme--sand { --theme-bg: #f4f0e6; --theme-text: #544629; --theme-dot: #b8a47a; }
  .theme--burgundy { --theme-bg: #f5ebed; --theme-text: #652232; --theme-dot: #a3586a; }
  .theme--olive { --theme-bg: #f1f2e6; --theme-text: #454b24; --theme-dot: #9aa06a; }
  .theme--stone { --theme-bg: #f2f0ed; --theme-text: #4a4037; --theme-dot: #a39382; }
  .theme--neutral { --theme-bg: #f1f1f1; --theme-text: #424242; --theme-dot: #9a9a9a; }

  /* Environment label (header) */
  .env-label {
    display: inline-flex; align-items: center; gap: var(--space-1-5);
    height: 1.625rem; padding: 0 var(--space-2-5);
    border-radius: var(--radius-full); border: var(--border-width) solid var(--env-badge-border);
    background: var(--env-badge-bg); color: var(--env-badge-text);
    font-size: var(--text-xs); font-weight: var(--weight-semibold); white-space: nowrap;
  }
  .env-label::before { content: ""; width: 0.4375rem; height: 0.4375rem; border-radius: var(--radius-full); background: var(--brand-flourish); box-shadow: 0 0 0 2px var(--surface); }

  /* --- Kbd ---------------------------------------------------------------- */
  .kbd {
    display: inline-grid; place-items: center; min-width: 1.375rem; height: 1.375rem; padding: 0 var(--space-1);
    border: var(--border-width) solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-xs);
    background: var(--surface); color: var(--text-tertiary); font-family: var(--font-sans); font-size: var(--text-2xs); font-weight: var(--weight-medium);
  }

  /* --- Search ------------------------------------------------------------- */
  .search { position: relative; width: 100%; max-width: 32rem; }
  .search .icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
  .search input {
    width: 100%; height: var(--control-md); padding: 0 2.75rem 0 2.25rem;
    border: var(--border-width) solid transparent; border-radius: var(--radius);
    background: var(--gray-75); font-size: var(--text-sm); color: var(--text);
    transition: border-color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
  }
  .search input::placeholder { color: var(--text-tertiary); }
  .search input:hover { background: var(--gray-100); }
  .search input:focus { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--blue-100); }
  .search .kbd { position: absolute; right: var(--space-2); top: 50%; transform: translateY(-50%); }
  .search--toolbar { max-width: 20rem; }
  .search--toolbar input { background: var(--surface); border-color: var(--border-strong); padding-right: var(--space-3); }
  .search--toolbar input:hover { background: var(--surface); border-color: var(--gray-300); }

  /* --- Menu / popover (details-based) ------------------------------------ */
  .menu { position: relative; }
  .menu > summary { list-style: none; cursor: pointer; }
  .menu > summary::-webkit-details-marker { display: none; }
  .menu__panel {
    position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 80; min-width: 15rem;
    padding: var(--space-1-5); border-radius: var(--radius-md);
    background: var(--surface); box-shadow: var(--shadow-popover);
  }
  .menu__section { padding: var(--space-2) var(--space-2) var(--space-3); border-bottom: var(--border-width) solid var(--border-subtle); margin-bottom: var(--space-1); }
  .menu__item {
    display: flex; align-items: center; gap: var(--space-2-5); width: 100%;
    min-height: 2.125rem; padding: var(--space-1-5) var(--space-2-5); border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--text); font-size: var(--text-sm); text-align: left; text-decoration: none;
  }
  .menu__item .icon { color: var(--text-tertiary); }
  .menu__item:hover { background: var(--gray-75); color: var(--text); text-decoration: none; }
  .menu__item:focus-visible { box-shadow: var(--focus-ring-inset); }

  .account-trigger { display: flex; align-items: center; gap: var(--space-2-5); height: 2.5rem; padding: 0 var(--space-2) 0 var(--space-1); border-radius: var(--radius-full); }
  .account-trigger:hover { background: var(--gray-75); }
  .account-trigger .avatar { background: linear-gradient(160deg, var(--blue-600), var(--blue-900)); color: var(--text-inverse); box-shadow: none; }
  .account-trigger__text { display: flex; flex-direction: column; line-height: 1.25; }
  .account-trigger__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); }
  .account-trigger__role { font-size: var(--text-xs); color: var(--text-tertiary); }
  .account-trigger .icon { color: var(--text-tertiary); }

  /* --- Panel (white surface on the paper canvas) -------------------------- */
  .panel { background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
  .panel__header {
    display: flex; align-items: center; gap: var(--space-3); min-height: 3.25rem;
    padding: var(--space-3) var(--panel-pad); border-bottom: var(--border-width) solid var(--border-subtle);
  }
  .panel__title { font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
  .panel__subtitle { font-size: var(--text-sm); color: var(--text-tertiary); }
  .panel__aside { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
  .panel__body { padding: var(--panel-pad); }
  .panel__body--flush { padding: 0; }
  .panel__footer { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--panel-pad); border-top: var(--border-width) solid var(--border-subtle); font-size: var(--text-sm); color: var(--text-secondary); }
  .panel--subtle { background: var(--surface-subtle); box-shadow: none; }
  .panel > :first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
  .panel > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }

  /* Section = unboxed group with a heading */
  .section + .section { margin-top: var(--section-gap); }
  .section__header { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin-bottom: var(--space-3); }
  .section__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
  .section__desc { font-size: var(--text-sm); color: var(--text-tertiary); }
  .section__aside { margin-left: auto; }

  /* --- Callout ------------------------------------------------------------ */
  .callout {
    display: flex; gap: var(--space-3); align-items: flex-start;
    padding: var(--space-3) var(--space-4); border-radius: var(--radius);
    border: var(--border-width) solid var(--border); background: var(--surface);
    font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--text-secondary);
  }
  .callout > .icon { margin-top: 0.1875rem; color: var(--text-tertiary); }
  .callout strong { color: var(--text); }
  .callout--info { background: var(--blue-25); border-color: var(--blue-100); color: var(--gray-700); }
  .callout--info > .icon { color: var(--blue-600); }
  .callout--info strong { color: var(--blue-900); }
  .callout--success { background: var(--success-50); border-color: var(--success-200); color: var(--success-600); }
  .callout--success > .icon { color: var(--success-600); }
  .callout--warning { background: var(--warning-50); border-color: var(--warning-200); color: var(--warning-600); }
  .callout--warning > .icon { color: var(--warning-600); }
  .callout--danger { background: var(--danger-50); border-color: var(--danger-200); color: var(--danger-600); }
  .callout--danger > .icon { color: var(--danger-600); }
  .callout--protected { background: var(--protected-50); border-color: var(--protected-200); color: var(--protected-600); }
  .callout--protected > .icon { color: var(--protected-600); }
  .callout--protected strong, .callout--danger strong, .callout--warning strong, .callout--success strong { color: inherit; }
  .messages { display: grid; gap: var(--space-2); margin-bottom: var(--space-6); }

  /* --- Tabs --------------------------------------------------------------- */
  .tabs { display: flex; gap: var(--space-6); border-bottom: var(--border-width) solid var(--border); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    position: relative; display: inline-flex; align-items: center; gap: var(--space-1-5);
    height: 2.75rem; padding: 0; border: 0; background: none; flex: none;
    font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-tertiary); white-space: nowrap; text-decoration: none;
  }
  .tab:hover { color: var(--text); text-decoration: none; }
  .tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--text); font-weight: var(--weight-semibold); }
  .tab[aria-selected="true"]::after, .tab[aria-current="page"]::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent);
  }
  .tab:focus-visible { box-shadow: var(--focus-ring-inset); border-radius: var(--radius-xs); }
  .tab__count {
    display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.125rem; padding: 0 var(--space-1-5);
    border-radius: var(--radius-full); background: var(--gray-100);
    font-size: var(--text-2xs); font-weight: var(--weight-semibold); color: var(--text-secondary); font-variant-numeric: tabular-nums;
  }
  .tab[aria-selected="true"] .tab__count, .tab[aria-current="page"] .tab__count { background: var(--blue-75); color: var(--blue-700); }

  .segmented { display: inline-flex; padding: 3px; border-radius: var(--radius); background: var(--gray-100); gap: 2px; }
  .segmented__item {
    height: 1.75rem; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent;
    font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary);
  }
  .segmented__item:hover { color: var(--text); }
  .segmented__item[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

  /* --- Forms ---------------------------------------------------------------- */
  .field { display: grid; gap: var(--space-1-5); }
  .field + .field { margin-top: var(--field-gap); }
  .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--field-gap); }
  .field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: var(--field-gap); }
  .field-row > .field + .field { margin-top: 0; } /* fields side by side share a top edge */
  .label { display: flex; align-items: baseline; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); }
  .label__optional { font-weight: var(--weight-regular); color: var(--text-tertiary); font-size: var(--text-xs); }
  .help { font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--text-tertiary); }
  .field-error { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--danger-600); font-weight: var(--weight-medium); }

  .control {
    width: 100%; height: var(--control-md); padding: 0 var(--space-3);
    border: var(--border-width) solid var(--border-control); border-radius: var(--radius);
    background: var(--surface); color: var(--text); font-size: var(--text-base);
    box-shadow: inset 0 1px 1px rgb(15 30 55 / 0.03);
    transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
  }
  .control::placeholder { color: var(--text-disabled); }
  .control:hover { border-color: var(--border-control-hover); }
  .control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--blue-100); }
  .control:disabled { background: var(--surface-muted); color: var(--text-disabled); border-color: var(--border-strong); cursor: not-allowed; }
  .control[aria-invalid="true"] { border-color: var(--danger-600); }
  .control[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-50); }
  textarea.control { height: auto; min-height: 6.5rem; padding: var(--space-2-5) var(--space-3); line-height: var(--leading-normal); resize: vertical; }
  select.control {
    appearance: none; padding-right: 2rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--gray-500) 50%), linear-gradient(135deg, var(--gray-500) 50%, transparent 50%);
    background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  }
  .control--mono { font-family: var(--font-mono); font-size: var(--text-sm); }

  .input-affix { position: relative; }
  .input-affix .icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
  .input-affix .control { padding-left: 2.25rem; }

  /* Searchable select (combobox) */
  .combobox { position: relative; }
  .combobox__list {
    position: absolute; left: 0; right: 0; top: calc(100% + var(--space-1)); z-index: 30;
    padding: var(--space-1); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-popover);
  }
  .combobox__option { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2-5); border-radius: var(--radius-sm); font-size: var(--text-sm); }
  .combobox__option[aria-selected="true"] { background: var(--blue-50); color: var(--blue-700); }
  .combobox__option small { margin-left: auto; color: var(--text-tertiary); }
  .combobox--static .combobox__list { position: static; margin-top: var(--space-1); }

  /* Checkbox / radio / switch */
  .choice { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); font-size: var(--text-base); color: var(--text); cursor: pointer; }
  .choice + .choice { margin-top: var(--space-2-5); }
  /* The hint sits under the label text, aligned past the 1rem control and its gap. */
  .choice__hint { display: block; flex-basis: 100%; margin-top: calc(var(--space-1) * -1); padding-left: 1.5rem; font-size: var(--text-xs); color: var(--text-tertiary); }
  .choice input[type="checkbox"], .choice input[type="radio"] {
    appearance: none; flex: none; margin: 0.15rem 0 0;
    width: 1rem; height: 1rem; border: var(--border-width) solid var(--border-control); background: var(--surface);
    display: grid; place-items: center;
    transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
  }
  .choice input[type="checkbox"] { border-radius: var(--radius-xs); }
  .choice input[type="radio"] { border-radius: var(--radius-full); }
  .choice input:hover { border-color: var(--border-control-hover); }
  .choice input:checked { background: var(--accent); border-color: var(--accent); }
  .choice input[type="checkbox"]:checked::after { content: ""; width: 0.55rem; height: 0.3rem; border: 2px solid var(--text-inverse); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
  .choice input[type="radio"]:checked::after { content: ""; width: 0.375rem; height: 0.375rem; border-radius: var(--radius-full); background: var(--text-inverse); }
  .choice input:focus-visible { box-shadow: var(--focus-ring); }
  .choice input:disabled { background: var(--surface-muted); border-color: var(--border-strong); }

  .switch { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); cursor: pointer; }
  .switch input { appearance: none; position: relative; width: 2.125rem; height: 1.25rem; margin: 0; border-radius: var(--radius-full); background: var(--gray-300); transition: background var(--duration) var(--ease); }
  .switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 1rem; height: 1rem; border-radius: var(--radius-full); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--duration) var(--ease); }
  .switch input:checked { background: var(--accent); }
  .switch input:checked::after { transform: translateX(0.875rem); }
  .switch input:focus-visible { box-shadow: var(--focus-ring); }

  /* Sensitive / protected field value */
  .sensitive { display: inline-flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
  .sensitive__value { font-size: var(--text-sm); letter-spacing: 0.12em; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .sensitive__note { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--protected-600); }

  /* Form layout: section title + description beside the fields */
  .form-section {
    display: grid; grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); gap: var(--space-8);
    padding: var(--space-8) 0; border-top: var(--border-width) solid var(--border);
  }
  .form-section:first-of-type { border-top: 0; padding-top: 0; }
  .form-section__title { font-size: var(--text-md); font-weight: var(--weight-semibold); }
  .form-section__desc { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--text-tertiary); }
  .form-section__fields { max-width: 40rem; padding: var(--space-6); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .form-actions {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2);
    padding: var(--space-3) 0; margin-top: var(--space-4);
    background: linear-gradient(to top, var(--surface-canvas) 70%, rgb(245 247 250 / 0));
    border-top: var(--border-width) solid var(--border);
  }
  /* Small action forms inside a record (approve, attest, review): actions stay in place. */
  .form--compact .form-actions { position: static; background: none; }
  .form-actions__start { margin-right: auto; display: flex; align-items: center; font-size: var(--text-sm); color: var(--text-tertiary); }
  @media (max-width: 800px) { .form-section { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); } .form-section__fields { padding: var(--space-5) var(--space-4); } }

  /* --- Data: definition list ------------------------------------------------ */
  /* Default: an inset grouped list (a white sheet of label/value rows). Inside
     panels, rails, drawers and entries it falls back to plain rows. */
  .dl {
    display: grid; grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr); column-gap: var(--space-6);
    padding: var(--space-1) var(--space-5);
    border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs);
  }
  .dl dt, .dl dd { padding: var(--space-3) 0; border-bottom: var(--border-width) solid var(--border-subtle); font-size: var(--text-sm); }
  .dl dt { color: var(--text-tertiary); }
  .dl dd { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
  .dl > :nth-last-child(-n + 2) { border-bottom: 0; }
  :where(.panel, .record-rail, .dash-rail, .drawer, .dialog, .entry, .match, .split-sections .section, .vote-card) .dl,
  .dl--plain, .dl--stacked {
    padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  }
  /* Stacked variant for narrow columns (record rails): label above value. */
  .dl--stacked, .record-rail .dl { grid-template-columns: minmax(0, 1fr); }
  .dl--stacked dt, .record-rail .dl dt { padding-bottom: 0; border-bottom: 0; font-size: var(--text-xs); }
  .dl--stacked dd, .record-rail .dl dd { padding-top: var(--space-0-5); }
  .dl--stacked > :nth-last-child(2), .record-rail .dl > :nth-last-child(2) { border-bottom: 0; }
  @media (max-width: 640px) {
    .dl { grid-template-columns: minmax(0, 1fr); }
    .dl dt { padding-bottom: 0; border-bottom: 0; font-size: var(--text-xs); }
    .dl dd { padding-top: var(--space-0-5); }
  }

  .meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1-5) var(--space-5); font-size: var(--text-sm); color: var(--text-secondary); }
  .meta__item { display: inline-flex; align-items: center; gap: var(--space-1-5); }
  .meta__item .icon { color: var(--text-tertiary); }
  .meta__label { color: var(--text-tertiary); }

  /* References: tabular Inter, never a typewriter face. */
  .ref {
    font-family: var(--font-sans); font-size: 0.78125rem; font-weight: var(--weight-medium);
    letter-spacing: 0.005em;
    color: var(--text-secondary); white-space: nowrap;
  }
  .num { font-variant-numeric: tabular-nums; }

  /* --- Metrics strip ------------------------------------------------------- */
  /* One white strip of figures divided by hairlines (never a row of boxes).
     Inside a panel the strip lays out by the panel's own width. */
  .panel:has(> .metrics) { container-type: inline-size; overflow: hidden; }
  .metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--border-subtle); gap: 1px; }
  .metric { position: relative; display: flex; flex-direction: column; padding: var(--space-4) var(--space-5) var(--space-5); background: var(--surface); min-width: 0; }
  .metric:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* Wide: one row; label, figure and hint rows line up across the strip (subgrid). */
  @container (min-width: 36rem) {
    .metrics { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
    .metric { display: grid; grid-row: span 4; grid-template-rows: subgrid; align-content: start; row-gap: 0; }
    .metric__value { align-self: end; }
    .metric:last-child:nth-child(odd) { grid-column: auto; }
    .metrics:has(> :nth-child(6)) .metric { padding-left: var(--space-4); padding-right: var(--space-4); }
  }
  .metric__label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary); line-height: var(--leading-snug); }
  .metric__value {
    padding-top: var(--space-2);
    font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-figure); line-height: 1.05;
    font-variant-numeric: tabular-nums; color: var(--text);
  }
  .metrics:has(> :nth-child(6)) .metric__value { font-size: 1.625rem; }
  .metric__value--empty { color: var(--gray-300); }
  .metric__hint { margin-top: var(--space-1-5); font-size: var(--text-xs); color: var(--text-tertiary); }
  /* An alert figure is marked by a red rule, a red dot in its label and red figures: never colour alone, the label says what it is. */
  .metric:has(.metric__value--alert) { box-shadow: inset 0 2px 0 var(--danger-dot); }
  .metric:has(.metric__value--alert) .metric__label::before { content: ""; display: inline-block; width: 0.4375rem; height: 0.4375rem; margin-right: var(--space-1-5); border-radius: var(--radius-full); background: var(--danger-dot); vertical-align: 0.08em; }

  /* Story strip: one lead figure, then the figures that explain it. */
  @container (min-width: 36rem) {
    .metrics--story { grid-template-columns: minmax(0, 1.55fr); }
  }
  .metrics--story > .metric:first-child { background: linear-gradient(160deg, var(--blue-25), var(--surface) 70%); }
  .metrics--story > .metric:first-child .metric__label { color: var(--blue-900); font-weight: var(--weight-semibold); }
  .metrics--story > .metric:first-child .metric__value { font-size: var(--text-3xl); color: var(--blue-900); }
  .metrics--story > .metric:first-child .metric__hint { color: var(--text-secondary); }
  .metrics--story > .metric:not(:first-child) .metric__value { font-size: 1.625rem; }
  /* Narrow strips: figures step down so text values ("Needs review") stay in proportion. */
  @container (max-width: 35.99rem) {
    .metric__value, .metrics:has(> :nth-child(6)) .metric__value, .metrics--story > .metric:not(:first-child) .metric__value { font-size: 1.375rem; letter-spacing: -0.02em; }
    .metrics--story > .metric:first-child .metric__value { font-size: 2.25rem; }
  }
  @container (max-width: 35.99rem) {
    .metrics--story > .metric:first-child { grid-column: 1 / -1; }
    .metrics--story > .metric:last-child:nth-child(odd) { grid-column: auto; }
    .metrics--story > .metric:last-child:nth-child(even) { grid-column: 1 / -1; }
  }
  /* A small trend inside a metric (inline SVG; geometry from the view). */
  .metric__spark { display: block; width: 100%; max-width: 12rem; height: 2rem; margin-top: var(--space-3); overflow: visible; }
  .metric__spark rect { fill: var(--blue-200); }
  .metric__spark rect.is-current { fill: var(--accent); }
  .metric__spark rect.is-partial { fill: var(--blue-100); }

  /* --- Empty state ----------------------------------------------------------- */
  .empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-12) var(--space-6); }
  .empty__icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-bottom: var(--space-2); border-radius: var(--radius-md); border: var(--border-width) solid var(--border); background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
  .empty__title { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text); }
  .empty__text { max-width: 30rem; font-size: var(--text-sm); color: var(--text-tertiary); }
  .empty--compact { padding: var(--space-8) var(--space-4); }
  .checklist { display: grid; gap: var(--space-1-5); margin-top: var(--space-2); text-align: left; font-size: var(--text-sm); color: var(--text-secondary); }
  .checklist li { display: flex; gap: var(--space-2); align-items: flex-start; }
  .checklist .icon { margin-top: 0.2rem; color: var(--accent); }

  /* --- Skeleton ---------------------------------------------------------------- */
  .skeleton { display: block; height: 0.75rem; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-75) 37%, var(--gray-100) 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; }
  .skeleton--title { height: 1.125rem; width: 40%; }
  .skeleton--line { width: 100%; }
  .skeleton--short { width: 60%; }
  .skeleton--avatar { width: 1.75rem; height: 1.75rem; border-radius: var(--radius-full); }
  @keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

  /* --- Dialog & drawer (native <dialog>) ------------------------------------ */
  .dialog {
    width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem);
    border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-dialog);
  }
  .dialog::backdrop { background: rgb(0 20 40 / 0.36); backdrop-filter: blur(2px); }
  .dialog__header { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-6) var(--space-6) 0; }
  .dialog__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
  .dialog__body { padding: var(--space-3) var(--space-6) var(--space-6); font-size: var(--text-base); color: var(--text-secondary); }
  .dialog__footer { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-6); border-top: var(--border-width) solid var(--border-subtle); background: var(--surface-subtle); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .dialog__close { margin-left: auto; }

  .drawer {
    position: fixed; inset: 0 0 0 auto; margin: 0 0 0 auto;
    width: min(30rem, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
    background: var(--surface); box-shadow: var(--shadow-dialog);
  }
  .drawer::backdrop { background: rgb(0 20 40 / 0.28); }
  .drawer[open] { display: flex; flex-direction: column; animation: drawer-in var(--duration-slow) var(--ease); }
  .drawer__header { display: flex; align-items: center; gap: var(--space-3); height: var(--topbar-height); padding: 0 var(--space-5); border-bottom: var(--border-width) solid var(--border); }
  .drawer__title { font-size: var(--text-md); font-weight: var(--weight-semibold); }
  .drawer__body { flex: 1; overflow-y: auto; padding: var(--space-5); }
  .drawer__footer { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-top: var(--border-width) solid var(--border); }
  @keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* --- Pagination ----------------------------------------------------------- */
  .pagination { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-secondary); }
  .pagination__status { margin-right: auto; font-variant-numeric: tabular-nums; }
  .pagination__pages { display: flex; gap: var(--space-0-5); }
  .page-link { display: inline-grid; place-items: center; min-width: var(--control-sm); height: var(--control-sm); padding: 0 var(--space-1-5); border-radius: var(--radius-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .page-link:hover { background: var(--gray-100); color: var(--text); text-decoration: none; }
  .page-link[aria-current="page"] { background: var(--blue-50); color: var(--blue-700); font-weight: var(--weight-semibold); }
}

/* ============================================================== patterns == */
@layer patterns {
  /* --- Page header ------------------------------------------------------------ */
  /* Eyebrow (module or breadcrumb) / title / one-line purpose / actions at the right. */
  .page-header { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4) var(--space-6); margin-bottom: var(--space-8); }
  .page-header__main { flex: 1 1 28rem; min-width: 0; }
  .breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin-bottom: var(--space-3); font-size: var(--text-sm); color: var(--text-tertiary); }
  .breadcrumb a { color: var(--text-secondary); font-weight: var(--weight-medium); }
  .breadcrumb a:hover { color: var(--accent); text-decoration: none; }
  .breadcrumb .icon { width: 0.75rem; height: 0.75rem; color: var(--gray-300); }
  .page-title { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); line-height: var(--leading-tight); }
  .page-desc { margin-top: var(--space-2); max-width: 46rem; font-size: var(--text-md); line-height: var(--leading-normal); color: var(--text-secondary); }
  .page-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  @media (max-width: 640px) {
    .page-header { margin-bottom: var(--space-6); gap: var(--space-4); }
    .page-header__main { flex-basis: 100%; }
    .page-header__actions { width: 100%; }
    .page-header__actions > .btn { flex: 1 1 auto; }
    .page-title { font-size: 1.375rem; }
    .page-desc { font-size: var(--text-base); }
  }

  /* --- Register (table pattern) --------------------------------------------------- */
  .register { border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); }
  .register__views { display: flex; align-items: center; gap: var(--space-5); padding: 0 var(--space-5); border-bottom: var(--border-width) solid var(--border); }
  .register__views .tabs { border-bottom: 0; gap: var(--space-5); }
  .register__views .tab { font-size: var(--text-sm); height: 2.875rem; }
  /* Register views: full labels on wider screens; on phones three equal tabs with short labels,
     all visible without scrolling. The full label stays the accessible name. */
  .tab__short { display: none; }
  /* Support Case sections (C3): tabs on tablet and desktop; a labelled selector on phones. */
  .section-select { display: none; }
  @media (max-width: 640px) {
    .record-tabs--case { display: none; }
    .section-select { display: block; margin: var(--space-4) 0 var(--space-5); }
    .section-select__row { display: flex; gap: var(--space-2); margin-top: var(--space-1-5); }
    .section-select__row .control { flex: 1 1 auto; min-width: 0; min-height: 2.75rem; }
    .section-select__row .btn { min-height: 2.75rem; }
    .section-select__current { margin-top: var(--space-1-5); }
  }
  @media (max-width: 640px) {
    .register__views:has(> .tabs--views) { flex-wrap: wrap; gap: 0; padding: 0; }
    .tabs--views { flex: 1 1 100%; gap: 0; overflow: visible; }
    .tabs--views .tab { flex: 1 1 0; justify-content: center; min-width: 0; min-height: 2.875rem; padding-inline: var(--space-2); white-space: nowrap; }
    .tabs--views .tab__long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .tabs--views .tab__short { display: inline; }
    .register__views:has(> .tabs--views) > .menu { margin-left: auto; padding: var(--space-1) var(--space-3); }
  }
  .register__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-5); border-bottom: var(--border-width) solid var(--border); background: var(--surface-subtle); }
  .register__toolbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
  .register__toolbar select.control { width: auto; min-width: 12rem; font-size: var(--text-sm); border-color: var(--border-strong); }
  /* Register: secondary filters and extra columns, folded below the toolbar (ADR-089). */
  .register__filters { flex-basis: 100%; }
  .register__note { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2-5) var(--space-5); border-bottom: var(--border-width) solid var(--border-subtle); background: var(--blue-25); font-size: var(--text-sm); color: var(--text-secondary); }
  .register__note strong { color: var(--text); }
  .register__legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-5); border-bottom: var(--border-width) solid var(--border-subtle); }
  .activity-key { display: inline-flex; align-items: center; gap: var(--space-1-5); font-weight: var(--weight-medium); color: var(--text); }
  .activity-key::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: var(--radius-full); background: var(--gray-300); }
  .activity-key--approaching::before { background: var(--warning-dot); }
  .activity-key--attention::before { background: var(--danger-dot); }
  .register__filters > summary { list-style: none; cursor: pointer; }
  .register__filters > summary::-webkit-details-marker { display: none; }
  .register__filters[open] > summary { margin-bottom: var(--space-3); }
  .register__filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--space-3); align-items: end; }
  .register__filter-grid .field { margin: 0; }
  .register__filter-grid select.control, .register__filter-grid input.control { width: 100%; min-width: 0; }
  .register__filters fieldset { border: 0; padding: 0; margin-inline: 0; }
  .filter-chip {
    display: inline-flex; align-items: center; gap: var(--space-1); height: var(--control-sm); padding: 0 var(--space-2-5);
    border: var(--border-width) solid var(--border-strong); border-radius: var(--radius-full); background: var(--surface);
    font-size: var(--text-xs); color: var(--text-secondary); font-weight: var(--weight-medium);
  }
  .filter-chip .icon { width: 0.8125rem; height: 0.8125rem; color: var(--text-tertiary); }
  .filter-chip:hover { border-color: var(--gray-300); color: var(--text); }
  .filter-chip--active { border-color: var(--blue-200); background: var(--blue-50); color: var(--blue-700); }
  .filter-chip--active .icon { color: var(--blue-600); }
  .filter-chip__value { color: var(--text); font-weight: var(--weight-semibold); }
  .filter-chip--active .filter-chip__value { color: var(--blue-800); }
  .register__bulk { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-5); background: var(--blue-50); border-bottom: var(--border-width) solid var(--blue-100); font-size: var(--text-sm); color: var(--blue-800); }
  .register__footer { display: flex; align-items: center; padding: var(--space-2-5) var(--space-5); border-top: var(--border-width) solid var(--border-subtle); }
  /* position: relative makes the scroll area the containing block for absolutely
     positioned descendants (e.g. .visually-hidden cell text); otherwise they escape
     the horizontal scroll and widen the whole page. */
  .register, .register__scroll { position: relative; }
  .register__scroll {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    /* Scroll shadows: a soft edge shows there is more table to the side. */
    background:
      linear-gradient(to right, var(--surface) 30%, rgb(255 255 255 / 0)) left / 2.5rem 100% no-repeat local,
      linear-gradient(to left, var(--surface) 30%, rgb(255 255 255 / 0)) right / 2.5rem 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgb(15 30 55 / 0.1), transparent) left / 0.75rem 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgb(15 30 55 / 0.1), transparent) right / 0.75rem 100% no-repeat scroll;
  }
  .register__empty { border-top: var(--border-width) solid var(--border-subtle); }

  /* Tabular figures only where numbers align: Inter's tnum also widens hyphens. */
  .table { font-size: var(--text-sm); }
  .table .col-num { font-variant-numeric: tabular-nums; }
  .table th {
    height: 2.5rem; padding: 0 var(--cell-pad-x); text-align: left; white-space: nowrap;
    font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); letter-spacing: 0.01em;
    background: var(--surface); border-bottom: var(--border-width) solid var(--border);
  }
  .table th:first-child, .table td:first-child { padding-left: var(--space-5); }
  .table th:last-child, .table td:last-child { padding-right: var(--space-5); }
  .table td { height: var(--row-default); padding: var(--space-2-5) var(--cell-pad-x); border-bottom: var(--border-width) solid var(--border-subtle); vertical-align: middle; color: var(--text); }
  .table tbody tr:last-child td { border-bottom: 0; }
  .table tbody tr { transition: background var(--duration-fast) var(--ease); }
  .table--interactive tbody tr:hover td { background: var(--surface-hover); cursor: pointer; }
  .table tbody tr[aria-selected="true"] td { background: var(--blue-25); }
  .table tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
  .table--compact td { height: var(--row-compact); padding-top: var(--space-1-5); padding-bottom: var(--space-1-5); }
  .table .col-check { width: 2.75rem; padding-right: 0; }
  .table .col-num { text-align: right; }
  .table .col-actions { width: 3rem; text-align: right; }
  .table .muted { color: var(--text-tertiary); }
  .sort { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0; border: 0; background: none; font: inherit; color: inherit; }
  .sort:hover { color: var(--text); }
  .sort .icon { width: 0.75rem; height: 0.75rem; opacity: 0.6; }
  .sort[aria-sort="ascending"], .sort[aria-sort="descending"] { color: var(--text); }
  .sort[aria-sort="ascending"] .icon, .sort[aria-sort="descending"] .icon { opacity: 1; color: var(--accent); }
  .cell-primary { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
  .cell-primary__text { min-width: 0; }
  .cell-primary__title { display: block; font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  a.cell-primary__title:hover { color: var(--accent); text-decoration: none; }
  .cell-primary__sub { display: block; margin-top: 1px; font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table__group td { height: 2.25rem; background: var(--surface-subtle); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-secondary); letter-spacing: 0.01em; }
  .table__empty td { height: auto; padding: 0; }
  .table--matrix th, .table--matrix td { text-align: center; }
  .table--matrix th:first-child, .table--matrix td:first-child { text-align: left; }
  .table--matrix th { white-space: normal; vertical-align: bottom; padding-top: var(--space-2-5); padding-bottom: var(--space-2-5); height: auto; line-height: 1.35; min-width: 6.5rem; }
  .table--matrix td:first-child { min-width: 19rem; }
  .mark { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: var(--radius-full); background: var(--accent); }
  .mark--protected { background: var(--protected-dot); }

  /* Responsive registers (<= 640px). One mechanism, four shapes chosen by the markup:
     - record registers: an optional small eyebrow (the reference), the row's title as a line of
       its own, then the remaining facts flowing inline like a sentence;
     - transaction/history tables: the same, with the amount or status pinned top-right
       (.stack-end, or a trailing numeric column);
     - document and administrative tables: name as title, facts inline;
     - comparison tables (.table--matrix) and opt-outs (.table--scroll): keep their columns
       and scroll sideways with the first column pinned.
     Plain values get their column heading as a quiet inline label (data-label, set by app.js
     from <th> or in the template); statuses, tags, avatars and references explain themselves. */
  @media (max-width: 640px) {
    .register .table:not(.table--matrix, .table--scroll) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .register .table:not(.table--matrix, .table--scroll),
    .register .table:not(.table--matrix, .table--scroll) > tbody,
    .register .table:not(.table--matrix, .table--scroll) > tbody > tr { display: block; }
    .register .table:not(.table--matrix, .table--scroll) > tbody > tr {
      position: relative; padding: var(--space-3) var(--space-4) var(--space-3-5, 0.875rem);
      border-bottom: var(--border-width) solid var(--border-subtle);
    }
    .register .table:not(.table--matrix, .table--scroll) > tbody > tr:last-child { border-bottom: 0; }
    .register .table:not(.table--matrix, .table--scroll) > tbody > tr > td {
      display: inline-block; max-width: 100%; height: auto; padding: 0; margin-right: var(--space-3); border: 0;
      font-size: var(--text-sm); line-height: 1.85; text-align: left; white-space: normal; vertical-align: middle;
    }
    .register .table:not(.table--matrix, .table--scroll) td[data-label]:not(:has(.status, .tag, .avatar, .ref, .indicators, .sensitive, strong, .cell-primary))::before {
      content: attr(data-label) " "; font-size: var(--text-xs); color: var(--text-tertiary);
    }
    /* Title line: the .stack-title cell, or the first cell when no title is marked. */
    .register .table:not(.table--matrix, .table--scroll) tr > td.stack-title,
    .register .table:not(.table--matrix, .table--scroll) tr:not(:has(> .stack-title)) > td:first-child {
      display: block; margin: 0 0 var(--space-0-5); font-size: var(--text-base); font-weight: var(--weight-medium); line-height: 1.4;
    }
    .register .table:not(.table--matrix, .table--scroll) tr > td.stack-title::before,
    .register .table:not(.table--matrix, .table--scroll) tr > td:first-child::before { content: none; }
    /* Eyebrow: a first cell that precedes the marked title (usually the reference). When no
       title is marked and the row starts with a reference, the next cell is the title. */
    .register .table:not(.table--matrix, .table--scroll) tr:has(> .stack-title) > td:first-child:not(.stack-title),
    .register .table:not(.table--matrix, .table--scroll) tr:not(:has(> .stack-title)) > td:first-child:has(> .ref) {
      display: block; margin: 0; font-size: var(--text-sm); font-weight: var(--weight-regular); line-height: 1.5;
    }
    .register .table:not(.table--matrix, .table--scroll) tr:not(:has(> .stack-title)) > td:first-child:has(> .ref) + td {
      display: block; margin: 0 0 var(--space-0-5); font-size: var(--text-base); font-weight: var(--weight-medium); line-height: 1.4;
    }
    .register .table:not(.table--matrix, .table--scroll) tr:not(:has(> .stack-title)) > td:first-child:has(> .ref) + td::before { content: none; }
    /* Pinned end value: amount, status or days. */
    .register .table:not(.table--matrix, .table--scroll) tr > td.stack-end,
    .register .table:not(.table--matrix, .table--scroll) tr:not(:has(> .stack-end)) > td.col-num:last-child {
      position: absolute; top: var(--space-3); right: var(--space-4); margin: 0; line-height: 1.5; text-align: right;
    }
    .register .table:not(.table--matrix, .table--scroll) tr:is(:has(> .stack-end), :has(> td.col-num:last-child)) > td:first-child,
    .register .table:not(.table--matrix, .table--scroll) tr:is(:has(> .stack-end), :has(> td.col-num:last-child)) > td.stack-title { padding-right: 6.5rem; }
    .register .table:not(.table--matrix, .table--scroll) td:is(.stack-hide, .col-check, :empty),
    .register .table:not(.table--matrix, .table--scroll) td:has(> .muted:only-child),
    .register .table:not(.table--matrix, .table--scroll) td.muted { display: none; }
    .register .table:not(.table--matrix, .table--scroll) .cell-primary__title,
    .register .table:not(.table--matrix, .table--scroll) .cell-primary__sub { white-space: normal; }
    .register .table:not(.table--matrix, .table--scroll) .status { vertical-align: middle; font-size: var(--text-sm); }
    .register .table:not(.table--matrix, .table--scroll) .avatar { vertical-align: middle; }
    .register .table:not(.table--matrix, .table--scroll) .indicators { vertical-align: middle; }
    .register .table--interactive:not(.table--matrix, .table--scroll) tbody tr:hover td { background: none; }
    .register .table--interactive:not(.table--matrix, .table--scroll) tbody tr:hover { background: var(--surface-hover); }
    .register .table__empty td { display: block; }
    /* Comparison tables keep their grid; the row heading stays in view while scrolling. */
    .table--matrix td:first-child, .table--matrix th:first-child,
    .table--scroll td:first-child, .table--scroll th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border-subtle); }
    .table--matrix td:first-child { min-width: 12rem; }
  }

  /* --- Record (detail/profile) ------------------------------------------------------ */
  .record-header { padding-bottom: var(--space-6); }
  .record-header__top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4) var(--space-6); }
  .record-header__top > .btn-group { padding-top: var(--space-1); }
  .record-identity { display: flex; align-items: center; gap: var(--space-4); min-width: 0; flex: 1 1 26rem; }
  .record-identity__text { min-width: 0; }
  .record-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); line-height: var(--leading-tight); }
  /* The technical reference beside a title is a quiet chip, not a second headline. */
  .record-title .ref, .page-title .ref {
    display: inline-flex; align-items: center; height: 1.5rem; padding: 0 var(--space-2);
    border-radius: var(--radius-sm); background: var(--gray-75); border: var(--border-width) solid var(--border);
    font-size: var(--text-xs); color: var(--text-secondary); letter-spacing: 0.02em;
  }
  .record-subtitle { margin-top: var(--space-1-5); font-size: var(--text-md); color: var(--text-secondary); }
  .record-header .meta { margin-top: var(--space-5); }
  .record-tabs { margin-bottom: var(--space-8); }
  .record-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--space-10); align-items: start; }
  .record-rail { display: grid; gap: var(--space-6); }
  .rail-block { padding-bottom: var(--space-6); border-bottom: var(--border-width) solid var(--border); }
  .rail-block:last-child { border-bottom: 0; padding-bottom: 0; }
  .rail-block__title { margin-bottom: var(--space-3); font-size: var(--text-2xs); font-weight: var(--weight-semibold); color: var(--text-tertiary); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
  .related { display: grid; gap: var(--space-1); }
  .related a { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1-5) var(--space-2); margin: 0 calc(var(--space-2) * -1); border-radius: var(--radius-sm); color: var(--text); font-size: var(--text-sm); }
  .related a:hover { background: var(--gray-100); text-decoration: none; }
  .related .ref { margin-left: auto; }
  /* A related record the viewer cannot open (e.g. an identity-only person): same row, no link. */
  .related__item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1-5) var(--space-2); margin: 0 calc(var(--space-2) * -1); color: var(--text); font-size: var(--text-sm); }
  @media (max-width: 1100px) { .record-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); } .record-rail { padding-top: var(--space-6); border-top: var(--border-width) solid var(--border); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); column-gap: var(--space-8); } .record-rail .rail-block { border-bottom: 0; padding-bottom: 0; } }
  @media (max-width: 640px) { .record-identity { flex-basis: 100%; align-items: flex-start; } .record-header__top > .btn-group { width: 100%; } }

  /* Date tile: the date is the identity of a dated record (meetings). */
  .date-tile {
    display: grid; grid-template-rows: auto 1fr; flex: none; width: 4rem; overflow: hidden; text-align: center;
    border-radius: var(--radius-md); background: var(--surface); border: var(--border-width) solid var(--border); box-shadow: var(--shadow-sm);
  }
  .date-tile__month { padding: 0.1875rem 0; background: var(--blue-900); color: var(--text-inverse); font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
  .date-tile__day { padding: var(--space-1) 0 0; font-size: 1.75rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-figure); line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
  .date-tile__dow { padding-bottom: var(--space-1-5); font-size: var(--text-2xs); font-weight: var(--weight-medium); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }

  /* --- Timeline / history ------------------------------------------------------------- */
  .timeline { position: relative; display: grid; }
  .event { position: relative; display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: var(--space-3); padding-bottom: var(--space-6); }
  .event::before { content: ""; position: absolute; left: 1rem; top: 2.125rem; bottom: 0.25rem; width: 1px; background: var(--border-strong); }
  .event:last-child { padding-bottom: 0; }
  .event:last-child::before { display: none; }
  .event__marker { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--radius-full); border: var(--border-width) solid var(--border); background: var(--surface); color: var(--text-tertiary); box-shadow: var(--shadow-xs); }
  .event__marker .icon { width: 0.875rem; height: 0.875rem; }
  .event__marker--security { border-color: var(--warning-200); background: var(--warning-50); color: var(--warning-600); }
  .event__marker--protected { border-color: var(--protected-200); background: var(--protected-50); color: var(--protected-600); }
  .event__body { min-width: 0; padding-top: 0.3125rem; font-size: var(--text-sm); color: var(--text-secondary); }
  .event__body strong { color: var(--text); font-weight: var(--weight-semibold); }
  .event__time { padding-top: 0.3125rem; font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .event__detail { margin-top: var(--space-2); }

  .diff { width: 100%; border: var(--border-width) solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: var(--text-sm); background: var(--surface); }
  .diff th { padding: var(--space-1-5) var(--space-3); text-align: left; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); background: var(--surface-subtle); border-bottom: var(--border-width) solid var(--border); }
  .diff td { padding: var(--space-2) var(--space-3); border-bottom: var(--border-width) solid var(--border-subtle); vertical-align: top; }
  .diff tr:last-child td { border-bottom: 0; }
  .diff__field { width: 9rem; color: var(--text-tertiary); }
  .diff__before { color: var(--danger-600); background: var(--danger-50); text-decoration: line-through; text-decoration-color: rgb(176 38 30 / 0.45); }
  .diff__after { color: var(--success-600); background: var(--success-50); }

  /* --- Protected (clinical) treatment ------------------------------------------- */
  .protected-banner {
    display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
    padding: var(--space-2-5) var(--space-4); margin-bottom: var(--space-6);
    border: var(--border-width) solid var(--protected-200); border-left: 3px solid var(--protected-dot);
    border-radius: var(--radius); background: var(--protected-50);
    font-size: var(--text-sm); color: var(--protected-600);
  }
  .protected-banner .icon { color: var(--protected-600); }
  .protected-banner__end { margin-left: auto; font-size: var(--text-xs); }
  .protected-block { position: relative; border: var(--border-width) solid var(--border); border-left: 3px solid var(--protected-dot); border-radius: var(--radius-md); background: var(--surface); }
  .protected-strip {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-5);
    padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--protected-200); border-radius: var(--radius); background: var(--protected-50);
    font-size: var(--text-sm); color: var(--text-secondary);
  }
  .protected-strip__label { display: inline-flex; align-items: center; gap: var(--space-1-5); font-weight: var(--weight-semibold); color: var(--protected-600); }

  /* --- Notice (denied / not configured / errors) ------------------------------ */
  .notice { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); max-width: 30rem; margin: var(--space-16) auto; }
  .notice__icon { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-bottom: var(--space-1); border-radius: var(--radius-lg); border: var(--border-width) solid var(--border); background: var(--surface); color: var(--text-tertiary); box-shadow: var(--shadow-sm); }
  .notice__icon .icon { width: 1.375rem; height: 1.375rem; }
  .notice__icon--protected { border-color: var(--protected-200); background: var(--protected-50); color: var(--protected-600); }
  .notice__title { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); }
  .notice__text { font-size: var(--text-base); color: var(--text-secondary); }
  .notice .callout { text-align: left; }
  .notice .btn-group { justify-content: center; margin-top: var(--space-2); }
  .card-notice { width: min(28rem, 100%); padding: var(--space-8); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
  .card-notice .notice { margin: 0 auto; }

  .identity { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-3); border: var(--border-width) solid var(--border); border-radius: var(--radius); background: var(--surface-subtle); text-align: left; }
  .identity strong { display: block; font-size: var(--text-sm); }
  .identity > div > span { display: block; font-size: var(--text-xs); color: var(--text-tertiary); }

  /* --- List rows: compact actionable lists (attention items, search results) -- */
  .list-rows { display: grid; }
  .list-rows > li + li { border-top: var(--border-width) solid var(--border-subtle); }
  .list-rows--bordered { border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); }
  .list-row { display: flex; align-items: center; gap: var(--space-3-5, 0.875rem); min-height: 3.5rem; padding: var(--space-3) var(--panel-pad); font-size: var(--text-sm); color: var(--text); }
  .list-row--link { text-decoration: none; transition: background var(--duration-fast) var(--ease); }
  .list-row--link:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
  .list-row--link:focus-visible { box-shadow: var(--focus-ring-inset); border-radius: 0; }
  .list-row__icon { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: var(--radius); background: var(--gray-75); color: var(--text-tertiary); }
  .list-row__icon .icon { width: 1rem; height: 1rem; }
  .list-row__icon--danger { background: var(--danger-50); color: var(--danger-600); }
  .list-row__icon--warning { background: var(--warning-50); color: var(--warning-600); }
  .list-row__icon--protected { background: var(--protected-50); color: var(--protected-600); }
  .list-row__icon--info { background: var(--blue-50); color: var(--blue-600); }
  .list-row__main { flex: 1; min-width: 0; display: grid; gap: 0.125rem; }
  .list-row__title { font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text); overflow-wrap: anywhere; }
  .list-row__sub { font-size: var(--text-xs); color: var(--text-tertiary); overflow-wrap: anywhere; }
  .list-row__end { flex: none; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); white-space: nowrap; font-variant-numeric: tabular-nums; }
  .list-row .status { white-space: normal; }
  .list-row__chevron { flex: none; color: var(--text-disabled); transition: transform var(--duration) var(--ease), color var(--duration) var(--ease); }
  .list-row--link:hover .list-row__chevron { color: var(--accent); transform: translateX(2px); }

  /* --- Document: a file record (name, type, version, status, date, owner, actions) --- */
  .doc { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .doc + .doc { margin-top: var(--space-2); }
  .doc__type {
    position: relative; display: grid; place-items: end center; flex: none; width: 2.5rem; height: 3rem; padding-bottom: var(--space-1-5);
    border-radius: var(--radius-sm) 0.75rem var(--radius-sm) var(--radius-sm); background: var(--blue-50); border: var(--border-width) solid var(--blue-100);
    font-size: 0.5625rem; font-weight: var(--weight-bold); letter-spacing: 0.06em; color: var(--blue-700);
  }
  .doc__type::before { content: ""; position: absolute; top: -1px; right: -1px; width: 0.75rem; height: 0.75rem; border-radius: 0 0.75rem 0 var(--radius-xs); background: var(--blue-100); }
  .doc__type--docx { background: var(--gray-75); border-color: var(--border-strong); color: var(--gray-700); }
  .doc__type--docx::before { background: var(--border-strong); }
  .doc__main { flex: 1; min-width: 0; display: grid; gap: var(--space-1); }
  .doc__name { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text); overflow-wrap: anywhere; }
  .doc__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); font-size: var(--text-xs); color: var(--text-tertiary); }
  .doc__meta .status { font-size: var(--text-xs); }
  .doc__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); flex: none; }
  @media (max-width: 640px) { .doc { flex-wrap: wrap; } .doc__actions { width: 100%; } .doc__actions .btn { flex: 1; } }

  /* --- Entries: notes, assessments, clinical entries --------------------------- */
  .entries { display: grid; gap: var(--space-3); }
  .entry { padding: var(--space-4) var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .entry--protected { border-left: 3px solid var(--protected-200); }
  .entry__header { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--text-xs); color: var(--text-tertiary); }
  .entry__type { font-weight: var(--weight-semibold); color: var(--text-secondary); letter-spacing: var(--tracking-caps); text-transform: uppercase; font-size: var(--text-2xs); }
  .entry--protected .entry__type { color: var(--protected-600); }
  .entry__flags a { color: var(--text-tertiary); text-decoration: underline; text-underline-offset: 2px; }
  .entry__menu { margin-left: auto; margin-top: calc(var(--space-1) * -1); margin-bottom: calc(var(--space-1) * -1); }
  .entry__title { margin-top: var(--space-2); font-size: var(--text-md); font-weight: var(--weight-semibold); }
  .entry__body { margin-top: var(--space-1); font-size: var(--text-base); line-height: var(--leading-normal); color: var(--text); max-width: 46rem; }
  .entry__facts { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); margin-top: var(--space-3); font-size: var(--text-xs); color: var(--text-tertiary); }
  .entry--error .entry__title, .entry--error .entry__body { color: var(--text-tertiary); text-decoration: line-through; text-decoration-color: var(--gray-300); }

  /* --- Record state line, links and marks ---------------------------------------- */
  .record-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); color: var(--text); }
  .ref--link { color: var(--text-link); }
  .ref--link:hover { color: var(--text-link-hover); }
  .meta .ref--link + .ref--link { margin-left: var(--space-2); }
  .org-mark { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: var(--radius); border: var(--border-width) solid var(--border); background: var(--surface-subtle); color: var(--text-tertiary); }
  .org-mark .icon { width: 0.9375rem; height: 0.9375rem; }
  .org-mark--lg { width: 3.5rem; height: 3.5rem; border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--blue-700); }
  .org-mark--lg .icon { width: 1.5rem; height: 1.5rem; }
  .org-mark--protected { border-color: var(--protected-200); background: var(--protected-50); color: var(--protected-600); }
  .avatar--protected { background: var(--protected-100); color: var(--protected-600); box-shadow: none; }
  .person-link { display: flex; align-items: center; gap: var(--space-3); color: var(--text); }
  .person-link:hover { text-decoration: none; color: var(--accent); }
  .person-link strong { display: block; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
  .person-link span span { display: block; font-size: var(--text-xs); color: var(--text-tertiary); }
  .indicators { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }
  .note-warning { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--warning-600); }
  .prose { max-width: 46rem; font-size: var(--text-base); line-height: var(--leading-normal); color: var(--text); }
  .tab--protected .icon, .btn--lock .icon { color: var(--protected-600); }
  .menu__item--danger, .menu__item--danger .icon { color: var(--danger-600); }
  @media (max-width: 640px) { .record-header .menu__panel { right: auto; left: 0; } }
  .drawer__note { margin-right: auto; align-self: center; font-size: var(--text-xs); color: var(--text-tertiary); }
  .timeline--wide .event__body { max-width: 44rem; }

  /* --- Split view: a list of things on the left, the selected one on the right --- */
  .split { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-8); align-items: start; }
  .split__nav { display: grid; gap: var(--space-0-5); }
  .split__item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary); }
  .split__item:hover { background: var(--gray-100); color: var(--text); text-decoration: none; }
  .split__item[aria-current="page"] { background: var(--surface); color: var(--accent-strong-text); box-shadow: var(--shadow-xs), 0 0 0 1px var(--border); }
  .split__item .icon { color: var(--protected-600); }
  .split__count { margin-left: auto; font-size: var(--text-xs); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
  @media (max-width: 800px) {
    .split { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
    .split__nav { display: flex; overflow-x: auto; gap: var(--space-1); padding: 1px 1px var(--space-1); }
    .split__item { white-space: nowrap; }
  }

  /* --- Role cards (user access) ----------------------------------------------- */
  .split-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); align-items: start; }
  .split-sections > .section + .section { margin-top: 0; }
  @media (max-width: 900px) { .split-sections { grid-template-columns: minmax(0, 1fr); } }
  .section--protected .section__title { display: inline-flex; align-items: center; gap: var(--space-1-5); color: var(--protected-600); }
  .role-cards { display: grid; gap: var(--space-2); }
  .role-card { padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .role-card--protected { border-left: 3px solid var(--protected-dot); }
  .role-card__head { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
  .role-card__head .icon { color: var(--accent); }
  .role-card--protected .role-card__head .icon { color: var(--protected-600); }
  .role-card__head .btn { margin: calc(var(--space-1) * -1) 0; }
  .role-card__meta { margin-top: var(--space-1); padding-left: var(--space-6); font-size: var(--text-xs); color: var(--text-tertiary); }

  /* --- Possible matches (duplicate check) ------------------------------------- */
  .matches { display: grid; gap: var(--space-3); padding: var(--space-4); border: var(--border-width) solid var(--warning-200); border-radius: var(--radius-md); background: var(--surface); position: sticky; top: calc(var(--topbar-height) + var(--space-6)); box-shadow: var(--shadow-sm); }
  .matches__header { display: flex; align-items: center; gap: var(--space-2); }
  .matches__header .icon { color: var(--warning-600); }
  .matches__title { font-size: var(--text-md); font-weight: var(--weight-semibold); }
  .matches__list { display: grid; gap: var(--space-2); }
  .match { display: grid; gap: var(--space-2); justify-items: start; padding: var(--space-3); border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius); background: var(--surface-subtle); }
  .match__why { font-size: var(--text-xs); color: var(--warning-600); }
  @media (max-width: 1100px) { .matches { position: static; } }

  /* --- Form helpers -------------------------------------------------------- */
  .step { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: var(--space-2); border-radius: var(--radius-full); background: var(--blue-900); color: var(--text-inverse); font-size: var(--text-xs); font-weight: var(--weight-semibold); vertical-align: 0.1em; }
  .choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--space-2-5) var(--space-4); }
  .choice-grid .choice + .choice { margin-top: 0; }
  .choice-grid .choice { flex-wrap: nowrap; }
  .search--page { max-width: 40rem; }
  .search--page input { height: var(--control-lg); background: var(--surface); border-color: var(--border-control); font-size: var(--text-base); padding-right: var(--space-3); }
  .search-hints { margin-top: var(--space-4); }
  /* User Management: Microsoft 365 search field with its button on the same line. */
  .directory-search { display: flex; align-items: center; gap: var(--space-2); max-width: 46rem; }
  .directory-search .search { flex: 1; min-width: 0; max-width: none; }

  /* --- Prototype marker (development/test only, ADR-071) ------------------------- */
  .proto-mark {
    display: inline-flex; align-items: center; gap: var(--space-1); height: 1.375rem; margin-bottom: var(--space-3); padding: 0 var(--space-2);
    border: var(--border-width) dashed var(--border-strong); border-radius: var(--radius-full);
    font-size: var(--text-2xs); font-weight: var(--weight-medium); color: var(--text-tertiary); letter-spacing: 0.01em;
  }
  .proto-mark .icon { width: 0.75rem; height: 0.75rem; color: var(--text-disabled); }

  /* --- Whole-system prototype (ADR-072) ------------------------------------------ */
  /* Collapsible navigation groups (on navy) */
  .nav-fold { margin-top: var(--space-4); }
  .nav-group + .nav-fold { margin-top: var(--space-5); }
  .nav-fold__summary {
    display: flex; align-items: center; gap: var(--space-2); min-height: 1.875rem; padding: 0 var(--space-3);
    list-style: none; cursor: pointer; border-radius: var(--radius-sm);
    font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps);
    text-transform: uppercase; color: var(--nav-text-muted);
  }
  .nav-fold__summary::-webkit-details-marker { display: none; }
  .nav-fold__summary:hover { color: var(--nav-text-strong); }
  .nav-fold__summary:focus-visible { box-shadow: var(--focus-ring-nav); }
  .nav-fold__label { display: inline-flex; align-items: center; gap: var(--space-1-5); }
  .nav-fold__count { margin-left: auto; font-weight: var(--weight-medium); letter-spacing: 0; opacity: 0.85; }
  .nav-fold__chevron { transition: transform var(--duration) var(--ease); }
  .nav-fold[open] > .nav-fold__summary .nav-fold__chevron { transform: rotate(180deg); }
  .nav-fold--protected > .nav-fold__summary .icon { color: var(--nav-protected); }
  .nav-fold > ul { margin-top: var(--space-1); }
  .nav-fold > ul > li + li, .nav-group > ul > li + li { margin-top: 1px; }
  .nav-item__maturity {
    display: inline-grid; place-items: center; min-width: 1.125rem; height: 1.125rem; padding: 0 0.25rem;
    border: var(--border-width) solid rgb(255 255 255 / 0.22); border-radius: var(--radius-xs);
    font-size: 0.625rem; font-weight: var(--weight-semibold); color: var(--nav-text-muted);
  }
  .nav-group--end { margin-top: var(--space-5); padding-top: var(--space-3); border-top: var(--border-width) solid var(--nav-rule); }

  /* Module header and tabs */
  .module-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); font-size: var(--text-sm); color: var(--text-tertiary); }
  .module-crumb a { color: var(--text-secondary); font-weight: var(--weight-medium); }
  .module-crumb a:hover { color: var(--accent); text-decoration: none; }
  .module-crumb > span[aria-hidden] { color: var(--gray-300); }
  .module-crumb .status {
    margin-left: var(--space-1); height: 1.375rem; padding: 0 var(--space-2); border-radius: var(--radius-full);
    background: var(--surface); border: var(--border-width) solid var(--border); font-size: var(--text-2xs); font-weight: var(--weight-semibold); color: var(--text-secondary); gap: var(--space-1-5);
  }
  .module-crumb .status::before { width: 0.375rem; height: 0.375rem; box-shadow: none; }
  .module-tabs { display: flex; gap: var(--space-6); margin: var(--space-2) 0 var(--space-8); border-bottom: var(--border-width) solid var(--border); overflow-x: auto; scrollbar-width: none; }
  .module-tabs::-webkit-scrollbar { display: none; }
  .module-tab { position: relative; display: inline-flex; align-items: center; height: 2.75rem; padding: 0; font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-tertiary); text-decoration: none; white-space: nowrap; flex: none; }
  .module-tab:hover { color: var(--text); text-decoration: none; }
  .module-tab[aria-current="page"] { color: var(--text); font-weight: var(--weight-semibold); }
  .module-tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
  .module-tab:focus-visible { box-shadow: var(--focus-ring-inset); }
  /* A page-level note sits between the header and the work, with room on both sides. */
  .content > .callout { margin-bottom: var(--space-6); }
  .content > .callout:has(+ .callout) { margin-bottom: var(--space-2); }
  .page-header + .callout { margin-top: calc(var(--space-2) * -1); }
  .content > .callout + .module-tabs { margin-top: 0; }
  /* Module tabs placed above the title read as the module's own navigation: a segmented control. */
  .page-header__main > .module-tabs {
    display: inline-flex; max-width: 100%; gap: 2px; margin: 0 0 var(--space-6); padding: 3px;
    border: 0; border-radius: var(--radius); background: var(--gray-100);
  }
  .page-header__main > .module-tabs .module-tab { height: 2rem; padding: 0 var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); }
  .page-header__main > .module-tabs .module-tab::after { display: none; }
  .page-header__main > .module-tabs .module-tab[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow-sm); }
  /* Module tabs on their own full-width header row, so header actions never squeeze them. */
  .page-header__tabs { flex: 1 1 100%; min-width: 0; }
  /* With the tabs on their own row, actions centre on the title block rather than its last line. */
  .page-header:has(> .page-header__tabs) { align-items: center; }
  .page-header__tabs > .module-tabs {
    display: inline-flex; max-width: 100%; gap: 2px; margin: 0 0 var(--space-2); padding: 3px;
    border: 0; border-radius: var(--radius); background: var(--gray-100);
  }
  .page-header__tabs > .module-tabs .module-tab { height: 2rem; padding: 0 var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); }
  .page-header__tabs > .module-tabs .module-tab::after { display: none; }
  .page-header__tabs > .module-tabs .module-tab[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow-sm); }
  @media (max-width: 639px) {
    /* Phones: every tab stays visible, two per row, instead of scrolling out of sight. */
    .page-header__tabs > .module-tabs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
    .page-header__tabs > .module-tabs .module-tab { justify-content: center; height: 2.5rem; padding: 0 var(--space-2); }
    .page-header__tabs .module-tab__later { display: none; }  /* the tab's own page says so */
  }
  /* A tab for a stage that is not built yet (Policies, ADR-090 PG-1): labelled, never presented as working. */
  .module-tab__later { margin-left: var(--space-1-5); font-size: var(--text-2xs, 0.6875rem); font-weight: var(--weight-medium); color: var(--text-tertiary); }

  /* Prototype dock (ADR-079): development instrumentation in a corner, never a second toolbar.
     A simulated role lens is never a permission; when one is active the dock says so. */
  .proto-dock { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 70; }
  .proto-dock__trigger {
    display: inline-flex; align-items: center; gap: var(--space-1-5); height: 2rem; padding: 0 var(--space-3);
    border-radius: var(--radius-full); background: rgb(21 28 38 / 0.86); color: rgb(255 255 255 / 0.86);
    backdrop-filter: blur(8px); box-shadow: var(--shadow-md);
    font-size: var(--text-xs); font-weight: var(--weight-medium); white-space: nowrap;
  }
  .proto-dock__trigger:hover { background: var(--gray-900); color: var(--text-inverse); }
  .proto-dock__trigger:focus-visible { box-shadow: var(--focus-ring); }
  .proto-dock__trigger .icon { color: rgb(255 255 255 / 0.62); }
  .proto-dock--active .proto-dock__trigger { background: var(--blue-900); color: var(--text-inverse); }
  .proto-dock--active .proto-dock__trigger::before { content: ""; width: 0.4375rem; height: 0.4375rem; border-radius: var(--radius-full); background: var(--brand-flourish); }
  .proto-dock__panel { top: auto; bottom: calc(100% + var(--space-2)); right: 0; width: min(22rem, calc(100vw - 2rem)); max-height: min(36rem, 75vh); overflow-y: auto; padding: var(--space-2); }
  .proto-dock__head { padding: var(--space-2) var(--space-2) var(--space-3); border-bottom: var(--border-width) solid var(--border-subtle); margin-bottom: var(--space-2); }
  .proto-dock__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
  .lens-bar__text { margin-top: var(--space-1); font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--text-secondary); }
  .lens-bar__text strong { color: var(--text); font-weight: var(--weight-semibold); }
  .proto-dock__note { margin-top: var(--space-1-5); font-size: var(--text-xs); color: var(--text-tertiary); }
  .proto-dock__label { padding: var(--space-1) var(--space-2-5); font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
  .proto-dock__foot { display: flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-2) var(--space-1) var(--space-1); margin-top: var(--space-2); border-top: var(--border-width) solid var(--border-subtle); }
  .proto-dock__foot [aria-pressed="true"] { background: var(--blue-50); color: var(--blue-700); }
  .lens-list { list-style: none; margin: 0; padding: 0; }
  .lens-list__item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
  .lens-list__item[aria-current="true"] { background: var(--blue-25); }
  .lens-list__who { display: block; font-size: var(--text-xs); color: var(--text-tertiary); }
  .lens-notes { margin: var(--space-3) 0 0; padding-left: var(--space-5); font-size: var(--text-sm); color: var(--text-secondary); display: grid; gap: var(--space-1); }
  @media (max-width: 640px) {
    .proto-dock { right: var(--space-3); bottom: var(--space-3); }
    .proto-dock:not(.proto-dock--active) .proto-dock__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .proto-dock:not(.proto-dock--active) .proto-dock__chevron { display: none; }
    .proto-dock__trigger { padding: 0 var(--space-2-5); }
  }

  /* Design annotations: prototype marks, maturity markers and access diagnostics stay out of
     the product view until a reviewer turns them on from the dock. */
  :root:not(.show-annotations) :is(.annotation, .proto-mark, .nav-item__maturity) { display: none !important; }
  .show-annotations .annotation, .show-annotations .proto-mark { outline: 1px dashed var(--orange-300); outline-offset: 3px; }

  /* Rail lists: label / value rows in a narrow column. */
  .rail-list { display: grid; }
  .rail-list > li { display: grid; gap: 0.125rem; padding: var(--space-2-5) 0; border-bottom: var(--border-width) solid var(--border-subtle); font-size: var(--text-sm); color: var(--text); }
  .rail-list > li:first-child { padding-top: 0; }
  .rail-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
  .rail-list > li:has(> a:only-child) { padding: 0; }
  .rail-list > li > span:not(.ref):not(.status) { font-size: var(--text-xs); color: var(--text-tertiary); }
  .rail-list > li > .ref { display: block; }
  .rail-list a { font-weight: var(--weight-medium); color: var(--text); }
  .rail-list > li > a:only-child { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2-5) 0; font-size: var(--text-sm); }
  .rail-list > li:first-child > a:only-child { padding-top: 0; }
  .rail-list > li:last-child > a:only-child { padding-bottom: 0; }
  .rail-list a:hover { color: var(--accent); text-decoration: none; }
  .rail-block > .rail-block__link, .rail-block > p > .rail-block__link { margin-top: var(--space-3); }
  .rail-list small { display: block; font-size: var(--text-xs); color: var(--text-tertiary); }

  /* Financial hardship (ADR-074): decision form concept, public form mock */
  .decision-form { display: grid; gap: var(--space-4); max-width: 34rem; }
  .public-form { max-width: 34rem; padding: var(--space-8); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); display: grid; gap: var(--space-5); }
  .public-form__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
  .public-form__section { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
  .public-form__input { height: var(--control-md); border: var(--border-width) solid var(--border-control); border-radius: var(--radius); background: var(--surface); }

  /* Support Register tabs, section access, meeting lifecycle, analytics (ADR-075) */
  .module-tab--protected { gap: var(--space-1-5); color: var(--protected-600); }
  .module-tab--protected .icon { color: var(--protected-600); }
  .access-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
  .access-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .year-heading { margin: var(--space-6) 0 var(--space-3); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); letter-spacing: 0.01em; }
  .lifecycle { list-style: none; margin: 0; padding: var(--space-5); display: grid; gap: 0; border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .lifecycle__step { display: flex; gap: var(--space-3); padding: var(--space-2) 0; position: relative; font-size: var(--text-sm); }
  .lifecycle__step + .lifecycle__step::before { content: ""; position: absolute; left: 0.6875rem; top: -0.5rem; height: 1rem; width: 2px; border-radius: 1px; background: var(--border-strong); }
  .lifecycle__step--done + .lifecycle__step::before { background: var(--success-dot); }
  .lifecycle__marker { flex: none; display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: var(--radius-full); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-tertiary); }
  .lifecycle__step--done .lifecycle__marker { background: var(--success-600); border-color: var(--success-600); color: var(--text-inverse); }
  .lifecycle__step--current .lifecycle__marker { border-color: var(--accent); color: var(--accent); background: var(--blue-50); box-shadow: 0 0 0 4px var(--blue-75); }
  .lifecycle__step--current strong { color: var(--blue-900); }
  .lifecycle__step--todo { color: var(--text-tertiary); }
  .lifecycle__step--todo strong { font-weight: var(--weight-medium); }
  .lifecycle__when { display: block; font-size: var(--text-xs); color: var(--text-tertiary); font-weight: var(--weight-regular); }
  /* Trail: the chain of records that hang off one parent (agenda → paper → minute → resolution → action). */
  .trail { list-style: none; margin: 0; padding: 0; display: grid; }
  .trail__step { position: relative; display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); column-gap: var(--space-2-5); padding: var(--space-1-5) 0; }
  .trail__step + .trail__step::before { content: ""; position: absolute; left: calc(0.625rem - 1px); top: -0.4375rem; height: 0.875rem; width: 2px; border-radius: 1px; background: var(--border-strong); }
  .trail__step--done + .trail__step--done::before { background: var(--blue-300); }
  .trail__dot { grid-row: span 2; align-self: start; justify-self: center; margin-top: 0.3125rem; width: 0.625rem; height: 0.625rem; border-radius: var(--radius-full); border: 2px solid var(--border-strong); background: var(--surface); }
  .trail__step--done .trail__dot { border-color: var(--accent); background: var(--accent); }
  .trail__label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); }
  .trail__value { font-size: var(--text-xs); color: var(--text-tertiary); }
  .trail__step:not(.trail__step--done) .trail__label { color: var(--text-secondary); }
  .analytics-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
  .analytics-controls .control { width: auto; min-width: 12rem; }
  .analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--space-3); }
  .analytics-card {
    position: relative; display: grid; gap: var(--space-1); align-content: start;
    padding: var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs);
    color: var(--text); text-decoration: none;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
  }
  a.analytics-card:hover { border-color: var(--blue-200); box-shadow: var(--shadow-md); text-decoration: none; color: var(--text); }
  a.analytics-card:hover .analytics-card__figure { color: var(--accent); }
  .analytics-card .eyebrow { display: flex; align-items: center; gap: var(--space-1-5); }
  .analytics-card__measure { font-weight: var(--weight-semibold); }
  .analytics-card__figure { font-size: 1.75rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-figure); line-height: 1.15; color: var(--blue-900); font-variant-numeric: tabular-nums; transition: color var(--duration) var(--ease); }

  /* Flow: where things are in a workflow, as one connected strip. */
  .flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1px; background: var(--border); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-xs); }
  .flow__step { flex: 1 1 7rem; display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--surface); font-size: var(--text-sm); color: var(--text-secondary); }
  .flow__n { flex: none; font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); color: var(--text); font-variant-numeric: tabular-nums; }
  .flow__step--done { background: var(--surface-subtle); color: var(--text-tertiary); }
  .flow__step--done .flow__n { color: var(--text-tertiary); }
  .flow__step--current { background: var(--blue-25); color: var(--blue-900); font-weight: var(--weight-semibold); box-shadow: inset 0 -2px 0 var(--accent); }
  .flow__step--current .flow__n { color: var(--accent); }
  .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
  .steps__item { display: flex; gap: var(--space-3); align-items: flex-start; }
  .matrix-head { white-space: normal; min-width: 5.5rem; max-width: 7rem; font-size: var(--text-xs); }
  .matrix-yes { color: var(--success-600); }
  .agenda-sub { padding-left: var(--space-8); }
  .skill { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: var(--weight-semibold); background: var(--gray-75); color: var(--text-secondary); }
  .skill--1 { background: var(--blue-50); } .skill--2 { background: var(--blue-100); color: var(--accent-strong-text); } .skill--3 { background: var(--blue-600); color: var(--text-inverse); }
  .statement { max-width: 38rem; padding: var(--space-8); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-md); }
  .statement__org { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--accent-strong-text); }
  .statement__title { font-size: var(--text-xl); margin-top: var(--space-1); letter-spacing: var(--tracking-title); }
  .statement__sub { color: var(--text-secondary); margin-bottom: var(--space-4); }
  .statement__note { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--text-tertiary); border-top: var(--border-width) dashed var(--border-strong); padding-top: var(--space-3); }

  /* Director view of Board & governance (GOVERNANCE_DESIGN 8.4-8.5): reading-width content inside the
     normal application shell (ADR-073). The class names keep their original "portal-" prefix. */
  .portal-greeting { font-size: var(--text-sm); color: var(--text-tertiary); margin-bottom: var(--space-4); }
  .eyebrow { font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--space-1-5); }
  .next-meeting {
    position: relative; overflow: hidden; padding: var(--space-8);
    border: var(--border-width) solid var(--border); border-radius: var(--radius-lg);
    background: linear-gradient(150deg, var(--blue-25), var(--surface) 55%); box-shadow: var(--shadow-sm);
  }
  .next-meeting::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue-900); }
  .next-meeting__date { font-size: 2rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); line-height: 1.15; color: var(--blue-900); }
  .next-meeting__when { color: var(--text-secondary); margin-top: var(--space-1-5); font-size: var(--text-md); }
  .next-meeting__rule { border: 0; border-top: var(--border-width) solid var(--border); margin: var(--space-5) 0; }
  .next-meeting__pack { font-weight: var(--weight-semibold); margin-bottom: var(--space-3); }
  .next-meeting .btn-group { margin-top: var(--space-5); align-items: center; }
  .facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-variant-numeric: tabular-nums; font-size: var(--text-sm); }
  .facts li { display: inline-flex; align-items: center; gap: var(--space-1-5); }
  .dot { display: inline-block; flex: none; width: 0.5rem; height: 0.5rem; border-radius: var(--radius-full); background: var(--gray-400); }
  .dot--info { background: var(--info-dot); } .dot--warning { background: var(--warning-dot); } .dot--danger { background: var(--danger-dot); } .dot--success { background: var(--success-dot); }
  .portal-section { margin-top: var(--space-10); }
  .portal-section__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); margin-bottom: var(--space-3); }
  .attn-list { list-style: none; margin: 0; padding: 0 var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .attn { display: flex; align-items: center; gap: var(--space-3); min-height: 3.25rem; padding: var(--space-2-5) 0; border-bottom: var(--border-width) solid var(--border-subtle); color: var(--text); text-decoration: none; }
  .attn-list > li:last-child > .attn, .attn-list > .attn:last-child { border-bottom: 0; }
  .attn:hover { color: var(--accent); text-decoration: none; }
  .attn__main { flex: 1; min-width: 0; }
  .attn__due { font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .portal-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
  .plain-list { list-style: none; margin: 0; padding: 0 var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .plain-list li { padding: var(--space-3) 0; border-bottom: var(--border-width) solid var(--border-subtle); font-size: var(--text-sm); }
  .plain-list li:last-child { border-bottom: 0; }
  .reader { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); gap: var(--space-10); align-items: start; }
  .reader__main { max-width: 47.5rem; }
  .reader__title { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); margin-bottom: var(--space-2); }
  .reader__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-5); }
  .agenda-rail { position: sticky; top: calc(var(--topbar-height) + var(--space-6)); }
  .agenda-rail__list { list-style: none; margin: 0; padding: var(--space-1-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .agenda-rail__sub { padding-left: var(--space-4); }
  .agenda-rail__item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--text-secondary); text-decoration: none; }
  .agenda-rail__item:hover { background: var(--gray-75); color: var(--text); text-decoration: none; }
  .agenda-rail__item.is-current { background: var(--blue-50); color: var(--blue-900); font-weight: var(--weight-medium); box-shadow: inset 2px 0 0 var(--accent); }
  .agenda-rail__n { min-width: 1.75rem; font-variant-numeric: tabular-nums; color: var(--text-tertiary); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
  .agenda-rail__n--decision { box-shadow: 0 0 0 1.5px var(--blue-400); border-radius: var(--radius-full); text-align: center; color: var(--accent-strong-text); }
  .agenda-rail__title { flex: 1 1 8rem; }
  .agenda-list { list-style: none; margin: 0; padding: 0 var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .agenda-list__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-bottom: var(--border-width) solid var(--border-subtle); min-height: var(--touch-min); }
  .agenda-list__row:last-child { border-bottom: 0; }
  .agenda-list__row--sub { padding-left: var(--space-6); }
  .agenda-list__title { flex: 1 1 14rem; }
  .resolution-quote { margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-5); border-left: 3px solid var(--blue-900); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); color: var(--text); font-size: var(--text-md); line-height: var(--leading-normal); }
  .paper-rows { list-style: none; margin: 0; padding: 0 var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .paper-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-height: 3.25rem; padding: var(--space-2-5) 0; border-bottom: var(--border-width) solid var(--border-subtle); color: var(--text); text-decoration: none; }
  .paper-rows > li:last-child > .paper-row, .paper-rows > .paper-row:last-child { border-bottom: 0; }
  a.paper-row:hover { color: var(--accent); text-decoration: none; }
  .paper-row__title { flex: 1 1 12rem; font-weight: var(--weight-medium); }
  .pager { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-8); }
  .pager .btn { flex: 1; max-width: 16rem; }
  .reader-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-2) 0 var(--space-3); border-bottom: var(--border-width) solid var(--border); }
  .reader-bar__back { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--text-secondary); text-decoration: none; min-height: var(--touch-min); }
  .reader-bar__title { flex: 1 1 12rem; }
  .pdf-stage { padding: var(--space-8) 0; background: var(--gray-100); border-radius: var(--radius-md); margin-top: var(--space-4); display: grid; gap: var(--space-5); justify-items: center; }
  .pdf-page { width: min(34rem, 92%); min-height: 28rem; padding: var(--space-8); background: var(--surface); box-shadow: var(--shadow-md); border-radius: 2px; display: grid; align-content: start; gap: var(--space-3); }
  .pdf-page__line { height: 0.5rem; margin: 0; border-radius: var(--radius-xs); background: var(--gray-150); }
  .pdf-page__line--title { height: 1rem; width: 60%; background: var(--gray-300); }
  .pdf-page__line--short { width: 40%; }
  .vote-card { padding: var(--space-6); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); display: grid; gap: var(--space-2); }
  @media (max-width: 900px) {
    .reader { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
    .agenda-rail { position: static; }
    .agenda-rail__list { max-height: 15rem; overflow-y: auto; }
    .portal-cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .next-meeting { padding: var(--space-6) var(--space-5); }
    .next-meeting__date { font-size: var(--text-xl); }
  }
}

/* ================================================================= pages == */
@layer pages {
  /* --- Shell responsive visibility (here so it overrides component display rules) --- */
  .topbar__menu, .topbar__logo { display: none; }
  .topbar .search { flex: 1 1 auto; min-width: 0; }
  .account-trigger__name, .account-trigger__role { white-space: nowrap; }
  @media (max-width: 900px) {
    .topbar__menu { display: inline-flex; margin-left: calc(var(--space-2) * -1); }
    .topbar__logo { display: block; width: 1.875rem; height: 1.875rem; }
    .account-trigger__text, .account-trigger > .icon { display: none; }
    .account-trigger { padding: 0; }
  }
  @media (max-width: 640px) {
    .topbar { gap: var(--space-2); }
    .search .kbd { display: none; }
    .search input { padding-right: var(--space-2); }
    .topbar__end { gap: var(--space-2); }
  }
  @media (max-width: 480px) {
    /* Environment badge collapses to its dot; full text remains for assistive tech and title. */
    .env-label { padding: 0 var(--space-2); }
    .env-label__text { display: none; }
  }

  /* --- Sign-in ----------------------------------------------------------------- */
  .signin { width: min(29rem, 100%); }
  .signin__brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-4); margin-bottom: var(--space-8); }
  .signin__logo { width: 5.5rem; height: 5.5rem; }
  .signin__title { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); }
  .signin__subtitle { margin-top: var(--space-1); font-size: var(--text-base); color: var(--text-secondary); }
  .signin__card { padding: var(--space-6); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-md); }
  .signin__card > * + * { margin-top: var(--space-4); }
  .signin__note { font-size: var(--text-xs); color: var(--text-tertiary); text-align: center; }
  .signin__footer { margin-top: var(--space-8); text-align: center; font-size: var(--text-xs); color: var(--text-tertiary); }
  .signin__tagline { display: inline-block; padding-bottom: var(--space-1); margin-bottom: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary); border-bottom: 2px solid var(--brand-flourish); }
  .divider { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); }
  .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
  .dev-users { display: grid; border: var(--border-width) solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
  .dev-users li + li { border-top: var(--border-width) solid var(--border-subtle); }
  .dev-user { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-2-5) var(--space-3); border: 0; background: var(--surface); text-align: left; }
  .dev-user:hover { background: var(--surface-hover); }
  .dev-user:focus-visible { box-shadow: var(--focus-ring-inset); border-radius: 0; }
  .dev-user__text { flex: 1; min-width: 0; }
  .dev-user__name { display: block; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); }
  .dev-user__desc { display: block; font-size: var(--text-xs); color: var(--text-tertiary); }
  .dev-user .icon { color: var(--text-disabled); }
  .dev-user:hover .icon { color: var(--accent); }

  /* --- Dashboard ----------------------------------------------------------------- */
  .dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; gap: var(--space-10); align-items: start; }
  /* Explicit minmax(0, 1fr) track: wide tables scroll inside their register instead of
     stretching the column (an implicit auto track grows to the table's min-content). */
  .dash-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--section-gap); min-width: 0; }
  /* Rail: unboxed context, separated from the main column by a single hairline. */
  .dash-rail { display: grid; gap: var(--space-6); align-content: start; padding-left: var(--space-8); border-left: var(--border-width) solid var(--border); }
  .rail-block__header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
  .rail-block__header .rail-block__title { margin-bottom: 0; }
  .rail-block__link { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
  .rail-block__link .icon { width: 0.75rem; height: 0.75rem; }
  .role-list { display: grid; gap: var(--space-2); }
  .role-list li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text); }
  .role-list .icon { color: var(--accent); }
  .role-list .is-protected .icon { color: var(--protected-600); }
  @media (max-width: 1180px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
    .dash-rail { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--space-6) var(--space-8); padding: var(--space-6) 0 0; border-left: 0; border-top: var(--border-width) solid var(--border); }
    .dash-rail .rail-block { border-bottom: 0; padding-bottom: 0; }
  }

  /* Metrics that open their register */
  a.metric--link { color: inherit; text-decoration: none; transition: background var(--duration-fast) var(--ease); }
  a.metric--link:hover { background: var(--surface-hover); text-decoration: none; }
  a.metric--link:hover .metric__label { color: var(--accent); }
  a.metric--link:focus-visible { box-shadow: var(--focus-ring-inset); border-radius: 0; }
  .metric__value--alert { color: var(--danger-600); }

  /* Trend chart (inline SVG; geometry from the view, colour from tokens) */
  .chart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: var(--space-8); align-items: center; }
  .chart { margin: 0; }
  .chart__svg { display: block; width: 100%; height: auto; overflow: visible; }
  .chart__axis { stroke: var(--border-strong); stroke-width: 1; }
  .chart__bar { fill: var(--blue-200); }
  .chart__bar--current { fill: var(--accent); }
  .chart__bar--partial { fill: var(--blue-50); stroke: var(--blue-300); stroke-width: 1; stroke-dasharray: 3 2; }
  .chart__label { fill: var(--text-tertiary); font-size: 11px; font-family: var(--font-sans); }
  .chart-facts { display: grid; gap: var(--space-5); padding-left: var(--space-6); border-left: var(--border-width) solid var(--border-subtle); }
  .chart-facts dt { font-size: var(--text-xs); color: var(--text-tertiary); }
  .chart-facts dd { margin-top: var(--space-0-5); font-size: 1.375rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-title); font-variant-numeric: tabular-nums; color: var(--text); }
  @media (max-width: 700px) {
    .chart-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
    .chart-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: var(--space-4) 0 0; border-left: 0; border-top: var(--border-width) solid var(--border-subtle); gap: var(--space-3); }
    .chart-facts dd { font-size: var(--text-lg); }
  }

  /* Activity feed: one line per change */
  .activity { display: grid; padding: 0 var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .activity__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: var(--border-width) solid var(--border-subtle); font-size: var(--text-sm); color: var(--text-secondary); }
  .activity__item:last-child { border-bottom: 0; }
  .activity__item p { flex: 1; min-width: 0; }
  .activity__item strong { color: var(--text); font-weight: var(--weight-semibold); }
  .activity__subject { color: var(--text); font-weight: var(--weight-medium); }
  .activity__item time { flex: none; font-size: var(--text-xs); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

  /* Rail figures */
  .rail-figures { display: grid; gap: var(--space-2-5); }
  .rail-figures div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); }
  .rail-figures dt { color: var(--text-secondary); }
  .rail-figures dd { font-size: var(--text-md); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
  .rail-figures dd.is-alert { color: var(--danger-600); }

  .access-list { display: grid; gap: var(--space-3); }
  .access-item__title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); }
  .access-item__title .icon { color: var(--accent); }
  .access-item--protected .access-item__title .icon { color: var(--protected-600); }
  .access-item ul { margin-top: var(--space-1); padding-left: var(--space-6); font-size: var(--text-xs); color: var(--text-tertiary); }
  .access-item li { position: relative; }
  .access-item li::before { content: "–"; position: absolute; left: -0.75rem; color: var(--gray-300); }

  .checks { display: grid; }
  .check { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; font-size: var(--text-sm); border-bottom: var(--border-width) solid var(--border-subtle); }
  .check:last-child { border-bottom: 0; }
  .check__detail { margin-left: auto; color: var(--text-tertiary); font-size: var(--text-xs); }
  .check--ok .icon { color: var(--success-600); }
  .check--fail .icon { color: var(--danger-600); }

  /* --- Admin overview ---------------------------------------------------------------- */
  .tiles-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-xs); }
  /* Hairlines between tiles; the outer ones are clipped by the list's rounded edge. */
  .tiles-list > li { display: flex; background: var(--surface); box-shadow: 1px 0 0 var(--border-subtle), 0 1px 0 var(--border-subtle); }
  .tile-link { flex: 1; display: flex; gap: var(--space-4); padding: var(--space-5); background: var(--surface); color: inherit; }
  a.tile-link { transition: background var(--duration-fast) var(--ease); }
  a.tile-link:hover { background: var(--surface-hover); text-decoration: none; color: inherit; }
  a.tile-link:hover .tile-link__title { color: var(--accent); }
  .tile-link__icon { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--radius); background: var(--blue-50); color: var(--accent); box-shadow: inset 0 0 0 1px var(--blue-100); }
  .tile-link__title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text); }
  .tile-link__text { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--text-tertiary); }
  .tile-link--soon .tile-link__icon { background: var(--gray-75); color: var(--text-tertiary); box-shadow: inset 0 0 0 1px var(--border); }

  /* --- Design system showroom ---------------------------------------------------- */
  .ds-nav { position: sticky; top: calc(var(--topbar-height) + var(--space-6)); display: grid; gap: var(--space-0-5); font-size: var(--text-sm); }
  .ds-nav a { padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); color: var(--text-secondary); }
  .ds-nav a:hover { background: var(--gray-100); color: var(--text); text-decoration: none; }
  .ds-layout { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-10); }
  .ds-section { padding: var(--space-10) 0; border-top: var(--border-width) solid var(--border); scroll-margin-top: calc(var(--topbar-height) + var(--space-4)); }
  .ds-section:first-child { border-top: 0; padding-top: 0; }
  .ds-section__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
  .ds-section__desc { margin-top: var(--space-1); margin-bottom: var(--space-6); max-width: 44rem; font-size: var(--text-sm); color: var(--text-tertiary); }
  .ds-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
  .ds-row + .ds-row { margin-top: var(--space-4); }
  .ds-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
  .ds-label { margin-bottom: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); }
  .swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: var(--space-3); }
  .swatch { border: var(--border-width) solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: var(--text-xs); background: var(--surface); }
  .swatch__chip { height: 3rem; border-bottom: var(--border-width) solid var(--border-subtle); }
  .swatch__meta { padding: var(--space-1-5) var(--space-2); }
  .swatch__meta strong { display: block; font-weight: var(--weight-semibold); color: var(--text); }
  .swatch__meta code { color: var(--text-tertiary); }
  .type-specimen { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-2) var(--space-6); align-items: baseline; }
  .type-specimen dt { font-size: var(--text-xs); color: var(--text-tertiary); }
  .type-specimen dd { padding-bottom: var(--space-3); border-bottom: var(--border-width) solid var(--border-subtle); }
  .ds-frame { padding: var(--space-6); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface-canvas); }
  .ds-frame--white { background: var(--surface); }
  .ds-nav-demo { width: 16rem; padding: var(--space-3); border-radius: var(--radius-md); background: var(--nav-bg); color: var(--nav-text); }
  @media (max-width: 1000px) { .ds-layout { grid-template-columns: minmax(0, 1fr); } .ds-nav { display: none; } .ds-grid-2 { grid-template-columns: minmax(0, 1fr); } }
}

/* ============================================================= utilities == */
@layer utilities {
  .stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .stack-sm { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .stack-lg { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--section-gap); }
  .cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
  @media (max-width: 800px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
  .mt-1 { margin-top: var(--space-1); }
  .mt-2 { margin-top: var(--space-2); }
  .mt-3 { margin-top: var(--space-3); }
  .mt-4 { margin-top: var(--space-4); }
  .mt-6 { margin-top: var(--space-6); }
  .mt-8 { margin-top: var(--space-8); }
  .mb-4 { margin-bottom: var(--space-4); }
  .mb-6 { margin-bottom: var(--space-6); }
  .text-secondary { color: var(--text-secondary); }
  .text-tertiary { color: var(--text-tertiary); }
  .text-warning { color: var(--warning-600); font-weight: var(--weight-medium); }
  .clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .table--activity th, .table--activity td { padding-inline: var(--space-2-5); }
  .table--activity .col-description { min-width: 9rem; max-width: 20rem; white-space: normal; }
  .register__footer--stacked { display: block; }
  .table .is-withdrawn td { color: var(--text-tertiary); }
  /* Totals strip under a register (label above figure). */
  .totals { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: 0; }
  .totals dt { font-size: var(--text-xs); color: var(--text-tertiary); }
  .totals dd { margin: 0; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; color: var(--text); }
  /* Support Register: many columns; keep cells tight and tags on one line. */
  .table--register th, .table--register td { padding-inline: var(--space-2-5); }
  .table--register .tags { flex-wrap: nowrap; }
  .table--register .tag { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table--register .cell-clip { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
  .table--register .cell-clip .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .text-sm { font-size: var(--text-sm); }
  .text-xs { font-size: var(--text-xs); }
  .text-center { text-align: center; }
  .nowrap { white-space: nowrap; }
  .ml-auto { margin-left: auto; }
  .w-full { width: 100%; }
  .show-sm { display: none !important; }
  @media (max-width: 640px) { .hide-sm { display: none !important; } .show-sm { display: flex !important; } }
  .inline-sm { display: none; }
  @media (max-width: 640px) { .inline-sm { display: inline; } }
}

/* Swatch fills (showroom only): token-driven, no inline styles */
@layer pages {
  .sw-blue-50 { background: var(--blue-50); } .sw-blue-100 { background: var(--blue-100); } .sw-blue-200 { background: var(--blue-200); }
  .sw-blue-300 { background: var(--blue-300); } .sw-blue-400 { background: var(--blue-400); } .sw-blue-500 { background: var(--blue-500); }
  .sw-blue-600 { background: var(--blue-600); } .sw-blue-700 { background: var(--blue-700); } .sw-blue-800 { background: var(--blue-800); } .sw-blue-900 { background: var(--blue-900); }
  .sw-orange-50 { background: var(--orange-50); } .sw-orange-100 { background: var(--orange-100); } .sw-orange-200 { background: var(--orange-200); }
  .sw-orange-300 { background: var(--orange-300); } .sw-orange-400 { background: var(--orange-400); } .sw-orange-500 { background: var(--orange-500); }
  .sw-gray-0 { background: var(--gray-0); } .sw-gray-25 { background: var(--gray-25); } .sw-gray-50 { background: var(--gray-50); } .sw-gray-100 { background: var(--gray-100); }
  .sw-gray-150 { background: var(--gray-150); } .sw-gray-200 { background: var(--gray-200); } .sw-gray-300 { background: var(--gray-300); } .sw-gray-400 { background: var(--gray-400); }
  .sw-gray-500 { background: var(--gray-500); } .sw-gray-600 { background: var(--gray-600); } .sw-gray-700 { background: var(--gray-700); } .sw-gray-900 { background: var(--gray-900); }
  .sw-success { background: var(--success-50); box-shadow: inset 0 -6px 0 var(--success-dot); } .sw-warning { background: var(--warning-50); box-shadow: inset 0 -6px 0 var(--warning-dot); }
  .sw-danger { background: var(--danger-50); box-shadow: inset 0 -6px 0 var(--danger-dot); } .sw-info { background: var(--info-50); box-shadow: inset 0 -6px 0 var(--info-dot); }
  .sw-protected { background: var(--protected-50); box-shadow: inset 0 -6px 0 var(--protected-dot); }
}

/* ======================================================= premium pass 2 == */
/* Compositions (ADR-079): fewer boxes, stronger hierarchy. Each pattern is reusable. */
@layer patterns {
  /* --- Page identity --------------------------------------------------------- */
  .page-eyebrow { margin-bottom: var(--space-1-5); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-tertiary); }
  .page-title, .record-title { letter-spacing: -0.028em; }
  .content { padding-top: var(--space-10); }
  @media (max-width: 900px) { .content { padding-top: var(--space-6); } }
  @media (max-width: 640px) { .page-title, .record-title { font-size: 1.5rem; } }

  /* --- Small helpers for responsive columns ------------------------------------ */
  .show-mid, .unit-days { display: none; }
  @media (min-width: 641px) and (max-width: 1400px) {
    .col-wide { display: none; }
    .show-mid { display: inline; }
    .tag.show-mid { display: inline-flex; height: 1.125rem; margin-right: var(--space-1); vertical-align: 0.05em; }
    .register .cell-primary__sub { white-space: normal; }
    .register .table td:has(.cell-primary) { min-width: 13rem; }
  }
  @media (max-width: 640px) { .unit-days { display: inline; } }

  /* --- Brief: the one story a dashboard tells first ----------------------------- */
  /* A lead figure with its trend, and the signals that explain it, in one composed surface. */
  .brief {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(17rem, 1fr);
    margin-bottom: var(--section-gap);
    background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
  }
  .brief__lead { padding: var(--space-7) var(--space-8) var(--space-6); min-width: 0; }
  .brief__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); letter-spacing: 0; }
  .brief__figure {
    display: inline-flex; align-items: baseline; margin-top: var(--space-2);
    font-size: 4.25rem; font-weight: var(--weight-semibold); letter-spacing: -0.045em; line-height: 1;
    color: var(--blue-900); font-variant-numeric: tabular-nums; text-decoration: none;
  }
  a.brief__figure:hover { color: var(--accent); text-decoration: none; }
  .brief__unit { margin-left: var(--space-3); font-size: var(--text-md); font-weight: var(--weight-medium); letter-spacing: 0; color: var(--text-secondary); }
  .brief__delta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin-top: var(--space-3); font-size: var(--text-sm); }
  .brief__delta-note { color: var(--text-tertiary); }
  .brief__note { margin-top: var(--space-3); max-width: 30rem; font-size: var(--text-sm); color: var(--text-tertiary); }
  .delta { display: inline-flex; align-items: center; gap: 0.125rem; font-weight: var(--weight-semibold); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .delta .icon { color: var(--accent); }

  .trend { margin: var(--space-5) 0 0; }
  .trend__svg { display: block; width: 100%; height: auto; overflow: visible; }
  .trend__grid { stroke: var(--border-subtle); stroke-width: 1; }
  .trend__axis { fill: var(--text-tertiary); font-size: 11px; font-family: var(--font-sans); }
  .trend__area { fill: var(--blue-50); }
  .trend__line { fill: none; stroke: var(--blue-600); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
  .trend__end { fill: var(--surface); stroke: var(--blue-600); stroke-width: 2.5; }
  .trend__caption { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-tertiary); }

  .signals { display: grid; grid-auto-rows: 1fr; border-left: var(--border-width) solid var(--border-subtle); background: var(--surface-subtle); }
  .signals > li { display: flex; }
  .signals > li + li { border-top: var(--border-width) solid var(--border-subtle); }
  .signal {
    position: relative; flex: 1; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
    padding: var(--space-4) var(--space-6); color: var(--text); text-decoration: none;
    transition: background var(--duration-fast) var(--ease);
  }
  a.signal:hover { background: var(--surface); text-decoration: none; color: var(--text); }
  a.signal:hover .signal__label { color: var(--accent); }
  a.signal:focus-visible { box-shadow: var(--focus-ring-inset); border-radius: 0; }
  .signal__figure { font-size: 1.875rem; font-weight: var(--weight-semibold); letter-spacing: -0.035em; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
  .signal__label { display: block; font-size: var(--text-base); font-weight: var(--weight-medium); }
  .signal__hint { display: block; font-size: var(--text-xs); color: var(--text-tertiary); }
  .signal--danger::before { content: ""; position: absolute; left: 0; top: var(--space-3); bottom: var(--space-3); width: 3px; border-radius: 0 3px 3px 0; background: var(--danger-dot); }
  .signal--danger .signal__figure { color: var(--danger-600); }
  @media (max-width: 1100px) {
    .brief { grid-template-columns: minmax(0, 1fr); }
    .signals { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; border-left: 0; border-top: var(--border-width) solid var(--border-subtle); }
    .signals > li + li { border-top: 0; }
    .signals > li:nth-child(n + 3) { border-top: var(--border-width) solid var(--border-subtle); }
    .signals > li:nth-child(even) { border-left: var(--border-width) solid var(--border-subtle); }
  }
  @media (max-width: 640px) {
    .brief { border-radius: var(--radius-md); }
    .brief__lead { padding: var(--space-5) var(--space-4) var(--space-4); }
    .brief__figure { font-size: 3.25rem; }
    .signal { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); padding: var(--space-3) var(--space-4); align-content: start; }
    .signal__figure { font-size: 1.5rem; }
    .signal > .delta { position: absolute; top: var(--space-3); right: var(--space-4); }
  }

  /* --- Dashboard columns: the work, and what supports it -------------------------- */
  .dash-columns { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--space-10); align-items: start; }
  .dash-columns__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--section-gap); min-width: 0; }
  .dash-columns__main > .section + .section { margin-top: 0; }
  .dash-columns__side { display: grid; gap: var(--space-8); align-content: start; }
  @media (max-width: 1180px) {
    .dash-columns { grid-template-columns: minmax(0, 1fr); gap: var(--section-gap); }
    .dash-columns__side { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--space-8); }
  }
  .side-block__header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
  .side-block__title { display: inline-flex; align-items: center; gap: var(--space-1-5); font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
  .side-block--protected .side-block__title .icon { color: var(--protected-600); }
  .side-block__note { margin-top: var(--space-2); font-size: var(--text-xs); color: var(--text-tertiary); }
  .side-block__link { margin-top: var(--space-3); }

  .tally { display: grid; border-top: var(--border-width) solid var(--border); }
  .tally > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: var(--space-2-5) 0; border-bottom: var(--border-width) solid var(--border-subtle); font-size: var(--text-sm); }
  .tally dt { color: var(--text-secondary); }
  .tally dd { font-size: 1.25rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .tally__alert dt::before { content: ""; display: inline-block; width: 0.4375rem; height: 0.4375rem; margin-right: var(--space-1-5); border-radius: var(--radius-full); background: var(--danger-dot); vertical-align: 0.08em; }
  .tally__alert dd { color: var(--danger-600); }
  .tally__hint { display: block; margin-top: var(--space-0-5); font-size: var(--text-xs); color: var(--text-tertiary); }
  .tally__link { color: var(--text); text-decoration: none; font-weight: var(--weight-medium); }
  .tally__link:hover { color: var(--accent); text-decoration: underline; }
  .tally-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--space-6); }
  /* Support Register Overview: the four key figures, one row on desktop (ADR-089 acceptance). */
  @container (min-width: 36rem) { .metrics--primary .metric__value { font-size: var(--text-3xl); } }

  .feed { display: grid; }
  .feed__item { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-2-5) 0; border-bottom: var(--border-width) solid var(--border-subtle); font-size: var(--text-sm); color: var(--text-secondary); }
  .feed__item:last-child { border-bottom: 0; }
  .feed__item p { flex: 1; min-width: 0; line-height: var(--leading-snug); }
  .feed__item strong { color: var(--text); font-weight: var(--weight-semibold); }
  .feed__subject { color: var(--text); font-weight: var(--weight-medium); }
  .feed__item > time { flex: none; font-size: var(--text-xs); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
  .feed--compact time { display: block; margin-top: 0.125rem; font-size: var(--text-xs); color: var(--text-tertiary); }
  .feed__mark { display: grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: var(--radius); background: var(--gray-75); color: var(--text-tertiary); }
  .feed__mark--warning { background: var(--warning-50); color: var(--warning-600); }
  section > .feed:not(.feed--compact) { padding: 0 var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }

  .dash-footnote { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-8); margin-top: var(--space-12); padding-top: var(--space-4); border-top: var(--border-width) solid var(--border); font-size: var(--text-sm); }
  .dash-footnote__item { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); text-decoration: none; }
  .dash-footnote__item:hover { color: var(--accent); text-decoration: none; }
  .dash-footnote__item .icon { color: var(--text-tertiary); }

  /* --- Priority list: level, reason, record, owner, age ------------------------- */
  .priorities { border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
  .priorities > li + li { border-top: var(--border-width) solid var(--border-subtle); }
  .priority {
    position: relative; display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 9.5rem 6.5rem 1rem; align-items: center; gap: var(--space-4);
    min-height: 4.25rem; padding: var(--space-3) var(--space-5); color: var(--text); text-decoration: none;
    transition: background var(--duration-fast) var(--ease);
  }
  a.priority:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
  a.priority:hover .priority__reason { color: var(--accent); }
  a.priority:focus-visible { box-shadow: var(--focus-ring-inset); border-radius: 0; }
  .priority::before { content: ""; position: absolute; left: 0; top: var(--space-3); bottom: var(--space-3); width: 3px; border-radius: 0 3px 3px 0; background: var(--gray-300); }
  .priority--danger::before { background: var(--danger-dot); }
  .priority--warning::before { background: var(--warning-dot); }
  .priority--protected::before { background: var(--protected-dot); }
  .priority--info::before { background: var(--blue-500); }
  .priority__level { font-size: var(--text-2xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
  .priority--danger .priority__level { color: var(--danger-600); }
  .priority--warning .priority__level { color: var(--warning-600); }
  .priority--protected .priority__level { color: var(--protected-600); }
  .priority__main { min-width: 0; }
  .priority__reason { display: block; font-size: var(--text-base); font-weight: var(--weight-medium); transition: color var(--duration-fast) var(--ease); }
  .priority__record { display: block; margin-top: 0.125rem; font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .priority__owner { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-xs); color: var(--text-secondary); white-space: nowrap; }
  .priority__owner > span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .priority__age { display: grid; justify-items: end; text-align: right; }
  .priority__age strong { font-size: var(--text-sm); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
  .priority__age span { font-size: var(--text-xs); color: var(--text-tertiary); }
  .priority__chevron { color: var(--text-disabled); transition: transform var(--duration) var(--ease), color var(--duration) var(--ease); }
  a.priority:hover .priority__chevron { color: var(--accent); transform: translateX(2px); }
  div.priority { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
  @media (max-width: 900px) {
    .priority { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "level age" "main main" "owner owner"; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5); }
    div.priority { grid-template-columns: minmax(0, 1fr) auto; }
    .priority__level { grid-area: level; }
    .priority__main { grid-area: main; }
    .priority__owner { grid-area: owner; margin-top: var(--space-1); }
    .priority__age { grid-area: age; display: flex; gap: var(--space-1); align-items: baseline; }
    .priority__record { white-space: normal; }
    .priority__chevron { display: none; }
  }

  /* --- Vitals: a module's state as a quiet line of figures, not a row of boxes ---- */
  .vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 0 0 var(--section-gap); padding: var(--space-5) 0; border-top: var(--border-width) solid var(--border); border-bottom: var(--border-width) solid var(--border); }
  .vital { display: grid; align-content: start; gap: 0.125rem; min-width: 0; padding: 0 var(--space-6); border-left: var(--border-width) solid var(--border-subtle); }
  .vital:first-child { padding-left: 0; border-left: 0; }
  .vital dt { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); }
  .vital dd { font-size: 1.625rem; font-weight: var(--weight-semibold); letter-spacing: -0.03em; line-height: 1.25; color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .vital dd .status { font-size: var(--text-base); letter-spacing: 0; }
  .vital__note { font-size: var(--text-xs); color: var(--text-tertiary); }
  .vital__note--warning { color: var(--warning-600); }
  @media (max-width: 640px) {
    .vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
    .vital, .vital:first-child { padding: var(--space-3) var(--space-3) var(--space-3) 0; border-left: 0; }
    .vital:nth-child(even) { padding-left: var(--space-3); border-left: var(--border-width) solid var(--border-subtle); }
    .vital:nth-child(n + 3) { border-top: var(--border-width) solid var(--border-subtle); }
    .vital dd { font-size: 1.25rem; }
  }

  .flow-list { display: grid; }
  .flow-list li { position: relative; display: flex; align-items: baseline; gap: var(--space-2-5); padding: var(--space-1-5) 0; font-size: var(--text-sm); }
  .flow-list li + li::before { content: ""; position: absolute; left: calc(0.625rem - 0.5px); top: -0.5rem; height: 0.75rem; width: 1px; background: var(--border-strong); }
  .flow-list__n { flex: none; display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: var(--radius-full); background: var(--blue-50); color: var(--blue-700); font-size: var(--text-2xs); font-weight: var(--weight-semibold); }

  /* --- Toolbar and measure index (Analytics) --------------------------------- */
  .toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-5); margin-bottom: var(--section-gap); padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
  .toolbar__field { display: grid; gap: var(--space-1); }
  .toolbar .control { width: auto; min-width: 13rem; }
  .toolbar__note { margin-left: auto; align-self: center; font-size: var(--text-xs); color: var(--text-tertiary); }
  .measure-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
  .measure-index > li { display: flex; box-shadow: 1px 0 0 var(--border-subtle), 0 1px 0 var(--border-subtle); }
  .measure {
    flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto 1rem; grid-template-areas: "area figure chev" "name figure chev"; column-gap: var(--space-4);
    padding: var(--space-4) var(--space-5); color: var(--text); text-decoration: none; transition: background var(--duration-fast) var(--ease);
  }
  a.measure:hover { background: var(--surface-hover); text-decoration: none; color: var(--text); }
  a.measure:hover .measure__name { color: var(--accent); }
  .measure__area { grid-area: area; font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
  .measure__name { grid-area: name; margin-top: 0.125rem; font-size: var(--text-base); font-weight: var(--weight-medium); }
  .measure__figure { grid-area: figure; align-self: center; font-size: 1.375rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; color: var(--blue-900); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .measure__figure--empty { font-size: var(--text-xs); font-weight: var(--weight-medium); letter-spacing: 0; color: var(--text-tertiary); }
  .measure__chevron { grid-area: chev; align-self: center; color: var(--text-disabled); }
  @media (max-width: 800px) { .measure-index { grid-template-columns: minmax(0, 1fr); } }

  /* --- Settings groups (Administration) -------------------------------------- */
  .settings-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); align-items: start; }
  @media (max-width: 1000px) { .settings-groups { grid-template-columns: minmax(0, 1fr); } }
  .settings-group__head { margin-bottom: var(--space-3); }
  .settings-group__title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
  .settings-group__title .icon { color: var(--accent); }
  .settings-group__desc { margin-top: 0.125rem; font-size: var(--text-sm); color: var(--text-tertiary); }
  .settings-list { border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
  .settings-list > li + li { border-top: var(--border-width) solid var(--border-subtle); }
  .setting { display: flex; align-items: center; gap: var(--space-3-5, 0.875rem); min-height: 4.5rem; padding: var(--space-4) var(--space-5); color: var(--text); text-decoration: none; transition: background var(--duration-fast) var(--ease); }
  a.setting:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
  a.setting:hover .setting__title { color: var(--accent); }
  a.setting:focus-visible { box-shadow: var(--focus-ring-inset); border-radius: 0; }
  .setting__icon { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--radius); background: var(--blue-50); color: var(--accent); box-shadow: inset 0 0 0 1px var(--blue-100); }
  .setting__text { flex: 1; min-width: 0; }
  .setting__title { display: block; font-size: var(--text-base); font-weight: var(--weight-semibold); }
  .setting__desc { display: block; margin-top: 0.125rem; font-size: var(--text-sm); color: var(--text-tertiary); }
  .setting__value { flex: none; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .setting__chevron { flex: none; color: var(--text-disabled); }
  .setting--soon .setting__icon { background: var(--gray-75); color: var(--text-tertiary); box-shadow: inset 0 0 0 1px var(--border); }

  /* --- Record identity: summary strip, alert, contact sheet ------------------ */
  .summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: var(--space-6); border-top: var(--border-width) solid var(--border); border-bottom: var(--border-width) solid var(--border); }
  .summary-strip__item { min-width: 0; padding: var(--space-3) var(--space-5); border-left: var(--border-width) solid var(--border-subtle); }
  .summary-strip__item:first-child { padding-left: 0; border-left: 0; }
  .summary-strip dt { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); }
  .summary-strip dd { display: grid; justify-items: start; margin-top: var(--space-1); font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text); }
  .summary-strip__sub { display: block; margin-top: 0.125rem; font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--text-tertiary); }
  .summary-strip .sensitive__value { font-size: var(--text-base); color: var(--text); }
  .summary-strip__item--warning dd { color: var(--warning-600); }
  .summary-strip__flag { display: inline-flex; align-items: center; gap: var(--space-1-5); font-weight: var(--weight-semibold); }
  @media (max-width: 1100px) {
    .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .summary-strip__item:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
    .summary-strip__item:nth-child(n + 4) { border-top: var(--border-width) solid var(--border-subtle); }
  }
  @media (max-width: 640px) {
    .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-strip__item, .summary-strip__item:nth-child(3n + 1) { padding: var(--space-3) var(--space-3) var(--space-3) 0; border-left: 0; }
    .summary-strip__item:nth-child(even) { padding-left: var(--space-3); border-left: var(--border-width) solid var(--border-subtle); }
    .summary-strip__item:nth-child(n + 3) { border-top: var(--border-width) solid var(--border-subtle); }
    .summary-strip__item:last-child:nth-child(odd) { grid-column: 1 / -1; }
  }

  .alert { display: flex; gap: var(--space-3); margin-bottom: var(--space-8); padding: var(--space-3-5, 0.875rem) var(--space-5); border: var(--border-width) solid var(--warning-200); border-left: 3px solid var(--warning-dot); border-radius: var(--radius); background: var(--warning-50); font-size: var(--text-sm); color: var(--warning-600); }
  .alert > .icon { flex: none; margin-top: 0.1875rem; }
  .alert__title { font-size: var(--text-base); font-weight: var(--weight-bold); color: inherit; }
  .alert__meta { margin-top: var(--space-1); font-size: var(--text-xs); opacity: 0.88; }
  .alert--success { border-color: var(--success-200); border-left-color: var(--success-dot); background: var(--success-50); color: var(--success-600); }

  .sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
  .sheet__item { min-width: 0; padding: var(--space-4) var(--space-5); box-shadow: 1px 0 0 var(--border-subtle), 0 1px 0 var(--border-subtle); }
  .sheet dt { display: flex; align-items: center; gap: var(--space-1-5); font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); }
  .sheet dt .icon { width: 0.8125rem; height: 0.8125rem; color: var(--gray-400); }
  .sheet dd { display: grid; justify-items: start; gap: var(--space-1); margin-top: var(--space-1-5); font-size: var(--text-base); color: var(--text); overflow-wrap: anywhere; }
  .sheet .sensitive__value { font-size: var(--text-base); color: var(--text); }
  .sheet__note { font-size: var(--text-xs); color: var(--text-tertiary); }
  .sheet__item--protected dt .icon { color: var(--protected-600); }
  @media (max-width: 640px) { .sheet { grid-template-columns: minmax(0, 1fr); } .sheet__item { padding: var(--space-3) var(--space-4); } }

  .rail-block--quiet { border-bottom: 0; }
  .meta__link { color: var(--text-link); font-weight: var(--weight-medium); }
  .meta__link .icon { color: currentColor; }

  /* --- Progression: the signature governance component --------------------------- */
  /* A dated record's stages on one hairline: done (navy), current (ringed), in progress,
     to do. Restrained like a minute book, not a checkout wizard. */
  .progression {
    list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 0 var(--space-8); padding: var(--space-6) var(--space-7) var(--space-5);
    background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  }
  .progression--steps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .progression__stage { position: relative; display: grid; justify-items: start; align-content: start; gap: var(--space-1-5); min-width: 0; padding-right: var(--space-3); }
  .progression__stage:not(:last-child)::before { content: ""; position: absolute; top: 0.625rem; left: 1.75rem; right: 0.5rem; height: 2px; border-radius: 1px; background: var(--border); }
  .progression__stage--done:not(:last-child)::before { background: var(--blue-900); }
  .progression__stage--current:not(:last-child)::before { background: linear-gradient(90deg, var(--blue-300), var(--border) 70%); }
  .progression__node { position: relative; z-index: 1; display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: var(--radius-full); border: 2px solid var(--border-strong); background: var(--surface); color: var(--text-inverse); font-size: 0.625rem; font-weight: var(--weight-bold); }
  .progression__node .icon { width: 0.75rem; height: 0.75rem; stroke-width: 2.5; }
  .progression__stage--done .progression__node { border-color: var(--blue-900); background: var(--blue-900); }
  .progression__stage--current .progression__node { border-color: var(--blue-600); box-shadow: 0 0 0 4px var(--blue-75); }
  .progression__stage--current .progression__node::after { content: ""; width: 0.5rem; height: 0.5rem; border-radius: var(--radius-full); background: var(--blue-600); }
  .progression__stage--active .progression__node { border-color: var(--blue-300); background: var(--blue-50); }
  .progression__label { font-size: var(--text-2xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
  .progression__stage--done .progression__label { color: var(--text-secondary); }
  .progression__stage--current .progression__label { color: var(--blue-900); }
  .progression__note { font-size: var(--text-xs); line-height: 1.4; color: var(--text-tertiary); }
  .progression__stage--current .progression__note { color: var(--text); font-weight: var(--weight-semibold); }
  .progression__link { display: grid; justify-items: start; gap: var(--space-1-5); color: inherit; text-decoration: none; border-radius: var(--radius-xs); }
  .progression__link:hover { text-decoration: none; }
  .progression__link:hover .progression__label { color: var(--accent); }
  .progression--steps .progression__node { color: var(--text-tertiary); }
  .progression--steps .progression__stage--done .progression__node { color: var(--text-inverse); }
  .progression--steps .progression__stage--current .progression__node { background: var(--blue-600); color: var(--text-inverse); }
  .progression--steps .progression__stage--current .progression__node::after { content: none; }
  @media (max-width: 900px) {
    .progression:not(.progression--steps) { grid-template-columns: minmax(0, 1fr); padding: var(--space-4) var(--space-5); }
    .progression:not(.progression--steps) .progression__stage { grid-template-columns: 1.25rem minmax(0, 1fr); column-gap: var(--space-3); row-gap: 0; padding: 0 0 var(--space-3); }
    .progression:not(.progression--steps) .progression__stage:last-child { padding-bottom: 0; }
    .progression:not(.progression--steps) .progression__node { grid-row: span 2; }
    .progression:not(.progression--steps) .progression__stage:not(:last-child)::before { top: 1.375rem; bottom: 0.125rem; left: calc(0.625rem - 1px); right: auto; width: 2px; height: auto; }
    .progression:not(.progression--steps) .progression__stage--current:not(:last-child)::before { background: linear-gradient(180deg, var(--blue-300), var(--border)); }
  }
  @media (max-width: 640px) {
    .progression--steps { padding: var(--space-4); }
    .progression--steps .progression__stage { padding-right: var(--space-1); }
    .progression--steps .progression__stage:not(:last-child)::before { left: 1.5rem; right: 0.25rem; }
    .progression--steps .progression__stage:not(.progression__stage--current) .progression__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .progression--steps .progression__stage--current .progression__label { white-space: nowrap; }
  }

  /* Agenda item trails: the same language at item scale (paper → minute → resolution → action). */
  .item-trails { list-style: none; border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .item-trail { padding: var(--space-4) var(--space-5); }
  .item-trail + .item-trail { border-top: var(--border-width) solid var(--border-subtle); }
  .item-trail__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
  .item-trail__n { min-width: 2rem; font-size: var(--text-xs); font-weight: var(--weight-bold); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
  .item-trail__title { flex: 1 1 14rem; font-weight: var(--weight-medium); }
  .item-trail__steps {
    list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: var(--space-3) 0 0 calc(2rem + var(--space-3)); padding: 0;
    background: linear-gradient(var(--border), var(--border)) 0 0.25rem / calc(100% - 4rem) 2px no-repeat;
  }
  .item-trail__step { position: relative; display: grid; gap: 0.125rem; padding: var(--space-4) var(--space-3) 0 0; font-size: var(--text-xs); color: var(--text-tertiary); }
  .item-trail__step::before { content: ""; position: absolute; left: 0; top: 0; width: 0.625rem; height: 0.625rem; border-radius: var(--radius-full); border: 2px solid var(--border-strong); background: var(--surface); }
  .item-trail__step.is-done::before { border-color: var(--blue-900); background: var(--blue-900); }
  .item-trail__kind { font-size: var(--text-2xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
  .item-trail__step.is-done > span:last-child { color: var(--text); }
  @media (max-width: 640px) { .item-trail__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-3); margin-left: 0; background: none; } }

  .lifecycle--compact { padding: 0; border: 0; background: none; box-shadow: none; }
  .lifecycle--compact .lifecycle__step { padding: var(--space-1-5) 0; }

  /* --- Payroll: the import batch as a first-class object ----------------------- */
  .batch { margin-bottom: var(--section-gap); background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
  .batch__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4) var(--space-6); padding: var(--space-6) var(--space-7); }
  .batch__identity { min-width: 0; }
  .batch__date { margin-top: var(--space-0-5); font-size: 1.875rem; font-weight: var(--weight-semibold); letter-spacing: -0.03em; line-height: 1.15; color: var(--blue-900); }
  .batch__meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin-top: var(--space-1-5); font-size: var(--text-sm); color: var(--text-secondary); }
  .batch__file { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1-5); margin-top: var(--space-3); font-size: var(--text-sm); color: var(--text); }
  .batch__file .icon { color: var(--text-tertiary); }
  .batch__state { display: grid; justify-items: end; align-content: start; gap: var(--space-3); }
  .batch__figures { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: var(--border-width) solid var(--border-subtle); background: var(--surface-subtle); }
  .batch__figures > div { padding: var(--space-3-5, 0.875rem) var(--space-5); box-shadow: inset 1px 0 0 var(--border-subtle); }
  .batch__figures > div:first-child { box-shadow: none; padding-left: var(--space-7); }
  .batch__figures dt { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-tertiary); }
  .batch__figures dd { margin-top: 0.125rem; font-size: 1.25rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
  .batch__figure--warning dd { color: var(--warning-600); }
  .batch__sub { display: block; margin-top: 0.125rem; font-size: var(--text-xs); font-weight: var(--weight-regular); letter-spacing: 0; color: var(--text-tertiary); }

  /* Annual donation statements (ADR-083) */
  .statement-notes { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); }
  .statement-strip { margin-top: 0; }
  @media (min-width: 1101px) { .statement-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
  .reconcile-line { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 var(--space-5); font-size: var(--text-sm); color: var(--success-600); }
  .reconcile-line--danger { color: var(--danger-600); font-weight: var(--weight-medium); }
  .version-list { display: grid; gap: 0; }
  .version-list__item { display: grid; gap: var(--space-1); padding: var(--space-3) 0; border-top: var(--border-width) solid var(--border-subtle); }
  .version-list__item:first-child { border-top: 0; padding-top: 0; }
  .version-list__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); }
  .version-list__meta { font-size: var(--text-xs); color: var(--text-tertiary); overflow-wrap: anywhere; }
  .version-list__item > .btn { justify-self: start; margin-left: calc(-1 * var(--space-2)); }
  @media (max-width: 640px) { .statement-sheet { grid-template-columns: minmax(0, 1fr); } }
  .stack-form { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
  .statement-total { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-3); padding: 0 var(--space-5); font-size: var(--text-sm); color: var(--text-secondary); }
  .statement-total strong { color: var(--text); font-variant-numeric: tabular-nums; }
  /* Tax Statement delivery (ADR-085) */
  .subnav { margin: calc(-1 * var(--space-2)) 0 var(--space-6); }
  .mail-mode__note { margin: 0; }
  .delivery-actions__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
  @media (max-width: 1100px) { .delivery-actions__grid { grid-template-columns: minmax(0, 1fr); } }
  .action-card { display: grid; align-content: start; gap: var(--space-3); padding: var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .action-card > .btn { justify-self: start; }
  .action-card__title { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text); }
  .action-card__text { font-size: var(--text-sm); color: var(--text-secondary); }
  .action-card__fields { display: grid; gap: var(--space-2); }
  .cell-sub { display: block; margin-top: 0.125rem; font-size: var(--text-xs); color: var(--text-tertiary); }
  .run-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .run-figures dd, .summary-strip dd, .stack-form .choice span, .confirm .choice span { min-width: 0; overflow-wrap: anywhere; }
  @media (max-width: 640px) { .run-figures { grid-template-columns: minmax(0, 1fr); } }
  .run-strip { margin-top: 0; margin-bottom: var(--space-5); }
  @media (min-width: 1101px) { .run-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
  .run-continue { align-items: center; margin-bottom: var(--space-6); }
  .abandon-form { max-width: 32rem; margin: var(--space-5) 0 var(--space-6); }
  .delivery-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
  .delivery-history { margin-top: var(--space-4); }
  .delivery-history form { justify-self: start; }
  /* Controlled release of send runs (ADR-086) */
  .release-steps { margin-bottom: var(--space-6); }
  .stage-note { margin-bottom: var(--space-5); }
  .stage-panel { display: grid; gap: var(--space-4); margin-bottom: var(--space-6); padding: var(--space-6); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg, var(--radius-md)); background: var(--surface); box-shadow: var(--shadow-xs); }
  .stage-panel > .btn, .stage-panel > form { justify-self: start; }
  .stage-panel__title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
  .stage-panel__text { font-size: var(--text-sm); color: var(--text-secondary); max-width: 70ch; }
  .stage-panel--approve { border-color: var(--blue-200, var(--border)); }
  .stage-banner { justify-self: start; padding: var(--space-2) var(--space-3); border-radius: var(--radius); background: var(--blue-25); color: var(--blue-900); font-size: var(--text-sm); font-weight: var(--weight-semibold); letter-spacing: 0.04em; }
  .review-figures { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  @media (max-width: 1100px) { .review-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .review-figures dd { min-width: 0; overflow-wrap: anywhere; }
  .release { display: grid; gap: var(--space-5); max-width: 60rem; padding: var(--space-8) var(--space-7); border: 2px solid var(--blue-700, var(--border)); border-radius: var(--radius-lg, var(--radius-md)); background: var(--surface); box-shadow: var(--shadow-sm); }
  .release__mode { justify-self: start; padding: var(--space-1-5) var(--space-3); border-radius: var(--radius); font-size: var(--text-sm); font-weight: var(--weight-bold); letter-spacing: 0.04em; }
  .release__mode--live { background: var(--danger-50); color: var(--danger-600); border: 1px solid var(--danger-200); }
  .release__mode--safe { background: var(--blue-25); color: var(--blue-900); border: 1px solid var(--blue-100); }
  .release__mode--test { background: var(--warning-50); color: var(--warning-600); border: 1px solid var(--warning-200); }
  .release__headline { font-size: clamp(1.5rem, 2.6vw, 2.125rem); line-height: 1.2; font-weight: var(--weight-bold); letter-spacing: -0.01em; color: var(--text); }
  .release__facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4) var(--space-6); padding: var(--space-5) 0; border-top: var(--border-width) solid var(--border-subtle); border-bottom: var(--border-width) solid var(--border-subtle); }
  .release__facts dt { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: var(--weight-medium); }
  .release__facts dd { margin-top: var(--space-1); font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text); min-width: 0; overflow-wrap: anywhere; }
  .release__wide { grid-column: span 2; }
  .release__wide dd { font-size: var(--text-base); }
  @media (max-width: 760px) { .release { padding: var(--space-5); } .release__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .release__wide { grid-column: 1 / -1; } }
  .release__warning { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-sm); color: var(--text-secondary); }
  .release__form { display: grid; gap: var(--space-3); }
  .release__label { font-size: var(--text-base); color: var(--text); }
  .release__phrase { font-family: var(--font-mono); padding: 0.1rem 0.4rem; border-radius: var(--radius-sm, 4px); background: var(--gray-100, var(--surface-sunken)); }
  .release__input { max-width: 18rem; font-family: var(--font-mono); font-size: var(--text-lg); letter-spacing: 0.06em; }
  .release__fingerprint { margin: 0; }
  /* Separation of duties (ADR-086): LIVE three-person control */
  .duties { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5); border: 1px solid var(--danger-200); border-radius: var(--radius); background: var(--surface); }
  .duties__title { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text); }
  .duties__text { font-size: var(--text-sm); color: var(--text-secondary); max-width: 70ch; }
  .duties__chain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); list-style: none; margin: 0; padding: 0; }
  .duties__step { display: grid; gap: var(--space-1); padding: var(--space-3); border-radius: var(--radius); background: var(--surface-sunken, var(--gray-100)); min-width: 0; }
  .duties__role { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: var(--weight-medium); }
  .duties__who { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); overflow-wrap: anywhere; }
  .duties__rule { font-size: var(--text-xs); color: var(--text-secondary); }
  .duties__note { margin: 0; }
  @media (max-width: 760px) { .duties__chain { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .reason-list { display: grid; gap: var(--space-1); margin: var(--space-1-5) 0 0; padding-left: 1.1rem; list-style: disc; }
  .batch__figure--total { background: var(--blue-25); }
  .batch__figure--total dd { color: var(--blue-900); }
  @media (max-width: 1100px) {
    .batch__figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .batch__figures > div:nth-child(4n + 1) { box-shadow: none; padding-left: var(--space-7); }
    .batch__figures > div:nth-child(n + 5) { border-top: var(--border-width) solid var(--border-subtle); }
  }
  @media (max-width: 640px) {
    .batch__head { padding: var(--space-5) var(--space-4); }
    .batch__state { justify-items: start; }
    .batch__date { font-size: 1.5rem; }
    .batch__figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .batch__figures > div, .batch__figures > div:nth-child(4n + 1) { padding: var(--space-3) var(--space-4); box-shadow: none; }
    .batch__figures > div:nth-child(even) { box-shadow: inset 1px 0 0 var(--border-subtle); }
    .batch__figures > div:nth-child(n + 3) { border-top: var(--border-width) solid var(--border-subtle); }
    .batch__figures > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  }

  /* Positions: subscriber, financial and quality are different questions, set side by side. */
  .positions { display: grid; grid-template-columns: 1.15fr 1fr 1fr; margin-bottom: var(--section-gap); border-top: var(--border-width) solid var(--border); border-bottom: var(--border-width) solid var(--border); }
  .position { min-width: 0; padding: var(--space-6) var(--space-7); border-left: var(--border-width) solid var(--border); }
  .position:first-child { padding-left: 0; border-left: 0; }
  .position__title { font-size: var(--text-2xs); font-weight: var(--weight-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
  .position__lead { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin-top: var(--space-3); color: var(--text); text-decoration: none; }
  .position__lead:hover { text-decoration: none; }
  .position__lead:hover .position__figure { color: var(--accent); }
  .position__figure { font-size: 2.5rem; font-weight: var(--weight-semibold); letter-spacing: -0.04em; line-height: 1; color: var(--blue-900); font-variant-numeric: tabular-nums; transition: color var(--duration-fast) var(--ease); }
  .position__unit { font-size: var(--text-sm); color: var(--text-secondary); }
  .position__delta { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--text-tertiary); }
  .position__parts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-7); margin-top: var(--space-4); padding-top: var(--space-3); border-top: var(--border-width) solid var(--border-subtle); }
  .position__parts dt { font-size: var(--text-xs); color: var(--text-tertiary); }
  .position__parts dd { font-size: var(--text-base); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
  .position--quality .position__figure { color: var(--warning-600); }
  /* Reconciliation decision rows (payroll, ADR-081): the issue, its source values, the decision. */
  .decision__source { padding: 0 var(--space-5) var(--space-2) calc(4.5rem + var(--space-4) + var(--space-5)); font-size: var(--text-xs); color: var(--text-tertiary); overflow-wrap: anywhere; }
  .decision__form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 0 var(--space-5) var(--space-4) calc(4.5rem + var(--space-4) + var(--space-5)); }
  .decision__form .control { width: auto; min-width: 12rem; flex: 1 1 12rem; }
  .decision__form select.control { flex: 0 1 15rem; }
  @media (max-width: 900px) { .decision__source, .decision__form { padding-left: var(--space-5); } }
  .dropzone__input { max-width: 26rem; height: auto; margin-bottom: var(--space-2); padding: var(--space-1-5); background: var(--surface-subtle); font-size: var(--text-sm); color: var(--text-secondary); }
  .dropzone__input::file-selector-button {
    margin-right: var(--space-3); height: var(--control-sm); padding: 0 var(--space-3);
    border: var(--border-width) solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font: inherit; font-weight: var(--weight-medium); cursor: pointer;
  }
  .dropzone__input::file-selector-button:hover { border-color: var(--gray-300); background: var(--surface-subtle); }
  .position__note { margin-top: var(--space-3); font-size: var(--text-xs); color: var(--text-tertiary); }
  /* A provisional (undecided-rule) figure says so in words, quietly. */
  .provisional { display: inline-block; margin-left: var(--space-1); padding: 0 var(--space-1); border: var(--border-width) dashed var(--border-strong); border-radius: var(--radius-xs); font-size: var(--text-2xs); font-weight: var(--weight-medium); line-height: 1.4; color: var(--text-tertiary); vertical-align: 0.05em; }
  @media (max-width: 1100px) {
    .positions { grid-template-columns: minmax(0, 1fr); }
    .position, .position:first-child { padding: var(--space-5) 0; border-left: 0; }
    .position + .position { border-top: var(--border-width) solid var(--border-subtle); }
  }

  /* --- Staged workflow (payroll import concept) --------------------------------- */
  .stage { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: var(--space-10); align-items: start; }
  .stage__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); min-width: 0; }
  .stage__main > .section + .section { margin-top: 0; }
  .stage__main--wide { grid-column: 1 / -1; }
  .stage__side { display: grid; gap: var(--space-6); }
  @media (max-width: 1100px) { .stage { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); } }
  .stage-nav { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-10); padding-top: var(--space-5); border-top: var(--border-width) solid var(--border); }
  .dropzone { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-12) var(--space-6); border: 1.5px dashed var(--gray-300); border-radius: var(--radius-lg); background: var(--surface); text-align: center; }
  .dropzone__icon { display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: var(--space-2); border-radius: var(--radius-md); background: var(--blue-50); color: var(--accent); }
  .dropzone__title { font-size: var(--text-md); font-weight: var(--weight-semibold); }
  .dropzone__text { max-width: 26rem; margin-bottom: var(--space-3); font-size: var(--text-sm); color: var(--text-tertiary); }
  .file-line { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: var(--text-sm); }
  .file-line > .icon { color: var(--text-tertiary); }
  .check-list { border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
  .check-list__item { display: grid; grid-template-columns: 1.25rem 11rem 8rem minmax(0, 1fr); align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); font-size: var(--text-sm); }
  .check-list__item + .check-list__item { border-top: var(--border-width) solid var(--border-subtle); }
  .check-list__icon { color: var(--success-600); display: inline-flex; }
  .check-list__item--warning .check-list__icon, .check-list__item--warning .check-list__outcome { color: var(--warning-600); }
  .check-list__name { font-weight: var(--weight-medium); }
  .check-list__outcome { font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
  .check-list__detail { color: var(--text-tertiary); }
  @media (max-width: 640px) {
    .check-list__item { grid-template-columns: 1.25rem minmax(0, 1fr) auto; grid-template-areas: "icon name outcome" ". detail detail"; row-gap: 0.125rem; padding: var(--space-3) var(--space-4); }
    .check-list__icon { grid-area: icon; } .check-list__name { grid-area: name; } .check-list__outcome { grid-area: outcome; } .check-list__detail { grid-area: detail; font-size: var(--text-xs); }
  }
  .ledger { border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
  .ledger__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3-5, 0.875rem) var(--space-5); }
  .ledger__row + .ledger__row { border-top: var(--border-width) solid var(--border-subtle); }
  .ledger__row dt { font-size: var(--text-base); font-weight: var(--weight-medium); }
  .ledger__row dt span { display: block; margin-top: 0.125rem; font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--text-tertiary); }
  .ledger__row dd { font-size: 1.375rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .ledger__row--warning dd { color: var(--warning-600); }
  .ledger__row--info dd { color: var(--blue-700); }
  .ledger__row--muted dd { color: var(--text-secondary); }
  .ledger__row--total { background: var(--blue-25); border-top-color: var(--blue-100); }
  .ledger__row--total dd { color: var(--blue-900); }
  .confirm { display: grid; gap: var(--space-4); padding: var(--space-7); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
  .confirm__title { font-size: 1.375rem; font-weight: var(--weight-semibold); letter-spacing: -0.02em; }
  .confirm__text { margin-top: calc(var(--space-3) * -1); font-size: var(--text-sm); color: var(--text-secondary); }
  .confirm__figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-6); padding: var(--space-4) 0; border-top: var(--border-width) solid var(--border-subtle); border-bottom: var(--border-width) solid var(--border-subtle); }
  .confirm__figures dt { font-size: var(--text-xs); color: var(--text-tertiary); }
  .confirm__figures dd { font-size: 1.25rem; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }

  /* --- Mobile shell ------------------------------------------------------------ */
  .topbar__wordmark, .topbar__search { display: none; }
  @media (max-width: 900px) {
    .topbar__wordmark { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; margin-right: var(--space-2); }
    .topbar__wordmark strong { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); white-space: nowrap; }
    .topbar__wordmark span { font-size: var(--text-2xs); color: var(--text-tertiary); white-space: nowrap; }
  }
  @media (max-width: 640px) {
    .topbar .search { display: none; }
    .topbar__search { display: inline-flex; margin-left: auto; }
    .topbar__end { margin-left: 0; }
    .topbar { gap: var(--space-1-5); padding-left: var(--space-3); padding-right: var(--space-3); }
  }
  @media (max-width: 360px) { .topbar__wordmark span { display: none; } }

  /* --- Performance & Analytics (ADR-093) ---------------------------------------
     Charts: one value axis from zero; series 1 PVV blue, series 2 blue-400 dashed (validated
     for colour-vision deficiency); target line neutral and labelled in text; every mark has a
     native tooltip and every chart a table. */
  .segmented__item[aria-current="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
  .an-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-6); }
  .an-controls .field { margin: 0; }
  .an-controls .control { width: auto; min-width: 9rem; }
  .an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-3); }
  .an-kpi { display: grid; gap: var(--space-1-5); align-content: start; padding: var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); min-width: 0; }
  .an-kpi__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); }
  .an-kpi__label a { color: inherit; }
  .an-kpi__figure { font-size: 1.75rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-figure); line-height: 1.15; color: var(--blue-900); font-variant-numeric: tabular-nums; }
  .an-kpi__figure--empty { font-size: var(--text-lg); color: var(--text-tertiary); }
  .an-kpi__compare { font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .an-kpi__meta { display: grid; gap: 0.125rem; margin-top: var(--space-1); padding-top: var(--space-2); border-top: var(--border-width) solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-tertiary); }
  .an-kpi__meta dt { display: inline; }
  .an-kpi__meta dd { display: inline; color: var(--text-secondary); }
  .an-meter { display: grid; gap: var(--space-1); font-size: var(--text-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .an-meter svg { display: block; width: 100%; max-width: 12rem; }
  .an-meter__track { fill: var(--gray-150); }
  .an-meter__fill { fill: var(--accent); }
  .an-meter__fill--met { fill: var(--success-dot); }
  .an-badge { justify-self: start; }
  .an-chart { margin: 0; }
  .an-chart__svg { display: block; width: 100%; height: auto; overflow: visible; }
  .an-chart__grid { stroke: var(--border-subtle); stroke-width: 1; }
  .an-chart__axis { stroke: var(--border-strong); stroke-width: 1; }
  .an-chart__tick, .an-chart__xlabel, .an-chart__end, .an-chart__note { fill: var(--text-tertiary); font-size: 11px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
  .an-chart__end { fill: var(--text-secondary); font-weight: var(--weight-semibold); }
  .an-chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .an-chart__line.chart__line--1 { stroke: var(--blue-600); }
  .an-chart__line.chart__line--2 { stroke: var(--blue-400); }
  .an-chart__line.chart__line--dashed { stroke-dasharray: 5 4; }
  .an-chart__dot { fill: var(--surface); stroke: var(--blue-600); stroke-width: 2; }
  .an-chart__hit { fill: transparent; }
  .an-chart__hit:hover { fill: var(--blue-100); }
  .an-chart__target { stroke: var(--gray-500); stroke-width: 1.5; stroke-dasharray: 2 3; }
  .an-chart__divider { stroke: var(--gray-300); stroke-width: 1; stroke-dasharray: 3 3; }
  .chart__bar--cms { fill: var(--blue-600); }
  .chart__bar--history { fill: var(--blue-200); stroke: var(--blue-400); stroke-width: 1; }
  .chart__bar--projection { fill: var(--surface); stroke: var(--blue-400); stroke-width: 1; stroke-dasharray: 3 2; }
  .chart__bar--suppressed { fill: none; }
  .an-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); margin: var(--space-2) 0 0; padding: 0; list-style: none; font-size: var(--text-xs); color: var(--text-secondary); }
  .an-legend li { display: inline-flex; align-items: center; gap: var(--space-1-5); }
  .an-legend li::before { content: ""; display: inline-block; width: 1.125rem; height: 0; border-top: 2px solid var(--blue-600); }
  .an-legend .chart__key--2::before { border-top-color: var(--blue-400); }
  .an-legend .chart__key--dashed::before { border-top-style: dashed; }
  .an-legend .chart__key--target::before { border-top: 2px dotted var(--gray-500); }
  .an-legend .chart__key--cms::before, .an-legend .chart__key--history::before, .an-legend .chart__key--projection::before { width: 0.75rem; height: 0.75rem; border: 0; border-radius: 2px; background: var(--blue-600); }
  .an-legend .chart__key--history::before { background: var(--blue-200); box-shadow: inset 0 0 0 1px var(--blue-400); }
  .an-legend .chart__key--projection::before { background: var(--surface); box-shadow: inset 0 0 0 1px var(--blue-400); }
  .an-legend .chart__key--partial::before { width: 0.75rem; height: 0.75rem; border: 1px dashed var(--blue-300); border-radius: 2px; background: var(--blue-50); }
  .an-figures th, .an-figures td { white-space: nowrap; }
  .an-figures td.is-history { background: var(--surface-subtle); }
  .an-figures .is-suppressed { color: var(--text-tertiary); }
  .an-figures tfoot td { font-weight: var(--weight-semibold); border-top: var(--border-width) solid var(--border); }
  .an-sources { display: grid; gap: var(--space-2); }
  .an-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: var(--space-6); }
  .an-inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
  .an-inline-form .control { width: auto; min-width: 7rem; }

  /* Payroll analytics (ANALYTICS_DESIGN §14): sub-navigation, KPI grid, signed bars. */
  .an-subnav { display: flex; flex-wrap: wrap; gap: 2px; margin: calc(-1 * var(--space-4)) 0 var(--space-6); }
  .an-kpis--dense { grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); }
  .an-columns--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  @media (max-width: 1000px) { .an-columns--2 { grid-template-columns: minmax(0, 1fr); } }
  .an-kpis--dense .an-kpi { padding: var(--space-4); }
  .an-kpis--dense .an-kpi__figure { font-size: 1.5rem; }
  .an-kpi__figure a { color: inherit; text-decoration: none; }
  .an-kpi__figure a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
  .an-kpi__delta { font-size: var(--text-xs); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .an-kpi--target .an-kpi__figure { color: var(--text); }
  .an-window { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-6); }
  .an-window .field { margin: 0; }
  .an-window .control { width: auto; min-width: 10rem; }
  .an-window__note { flex-basis: 100%; margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .chart__bar--up { fill: var(--blue-600); }
  .chart__bar--down { fill: var(--gray-400); }
  .an-legend .chart__key--up::before, .an-legend .chart__key--down::before { width: 0.75rem; height: 0.75rem; border: 0; border-radius: 2px; background: var(--blue-600); }
  .an-legend .chart__key--down::before { background: var(--gray-400); }
  .an-bars { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
  .an-bars__row { display: grid; grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr) 6.5rem; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
  .an-bars__label { color: var(--text-secondary); }
  .an-bars__value { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
  .an-bars svg { display: block; width: 100%; height: 0.75rem; }
  .an-bars__track { fill: var(--gray-100); }
  .an-bars__fill { fill: var(--blue-600); }
  .an-drill { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); }
  .an-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: var(--space-6); }
  @media (max-width: 1100px) { .an-split { grid-template-columns: minmax(0, 1fr); } }

  /* Payroll import review cards (ANALYTICS_DESIGN §17): the discrepancy first, then the recorded
     and incoming records side by side, the explanation, and the decision. Differences are
     marked by a rule and weight, not by coloured boxes. */
  .review-list { display: grid; gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
  .review-card { display: grid; gap: var(--space-4); padding: var(--space-5) var(--space-6); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); scroll-margin-top: var(--space-8); }
  .review-card:target { box-shadow: var(--focus-ring); }
  .review-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); padding-bottom: var(--space-3); border-bottom: var(--border-width) solid var(--border-subtle); }
  .review-card__title { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue-900); }
  .review-card__state { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--warning-600); }
  .review-card__key { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .review-card__key strong { margin-left: var(--space-1); font-size: var(--text-base); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
  .review-card__section { display: grid; gap: var(--space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
  .review-card__section p { margin: 0; overflow-wrap: anywhere; }
  .review-card__label { margin: 0; padding: 0; font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
  .review-card__form { display: grid; gap: var(--space-4); padding-top: var(--space-4); border-top: var(--border-width) solid var(--border-subtle); }
  .review-card__form textarea { width: 100%; resize: vertical; }
  .review-card__actions { display: flex; justify-content: flex-end; }
  .compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
  .compare__col { min-width: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-subtle); }
  .compare__col--incoming { background: var(--surface); box-shadow: inset 0 0 0 var(--border-width) var(--border); }
  .compare__title { margin: 0 0 var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
  .compare__fields { display: grid; gap: var(--space-1-5); margin: 0; }
  .compare__fields--next { margin-top: var(--space-3); padding-top: var(--space-3); border-top: var(--border-width) dashed var(--border); }
  .compare__fields--source { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
  .compare__fields > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: var(--space-2); padding: var(--space-1) 0 var(--space-1) var(--space-2); border-left: 2px solid transparent; }
  .compare__fields dt { font-size: var(--text-sm); color: var(--text-tertiary); }
  .compare__fields dd { margin: 0; font-size: var(--text-sm); color: var(--text); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
  .compare__fields > .is-different { border-left-color: var(--accent); }
  .compare__fields > .is-different dd { font-weight: var(--weight-semibold); }
  .compare__fields > .is-different dt::after { content: " · differs"; color: var(--accent); font-weight: var(--weight-medium); }
  .review-choices { display: grid; gap: var(--space-2); }
  .review-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); align-items: start; padding: var(--space-3); border: var(--border-width) solid var(--border); border-radius: var(--radius); cursor: pointer; }
  .review-choice:hover { border-color: var(--border-strong); }
  .review-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
  .review-choice input { margin-top: 0.2rem; }
  .review-choice strong { display: block; font-size: var(--text-sm); color: var(--text); }
  .review-choice__effect { display: block; margin-top: 0.125rem; font-size: var(--text-sm); color: var(--text-secondary); }
  .review-card__keys { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-6); margin: 0; }
  .review-card__keys > div { display: flex; align-items: baseline; gap: var(--space-2); }
  .review-card__keys dt { font-size: var(--text-sm); color: var(--text-secondary); }
  .review-card__keys dd { margin: 0; font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
  .review-card__matching { flex-wrap: nowrap; padding: var(--space-3); border-radius: var(--radius); background: var(--surface-subtle); font-size: var(--text-sm); }
  .review-card__matching input { flex: none; margin-top: 0.2rem; }
  /* One review item on its own page: back to the queue, where am I, previous / next. */
  .review-nav { position: sticky; top: calc(var(--topbar-height) + var(--space-2)); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
  .review-nav__back { margin-left: calc(-1 * var(--space-2)); }
  .review-nav__where { display: grid; gap: 0.125rem; margin: 0; flex: 1 1 14rem; font-size: var(--text-sm); color: var(--text-secondary); }
  .review-nav__where strong { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text); font-variant-numeric: tabular-nums; }
  .review-nav [aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
  .review-list--single { margin-top: 0; }
  .review-card__open { color: inherit; text-decoration: none; }
  .review-card__open:hover, .review-card__open:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
  .queue-done { margin: 0; }
  @media (max-width: 640px) { .review-nav { position: static; } .review-nav__step { width: 100%; } .review-nav__step > * { flex: 1 1 0; justify-content: center; } }
  /* Identifier discrepancy (PAYROLL_DESIGN §23): the three identifiers, prominently. */
  .ident-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--space-3); margin: 0; }
  .ident-keys > div { display: grid; gap: var(--space-1); align-content: start; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-subtle); border-left: 2px solid transparent; }
  .ident-keys > .is-different { border-left-color: var(--accent); background: var(--surface); box-shadow: inset 0 0 0 var(--border-width) var(--border); }
  .ident-keys dt { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
  .ident-keys dd { display: grid; gap: var(--space-1); margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; overflow-wrap: anywhere; }
  .ident-keys__note { font-size: var(--text-xs); font-weight: var(--weight-regular); letter-spacing: 0; color: var(--text-tertiary); }
  .ident-table { display: block; max-width: 100%; overflow-x: auto; }
  .ident-mappings { display: grid; gap: var(--space-1); margin: 0; padding-left: var(--space-5); font-size: var(--text-sm); }

  /* Reconciliation queue of a master import (PAYROLL_DESIGN §22). */
  .queue-progress { display: grid; gap: var(--space-4); margin-bottom: var(--space-8); padding: var(--space-5) var(--space-6); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
  .queue-progress__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
  .queue-progress__title { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text); }
  .queue-progress__figure { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .queue-progress__figure strong { font-size: var(--text-lg); color: var(--blue-900); }
  .queue-progress__bar { width: 100%; height: 0.5rem; border: 0; border-radius: var(--radius-full); background: var(--gray-150); overflow: hidden; appearance: none; }
  .queue-progress__bar::-webkit-progress-bar { background: var(--gray-150); border-radius: var(--radius-full); }
  .queue-progress__bar::-webkit-progress-value { background: var(--blue-600); border-radius: var(--radius-full); }
  .queue-progress__bar::-moz-progress-bar { background: var(--blue-600); border-radius: var(--radius-full); }
  .queue-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-3); margin: 0; }
  .queue-figures > div { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border-left: 2px solid var(--border-subtle); }
  .queue-figures > div.is-attention { border-left-color: var(--warning-dot); }
  .queue-figures dt { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
  .queue-figures dd { margin: 0; font-size: 1.5rem; font-weight: var(--weight-semibold); color: var(--blue-900); font-variant-numeric: tabular-nums; }
  .queue-figures__sub { display: block; font-size: var(--text-xs); font-weight: var(--weight-regular, 400); color: var(--text-secondary); }
  .queue-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .queue-actions form { margin: 0; }
  .queue-year { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-semibold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
  .queue-year:first-of-type { margin-top: 0; }
  .queue-tabs { margin-bottom: var(--space-3); }
  .queue-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-5); }
  .queue-filters .field { margin: 0; }
  .queue-filters .control { width: auto; min-width: 11rem; }
  .queue-filters__actions { display: flex; gap: var(--space-2); }
  .queue-group { list-style: none; }
  .queue-group + .queue-group { margin-top: var(--space-6); }
  .queue-group__title { margin: 0 0 var(--space-3); font-size: var(--text-md, 1rem); font-weight: var(--weight-semibold); color: var(--blue-900); }
  .queue-group__title span { margin-left: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary); }
  .table tbody tr[aria-current="true"] td { background: var(--blue-25); }
  @media (max-width: 760px) {
    .compare { grid-template-columns: minmax(0, 1fr); }
    .compare__fields > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .review-card { padding: var(--space-4); }
  }

  /* Payroll Analytics trend charts (ANALYTICS_DESIGN §14.10): one filter bar, three headline
     figures, three stacked charts sharing one horizontal geometry. PVV blue marks, recessive
     grid, pale or hollow marks for fortnights awaiting approval, a tooltip on every fortnight. */
  .an-filter { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); padding: var(--space-4) var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
  .an-filter__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); }
  .an-filter .field { margin: 0; }
  .an-filter__fy .control { min-width: 11rem; }
  .an-filter__include { align-self: center; margin-top: var(--space-5); font-size: var(--text-sm); }
  .an-filter__actions { display: flex; gap: var(--space-2); margin-left: auto; }
  .an-filter__hint { margin: 0; font-size: var(--text-xs); color: var(--text-tertiary); }
  .an-filter__quick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1-5); padding-top: var(--space-3); border-top: var(--border-width) solid var(--border-subtle); }
  .an-filter__quick-label { margin-right: var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
  .an-quick { padding: var(--space-1) var(--space-3); border: var(--border-width) solid var(--border); border-radius: var(--radius-full); font-size: var(--text-sm); color: var(--text-secondary); text-decoration: none; }
  .an-quick:hover { border-color: var(--blue-200); color: var(--blue-800); text-decoration: none; }
  .an-quick[aria-current="true"] { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-800); font-weight: var(--weight-semibold); }
  .an-filter__error { margin: 0; }
  .an-filter__error p { margin: 0; }
  .an-date { position: relative; display: flex; align-items: center; }
  .an-date .control { width: 9.5rem; padding-right: 2.5rem; font-variant-numeric: tabular-nums; }
  .an-date__open { position: absolute; right: 0.25rem; display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; }
  .an-date__open:hover { background: var(--blue-50); color: var(--blue-700); }
  .an-date__open:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  .an-date__native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
  .an-period { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-4); margin: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--text-secondary); }
  .an-period strong { color: var(--text); font-weight: var(--weight-semibold); }
  .an-status { color: var(--text-secondary); }
  .an-status--provisional { color: var(--warning-600); font-weight: var(--weight-medium); }
  .an-headline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: var(--space-8); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
  .an-headline:empty { display: none; }
  .an-headline__item { display: grid; gap: var(--space-1); align-content: start; padding: var(--space-5) var(--space-6); min-width: 0; }
  .an-headline__item + .an-headline__item { border-left: var(--border-width) solid var(--border-subtle); }
  .an-headline__label { margin: 0; font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
  .an-headline__figure { margin: 0; font-size: 2rem; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-figure); line-height: 1.15; color: var(--blue-900); font-variant-numeric: tabular-nums; }
  .an-headline__sub, .an-headline__change { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .an-headline__state { margin: var(--space-1) 0 0; font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--success-600); }
  .an-headline__state--provisional { color: var(--warning-600); }
  .an-trend-section { margin-bottom: var(--space-8); }
  .an-trend-section__head { margin-bottom: var(--space-3); }
  .an-trend-section__title { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--text); }
  .an-trend-section__desc { max-width: 60rem; margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .an-trend-empty { margin-bottom: var(--space-8); }
  .an-trend-note { display: flex; align-items: center; gap: var(--space-1-5); margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .an-trend-table { margin-top: var(--space-2); font-size: var(--text-sm); }
  .an-trend-table > summary { cursor: pointer; color: var(--text-link); }
  .an-trend-table .register { margin-top: var(--space-2); }
  .an-trend-table .num { text-align: right; }
  .an-after-trends { padding-top: var(--space-6); border-top: var(--border-width) solid var(--border-subtle); }
  .an-trend { position: relative; margin: 0; }
  .an-trend__svg { display: block; width: 100%; height: auto; overflow: visible; }
  .an-trend__grid { stroke: var(--border-subtle); stroke-width: 1; }
  .an-trend__axis { stroke: var(--border-strong); stroke-width: 1; }
  .an-trend__tick, .an-trend__xlabel, .an-trend__note, .an-trend__end, .an-trend__axis-title { fill: var(--text-tertiary); font-size: 12px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
  .an-trend__axis-title { fill: var(--text-secondary); font-size: 11px; font-weight: var(--weight-semibold); letter-spacing: 0.04em; }
  .an-trend__end { fill: var(--text); font-weight: var(--weight-semibold); }
  .an-trend__divider { stroke: var(--gray-400); stroke-width: 1; stroke-dasharray: 3 3; }
  .an-trend__note { fill: var(--text-secondary); font-size: 11px; }
  .an-trend__line { fill: none; stroke: var(--blue-600); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .an-trend__area { fill: var(--blue-50); }
  .an-trend__bar { fill: var(--blue-600); }
  .an-trend__bar--provisional { fill: var(--blue-100); stroke: var(--blue-400); stroke-width: 1; stroke-dasharray: 3 2; }
  .an-trend__dot { fill: var(--blue-600); stroke: var(--surface); stroke-width: 2; }
  .an-trend__dot--provisional { fill: var(--surface); stroke: var(--blue-600); stroke-width: 2; }
  .an-trend__band { fill: transparent; }
  .an-trend__guide { stroke: var(--blue-300); stroke-width: 1; opacity: 0; }
  .an-trend__focus { fill: none; stroke: var(--blue-600); stroke-width: 2; opacity: 0; }
  .an-trend__slot { cursor: default; outline: none; }
  .an-trend__slot:hover .an-trend__band, .an-trend__slot:focus .an-trend__band, .an-trend__slot.is-active .an-trend__band { fill: var(--blue-25); fill-opacity: 0.6; }
  .an-trend__slot:hover .an-trend__guide, .an-trend__slot:focus .an-trend__guide, .an-trend__slot.is-active .an-trend__guide,
  .an-trend__slot:hover .an-trend__focus, .an-trend__slot:focus .an-trend__focus, .an-trend__slot.is-active .an-trend__focus { opacity: 1; }
  .an-trend__slot:focus-visible .an-trend__band { stroke: var(--blue-500); stroke-width: 1.5; }
  .an-trend__legend .an-key--line::before { border-top: 2px solid var(--blue-600); }
  .an-trend__legend .an-key--hollow::before { width: 0.625rem; height: 0.625rem; border: 2px solid var(--blue-600); border-radius: var(--radius-full); background: var(--surface); }
  .an-trend__legend .an-key--bar::before { width: 0.75rem; height: 0.75rem; border: 0; border-radius: 2px; background: var(--blue-600); }
  .an-trend__legend .an-key--bar-provisional::before { width: 0.75rem; height: 0.75rem; border: 1px dashed var(--blue-400); border-radius: 2px; background: var(--blue-100); }
  .an-tip { position: absolute; z-index: 5; min-width: 15rem; max-width: 20rem; padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-md); font-size: var(--text-sm); color: var(--text); pointer-events: none; }
  .an-tip[hidden] { display: none; }
  .an-tip__title { margin: 0 0 var(--space-1-5); font-weight: var(--weight-semibold); color: var(--blue-900); }
  .an-tip__rows { display: grid; grid-template-columns: auto auto; gap: 0.125rem var(--space-4); margin: 0; }
  .an-tip__rows dt { color: var(--text-secondary); }
  .an-tip__rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: var(--weight-medium); }
  .an-tip__note { margin: var(--space-2) 0 0; padding-top: var(--space-1-5); border-top: var(--border-width) solid var(--border-subtle); font-size: var(--text-xs); color: var(--success-600); font-weight: var(--weight-semibold); }
  .an-tip__note--provisional { color: var(--warning-600); }
  @media (max-width: 900px) {
    .an-headline { grid-template-columns: minmax(0, 1fr); }
    .an-headline__item + .an-headline__item { border-left: 0; border-top: var(--border-width) solid var(--border-subtle); }
    .an-filter__actions { margin-left: 0; }
  }
  /* The charts scale with their width (one viewBox), so their text is set larger in viewBox
     units on narrower screens to stay legible. */
  @media (max-width: 1100px) {
    .an-trend__tick, .an-trend__xlabel, .an-trend__end { font-size: 14px; }
    .an-trend__axis-title, .an-trend__note { font-size: 13px; }
  }
  @media (max-width: 640px) {
    .an-trend__tick, .an-trend__xlabel, .an-trend__end { font-size: 18px; }
    .an-trend__axis-title, .an-trend__note { font-size: 16px; }
  }

  /* Payroll Analytics dashboard (ANALYTICS_DESIGN §14.11): toolbar, six figures, four panels. */
  .pad { position: relative; display: grid; gap: var(--space-5); }
  .pad-toolbar { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
  .pad-toolbar__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); }
  .pad-toolbar .field { margin: 0; }
  .pad-toolbar__fy .control { min-width: 10.5rem; }
  .pad-toolbar__actions { display: flex; gap: var(--space-2); margin-left: auto; }
  .pad-toolbar__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding-top: var(--space-3); border-top: var(--border-width) solid var(--border-subtle); }
  .pad-quick { display: flex; flex-wrap: wrap; gap: var(--space-1-5); }
  .pad-choice { display: grid; gap: var(--space-1-5); margin: 0; padding: 0; border: 0; min-width: 0; }
  .pad-choice__options { display: inline-flex; padding: 2px; border: var(--border-width) solid var(--border); border-radius: var(--radius); background: var(--surface-subtle); }
  .pad-choice__option { position: relative; display: inline-flex; cursor: pointer; }
  .pad-choice__option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .pad-choice__option span { display: inline-flex; align-items: center; height: calc(var(--control-sm, 2rem) + 2px); padding: 0 var(--space-3); border-radius: calc(var(--radius) - 2px); font-size: var(--text-sm); color: var(--text-secondary); white-space: nowrap; }
  .pad-choice__option:hover span { color: var(--text); }
  .pad-choice__option input:checked + span { background: var(--surface); color: var(--blue-900); font-weight: var(--weight-semibold); box-shadow: 0 1px 2px rgb(15 30 55 / 0.12), inset 0 0 0 1px var(--border); }
  .pad-choice__option input:focus-visible + span { box-shadow: var(--focus-ring); }

  .pad-context { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
  .pad-context__period { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .pad-context__period strong { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--blue-900); }
  .pad-context__period span + span::before, .pad-context__period strong + span::before { content: "·"; margin-right: var(--space-3); color: var(--gray-300); }
  .pad-flag { display: inline-flex; align-items: center; gap: var(--space-1-5); margin: 0; padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); background: var(--success-50); font-size: var(--text-sm); color: var(--success-600); }
  .pad-flag--provisional { background: var(--warning-50); color: var(--warning-600); box-shadow: inset 0 0 0 1px var(--warning-200); }
  .pad-flag a { color: inherit; font-weight: var(--weight-semibold); }
  .pad-note { display: flex; align-items: flex-start; gap: var(--space-2); margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .pad-note .icon { flex: none; margin-top: 0.2rem; }
  .pad-note--warning { color: var(--warning-600); }
  .pad-empty { padding: var(--space-10) var(--space-6); border: var(--border-width) dashed var(--border); border-radius: var(--radius-md); background: var(--surface); }
  /* Provisional data: unmistakable, but not alarming. */
  .pad-provisional { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-5); border: var(--border-width) solid var(--warning-200); border-left: 4px solid var(--warning-dot); border-radius: var(--radius-md); background: var(--warning-50); color: var(--warning-600); }
  .pad-provisional > .icon { flex: none; margin-top: 0.15rem; }
  .pad-provisional p { margin: 0; font-size: var(--text-sm); color: var(--text); }
  .pad-provisional .pad-provisional__title { margin-bottom: var(--space-1); font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--warning-600); }
  .pad-provisional a { font-weight: var(--weight-semibold); }

  .pad-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
  .pad-kpi { position: relative; display: grid; align-content: start; gap: var(--space-1-5); min-width: 0; padding: var(--space-5) var(--space-5) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none; transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease); }
  .pad-kpi::before { content: ""; position: absolute; top: 0; left: var(--space-5); width: 2.25rem; height: 3px; border-radius: 0 0 3px 3px; background: var(--orange-400); }
  a.pad-kpi:hover { border-color: var(--blue-200); box-shadow: var(--shadow-md); text-decoration: none; }
  a.pad-kpi:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  .pad-kpi__label { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0; font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
  .pad-kpi__badge { padding: 0.0625rem var(--space-2); border-radius: var(--radius-full); background: var(--warning-50); font-size: 0.6875rem; letter-spacing: 0.02em; text-transform: none; color: var(--warning-600); box-shadow: inset 0 0 0 1px var(--warning-200); }
  .pad-kpi__value { margin: var(--space-1) 0 0; font-size: 2.125rem; font-weight: var(--weight-semibold); line-height: 1.1; letter-spacing: var(--tracking-figure); color: var(--blue-900); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .pad-kpi__value--good { color: var(--success-600); }
  .pad-kpi__value--bad { color: var(--danger-600); }
  .pad-kpi__sub { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .pad-kpi__delta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-1-5); margin: var(--space-1) 0 0; font-size: var(--text-sm); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; color: var(--text-secondary); }
  .pad-kpi__delta--good { color: var(--success-600); }
  .pad-kpi__delta--bad { color: var(--danger-600); }
  .pad-kpi__vs { font-weight: var(--weight-regular); color: var(--text-tertiary); }
  .pad-kpi__arrow { display: inline-block; width: 0; height: 0; border-left: 0.3rem solid transparent; border-right: 0.3rem solid transparent; transform: translateY(-0.1rem); }
  .pad-kpi__arrow--up { border-bottom: 0.4rem solid currentColor; }
  .pad-kpi__arrow--down { border-top: 0.4rem solid currentColor; }
  .pad-kpi__arrow--flat { width: 0.5rem; height: 2px; border: 0; background: currentColor; }
  .pad-kpi__target { margin: 0; font-size: var(--text-xs); color: var(--text-tertiary); }
  .pad-kpi__more { display: inline-flex; align-items: center; gap: var(--space-1); margin-top: var(--space-2); padding-top: var(--space-2); border-top: var(--border-width) solid var(--border-subtle); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--blue-600); }

  .pad-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }
  /* Half-width panels scale the 640-unit charts down, so their text is set larger in viewBox
     units to read at about 12px; one column (wider) and phones (narrower) adjust. */
  .pad-chart .an-trend__tick, .pad-chart .an-trend__xlabel, .pad-chart .an-trend__end { font-size: 15px; }
  .pad-chart .an-trend__axis-title { font-size: 13px; }
  .pad-chart .pad-value { font-size: 14px; }
  .pad-panel { display: grid; grid-template-rows: auto 1fr; min-width: 0; border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
  .pad-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5) var(--space-2); }
  .pad-panel__title { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--blue-900); }
  .pad-panel__desc { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .pad-panel__expand { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border: var(--border-width) solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; }
  .pad-panel__expand:hover { border-color: var(--border); background: var(--surface-subtle); color: var(--blue-700); }
  .pad-panel__expand:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  .pad-panel__body { display: grid; align-content: start; gap: var(--space-3); padding: 0 var(--space-5) var(--space-4); min-width: 0; }
  .pad-panel__empty { margin: 0; padding: var(--space-8) 0; text-align: center; font-size: var(--text-sm); color: var(--text-tertiary); }
  .pad-panel .an-trend-table { margin-top: 0; }
  .pad-panel.is-expanded { position: fixed; inset: 3vh 3vw; z-index: 90; overflow: auto; box-shadow: 0 24px 64px rgb(0 33 63 / 0.28); }
  .pad-panel.is-expanded .pad-panel__body { max-width: 96rem; width: 100%; margin: 0 auto; }
  .pad-backdrop { position: fixed; inset: 0; z-index: 89; background: rgb(0 33 63 / 0.45); }
  body.has-pad-expanded { overflow: hidden; }
  .pad-sub { display: grid; gap: var(--space-1); padding-top: var(--space-3); border-top: var(--border-width) solid var(--border-subtle); }
  .pad-sub__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
  .pad-sub__title { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); }
  .pad-toggles { display: flex; flex-wrap: wrap; gap: var(--space-1-5); }
  .pad-toggle { display: inline-flex; align-items: center; gap: var(--space-1-5); padding: 0.125rem var(--space-2-5, 0.625rem); border: var(--border-width) solid var(--border); border-radius: var(--radius-full); background: var(--surface); font-size: var(--text-xs); color: var(--text-secondary); cursor: pointer; }
  .pad-toggle::before { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 2px; background: var(--blue-600); }
  .pad-toggle--resumed::before { background: var(--blue-300); }
  .pad-toggle--ceased::before { background: var(--gray-400); }
  .pad-toggle[aria-pressed="false"] { color: var(--text-tertiary); text-decoration: line-through; }
  .pad-toggle[aria-pressed="false"]::before { background: var(--gray-150); }
  .pad-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
  [data-hide~="new"] .pad-series--new, [data-hide~="resumed"] .pad-series--resumed, [data-hide~="ceased"] .pad-series--ceased { display: none; }

  .pad-line { fill: none; stroke: var(--blue-600); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
  .pad-line--previous { stroke: var(--gray-400); stroke-width: 2; stroke-dasharray: 5 4; }
  .pad-area { fill: var(--blue-50); fill-opacity: 0.7; }
  .pad-bar { fill: var(--blue-600); }
  .pad-bar--year { fill: var(--blue-300); }
  .pad-bar--year.is-selected { fill: var(--blue-900); }
  .pad-bar--incomplete { fill-opacity: 0.55; stroke: var(--blue-700); stroke-width: 1.25; stroke-dasharray: 4 3; }
  .pad-bar--new { fill: var(--blue-600); }
  .pad-bar--resumed { fill: var(--blue-300); }
  .pad-bar--ceased { fill: var(--gray-400); }
  .pad-bar--provisional { fill-opacity: 0.4; stroke: var(--blue-600); stroke-width: 1; stroke-dasharray: 3 2; }
  .pad-bar--partial { stroke: var(--orange-400); stroke-width: 1.5; stroke-dasharray: 3 2; }
  .pad-value { font-size: 12px; }
  .pad-slot { cursor: pointer; }
  .pad-legend .pad-key--line::before { border-top: 2px solid var(--blue-600); }
  .pad-legend .pad-key--dashed::before { border-top: 2px dashed var(--gray-400); }
  .pad-legend .pad-key--hollow::before { width: 0.625rem; height: 0.625rem; border: 2px solid var(--blue-600); border-radius: var(--radius-full); background: var(--surface); }
  .pad-legend .pad-key--bar::before, .pad-legend .pad-key--new::before { width: 0.75rem; height: 0.75rem; border: 0; border-radius: 2px; background: var(--blue-600); }
  .pad-legend .pad-key--resumed::before, .pad-legend .pad-key--year::before { width: 0.75rem; height: 0.75rem; border: 0; border-radius: 2px; background: var(--blue-300); }
  .pad-legend .pad-key--ceased::before { width: 0.75rem; height: 0.75rem; border: 0; border-radius: 2px; background: var(--gray-400); }
  .pad-legend .pad-key--bar-provisional::before { width: 0.75rem; height: 0.75rem; border: 1px dashed var(--blue-600); border-radius: 2px; background: var(--blue-100); }
  .pad-legend .pad-key--incomplete::before { width: 0.75rem; height: 0.75rem; border: 1px dashed var(--blue-700); border-radius: 2px; background: var(--blue-100); }
  .pad-legend .pad-key--partial::before { width: 0.75rem; height: 0.75rem; border: 1.5px dashed var(--orange-400); border-radius: 2px; background: var(--blue-100); }

  .pad.is-loading .pad-kpis, .pad.is-loading .pad-grid { opacity: 0.45; pointer-events: none; transition: opacity var(--duration-fast) var(--ease); }
  .pad-loading { position: absolute; top: var(--space-3); right: var(--space-3); z-index: 3; display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1-5) var(--space-3); border-radius: var(--radius-full); background: var(--blue-900); font-size: var(--text-xs); font-weight: var(--weight-semibold); color: #fff; }
  .pad-loading[hidden] { display: none; }
  .pad-footer { display: grid; gap: var(--space-2); }
  .pad-details { padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius); background: var(--surface); font-size: var(--text-sm); }
  .pad-details > summary { cursor: pointer; font-weight: var(--weight-medium); color: var(--text-link, var(--blue-700)); }
  .pad-details .dl, .pad-details .check-list { margin-top: var(--space-3); }

  /* Drill-down reports. */
  .pad-report__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
  .pad-report__title { margin: 0 0 var(--space-1-5); font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: -0.01em; color: var(--blue-900); }
  .pad-report__tabs { margin-bottom: var(--space-3); }
  .pad-report__privacy { display: flex; align-items: center; gap: var(--space-1-5); margin: 0 0 var(--space-4); font-size: var(--text-xs); color: var(--text-tertiary); }
  .pad-report__filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); padding: var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
  .pad-report__filters .field { margin: 0; }
  .pad-report__filters input[type="search"] { min-width: 26rem; }
  .pad-report__actions { display: flex; gap: var(--space-2); }
  .pad-report__summary { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-4); }
  .pad-report__summary > div { display: grid; gap: 0.125rem; min-width: 9rem; padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .pad-report__summary dt { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
  .pad-report__summary dd { margin: 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); color: var(--blue-900); font-variant-numeric: tabular-nums; }
  .pad-report__check { border-color: var(--success-200) !important; background: var(--success-50) !important; }
  .pad-report__check dd { color: var(--success-600); font-size: var(--text-base); }
  .pad-report__check.is-bad { border-color: var(--danger-200) !important; background: var(--danger-50) !important; }
  .pad-report__check.is-bad dd { color: var(--danger-600); }
  .pad-report__table .num { text-align: right; font-variant-numeric: tabular-nums; }
  .pad-sort { display: inline-flex; align-items: center; gap: 0.25rem; color: inherit; text-decoration: none; white-space: nowrap; }
  .pad-sort:hover { color: var(--blue-700); text-decoration: underline; }
  .pad-sort.is-asc::after { content: "▲"; font-size: 0.6rem; color: var(--blue-600); }
  .pad-sort.is-desc::after { content: "▼"; font-size: 0.6rem; color: var(--blue-600); }
  .pad-move { white-space: nowrap; display: inline-flex; padding: 0.0625rem var(--space-2); border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--weight-semibold); background: var(--blue-50); color: var(--blue-800); }
  .pad-move--ceased { background: var(--gray-150); color: var(--gray-500); }
  .pad-move--resumed { background: var(--success-50); color: var(--success-600); }
  .pad-calc { display: grid; gap: var(--space-4); max-width: 52rem; padding: var(--space-5) var(--space-6); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
  .pad-calc__steps { display: grid; gap: 0; margin: 0; }
  .pad-calc__steps > div { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: var(--space-4); padding: var(--space-3) 0; border-bottom: var(--border-width) solid var(--border-subtle); }
  .pad-calc__steps dt { color: var(--text-secondary); }
  .pad-calc__steps dd { margin: 0; font-variant-numeric: tabular-nums; }
  .pad-calc__result dt { font-weight: var(--weight-semibold); color: var(--text); }
  .pad-calc__result dd { font-size: var(--text-xl, 1.5rem); font-weight: var(--weight-semibold); color: var(--blue-900); }
  .pad-calc__notes { display: grid; gap: var(--space-1-5); margin: 0; padding-left: var(--space-5); font-size: var(--text-sm); color: var(--text-secondary); }

  @media (max-width: 1240px) { .pad-toolbar__actions { margin-left: 0; } }
  @media (max-width: 1100px) {
    .pad-grid { grid-template-columns: minmax(0, 1fr); }
    .pad-chart .an-trend__tick, .pad-chart .an-trend__xlabel, .pad-chart .an-trend__end, .pad-chart .pad-value { font-size: 13px; }
    .pad-chart .an-trend__axis-title { font-size: 12px; }
  }
  @media (max-width: 640px) {
    .pad-chart .an-trend__tick, .pad-chart .an-trend__xlabel, .pad-chart .an-trend__end, .pad-chart .pad-value { font-size: 20px; }
    .pad-chart .an-trend__axis-title { font-size: 18px; }
  }
  @media (max-width: 900px) { .pad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pad-calc__steps > div { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); } }
  @media (max-width: 560px) { .pad-kpis { grid-template-columns: minmax(0, 1fr); } .pad-report__filters input[type="search"] { min-width: 0; width: 100%; } }

  /* Overview: the executive payroll section (ADR-099) reuses the Payroll Analytics patterns. */
  .ov-payroll { margin-bottom: var(--space-8, 2rem); }
  .ov-payroll .section__header { align-items: flex-end; }
  .ov-payroll .pad-kpi__value { font-size: var(--text-xl, 1.5rem); }
  @media (min-width: 1280px) { .ov-payroll .pad-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

  /* Document viewer (ADR-099): the browser's PDF viewer in a frame that fills the screen. */
  .doc-viewer { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--space-3); min-height: calc(100vh - var(--topbar-height, 4rem) - 9rem); }
  .doc-viewer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
  .doc-viewer__heading { margin: 0; font-size: var(--text-lg, 1.25rem); font-weight: var(--weight-semibold); color: var(--text); }
  .doc-viewer__meta { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text-secondary); }
  .doc-viewer__actions { flex-wrap: wrap; }
  .doc-viewer__frame { width: 100%; height: 100%; min-height: 28rem; border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface-sunken, #f4f5f7); }
  .doc-viewer__note { margin: 0; }
  .doc-viewer { grid-template-columns: minmax(0, 1fr); }
  /* A definite height, so the pages scroll inside the viewer (toolbar and page indicator stay in view). */
  .pdf-app { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; min-height: 24rem; height: calc(100vh - 15rem); min-width: 0; border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface-sunken, #f4f5f7); overflow: hidden; }
  .pdf-app__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--surface); border-bottom: var(--border-width) solid var(--border); }
  .pdf-app__label { margin-right: auto; font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .pdf-app__pages { min-width: 0; min-height: 0; overflow: auto; padding: var(--space-3); display: grid; justify-items: start; align-content: start; gap: var(--space-3); }
  .pdf-app__pages:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
  /* Pages centre when narrower than the viewer and scroll sideways when zoomed past it. */
  .pdfjs-page { background: #fff; box-shadow: var(--shadow-md); margin-inline: auto; flex: none; }
  .pdfjs-page canvas { display: block; }
  .pdf-app__status { margin: 0; padding: var(--space-2) var(--space-3); color: var(--text-secondary); }
  .doc-viewer__empty { align-self: center; }

  /* Policy approvals and files (ADR-100). A historical approval is shown as evidence, set apart
     from CMS decisions by a quiet left rule; a missing record is dashed, never hidden. */
  .historical { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border-subtle); border-left: 3px solid var(--blue-200); border-radius: var(--radius); background: var(--surface-subtle); }
  .historical + .historical { margin-top: var(--space-2); }
  .historical--missing { border-left-style: dashed; border-left-color: var(--border-strong); }
  .historical--unestablished { border-left-color: var(--warning-dot); }
  .historical { min-width: 0; }
  /* Import batch documents: long titles wrap so every column, including the action, stays in view. */
  .import-items .cell-primary__title { white-space: normal; }
  .import-items .stack-title { min-width: 14rem; }
  .historical__head { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
  /* The evidence labels are long; on a phone they wrap inside the card rather than overflow it. */
  .historical__head .status { white-space: normal; min-width: 0; }
  .file-list { display: grid; gap: var(--space-2); }
  .file-list__item { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius); background: var(--surface); }
  .file-list__name { font-weight: var(--weight-semibold); color: var(--text); overflow-wrap: anywhere; }
  .file-list__meta { font-size: var(--text-xs); color: var(--text-tertiary); }
  .file-list__end { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .fingerprint { font-size: var(--text-xs); color: var(--text-tertiary); overflow-wrap: anywhere; word-break: break-all; }
  .board-strip { margin-bottom: var(--space-6); }
  .register .col-owner { min-width: 13rem; }

  /* Document content read from the file (extraction.py): a reading column with the document's
     own outline. Typography follows the document's structure, never a fixed template. */
  .content-status { margin-bottom: var(--space-2); }
  .content-status__notes { margin: var(--space-2) 0 0; padding-left: var(--space-5); font-size: var(--text-sm); display: grid; gap: var(--space-1); }
  .content-provenance { margin: 0 0 var(--space-6); overflow-wrap: anywhere; }
  .reader { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: var(--space-8); align-items: start; }
  .reader__outline { position: sticky; top: var(--space-6); max-height: calc(100vh - var(--space-12)); overflow: auto; min-width: 0; }
  .reader__toc-title { font-size: var(--text-xs); font-weight: var(--weight-semibold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); cursor: pointer; padding: var(--space-1) 0 var(--space-2); }
  .reader__body { min-width: 0; max-width: 48rem; padding: var(--space-8) var(--space-10); background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); }
  .reader__version { margin: 0 0 var(--space-4); font-size: var(--text-xs); color: var(--text-tertiary); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
  .reader-after { max-width: 66rem; margin-top: var(--space-10); }
  .doc-outline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
  .doc-outline__item a { display: flex; gap: var(--space-2); padding: var(--space-1) var(--space-2); border-radius: var(--radius); font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-snug); text-decoration: none; }
  .doc-outline__item a:hover { background: var(--surface-subtle); color: var(--text); }
  .doc-outline__text { display: flex; gap: var(--space-2); padding: var(--space-1) 0; font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-snug); }
  .doc-outline__item--l1 a { color: var(--text); font-weight: var(--weight-medium); }
  .doc-outline__item--l2 a { padding-left: var(--space-5); }
  .doc-outline__item--l3 a, .doc-outline__item--l4 a, .doc-outline__item--l5 a { padding-left: var(--space-8); font-size: var(--text-xs); }
  .doc-outline__num { flex: none; min-width: 2.25rem; font-variant-numeric: tabular-nums; color: var(--text-tertiary); }
  .doc-outline--summary { columns: 2 18rem; column-gap: var(--space-8); margin-top: var(--space-2); }
  .doc-outline--summary .doc-outline__item { break-inside: avoid; }
  .doc-text { font-size: var(--text-base); line-height: var(--leading-normal); color: var(--text); overflow-wrap: break-word; }
  .doc-text > * + * { margin-top: var(--space-3); }
  .doc-text__title { font-size: var(--text-xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); margin-bottom: var(--space-6); }
  .doc-text__h { scroll-margin-top: var(--space-6); line-height: var(--leading-snug); display: flex; gap: var(--space-3); font-weight: var(--weight-semibold); }
  .doc-text__h1 { font-size: var(--text-lg); margin-top: var(--space-8); padding-top: var(--space-4); border-top: var(--border-width) solid var(--border-subtle); }
  .doc-text__h2 { font-size: var(--text-md); margin-top: var(--space-6); }
  .doc-text__h3, .doc-text__h4, .doc-text__h5 { font-size: var(--text-base); margin-top: var(--space-5); }
  .doc-text__h:first-child, .doc-text__title + .doc-text__h1 { border-top: 0; padding-top: 0; margin-top: 0; }
  .doc-text__num { flex: none; min-width: 2.5rem; font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: var(--weight-semibold); }
  .doc-text__p--numbered, .doc-text__item:not(.doc-text__item--bullet) { display: flex; gap: var(--space-3); }
  .doc-text__p--numbered .doc-text__num, .doc-text__item .doc-text__num { font-weight: var(--weight-regular); }
  .doc-text__list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
  .doc-text__item { padding-left: var(--space-5); }
  .doc-text__item--bullet { position: relative; padding-left: var(--space-6); }
  .doc-text__item--bullet::before { content: ""; position: absolute; left: var(--space-2); top: 0.7em; width: 0.35rem; height: 0.35rem; border-radius: 50%; background: var(--text-tertiary); }
  .doc-text__d1 { margin-left: var(--space-6); }
  .doc-text__d2 { margin-left: var(--space-10); }
  .doc-text__d3, .doc-text__d4 { margin-left: var(--space-12); }
  .doc-text__box { padding-left: var(--space-3); border-left: 2px solid var(--border-subtle); }
  .doc-text__table { overflow-x: auto; margin: var(--space-4) 0; }
  .doc-text__table table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  .doc-text__table td, .doc-text__table th { border: var(--border-width) solid var(--border); padding: var(--space-2) var(--space-3); vertical-align: top; text-align: left; min-width: 6rem; }
  .doc-text__table th { background: var(--surface-subtle); font-weight: var(--weight-semibold); }
  .doc-text__table p { margin: 0; }
  .doc-text__table p + p { margin-top: var(--space-1); }
  .doc-text__table td:empty::after { content: "\00a0"; }
  .doc-text__merged { border-top-color: transparent !important; }
  .compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); }
  .compare__pane { min-width: 0; display: grid; gap: var(--space-2); align-content: start; }
  .compare__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); margin: 0; }
  .compare__scroll { height: calc(100vh - 14rem); min-height: 24rem; overflow: auto; padding: var(--space-5) var(--space-6); background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); font-size: var(--text-sm); }
  .compare__pdf.pdf-app, .compare__pdf.doc-viewer__frame { height: calc(100vh - 14rem); min-height: 24rem; }
  .register__note { margin: 0; padding: var(--space-3) var(--space-5); border-top: var(--border-width) solid var(--border-subtle); color: var(--text-secondary); display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
  .search--wide { flex: 1 1 22rem; }
  .search-results { list-style: none; margin: 0; padding: 0; border-top: var(--border-width) solid var(--border-subtle); }
  .search-result { padding: var(--space-5); border-bottom: var(--border-width) solid var(--border-subtle); display: grid; gap: var(--space-3); }
  .search-result__head { display: grid; gap: var(--space-1); }
  .search-result__title { font-size: var(--text-md); font-weight: var(--weight-semibold); color: var(--text); }
  .search-result__meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--text-xs); color: var(--text-secondary); }
  .search-result__hits { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
  .search-hit { padding-left: var(--space-4); border-left: 2px solid var(--border-subtle); }
  .search-hit__section { font-size: var(--text-sm); font-weight: var(--weight-medium); }
  .search-hit__excerpt { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--text-secondary); overflow-wrap: anywhere; }
  .search-hit__excerpt mark { background: var(--warning-50); box-shadow: inset 0 -2px 0 var(--warning-200); color: var(--text); padding: 0 1px; border-radius: 2px; }
  @media (max-width: 1100px) {
    .reader { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
    .reader__outline { position: static; max-height: none; padding: var(--space-3) var(--space-4); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
    .compare { grid-template-columns: minmax(0, 1fr); }
    .compare__scroll, .compare__pdf.pdf-app, .compare__pdf.doc-viewer__frame { height: 70vh; }
  }
  @media (max-width: 640px) {
    .reader__body { padding: var(--space-5) var(--space-4); }
    .doc-text__d1, .doc-text__d2, .doc-text__d3, .doc-text__d4 { margin-left: var(--space-3); }
    .doc-text__num { min-width: 2rem; }
    .doc-outline--summary { columns: 1; }
  }
}

/* --- Historical records review (ADR-105) ------------------------------------------- */
@layer pages {
  .review-total { padding: var(--space-2) var(--space-3); border-radius: var(--radius); border: var(--border-width) solid var(--success-200); background: var(--success-50); color: var(--success-600); font-size: var(--text-sm); display: inline-flex; gap: var(--space-1-5); align-items: center; }
  .review-total--open { border-color: var(--warning-200); background: var(--warning-50); color: var(--warning-600); }
  .review-tabs { overflow-x: auto; scrollbar-width: thin; }
  .review-tabs .tab { white-space: nowrap; }
  .tab__count--open, .tab[aria-current="page"] .tab__count--open { background: var(--warning-50); color: var(--warning-600); }

  .review-progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
  .review-progress__bar { appearance: none; width: min(22rem, 100%); height: 0.5rem; border: 0; border-radius: var(--radius-full); background: var(--gray-100); overflow: hidden; }
  .review-progress__bar::-webkit-progress-bar { background: var(--gray-100); border-radius: var(--radius-full); }
  .review-progress__bar::-webkit-progress-value { background: var(--success-dot); border-radius: var(--radius-full); }
  .review-progress__bar::-moz-progress-bar { background: var(--success-dot); border-radius: var(--radius-full); }
  .review-filters { flex-wrap: wrap; }
  .review-filters .segmented__item { display: inline-flex; align-items: center; text-decoration: none; }

  .review-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--space-3); }
  .review-card { display: grid; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius); border: var(--border-width) solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm); }
  .review-card:hover { border-color: var(--border-control); }
  .review-card--open { border-left: 3px solid var(--warning-dot); }
  .review-card__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-secondary); }
  .review-card__figure { font-size: 1.5rem; font-weight: var(--weight-semibold); display: flex; align-items: center; gap: var(--space-1); font-variant-numeric: tabular-nums; }
  .review-card__unit { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary); }
  .review-card .review-progress__bar { width: 100%; }
  .review-card__sub { font-size: var(--text-xs); color: var(--text-tertiary); }
  .review-history { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1-5); font-size: var(--text-xs); color: var(--text-secondary); }

  .review-group { margin-bottom: var(--space-6); padding: var(--space-4); border-radius: var(--radius); border: var(--border-width) solid var(--border); background: var(--surface); }
  .review-group--open { border-left: 3px solid var(--warning-dot); }
  .review-group__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
  .review-group__title { font-size: var(--text-base); font-weight: var(--weight-semibold); margin: 0; }
  .review-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--space-3); }
  .review-person { padding: var(--space-3); border-radius: var(--radius-sm); border: var(--border-width) solid var(--border); background: var(--gray-50); min-width: 0; }
  .review-person--excluded { opacity: 0.65; }
  .review-person__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
  .review-person__name { font-weight: var(--weight-semibold); margin: 0 0 var(--space-1); overflow-wrap: anywhere; }
  .review-person__actions { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
  .review-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-3); margin: var(--space-2) 0 0; font-size: var(--text-sm); }
  .review-facts dt { color: var(--text-tertiary); }
  .review-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
  .review-questions { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-2); }
  .review-question { display: grid; gap: var(--space-1-5); padding: var(--space-3); border-radius: var(--radius-sm); border: var(--border-width) solid var(--border); }
  .review-question--open { background: var(--warning-50); border-color: var(--warning-200); }
  .review-question__pair { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1-5); font-weight: var(--weight-medium); }
  .review-question__why { font-size: var(--text-sm); color: var(--text-secondary); }
  .review-question__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
  .review-compare { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1-5); }
  .review-compare__item { display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-2); border-radius: var(--radius-full); font-size: var(--text-xs); border: var(--border-width) solid; }
  .review-compare__item--match { background: var(--success-50); border-color: var(--success-200); color: var(--success-600); }
  .review-compare__item--conflict { background: var(--danger-50); border-color: var(--danger-200); color: var(--danger-600); }

  .review-list { display: grid; gap: var(--space-3); }
  .review-item { padding: var(--space-4); border-radius: var(--radius); border: var(--border-width) solid var(--border); background: var(--surface); }
  .review-item--open { border-left: 3px solid var(--warning-dot); }
  .review-item__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
  .review-item__title { font-size: var(--text-base); font-weight: var(--weight-semibold); margin: 0; overflow-wrap: anywhere; }
  .review-name { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: var(--space-4); margin-top: var(--space-3); }
  .review-name__source { font-size: var(--text-sm); margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
  .review-name__form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: var(--space-3); align-items: end; }
  .review-vpso__form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
  .review-vpso__form .control { width: auto; max-width: 100%; min-width: min(18rem, 100%); }
  .review-blocking { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1-5); font-size: var(--text-sm); }
  .review-blocking li { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--warning-600); }
  .review-pagination { margin-top: var(--space-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

  @media (max-width: 720px) {
    .review-name, .review-name__form, .review-people { grid-template-columns: 1fr; }
  }
}

/* Clinical reporting (ADR-108): filters, the period banner, linked summary figures, horizontal bar
   lists (HTML labels, tiny SVG bars: no inline styles under the strict CSP), column charts, the
   theme heat table. Restrained: white panels, thin rules, muted theme tints. */
@layer pages {
  .report-filters { background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-4); }
  .report-filters__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: var(--space-3) var(--space-4); }
  .report-filters .field { margin: 0; }
  .report-period { border-left: 3px solid var(--blue-600); background: var(--blue-25); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-size: var(--text-sm); }
  .report-period p { margin: 0; }
  .report-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: var(--space-3); }
  .report-figure { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); color: var(--text); text-decoration: none; }
  .report-figure:hover, .report-figure:focus-visible { border-color: var(--blue-300); background: var(--blue-25); }
  .report-figure__label { font-size: var(--text-xs); color: var(--text-secondary); font-weight: var(--weight-medium); }
  .report-figure__value { font-size: 1.6rem; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; color: var(--blue-800); line-height: 1.1; }
  .report-figure__hint { font-size: var(--text-xs); color: var(--text-tertiary); line-height: 1.35; }
  .report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
  .rbars, .rcols { margin: 0; background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); min-width: 0; }
  .rbars__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text); margin-bottom: var(--space-3); }
  .rbars__empty { font-size: var(--text-sm); color: var(--text-tertiary); margin: 0; }
  .rbars__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
  .rbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: 0.2rem var(--space-3); padding: 0.2rem 0.3rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
  a.rbar:hover, a.rbar:focus-visible { background: var(--surface-hover); }
  .rbar__label { grid-area: label; font-size: var(--text-sm); display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; overflow-wrap: anywhere; }
  .rbar__value { grid-area: value; font-size: var(--text-sm); font-variant-numeric: tabular-nums; font-weight: var(--weight-medium); white-space: nowrap; }
  .rbar__share { color: var(--text-tertiary); font-weight: var(--weight-regular); }
  .rbar__track { grid-area: track; width: 100%; height: 6px; display: block; background: var(--gray-75); border-radius: 2px; }
  .rbar__fill { fill: var(--blue-600); }
  .rbar__fill--theme { fill: var(--theme-dot); }
  .rbar__fill--unknown { fill: var(--gray-300); }
  .rcols__svg { display: block; width: 100%; height: auto; overflow: visible; }
  .rcols__bar { fill: var(--blue-600); }
  a:hover .rcols__bar, a:focus-visible .rcols__bar { fill: var(--blue-800); }
  .rcols__bar--zero { fill: var(--gray-200); }
  .rcols__table { margin-top: var(--space-2); }
  .rcols__table summary { cursor: pointer; color: var(--text-secondary); }
  .heat__cell a { display: block; color: inherit; text-decoration: none; font-weight: var(--weight-medium); }
  .heat__cell.heat--1 { background: color-mix(in srgb, var(--theme-dot) 14%, transparent); }
  .heat__cell.heat--2 { background: color-mix(in srgb, var(--theme-dot) 28%, transparent); }
  .heat__cell.heat--3 { background: color-mix(in srgb, var(--theme-dot) 44%, transparent); }
  .heat__cell.heat--4 { background: color-mix(in srgb, var(--theme-dot) 60%, transparent); color: var(--theme-text); }
  .heat th[scope="row"] { white-space: nowrap; font-weight: var(--weight-medium); }
  .tally-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: 0 0 var(--space-2); }
  .tally-row > div { background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-md); padding: var(--space-2) var(--space-4); min-width: 9rem; }
  .tally-row dt { font-size: var(--text-xs); color: var(--text-secondary); }
  .tally-row dd { margin: 0; font-size: 1.25rem; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
  .report-definitions summary { cursor: pointer; color: var(--text-secondary); }
  .summary-strip--figures a { color: var(--blue-700); text-decoration: none; font-weight: var(--weight-semibold); }
  @media (max-width: 640px) {
    .report-filters__grid { grid-template-columns: 1fr 1fr; }
    .report-figure__value { font-size: 1.35rem; }
  }
}
