/*
 * OpenBGA QM LIMS application theme for Bootstrap 5.3: "Line".
 *
 * Bootstrap supplies every control, dialog, dropdown, table and form widget; DataTables supplies
 * column presentation. This file sets the design tokens for the light, dark and print palettes
 * (Bootstrap `data-bs-theme`, chosen in the theme menu, applied before paint by
 * static/js/theme-init.js), maps them onto Bootstrap's variables, and styles the shared
 * components. docs/ui-standards.md states the rules; this file is the implementation.
 *
 * Line: a calm, precise workspace for manufacturing QC. One mineral-grey shell (top bar and
 * sidebar) around a soft content ground; panels are lighter tonal surfaces with rounded corners
 * and no hairlines between things. One accent, petrol, does one job: the action (primary button,
 * current item, checked control) and the QC flow line from lot to certificate. Status is a tinted
 * pill with a Bootstrap icon and text, never colour alone. One family on screen, Archivo, with a
 * tabular data voice for identifiers, dates, counts and results. Signing keeps its own solid
 * petrol band so a signature moment is unmistakable. Contrast (WCAG 2.2 AA) is checked for both
 * modes; recheck when changing tokens.
 */

/* ================================================================ Tokens */

/* Archivo 2.001 (SIL OFL 1.1; static/vendor/archivo-2.001): the only family on screen.
   Its metrics (UPM 1000, ascent 878, descent 210, cap height 686, measured with fontTools) put
   capitals above the centre of the line box. The overrides keep the same total height (1088)
   with ascent - descent = cap height, so labels centre in buttons, fields, nav items and pills
   (e2e/test_alignment.py measures the ink). */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 100% 125%;
  font-display: swap;
  ascent-override: 88.7%;
  descent-override: 20.1%;
  line-gap-override: 0%;
  src: url("../vendor/archivo-2.001/archivo-latin-wdth-wght.e46da7fc27d8.woff2") format("woff2");
}

:root,
[data-bs-theme="light"] {
  color-scheme: light;

  /* Shell: the top bar and the sidebar are one surface */
  --vr-topbar-bg: #e4e9e8;
  --vr-topbar-text: #1b2322;
  --vr-topbar-text-rgb: 27, 35, 34;
  --vr-topbar-text-muted: #4b5756;
  --vr-topbar-field: #f6f8f7;
  --vr-topbar-field-border: #788483;
  --vr-topbar-field-text: #1b2322;
  --vr-topbar-field-muted: #576261;
  --vr-topbar-accent: #0f5c63;
  --vr-shell-chip: #d7dedd;
  --vr-shell-hover: #d7dedd;
  --vr-shell-current: #0f5c63; /* the current nav item: solid petrol, 3:1+ on the shell */
  --vr-on-shell-current: #f2f9f9;

  /* Ground, panels, text */
  --vr-paper: #eff1f0; /* the content ground behind panels */
  --vr-surface: #fbfcfb; /* panels, table cards */
  --vr-surface-2: #edf0ef; /* wells inside panels: history items, counts, sign summary */
  --vr-surface-hover: #e5eae9;
  --vr-raised: #fbfcfb; /* menus, popovers, dialogs */
  --vr-text: #1d2524;
  --vr-text-strong: #121918; /* titles, emphasised values, identifiers */
  --vr-text-muted: #4f5b5a;
  --vr-placeholder: #576261;
  --vr-selection: #d1e9e8; /* chips, chosen options, search marks, ::selection */

  /* Action, links, focus */
  --vr-ink: #0f5c63; /* petrol: primary button, current pager page, checked controls, flow line */
  --vr-ink-rgb: 15, 92, 99;
  --vr-ink-hover: #0a464c;
  --vr-on-ink: #f2f9f9;
  --vr-pen: #0d5960; /* links */
  --vr-pen-rgb: 13, 89, 96;
  --vr-pen-hover: #083e43;
  --vr-pen-hover-rgb: 8, 62, 67;
  --vr-focus: #0f5c63;
  --vr-focus-halo: rgba(15, 92, 99, 0.18);
  --vr-pencil: #a8332a; /* the required mark and struck prior values only */

  /* Fields (treatment A: one hairline outline, 3:1+ on every surface) and buttons */
  --vr-border-strong: #788483;
  --vr-border-strong-hover: #5b6766;
  --vr-button-secondary: #e3e9e8; /* secondary buttons are a tonal fill, no outline */
  --vr-button-secondary-hover: #d7dfde;

  /* Tables */
  --vr-th-bg: #e8eceb;
  --vr-row-stripe: #f5f7f6;
  --vr-row-hover: #e2eeed;

  /* Status tones: pill fill + icon + text. The -border values are not drawn; they feed
     Bootstrap's -border-subtle mapping only. */
  --vr-neutral-text: #4a5453;
  --vr-neutral-text-rgb: 74, 84, 83;
  --vr-neutral-bg: #e8eceb;
  --vr-neutral-border: #7d8a83;
  --vr-info-text: #1d5687;
  --vr-info-text-rgb: 29, 86, 135;
  --vr-info-bg: #e2ebf5;
  --vr-info-border: #5c7fb3;
  --vr-progress-text: #5b3f8c;
  --vr-progress-bg: #ede9f5;
  --vr-progress-border: #8178b5;
  --vr-success-text: #23663a;
  --vr-success-text-rgb: 35, 102, 58;
  --vr-success-bg: #e2f1e6;
  --vr-success-border: #58935d;
  --vr-warning-text: #7c4d00;
  --vr-warning-text-rgb: 124, 77, 0;
  --vr-warning-bg: #f7ecd3;
  --vr-warning-border: #a97b22;
  --vr-danger-text: #a6271f;
  --vr-danger-text-rgb: 166, 39, 31;
  --vr-danger-bg: #f9e5e2;
  --vr-danger-border: #bd3a2d; /* the invalid field edge */
  --vr-danger-solid: #bd3a2d; /* the solid destructive fill */
  --vr-on-danger: #fbfcfb;
  --vr-hold-text: #8b2c5d;
  --vr-hold-bg: #f5e5ee;
  --vr-hold-border: #b46d98;

  /* The QC flow diagram, counts */
  --vr-line: #0f5c63; /* flow lines and reached route segments: accent only, never status */
  --vr-line-pending: #c9d1d0;
  --vr-lane: #f3f5f4;
  --vr-count: #d6eae9;
  --vr-on-count: #0a464c;

  /* What a material is: one tile colour per kind (material tag); the icon on it is --vr-on-kind */
  --vr-kind-raw: #8a6418;
  --vr-kind-component: #3f5f86;
  --vr-kind-packaging: #8a4f3a;
  --vr-kind-intermediate: #5b4a8a;
  --vr-kind-finished: #2f6b4a;
  --vr-on-kind: #fbfcfb;

  /* Signing: the signature dialog's band and the signature mark in history */
  --vr-sign: #0f5c63;
  --vr-on-sign: #f2f9f9;

  /* Scrollbars, scrim */
  --vr-scrollbar: #b7c1c0;
  --vr-scrollbar-hover: #87928f;
  --vr-scrollbar-active: #6c7776;
  --vr-backdrop: rgba(18, 25, 24, 0.48);
  --vr-backdrop-blur: 5px; /* the page under a dialog softens, so the dialog reads as the task */

  /* Elevation: soft layers, no hard offset anywhere */
  --vr-shadow-panel: 0 1px 2px rgba(20, 26, 34, 0.05), 0 2px 10px rgba(20, 26, 34, 0.04);
  --vr-shadow-raised: 0 8px 24px rgba(20, 26, 34, 0.14), 0 2px 6px rgba(20, 26, 34, 0.06);
  --vr-shadow-dialog: 0 24px 60px rgba(20, 26, 34, 0.22), 0 4px 12px rgba(20, 26, 34, 0.08);
  --vr-shadow-button: 0 1px 2px rgba(20, 26, 34, 0.14);
  --vr-shadow-current: 0 1px 2px rgba(20, 26, 34, 0.1), 0 1px 6px rgba(20, 26, 34, 0.05);
  --vr-shadow-scroll-top: 0 6px 14px -8px rgba(20, 26, 34, 0.24);
  --vr-shadow-scroll-bottom: 0 -6px 14px -8px rgba(20, 26, 34, 0.24);
  --vr-shadow-drawer: -12px 0 32px rgba(20, 26, 34, 0.09), -1px 0 0 rgba(20, 26, 34, 0.05);
}

[data-bs-theme="dark"] {
  color-scheme: dark;

  --vr-topbar-bg: #0e1514;
  --vr-topbar-text: #d5e0de;
  --vr-topbar-text-rgb: 213, 224, 222;
  --vr-topbar-text-muted: #97a8a6;
  --vr-topbar-field: #131c1b;
  --vr-topbar-field-border: #6c7d7b;
  --vr-topbar-field-text: #d5e0de;
  --vr-topbar-field-muted: #93a4a2;
  --vr-topbar-accent: #79cdd0;
  --vr-shell-chip: #18211f;
  --vr-shell-hover: #18211f;
  --vr-shell-current: #6cc5c9;
  --vr-on-shell-current: #062a2d;

  --vr-paper: #121a19;
  --vr-surface: #172120;
  --vr-surface-2: #1d2928;
  --vr-surface-hover: #233130;
  --vr-raised: #1b2625;
  --vr-text: #d5e0de;
  --vr-text-strong: #ecf3f2;
  --vr-text-muted: #9aabaa;
  --vr-placeholder: #93a4a2;
  --vr-selection: #1f4a4c;

  --vr-ink: #6cc5c9;
  --vr-ink-rgb: 108, 197, 201;
  --vr-ink-hover: #8ad3d6;
  --vr-on-ink: #062a2d;
  --vr-pen: #79cdd0;
  --vr-pen-rgb: 121, 205, 208;
  --vr-pen-hover: #a9e1e3;
  --vr-pen-hover-rgb: 169, 225, 227;
  --vr-focus: #79cdd0;
  --vr-focus-halo: rgba(108, 197, 201, 0.22);
  --vr-pencil: #f2a091;

  --vr-border-strong: #6c7d7b;
  --vr-border-strong-hover: #8c9e9c;
  --vr-button-secondary: #223231;
  --vr-button-secondary-hover: #2a3c3b;

  --vr-th-bg: #1d2928;
  --vr-row-stripe: #1a2423;
  --vr-row-hover: #213433;

  --vr-neutral-text: #c0cccb;
  --vr-neutral-text-rgb: 192, 204, 203;
  --vr-neutral-bg: #253130;
  --vr-neutral-border: #74867c;
  --vr-info-text: #a9cdf0;
  --vr-info-text-rgb: 169, 205, 240;
  --vr-info-bg: #18304a;
  --vr-info-border: #5577a8;
  --vr-progress-text: #d0c3ef;
  --vr-progress-bg: #2c2645;
  --vr-progress-border: #776ca8;
  --vr-success-text: #a6dbb5;
  --vr-success-text-rgb: 166, 219, 181;
  --vr-success-bg: #183726;
  --vr-success-border: #4f8a58;
  --vr-warning-text: #ecd08f;
  --vr-warning-text-rgb: 236, 208, 143;
  --vr-warning-bg: #3a2f15;
  --vr-warning-border: #9a7631;
  --vr-danger-text: #f4b2a8;
  --vr-danger-text-rgb: 244, 178, 168;
  --vr-danger-bg: #44221f;
  --vr-danger-border: #e8806f;
  --vr-danger-solid: #e8806f;
  --vr-on-danger: #121a19;
  --vr-hold-text: #efb3d2;
  --vr-hold-bg: #3c2232;
  --vr-hold-border: #a3618b;

  --vr-line: #5fb8bc;
  --vr-line-pending: #2f3d3c;
  --vr-lane: #192322;
  --vr-count: #1f3d3f;
  --vr-on-count: #cdeeed;

  --vr-kind-raw: #d9b25a;
  --vr-kind-component: #9db8dd;
  --vr-kind-packaging: #e0a48e;
  --vr-kind-intermediate: #bcaee6;
  --vr-kind-finished: #8fcfa8;
  --vr-on-kind: #121a19;

  --vr-sign: #173a3c;
  --vr-on-sign: #d2f0ef;

  --vr-scrollbar: #374645;
  --vr-scrollbar-hover: #5a6b69;
  --vr-scrollbar-active: #7a8c8a;
  --vr-backdrop: rgba(3, 7, 7, 0.62);

  --vr-shadow-panel: 0 1px 2px rgba(0, 0, 0, 0.24);
  --vr-shadow-raised: 0 10px 28px rgba(0, 0, 0, 0.42);
  --vr-shadow-dialog: 0 28px 64px rgba(0, 0, 0, 0.52);
  --vr-shadow-button: none;
  --vr-shadow-current: none;
  --vr-shadow-scroll-top: 0 6px 14px -8px rgba(0, 0, 0, 0.6);
  --vr-shadow-scroll-bottom: 0 -6px 14px -8px rgba(0, 0, 0, 0.6);
  --vr-shadow-drawer: -14px 0 36px rgba(0, 0, 0, 0.45), -1px 0 0 rgba(255, 255, 255, 0.04);
}

/* Print: one light, high-contrast palette whatever the screen mode; pills print as text and icon
   on white; no shadows; a light rule between table rows only. */
@media print {
  :root,
  [data-bs-theme],
  [data-bs-theme="dark"] {
    color-scheme: light;
    --vr-paper: #ffffff;
    --vr-surface: #ffffff;
    --vr-surface-2: #f2f4f3;
    --vr-surface-hover: #ffffff;
    --vr-raised: #ffffff;
    --vr-text: #000000;
    --vr-text-strong: #000000;
    --vr-text-muted: #3d4741;
    --vr-placeholder: #3d4741;
    --vr-selection: #ffffff;
    --vr-ink: #0f5c63;
    --vr-ink-rgb: 15, 92, 99;
    --vr-ink-hover: #0a464c;
    --vr-on-ink: #ffffff;
    --vr-pen: #083e43;
    --vr-pen-rgb: 8, 62, 67;
    --vr-pen-hover: #083e43;
    --vr-pen-hover-rgb: 8, 62, 67;
    --vr-pencil: #8f1f18;
    --vr-border-strong: #555f59;
    --vr-th-bg: #f2f2f0;
    --vr-row-stripe: #ffffff;
    --vr-row-hover: #ffffff;
    --vr-print-rule: #b9c4be;
    --vr-neutral-text: #333b37;
    --vr-neutral-text-rgb: 51, 59, 55;
    --vr-neutral-bg: #ffffff;
    --vr-neutral-border: #555f59;
    --vr-info-text: #163c70;
    --vr-info-text-rgb: 22, 60, 112;
    --vr-info-bg: #ffffff;
    --vr-info-border: #163c70;
    --vr-progress-text: #3b3270;
    --vr-progress-bg: #ffffff;
    --vr-progress-border: #3b3270;
    --vr-success-text: #17521f;
    --vr-success-text-rgb: 23, 82, 31;
    --vr-success-bg: #ffffff;
    --vr-success-border: #17521f;
    --vr-warning-text: #5e3c00;
    --vr-warning-text-rgb: 94, 60, 0;
    --vr-warning-bg: #ffffff;
    --vr-warning-border: #5e3c00;
    --vr-danger-text: #861c15;
    --vr-danger-text-rgb: 134, 28, 21;
    --vr-danger-bg: #ffffff;
    --vr-danger-border: #861c15;
    --vr-danger-solid: #861c15;
    --vr-on-danger: #ffffff;
    --vr-hold-text: #62224a;
    --vr-hold-bg: #ffffff;
    --vr-hold-border: #62224a;
    --vr-line: #0f5c63;
    --vr-line-pending: #c9d1d0;
    --vr-lane: #ffffff;
    --vr-count: #ffffff;
    --vr-on-count: #000000;
    --vr-kind-raw: #8a6418;
    --vr-kind-component: #3f5f86;
    --vr-kind-packaging: #8a4f3a;
    --vr-kind-intermediate: #5b4a8a;
    --vr-kind-finished: #2f6b4a;
    --vr-on-kind: #ffffff;
    --vr-shadow-panel: none;
    --vr-shadow-raised: none;
    --vr-shadow-dialog: none;
    --vr-shadow-button: none;
    --vr-shadow-current: none;
  }
}

:root {
  /* Space: every margin, padding, gap and offset is a step of this scale (rem, so it follows
     the root size: 14px on desktop, 16px on phones). */
  --vr-space-0-5: 0.125rem;
  --vr-space-1: 0.25rem;
  --vr-space-1-5: 0.375rem;
  --vr-space-2: 0.5rem;
  --vr-space-2-5: 0.625rem;
  --vr-space-3: 0.75rem;
  --vr-space-3-5: 0.875rem;
  --vr-space-4: 1rem;
  --vr-space-5: 1.25rem;
  --vr-space-6: 1.5rem;
  --vr-space-8: 2rem;
  --vr-space-10: 2.5rem;
  --vr-space-12: 3rem;
  --vr-space-16: 4rem;
  --vr-space-20: 5rem;

  /* Type */
  --vr-font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --vr-font-data: var(--vr-font-sans); /* with tabular, slashed-zero figures (.vr-data, time) */
  --vr-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; /* code, hashes */
  --vr-font-stretch-title: 112%;
  --vr-font-size-1: 0.75rem;
  --vr-font-size-2: 0.8125rem; /* labels, table heads, uppercase panel titles */
  --vr-font-size-3: 0.875rem; /* pills, meta lines, help text */
  --vr-font-size-4: 0.9375rem; /* table body, nav items, buttons */
  --vr-font-size-5: 1rem; /* body, fields */
  --vr-font-size-6: 1.1429rem; /* fieldset legends, empty-state titles */
  --vr-font-size-7: 1.4286rem; /* band counts */
  --vr-font-size-8: 1.7143rem; /* dialog titles, lane totals */
  --vr-font-size-9: 2.1429rem; /* page title */
  --vr-font-weight-regular: 400;
  --vr-font-weight-medium: 500;
  --vr-font-weight-semibold: 600;
  --vr-font-weight-bold: 700;
  --vr-font-weight-heavy: 800; /* page and dialog titles, uppercase panel titles, counts */
  --vr-line-height-tight: 1.15;
  --vr-line-height-snug: 1.35;
  --vr-line-height-base: 1.5;
  --vr-label-size: var(--vr-font-size-2);
  --vr-label-tracking: 0.05em;
  --vr-label-case: uppercase; /* fact labels, table heads, panel titles, nav group labels */

  /* Shape: corners and line widths */
  --vr-radius-xs: 1px;
  --vr-radius-sm: 4px;
  --vr-radius-tag: 5px; /* icon tiles */
  --vr-radius: 8px;
  --vr-radius-lg: 10px; /* fields, buttons, nav items, table row ends, menu options */
  --vr-radius-menu: 12px;
  --vr-radius-xl: 14px; /* panels, notices */
  --vr-radius-dialog: 18px;
  --vr-radius-main: 18px; /* the content ground's corner against the shell */
  --vr-radius-pill: 999px;
  --vr-border-width: 1px;
  --vr-border-width-md: 1.5px;
  --vr-border-width-lg: 2px;
  --vr-border-width-xl: 3px;
  --vr-line-width: 4px; /* the flow diagram's line */
  --vr-focus-width: 2px;
  --vr-focus-offset: 2px;
  --vr-halo-width: 0.25rem; /* the soft ring outside a focused field */

  /* Stacking: one ladder for everything that overlaps. Bootstrap's own layers (dropdown 1000,
     sticky 1020, fixed 1030, offcanvas 1045, modal 1055, popover 1070, tooltip 1080) sit
     between these. */
  --vr-z-below: -1;
  --vr-z-base: 0;
  --vr-z-raised: 1;
  --vr-z-sticky: 5;
  --vr-z-panel: 1025; /* the page-help drawer, under the top bar */
  --vr-z-topbar: 1030;
  --vr-z-panel-cover: 1035; /* the page-help drawer on narrow screens, over the top bar */
  --vr-z-menu: 1060; /* select menus and date popovers: over the top bar, and within a dialog */
  --vr-z-confirm-backdrop: 1065; /* a confirmation stacked over the form dialog, and its scrim */
  --vr-z-confirm: 1070;
  --vr-z-notice: 1090;
  --vr-z-skip: 1100;

  /* Motion: colour transitions only; prefers-reduced-motion removes them */
  --vr-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --vr-motion-fast: 140ms;

  /* Layout and density */
  --vr-topbar-height: 4rem;
  --vr-sidenav-width: 16.875rem;
  --vr-sidenav-rail-width: 4.25rem; /* the collapsed, icon-only navigation */
  --vr-shell-gutter: 0.5714rem; /* keeps the sidebar's scrollbar inside the shell */
  --vr-content-pad-x: var(--vr-space-4);
  --vr-content-pad-y: var(--vr-space-4);
  --vr-form-width: 48rem;
  --vr-aside-width: 22.857rem;
  --vr-control-height: 2.5714rem;
  --vr-control-height-sm: 2.1429rem;
  --vr-nav-item-height: 2.4286rem;
  --vr-cell-py: 0.5714rem;
  --vr-cell-px: 0.7143rem;
  /* Panel spacing, defined once: content inside a panel sits --vr-panel-inset from its edge, and
     stacked blocks (and panels) are --vr-stack apart (e2e/panel_spacing.js measures both). */
  --vr-panel-inset: var(--vr-space-6);
  --vr-table-inset: var(--vr-space-4); /* a table panel's first and last columns */
  --vr-stack: var(--vr-space-4);
  /* Scrollbars: thin, rounded and inset from the container's edge by a transparent border. */
  --vr-scrollbar-size: 0.75rem;
  --vr-scrollbar-inset: 3px;
  --vr-scrollbar-inset-hover: 2px;
}

/* Derived tokens and the Bootstrap mapping, re-evaluated per mode because the tokens change
   underneath. */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --vr-field-focus-ring: 0 0 0 var(--vr-border-width) var(--vr-focus), 0 0 0 var(--vr-halo-width) var(--vr-focus-halo);
  --vr-field-invalid-ring: 0 0 0 var(--vr-border-width) var(--vr-danger-border);

  --bs-body-font-family: var(--vr-font-sans);
  --bs-font-sans-serif: var(--vr-font-sans);
  --bs-font-monospace: var(--vr-font-mono);
  --bs-body-line-height: var(--vr-line-height-base);
  --bs-primary: var(--vr-ink);
  --bs-primary-rgb: var(--vr-ink-rgb);
  --bs-primary-text-emphasis: var(--vr-text-strong);
  --bs-primary-bg-subtle: var(--vr-selection);
  --bs-primary-border-subtle: var(--vr-ink);
  --bs-body-color: var(--vr-text);
  --bs-body-bg: var(--vr-paper);
  --bs-emphasis-color: var(--vr-text-strong);
  --bs-heading-color: var(--vr-text-strong);
  --bs-secondary-color: var(--vr-text-muted);
  --bs-secondary-bg: var(--vr-surface-2);
  --bs-tertiary-bg: var(--vr-surface-2);
  --bs-tertiary-color: var(--vr-text-muted);
  /* Separation is by surface, not lines: stock Bootstrap edges disappear. */
  --bs-border-color: transparent;
  --bs-border-color-translucent: transparent;
  --bs-border-width: var(--vr-border-width);
  --bs-border-radius: var(--vr-radius-lg);
  --bs-border-radius-sm: var(--vr-radius);
  --bs-border-radius-lg: var(--vr-radius-xl);
  --bs-border-radius-xl: var(--vr-radius-xl);
  --bs-border-radius-pill: var(--vr-radius-pill);
  /* Bootstrap 5.3 hovers links through the -rgb variable: both are set, or links hover blue. */
  --bs-link-color: var(--vr-pen);
  --bs-link-color-rgb: var(--vr-pen-rgb);
  --bs-link-hover-color: var(--vr-pen-hover);
  --bs-link-hover-color-rgb: var(--vr-pen-hover-rgb);
  --bs-focus-ring-color: var(--vr-focus-halo);
  --bs-form-invalid-color: var(--vr-danger-text);
  --bs-form-invalid-border-color: var(--vr-danger-border);
  --bs-form-valid-color: var(--vr-success-text);
  --bs-form-valid-border-color: var(--vr-success-border);
  --bs-highlight-bg: var(--vr-selection);
  --bs-highlight-color: var(--vr-text-strong);
  --bs-code-color: var(--vr-text-strong); /* Bootstrap's pink fails AA on every surface */
  --bs-backdrop-bg: var(--vr-backdrop);
  --bs-backdrop-opacity: 1;
  /* Bootstrap's semantic colours take the status tones (secondary is the neutral tone), so its
     utilities, alerts and validation follow the theme instead of stock Bootstrap colours. */
  --bs-secondary: var(--vr-neutral-text);
  --bs-secondary-rgb: var(--vr-neutral-text-rgb);
  --bs-secondary-text-emphasis: var(--vr-neutral-text);
  --bs-secondary-bg-subtle: var(--vr-neutral-bg);
  --bs-secondary-border-subtle: var(--vr-neutral-border);
  --bs-info: var(--vr-info-text);
  --bs-info-rgb: var(--vr-info-text-rgb);
  --bs-info-text-emphasis: var(--vr-info-text);
  --bs-info-bg-subtle: var(--vr-info-bg);
  --bs-info-border-subtle: var(--vr-info-border);
  --bs-success: var(--vr-success-text);
  --bs-success-rgb: var(--vr-success-text-rgb);
  --bs-success-text-emphasis: var(--vr-success-text);
  --bs-success-bg-subtle: var(--vr-success-bg);
  --bs-success-border-subtle: var(--vr-success-border);
  --bs-warning: var(--vr-warning-text);
  --bs-warning-rgb: var(--vr-warning-text-rgb);
  --bs-warning-text-emphasis: var(--vr-warning-text);
  --bs-warning-bg-subtle: var(--vr-warning-bg);
  --bs-warning-border-subtle: var(--vr-warning-border);
  --bs-danger: var(--vr-danger-text);
  --bs-danger-rgb: var(--vr-danger-text-rgb);
  --bs-danger-text-emphasis: var(--vr-danger-text);
  --bs-danger-bg-subtle: var(--vr-danger-bg);
  --bs-danger-border-subtle: var(--vr-danger-border);
}

/* Desktop density (the root is 14px from 992px up): wider content padding. */
@media (min-width: 992px) {
  :root {
    --vr-content-pad-x: 2.2857rem;
    --vr-content-pad-y: 1.7143rem;
  }
}

/* ================================================================ Base */

/* Desktop density; phones keep 16px so form inputs do not trigger zoom on focus. */
@media (min-width: 992px) {
  html {
    font-size: 87.5%;
  }

}

html {
  scroll-padding-top: calc(var(--vr-topbar-height) + var(--vr-space-3));
}

body {
  min-height: 100vh;
  background-color: var(--vr-paper);
  color: var(--vr-text);
  font-variant-numeric: tabular-nums;
  caret-color: var(--vr-text);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--vr-selection);
  color: var(--vr-text-strong);
}

h1,
h2,
h3,
h4 {
  font-weight: var(--vr-font-weight-bold);
  color: var(--vr-text-strong);
  text-wrap: balance;
}

/* Links are petrol without an underline until hovered; links inside running text keep one, so
   they never rely on colour alone. */
a {
  text-decoration: none;
  text-decoration-thickness: var(--vr-border-width);
  text-underline-offset: 0.2em;
}

a:hover,
:is(p, .alert, .form-text, .vr-timeline-main li) a:not(.btn) {
  text-decoration: underline;
}

:focus-visible {
  outline: var(--vr-focus-width) solid var(--vr-focus);
  outline-offset: var(--vr-focus-offset);
}

.vr-icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
  vertical-align: -0.125em;
}

.vr-muted,
.text-body-secondary {
  color: var(--vr-text-muted) !important;
}

.vr-nowrap {
  white-space: nowrap;
}

/* Labels: small, bold capitals in the muted voice (fact labels, table heads, nav group labels,
   panel titles). Never on buttons, fields, pills or body text. */
.vr-facts dt,
.vr-nav-heading,
.dropdown-header,
.vr-page-toc-title,
.vr-lab-name,
.vr-entrance-or,
.vr-dateline,
.vr-table > thead > tr > th {
  font-size: var(--vr-label-size);
  font-weight: var(--vr-font-weight-bold);
  letter-spacing: var(--vr-label-tracking);
  text-transform: var(--vr-label-case);
  color: var(--vr-text-muted);
}

/* Field labels: the reading voice, bold, in the label's own case. */
.form-label,
.form-check-label {
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-bold);
  color: var(--vr-text-strong);
}

.form-check-label {
  font-weight: var(--vr-font-weight-medium);
  color: var(--vr-text);
}

/* The data voice: identifiers, dates, counts, results and limits in Archivo with tabular,
   slashed-zero figures, so 0/O stay distinct and digits line up. */
time,
.vr-id,
.vr-data,
.vr-count,
.vr-timeline-meta,
.vr-navlink-count,
.vr-table > tbody > tr > .text-end {
  font-family: var(--vr-font-data);
  font-variant-numeric: tabular-nums slashed-zero;
}

/* Identifiers display verbatim: an uppercase role (panel title, fact label, table head, route
   label) never changes their case or spacing. */
:is(.vr-id, .vr-data, code, kbd, samp, [data-identifier]) {
  text-transform: none;
  letter-spacing: 0;
}

.vr-id {
  color: var(--vr-text-strong);
  font-weight: var(--vr-font-weight-bold);
  white-space: nowrap;
}

mark,
.mark {
  padding: 0 0.15em;
  border-radius: var(--vr-radius-sm);
  background: var(--vr-selection);
  color: var(--vr-text-strong);
}

/* Red pencil: prior values struck through in corrections and amendments. */
del,
s,
.vr-prior {
  color: var(--vr-text-muted);
  text-decoration-line: line-through;
  text-decoration-color: var(--vr-pencil);
  text-decoration-thickness: var(--vr-border-width-lg);
}

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .form-control,
  .form-select,
  .vr-navlink {
    transition: background-color var(--vr-motion-fast) var(--vr-ease), border-color var(--vr-motion-fast) var(--vr-ease),
      color var(--vr-motion-fast) var(--vr-ease), box-shadow var(--vr-motion-fast) var(--vr-ease);
  }
}

/* A registered colour, so the sidebar can fade its scrollbar in: scrollbar colours do not
   transition themselves, but an animatable custom property they read does. */
@property --vr-thumb {
  syntax: "<color>";
  inherits: true;
  initial-value: transparent;
}

/* Scrollbars: one treatment for every scroll container. Thin, rounded, inset from the edge by a
   transparent border on a transparent track, so a thumb never touches the neighbouring panel;
   quiet at rest, stronger when the container is hovered, strongest on the thumb. Chromium ignores
   ::-webkit-scrollbar once scrollbar-color is set, so the standard properties go only to browsers
   without it (Firefox). Never hidden. */
::-webkit-scrollbar {
  width: var(--vr-scrollbar-size);
  height: var(--vr-scrollbar-size);
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  min-width: var(--vr-space-8);
  min-height: var(--vr-space-8);
  border: var(--vr-scrollbar-inset) solid transparent;
  border-radius: var(--vr-radius-pill);
  background-color: var(--vr-scrollbar);
  background-clip: padding-box;
}

html:hover::-webkit-scrollbar-thumb,
.modal-body:hover::-webkit-scrollbar-thumb,
.ts-dropdown-content:hover::-webkit-scrollbar-thumb,
.vr-table-wrap:hover::-webkit-scrollbar-thumb,
.dt-scroll-body:hover::-webkit-scrollbar-thumb {
  background-color: var(--vr-scrollbar-hover);
}

::-webkit-scrollbar-thumb:hover {
  border-width: var(--vr-scrollbar-inset-hover);
  background-color: var(--vr-scrollbar-hover);
}

::-webkit-scrollbar-thumb:active {
  border-width: var(--vr-scrollbar-inset-hover);
  background-color: var(--vr-scrollbar-active);
}

@supports not selector(::-webkit-scrollbar) {
  html,
  .modal-body,
  .ts-dropdown-content,
  .vr-table-wrap {
    scrollbar-width: thin;
    scrollbar-color: var(--vr-scrollbar) transparent;
  }

  html:hover,
  .modal-body:hover,
  .ts-dropdown-content:hover,
  .vr-table-wrap:hover {
    scrollbar-color: var(--vr-scrollbar-hover) transparent;
  }
}

/* The sidebar's scrollbar is invisible at rest and fades in while the sidebar is hovered or holds
   focus. */
.vr-sidenav {
  --vr-thumb: transparent;
  transition: --vr-thumb 180ms ease-out;
}

.vr-sidenav:hover,
.vr-sidenav:focus-within {
  --vr-thumb: var(--vr-scrollbar-hover);
}

.vr-sidenav::-webkit-scrollbar-thumb {
  background-color: var(--vr-thumb);
}

@supports not selector(::-webkit-scrollbar) {
  .vr-sidenav {
    scrollbar-width: thin;
    scrollbar-color: var(--vr-thumb) transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vr-sidenav {
    transition: none;
  }
}

/* ================================================================ Bootstrap components */

/* Buttons: primary is the petrol fill (one per page header), secondary a tonal fill without an
   outline (the class stays btn-outline-secondary), quiet a petrol link, destructive danger text
   on transparent. No outlines; small buttons are 30px; icon-only buttons are square. */
.btn {
  --bs-btn-font-family: var(--vr-font-sans);
  --bs-btn-font-size: var(--vr-font-size-4);
  --bs-btn-font-weight: var(--vr-font-weight-bold);
  --bs-btn-line-height: var(--vr-line-height-tight);
  --bs-btn-border-radius: var(--vr-radius-lg);
  --bs-btn-border-width: 0;
  --bs-btn-padding-y: 0;
  --bs-btn-padding-x: var(--vr-space-3-5);
  --bs-btn-disabled-opacity: 0.55;
  min-height: var(--vr-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--vr-space-2);
  white-space: nowrap;
}

.btn-sm {
  --bs-btn-font-size: var(--vr-font-size-3);
  --bs-btn-padding-x: var(--vr-space-2-5);
  --bs-btn-border-radius: var(--vr-radius-lg);
  min-height: var(--vr-control-height-sm);
}

/* Icon-only buttons (an icon plus a visually hidden label) are square. */
.btn.vr-btn-icon {
  --bs-btn-padding-x: 0;
  width: var(--vr-control-height);
}

.btn-sm.vr-btn-icon {
  width: var(--vr-control-height-sm);
}

.btn:focus-visible {
  outline: var(--vr-focus-width) solid var(--vr-focus);
  outline-offset: var(--vr-focus-offset);
  box-shadow: none;
}

.btn-primary {
  --bs-btn-color: var(--vr-on-ink);
  --bs-btn-bg: var(--vr-ink);
  --bs-btn-hover-color: var(--vr-on-ink);
  --bs-btn-hover-bg: var(--vr-ink-hover);
  --bs-btn-active-color: var(--vr-on-ink);
  --bs-btn-active-bg: var(--vr-ink-hover);
  --bs-btn-disabled-color: var(--vr-on-ink);
  --bs-btn-disabled-bg: var(--vr-ink);
  box-shadow: var(--vr-shadow-button);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-secondary {
  --bs-btn-color: var(--vr-text);
  --bs-btn-bg: var(--vr-button-secondary);
  --bs-btn-hover-color: var(--vr-text-strong);
  --bs-btn-hover-bg: var(--vr-button-secondary-hover);
  --bs-btn-active-color: var(--vr-text-strong);
  --bs-btn-active-bg: var(--vr-button-secondary-hover);
  --bs-btn-disabled-color: var(--vr-text-muted);
  --bs-btn-disabled-bg: var(--vr-button-secondary);
}

.btn-outline-danger {
  --bs-btn-color: var(--vr-danger-text);
  --bs-btn-bg: transparent;
  --bs-btn-hover-color: var(--vr-danger-text);
  --bs-btn-hover-bg: var(--vr-danger-bg);
  --bs-btn-active-color: var(--vr-danger-text);
  --bs-btn-active-bg: var(--vr-danger-bg);
  --bs-btn-disabled-color: var(--vr-danger-text);
  --bs-btn-disabled-bg: transparent;
}

.btn-link {
  --bs-btn-color: var(--vr-pen);
  --bs-btn-hover-color: var(--vr-pen-hover);
  --bs-btn-active-color: var(--vr-pen-hover);
  --bs-btn-disabled-color: var(--vr-text-muted);
  --bs-btn-padding-x: var(--vr-space-1);
  text-decoration: none;
}

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

/* Solid danger: a destructive confirmation (reject, cancel a record). */
.btn-danger {
  --bs-btn-color: var(--vr-on-danger);
  --bs-btn-bg: var(--vr-danger-solid);
  --bs-btn-hover-color: var(--vr-on-danger);
  --bs-btn-hover-bg: var(--vr-danger-text);
  --bs-btn-active-color: var(--vr-on-danger);
  --bs-btn-active-bg: var(--vr-danger-text);
  --bs-btn-disabled-color: var(--vr-on-danger);
  --bs-btn-disabled-bg: var(--vr-danger-solid);
}

/* Bootstrap's other contextual buttons compile stock colours into each class: they take the
   status tones (tinted fill, tone text), so no stock colour appears if one is used. */
:is(.btn-success, .btn-outline-success) {
  --vr-btn-tone-text: var(--vr-success-text);
  --vr-btn-tone-bg: var(--vr-success-bg);
}

:is(.btn-warning, .btn-outline-warning) {
  --vr-btn-tone-text: var(--vr-warning-text);
  --vr-btn-tone-bg: var(--vr-warning-bg);
}

:is(.btn-info, .btn-outline-info) {
  --vr-btn-tone-text: var(--vr-info-text);
  --vr-btn-tone-bg: var(--vr-info-bg);
}

:is(.btn-success, .btn-outline-success, .btn-warning, .btn-outline-warning, .btn-info, .btn-outline-info) {
  --bs-btn-color: var(--vr-btn-tone-text);
  --bs-btn-bg: var(--vr-btn-tone-bg);
  --bs-btn-hover-color: var(--vr-btn-tone-text);
  --bs-btn-hover-bg: var(--vr-surface-hover);
  --bs-btn-active-color: var(--vr-btn-tone-text);
  --bs-btn-active-bg: var(--vr-surface-hover);
}

/* Fields, treatment A: no fill, one hairline outline (3:1+ on every surface), the control radius;
   hover darkens the outline; focus adds the petrol ring and halo; invalid is the danger outline
   and ring with the message under the field, never a red fill. */
.form-control,
.form-select {
  min-height: var(--vr-control-height);
  padding: var(--vr-space-1-5) var(--vr-space-3);
  background-color: transparent;
  border: var(--vr-border-width) solid var(--vr-border-strong);
  border-radius: var(--vr-radius-lg);
  color: var(--vr-text);
  font-size: var(--vr-font-size-5);
}

.form-select {
  padding-right: var(--vr-space-10);
  background-position: right var(--vr-space-3) center;
}

textarea.form-control {
  min-height: 76px;
  resize: none;
}

.form-control-sm,
.form-select-sm {
  min-height: var(--vr-control-height-sm);
  font-size: var(--vr-font-size-4);
}

.form-control:hover:not(:disabled, [readonly], .is-invalid, [aria-invalid="true"]),
.form-select:hover:not(:disabled, .is-invalid, [aria-invalid="true"]) {
  border-color: var(--vr-border-strong-hover);
}

.form-control::placeholder {
  color: var(--vr-placeholder);
  opacity: 1;
}

.form-control:focus,
.form-select:focus {
  background-color: transparent;
  border-color: var(--vr-focus);
  box-shadow: var(--vr-field-focus-ring);
  outline: none;
  color: var(--vr-text);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  background-color: var(--vr-surface-2);
  border-style: dashed;
  color: var(--vr-text-muted);
}

/* Django marks fields with errors aria-invalid="true"; style them like Bootstrap's .is-invalid. */
.form-control.is-invalid,
.form-select.is-invalid,
.form-control[aria-invalid="true"],
.form-select[aria-invalid="true"] {
  border-color: var(--vr-danger-border);
  box-shadow: var(--vr-field-invalid-ring);
  background-image: none;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
.form-control[aria-invalid="true"]:focus,
.form-select[aria-invalid="true"]:focus {
  border-color: var(--vr-danger-border);
  box-shadow: var(--vr-field-invalid-ring), 0 0 0 var(--vr-halo-width) var(--vr-focus-halo);
}

/* Checkboxes, radios and switches: an 18px box with a 1.5px edge, checked in petrol with
   Bootstrap's own mark, the soft halo on focus. */
.form-check-input {
  --bs-form-check-bg: transparent;
  width: 18px;
  height: 18px;
  margin-top: 0.1em;
  border: var(--vr-border-width-md) solid var(--vr-border-strong);
  border-radius: var(--vr-radius-sm);
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input:hover:not(:disabled) {
  border-color: var(--vr-border-strong-hover);
}

.form-check-input:focus {
  border-color: var(--vr-focus);
  box-shadow: 0 0 0 var(--vr-halo-width) var(--vr-focus-halo);
  outline: none;
}

/* Checked and mixed ("select all" on a partly selected page). Bootstrap hard-codes its blue for
   [type=checkbox]:indeterminate, so the selector matches its specificity. */
.form-check-input:checked,
.form-check-input[type="checkbox"]:indeterminate {
  background-color: var(--vr-ink);
  border-color: var(--vr-ink);
}

[data-bs-theme="dark"] .form-check-input:checked[type="checkbox"] {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23062a2d' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

[data-bs-theme="dark"] .form-check-input[type="checkbox"]:indeterminate {
  --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23062a2d' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
}

.form-check-input:disabled {
  border-style: dashed;
}

.form-check-input[aria-invalid="true"] {
  border-color: var(--vr-danger-border);
  box-shadow: var(--vr-field-invalid-ring);
}

.form-switch .form-check-input {
  width: 34px;
  border-radius: var(--vr-radius-pill);
}

.form-label {
  margin-bottom: var(--vr-space-1);
}

.form-text {
  margin-top: var(--vr-space-1);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

/* A unit inside the field: the group carries the one outline; the unit is muted text, no fill. */
.input-group-text {
  background-color: transparent;
  border: var(--vr-border-width) solid var(--vr-border-strong);
  border-radius: var(--vr-radius-lg);
  color: var(--vr-text-muted);
}

.pagination {
  --bs-pagination-color: var(--vr-text);
  --bs-pagination-bg: transparent;
  --bs-pagination-border-width: 0;
  --bs-pagination-border-radius: var(--vr-radius-lg);
  --bs-pagination-hover-color: var(--vr-text-strong);
  --bs-pagination-hover-bg: var(--vr-surface-hover);
  --bs-pagination-focus-color: var(--vr-text-strong);
  --bs-pagination-focus-bg: var(--vr-surface-hover);
  --bs-pagination-focus-box-shadow: none;
  --bs-pagination-active-color: var(--vr-on-ink);
  --bs-pagination-active-bg: var(--vr-ink);
  --bs-pagination-disabled-color: var(--vr-text-muted);
  --bs-pagination-disabled-bg: transparent;
  gap: var(--vr-space-0-5);
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-semibold);
}

.page-link {
  min-width: var(--vr-control-height-sm);
  min-height: var(--vr-control-height-sm);
  padding: 0 var(--vr-space-1-5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--vr-radius-lg);
  font-variant-numeric: tabular-nums;
}

.page-item .page-link {
  border-radius: var(--vr-radius-lg);
}

/* Bootstrap components that hard-code its default blue rather than --bs-primary. */
.nav {
  --bs-nav-link-color: var(--vr-pen);
  --bs-nav-link-hover-color: var(--vr-pen-hover);
}

.nav-link:focus-visible {
  box-shadow: none; /* restore the shared outline over Bootstrap's nav reset */
  outline: var(--vr-focus-width) solid var(--vr-focus);
  outline-offset: var(--vr-focus-offset);
}

.list-group {
  --bs-list-group-bg: var(--vr-surface);
  --bs-list-group-border-color: transparent;
  --bs-list-group-active-color: var(--vr-text-strong);
  --bs-list-group-active-bg: var(--vr-selection);
  --bs-list-group-active-border-color: transparent;
}

.progress,
.progress-stacked {
  --bs-progress-bg: var(--vr-line-pending);
  --bs-progress-border-radius: var(--vr-radius-pill);
  --bs-progress-bar-bg: var(--vr-line);
  --bs-progress-bar-color: var(--vr-on-ink);
}

.form-range {
  accent-color: var(--vr-ink);
}

/* Menus ("More", the theme menu): a raised surface, no border, rounded options. */
.dropdown-menu {
  --bs-dropdown-bg: var(--vr-raised);
  --bs-dropdown-color: var(--vr-text);
  --bs-dropdown-border-width: 0;
  --bs-dropdown-border-radius: var(--vr-radius-menu);
  --bs-dropdown-inner-border-radius: var(--vr-radius-menu);
  --bs-dropdown-link-color: var(--vr-text);
  --bs-dropdown-link-hover-color: var(--vr-text-strong);
  --bs-dropdown-link-hover-bg: var(--vr-surface-hover);
  --bs-dropdown-link-active-color: var(--vr-text-strong);
  --bs-dropdown-link-active-bg: var(--vr-selection);
  --bs-dropdown-header-color: var(--vr-text-muted);
  --bs-dropdown-divider-bg: var(--vr-surface-2);
  --bs-dropdown-divider-margin-y: var(--vr-space-1-5);
  --bs-dropdown-font-size: var(--vr-font-size-4);
  --bs-dropdown-item-padding-y: var(--vr-space-1-5);
  --bs-dropdown-item-padding-x: var(--vr-space-2-5);
  --bs-dropdown-box-shadow: var(--vr-shadow-raised);
  min-width: 14rem;
  box-shadow: var(--vr-shadow-raised);
  padding: var(--vr-space-1-5);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--vr-space-3);
  border-radius: var(--vr-radius-lg);
}

.dropdown-item .vr-icon {
  color: var(--vr-text-muted);
}

.dropdown-divider {
  margin-inline: var(--vr-space-1);
  opacity: 1;
}

.dropdown-header {
  padding: var(--vr-space-1-5) var(--vr-space-2-5) var(--vr-space-0-5);
}

/* A toggle that draws its own chevron icon drops Bootstrap's caret. */
.dropdown-toggle:has(.vr-icon)::after {
  display: none;
}

/* A destructive item in a More menu: danger text and icon. */
.dropdown-item.vr-menu-danger,
.dropdown-item.vr-menu-danger .vr-icon {
  color: var(--vr-danger-text);
}

/* Dialogs: a raised sheet with the dialog radius and shadow over the scrim; no borders between
   header, body and footer. */
.modal {
  --bs-modal-bg: var(--vr-raised);
  --bs-modal-color: var(--vr-text);
  --bs-modal-border-width: 0;
  --bs-modal-border-radius: var(--vr-radius-dialog);
  --bs-modal-inner-border-radius: var(--vr-radius-dialog);
  --bs-modal-header-border-width: 0;
  --bs-modal-footer-border-width: 0;
  --bs-modal-padding: var(--vr-panel-inset);
  --bs-modal-header-padding: var(--vr-space-5) var(--vr-panel-inset) var(--vr-space-3);
  --bs-modal-box-shadow: var(--vr-shadow-dialog);
}

.modal-content {
  box-shadow: var(--vr-shadow-dialog);
}

.modal-title {
  font-size: var(--vr-font-size-8);
  font-weight: var(--vr-font-weight-heavy);
  font-stretch: var(--vr-font-stretch-title);
  line-height: var(--vr-line-height-tight);
  color: var(--vr-text-strong);
}

.modal-header .btn-close {
  border-radius: var(--vr-radius-lg);
}

.offcanvas {
  --bs-offcanvas-bg: var(--vr-topbar-bg);
  --bs-offcanvas-color: var(--vr-topbar-text);
  --bs-offcanvas-border-width: 0;
  --bs-offcanvas-box-shadow: var(--vr-shadow-dialog);
}

/* Panels: a tonal surface on the ground, rounded, softly lifted; no outline, no heading band and
   no rule under the head. */
.card {
  --bs-card-bg: var(--vr-surface);
  --bs-card-border-width: 0;
  --bs-card-border-radius: var(--vr-radius-xl);
  --bs-card-inner-border-radius: var(--vr-radius-xl);
  --bs-card-cap-bg: transparent;
  --bs-card-cap-padding-y: 0;
  --bs-card-cap-padding-x: var(--vr-panel-inset);
  --bs-card-spacer-x: var(--vr-panel-inset);
  --bs-card-spacer-y: var(--vr-space-4);
  box-shadow: var(--vr-shadow-panel);
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-2) var(--vr-space-3);
  min-height: var(--vr-control-height);
  padding-top: var(--vr-space-4);
  border-bottom: 0;
}

/* Panel titles: small, heavy, widened capitals. */
.card-title {
  margin: 0;
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-2);
  font-weight: var(--vr-font-weight-heavy);
  font-stretch: var(--vr-font-stretch-title);
  letter-spacing: 0.06em;
  text-transform: var(--vr-label-case);
}

/* The count beside a panel title is a pill. */
.card-header .vr-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--vr-space-6);
  min-height: var(--vr-space-5);
  padding: 0 var(--vr-space-2);
  border-radius: var(--vr-radius-pill);
  background: var(--vr-surface-2);
  color: var(--vr-text);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-bold);
}

.card-header > .ms-auto {
  gap: var(--vr-space-2) var(--vr-space-4);
}

/* A link with an icon in a panel head (Requirements and sampling →): icon and text apart. */
.card-header a:not(.btn):has(> .vr-icon) {
  display: inline-flex;
  align-items: center;
  gap: var(--vr-space-1);
}

/* A collapsible panel ({% panel collapsible=True %}): its head is the <summary>. Closed, the
   title sits centred with the same inset above and below; open, the head joins its body like any
   panel head. The chevron (a Bootstrap icon in the markup) turns when the panel opens. */
details.card > summary.card-header {
  padding-top: var(--vr-space-4);
  padding-bottom: var(--vr-space-4);
  border-radius: var(--vr-radius-xl);
  cursor: pointer;
  list-style: none;
}

details.card[open] > summary.card-header {
  padding-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

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

details.card > summary.card-header:hover .card-title {
  color: var(--vr-pen);
}

details.card > summary.card-header:focus-visible {
  outline: var(--vr-focus-width) solid var(--vr-focus);
  outline-offset: calc(-1 * var(--vr-focus-width));
}

.vr-panel-chevron {
  margin-left: auto;
  color: var(--vr-text-muted);
  transition: transform var(--vr-motion-fast) var(--vr-ease);
}

details.card[open] > summary .vr-panel-chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
  .vr-panel-chevron {
    transition: none;
  }
}

.card-footer {
  background: transparent;
  border-top: 0;
  padding-bottom: var(--vr-space-4);
}

/* Panel spacing, defined once ({% panel %}, {% panel_section %}): every panel body insets its
   content by --vr-panel-inset, and stacked blocks inside it are separated by one gap,
   --vr-stack. A table is flush only as a table panel's own body; text beside it keeps the
   inset. A section rule draws no line: sections are separated by the stack gap. */
.vr-panel-body {
  padding: var(--vr-space-4) var(--vr-panel-inset) var(--vr-panel-inset);
}

.card .vr-panel-body > * {
  margin-top: 0;
  margin-bottom: 0;
}

.card .vr-panel-body > * + * {
  margin-top: var(--vr-stack);
}

.card > .vr-panel-body.border-top {
  border-top: 0 !important; /* panel_section rule=True: separation by space, not a line */
  padding-top: 0;
}

/* Notices: the tone's fill, rounded, no border; the tone icon and bold label open it, the body
   is the normal text colour. */
.alert {
  --bs-alert-padding-y: var(--vr-space-3);
  --bs-alert-padding-x: var(--vr-space-4);
  --bs-alert-border: 0; /* tone-filled only: Bootstrap draws the edge from this shorthand */
  --bs-alert-border-radius: var(--vr-radius-xl);
  --bs-alert-color: var(--vr-text);
  --bs-alert-link-color: var(--vr-pen);
}

/* Label + body (includes/notice.html, messages, form errors) sit side by side while the body
   keeps at least about 18rem beside the label; in a narrower notice (the record aside, a phone)
   the label goes above the text instead of squeezing it into a column. */
.alert:has(> .vr-status) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-1-5) var(--vr-space-3);
  align-items: flex-start;
}

.alert:has(> .vr-status) > .vr-status {
  flex: none;
}

.alert:has(> .vr-status) > :not(.vr-status) {
  flex: 1 1 18rem;
  min-width: 0;
}

.alert-dismissible:has(> .vr-status) > .btn-close {
  flex: none;
}

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

.alert-dismissible .btn-close {
  padding: var(--vr-space-3-5);
  border-radius: var(--vr-radius-lg);
}

.alert-info {
  --bs-alert-bg: var(--vr-info-bg);
}

.alert-warning {
  --bs-alert-bg: var(--vr-warning-bg);
}

.alert-success {
  --bs-alert-bg: var(--vr-success-bg);
}

.alert-danger {
  --bs-alert-bg: var(--vr-danger-bg);
}

.alert-secondary {
  --bs-alert-bg: var(--vr-neutral-bg);
}

.alert-progress {
  --bs-alert-bg: var(--vr-progress-bg);
}

.alert-hold {
  --bs-alert-bg: var(--vr-hold-bg);
}

/* The notice's leading label: the tone icon in the tone colour, the label in strong text. */
.alert > .vr-status.vr-status-plain {
  flex: none;
  padding: 0;
  background: none;
  color: var(--vr-text-strong);
}

.alert > .vr-status.vr-status-plain .vr-status-glyph {
  width: 18px;
  height: 18px;
  color: var(--vr-tone-text);
}

.breadcrumb {
  --bs-breadcrumb-margin-bottom: var(--vr-space-2);
  --bs-breadcrumb-font-size: var(--vr-font-size-3);
  --bs-breadcrumb-divider-color: var(--vr-text-muted);
  --bs-breadcrumb-item-active-color: var(--vr-text-muted);
  --bs-breadcrumb-item-padding-x: var(--vr-space-2);
}

.breadcrumb a {
  font-weight: var(--vr-font-weight-bold);
}

.table {
  --bs-table-color: var(--vr-text);
  --bs-table-bg: transparent;
  --bs-table-border-color: transparent;
  --bs-table-hover-color: var(--vr-text);
  --bs-table-hover-bg: var(--vr-row-hover);
  --bs-table-striped-color: var(--vr-text);
  --bs-table-striped-bg: var(--vr-row-stripe);
}

/* Rows with an error (invalid result/QC entry, import row) and the other contextual rows take
   their status tone's fill, so text keeps the contrast of its theme. */
.table-danger {
  --vr-row-bg: var(--vr-danger-bg);
}

.table-success {
  --vr-row-bg: var(--vr-success-bg);
}

.table-warning {
  --vr-row-bg: var(--vr-warning-bg);
}

.table-info {
  --vr-row-bg: var(--vr-info-bg);
}

.table-secondary {
  --vr-row-bg: var(--vr-neutral-bg);
}

:is(.table-danger, .table-success, .table-warning, .table-info, .table-secondary) {
  --bs-table-color: var(--vr-text);
  --bs-table-bg: var(--vr-row-bg);
  --bs-table-border-color: transparent;
  --bs-table-striped-color: var(--vr-text);
  --bs-table-striped-bg: var(--vr-row-bg);
  --bs-table-active-color: var(--vr-text);
  --bs-table-active-bg: var(--vr-row-bg);
  --bs-table-hover-color: var(--vr-text);
  --bs-table-hover-bg: var(--vr-row-bg);
}

/* ================================================================ Application shell */

/* The shell: the top bar and the sidebar are one mineral-grey surface. The content ground is a
   sheet laid into it, its top-left corner rounded where it meets the shell. No edges between
   them. Sign-in pages have their own layout (Entrance pages, below). */
.vr-app {
  background-color: var(--vr-topbar-bg);
}

.vr-skip:focus {
  position: fixed !important;
  top: var(--vr-space-2);
  left: var(--vr-space-2);
  z-index: var(--vr-z-skip);
  padding: var(--vr-space-2) var(--vr-space-3);
  background: var(--vr-raised);
  border-radius: var(--vr-radius-lg);
  box-shadow: var(--vr-shadow-raised);
}

.vr-topbar {
  position: sticky;
  top: 0;
  z-index: var(--vr-z-topbar);
  min-height: var(--vr-topbar-height);
  padding: 0 var(--vr-space-4);
  display: flex;
  align-items: center;
  gap: var(--vr-space-4);
  background: var(--vr-topbar-bg);
  color: var(--vr-topbar-text);
}

.vr-topbar :focus-visible {
  outline-color: var(--vr-topbar-accent);
}

/* Menus open from the bar onto the page: they take the page's focus colour back. */
.vr-topbar .dropdown-menu :focus-visible {
  outline-color: var(--vr-focus);
}

.vr-brand,
.vr-brand:hover {
  display: flex;
  align-items: center;
  gap: var(--vr-space-3);
  color: var(--vr-topbar-text);
  font-size: var(--vr-font-size-5);
  font-weight: var(--vr-font-weight-bold);
  text-decoration: none;
  white-space: nowrap;
}

.vr-brand img {
  width: 28px;
  height: 28px;
}

.vr-lab-name {
  padding: var(--vr-space-0-5) var(--vr-space-3);
  border-radius: var(--vr-radius-pill);
  background: var(--vr-shell-chip);
  color: var(--vr-topbar-text);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-semibold);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vr-topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--vr-space-1);
}

/* Reserve space for every action on phones, including with wider system fonts.
   Only the brand text may truncate; controls must neither wrap nor leave the viewport. */
@media (max-width: 575.98px) {
  .vr-topbar {
    gap: var(--vr-space-1-5);
    padding: 0 var(--vr-space-2);
  }

  .vr-topbar > .vr-brand {
    min-width: 0;
  }

  .vr-topbar > .vr-brand span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* The product token stays visible; the prefix remains in the accessible name. */
  .vr-topbar > .vr-brand .vr-brand-prefix {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .vr-topbar > .vr-brand img,
  .vr-topbar > button,
  .vr-topbar-end {
    flex-shrink: 0;
  }

  .vr-topbar-end .vr-topbar-btn {
    white-space: nowrap;
  }
}

/* Quiet text buttons on the shell (and the theme menu on the sign-in pages): no fill at rest,
   the shell's hover tone, the icon muted. */
.vr-topbar-btn {
  --bs-btn-color: var(--vr-topbar-text);
  --bs-btn-bg: transparent;
  --bs-btn-hover-color: var(--vr-topbar-text);
  --bs-btn-hover-bg: var(--vr-shell-hover);
  --bs-btn-active-color: var(--vr-topbar-text);
  --bs-btn-active-bg: var(--vr-shell-hover);
  --bs-btn-padding-x: var(--vr-space-3);
  --bs-btn-font-size: var(--vr-font-size-4);
  --bs-btn-font-weight: var(--vr-font-weight-medium);
  box-shadow: none;
}

.vr-topbar-btn > .vr-icon {
  color: var(--vr-topbar-text-muted);
}

/* What's new in the top bar: the count of changes this user has not seen (whatsnew/button.html). */
.vr-whatsnew-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--vr-space-1-5);
}

.vr-whatsnew-badge {
  min-width: 1.25rem;
  padding: 0 var(--vr-space-1-5);
  border-radius: var(--vr-radius-pill);
  background: var(--vr-ink);
  color: var(--vr-on-ink);
  font-size: var(--vr-font-size-1);
  font-weight: var(--vr-font-weight-bold);
  line-height: var(--vr-line-height-base);
  text-align: center;
}

/* Phones: the count sits on the icon's corner, so the brand keeps its width. */
@media (max-width: 575.98px) {
  .vr-whatsnew-btn {
    position: relative;
  }

  .vr-whatsnew-badge {
    position: absolute;
    top: var(--vr-space-0-5);
    right: 0;
    padding: 0 var(--vr-space-1);
    line-height: var(--vr-line-height-snug);
  }
}

.vr-topbar-user {
  padding: 0 var(--vr-space-2);
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-medium);
  white-space: nowrap;
}

/* Which laboratory roles the signed-in person acts in, after their name. */
.vr-topbar-role {
  color: var(--vr-topbar-text-muted);
  font-weight: var(--vr-font-weight-regular);
}

/* Theme menu: the pressed option carries a check; text names the mode. */
.vr-theme-option .vr-theme-check {
  margin-left: auto;
  visibility: hidden;
  color: var(--vr-ink);
}

.vr-theme-option[aria-pressed="true"] .vr-theme-check {
  visibility: visible;
}

.vr-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

/* Offcanvas below lg, static rail from lg up (Bootstrap .offcanvas-lg). */
.vr-sidenav {
  --bs-offcanvas-width: 17rem;
  background: var(--vr-topbar-bg);
}

.vr-main {
  min-width: 0;
  padding: var(--vr-content-pad-y) var(--vr-content-pad-x) var(--vr-space-12);
  background: var(--vr-paper);
}

@media (min-width: 992px) {
  .vr-shell {
    grid-template-columns: var(--vr-sidenav-width) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: calc(100vh - var(--vr-topbar-height));
  }

  .vr-shell > .vr-sidenav {
    grid-row: span 2;
  }

  /* The sidebar keeps a gutter, so its scrollbar sits inside the shell and never touches the
     content sheet. */
  .vr-sidenav {
    position: sticky;
    top: var(--vr-topbar-height);
    height: calc(100vh - var(--vr-topbar-height));
    padding-right: var(--vr-shell-gutter);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .vr-main {
    border-top-left-radius: var(--vr-radius-main);
  }

  .vr-shell > .vr-app-footer {
    grid-column: -2 / -1;
  }
}

/* Application footer under the content column, on the same sheet: product, licence and the
   source-code link that AGPL-3.0 section 13 requires on every page. Outside .vr-main. */
.vr-app-footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-1) var(--vr-space-5);
  padding: var(--vr-space-4) var(--vr-content-pad-x) var(--vr-space-6);
  background: var(--vr-paper);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

.vr-app-footer a {
  color: var(--vr-pen);
}

.vr-app-footer a:hover {
  color: var(--vr-pen-hover);
}

.vr-sidenav .offcanvas-body {
  display: block;
  padding: var(--vr-space-2) 0 var(--vr-space-6) var(--vr-space-3);
}

.vr-nav-section {
  margin-top: var(--vr-space-5);
}

.vr-nav-section:first-of-type {
  margin-top: var(--vr-space-1);
}

.vr-nav-heading {
  margin: 0 0 var(--vr-space-1);
  padding: 0 var(--vr-space-3);
  color: var(--vr-topbar-text-muted);
  letter-spacing: 0.06em;
}

/* Phones: the signed-in person and their roles open the Account section (the top bar has no
   room for them). */
.vr-nav-person {
  margin: 0 0 var(--vr-space-1);
  padding: 0 var(--vr-space-3);
  font-size: var(--vr-font-size-3);
}

.vr-nav-person .vr-muted {
  color: var(--vr-topbar-text-muted);
}

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

.vr-navlink {
  display: flex;
  align-items: center;
  gap: var(--vr-space-3);
  min-height: var(--vr-nav-item-height);
  padding: 0 var(--vr-space-3);
  border-radius: var(--vr-radius-lg);
  color: var(--vr-topbar-text);
  font-size: var(--vr-font-size-4);
  text-decoration: none;
}

.vr-navlink > .vr-icon {
  width: 16px;
  height: 16px;
  color: var(--vr-topbar-text-muted);
}

a.vr-navlink:hover {
  background: var(--vr-shell-hover);
  color: var(--vr-topbar-text);
  text-decoration: none;
}

/* Where you are: a solid petrol item with bold text and icon. No marker, ring or edge. */
.vr-navlink[aria-current="page"],
a.vr-navlink[aria-current="page"]:hover {
  background: var(--vr-shell-current);
  color: var(--vr-on-shell-current);
  font-weight: var(--vr-font-weight-bold);
  box-shadow: var(--vr-shadow-current);
}

.vr-navlink[aria-current="page"] > .vr-icon {
  color: currentColor;
}

/* Reserve the bold width so marking the current page never shifts the rail. */
.vr-navlink > span[data-label] {
  display: inline-grid;
}

.vr-navlink > span[data-label]::after {
  content: attr(data-label);
  content: attr(data-label) / ""; /* empty alt text: not announced twice */
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: var(--vr-font-weight-bold);
  user-select: none;
}

/* Containers that receive focus from script (skip target, dialogs, phone menu) need no ring: the
   focus ring belongs to the controls inside them. */
.vr-main:focus,
.modal:focus,
.offcanvas:focus,
.offcanvas-lg:focus {
  outline: none;
}

/* ================================================================ Page header */

.vr-page-header {
  margin-bottom: var(--vr-space-5);
}

.vr-page-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--vr-space-3) var(--vr-space-4);
}

/* The title block takes the free space and wraps its own key facts, so the actions stay right of
   the title from 992px, bottom-aligned with the header, wrapping inside their own column. */
.vr-page-header-row > :first-child {
  flex: 1 1 26rem;
  min-width: 0;
}

/* Title: large, heavy, slightly widened. A record identifier as title keeps normal width. */
.vr-page-title {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-9);
  font-weight: var(--vr-font-weight-heavy);
  font-stretch: var(--vr-font-stretch-title);
  letter-spacing: -0.005em;
  line-height: var(--vr-line-height-tight);
}

.vr-page-title .vr-id,
.vr-page-title.vr-data {
  font-stretch: 100%;
}

/* Key facts under the title: status pill(s) first (the large pill), then up to four facts in
   muted text with the value strong. */
.vr-page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-2) var(--vr-space-4);
  margin: var(--vr-space-3) 0 0;
  padding: 0;
  list-style: none;
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-4);
}

.vr-page-meta :is(strong, b) {
  color: var(--vr-text-strong);
  font-weight: var(--vr-font-weight-semibold);
}

.vr-page-meta .vr-status:not(.vr-status-plain) {
  padding: var(--vr-space-0-5) var(--vr-space-3) var(--vr-space-0-5) var(--vr-space-2-5);
  font-size: var(--vr-font-size-4);
}

.vr-page-intro {
  max-width: 75ch;
  margin: var(--vr-space-2) 0 0;
  color: var(--vr-text-muted);
}

.vr-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-2);
}

.vr-page-actions:empty {
  display: none;
}

/* Why the expected next step is not offered, said before the button that fixes it (e.g. "No
   open QC batch accepting tests uses … revision 1." then New QC batch). */
.vr-action-note {
  max-width: 40ch;
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

@media (min-width: 992px) {
  .vr-page-actions {
    max-width: 66%;
    justify-content: flex-end;
  }
}

/* Dateline: today's date in the laboratory's time zone on an overview page. */
.vr-dateline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-1) var(--vr-space-3);
  margin: 0 0 var(--vr-space-2);
  font-size: var(--vr-font-size-3);
  letter-spacing: 0.06em;
}

.vr-dateline time {
  font-size: inherit;
}

/* Small option forms inside a page-action dropdown (e.g. label download). */
.vr-labels-menu {
  width: min(18rem, calc(100vw - var(--vr-space-8)));
  padding: var(--vr-space-3-5);
}

.vr-labels-menu fieldset,
.vr-labels-menu .vr-field {
  margin-bottom: var(--vr-space-3);
}

.vr-labels-menu legend {
  font-size: inherit;
  font-weight: var(--vr-font-weight-bold);
}

.vr-section-title {
  margin: 0 0 var(--vr-space-3);
  font-size: var(--vr-font-size-6);
}

/* Section tabs (includes/section_tabs.html): sibling pages as pill links above the header; the
   current page is a lifted panel-coloured pill. One row that scrolls when space is short. */
.vr-section-tabs {
  min-width: 0;
  margin-bottom: var(--vr-space-4);
}

.vr-section-tabs .nav-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: var(--vr-space-1);
  scroll-padding-inline: var(--vr-space-1);
}

.vr-section-tabs .nav-item {
  flex: 0 0 auto;
}

.nav-tabs {
  --bs-nav-tabs-border-width: 0;
  --bs-nav-tabs-border-radius: var(--vr-radius-pill);
  gap: var(--vr-space-1);
  border-bottom: 0;
}

.nav-tabs .nav-link {
  display: flex;
  align-items: center;
  min-height: var(--vr-control-height-sm);
  padding: 0 var(--vr-space-3);
  border: 0;
  border-radius: var(--vr-radius-pill);
  background: transparent;
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-semibold);
  white-space: nowrap;
}

.nav-tabs .nav-link:hover {
  background: var(--vr-surface-hover);
  color: var(--vr-text);
  text-decoration: none;
}

/* The current tab keeps the same weight, so marking it never shifts the row. */
.nav-tabs .nav-link.active,
.nav-tabs .nav-link[aria-current="page"] {
  background: var(--vr-surface);
  color: var(--vr-text-strong);
  box-shadow: var(--vr-shadow-panel);
}

/* "On this page" anchors (includes/page_toc.html). */
.vr-page-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--vr-space-1) var(--vr-space-4);
  margin-bottom: var(--vr-space-4);
  font-size: var(--vr-font-size-3);
}

.vr-page-toc-title {
  margin: 0;
}

.vr-page-toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-1) var(--vr-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.vr-page-toc a {
  font-weight: var(--vr-font-weight-semibold);
}

/* ================================================================ Status stamps */

/* Status is a tinted pill: the tone's fill, the tone's text and Bootstrap icon (one per tone,
   from {% status %}), never colour alone and no edge. The print variant (the certificate) is the
   text alone. */
.vr-status {
  --vr-tone-text: var(--vr-neutral-text);
  --vr-tone-bg: var(--vr-neutral-bg);
  display: inline-flex;
  align-items: center;
  gap: var(--vr-space-1);
  padding: var(--vr-space-0-5) var(--vr-space-2-5) var(--vr-space-0-5) var(--vr-space-2);
  border-radius: var(--vr-radius-pill);
  background: var(--vr-tone-bg);
  color: var(--vr-tone-text);
  font-family: var(--vr-font-sans);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-bold);
  letter-spacing: 0;
  line-height: var(--vr-line-height-snug);
  text-transform: none; /* a pill keeps its label's case, also inside an uppercase title */
  white-space: nowrap;
}

.vr-status-glyph {
  width: 12px;
  height: 12px;
}

.vr-status[data-tone="info"] {
  --vr-tone-text: var(--vr-info-text);
  --vr-tone-bg: var(--vr-info-bg);
}

.vr-status[data-tone="progress"] {
  --vr-tone-text: var(--vr-progress-text);
  --vr-tone-bg: var(--vr-progress-bg);
}

.vr-status[data-tone="success"] {
  --vr-tone-text: var(--vr-success-text);
  --vr-tone-bg: var(--vr-success-bg);
}

.vr-status[data-tone="warning"] {
  --vr-tone-text: var(--vr-warning-text);
  --vr-tone-bg: var(--vr-warning-bg);
}

.vr-status[data-tone="danger"] {
  --vr-tone-text: var(--vr-danger-text);
  --vr-tone-bg: var(--vr-danger-bg);
}

.vr-status[data-tone="hold"] {
  --vr-tone-text: var(--vr-hold-text);
  --vr-tone-bg: var(--vr-hold-bg);
}

/* A result's kind beside its identifier ({% kind_tag %}: Retest, Resample, Original): a squarer
   tag in the progress tone, so it never reads as a status pill. */
.vr-kind-tag {
  display: inline-flex;
  align-items: center;
  margin-left: var(--vr-space-1);
  padding: 0 var(--vr-space-1-5);
  border-radius: var(--vr-radius-tag);
  background: var(--vr-progress-bg);
  color: var(--vr-progress-text);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-bold);
  line-height: var(--vr-line-height-snug);
  white-space: nowrap;
  vertical-align: baseline;
}

/* Plain variant for dense table cells and notices: icon and text in the tone colour, no fill. */
.vr-status.vr-status-plain {
  padding: 0;
  background: none;
}

/* Helper notes under a cell value (e.g. the preparation identity under a test name) wrap, so a
   narrow panel does not push the last columns out of view. */
.vr-table td .vr-form-note {
  white-space: normal;
}

/* Status labels in table cells keep one line from 768px, so a row stays within two lines (a
   second pill stacks under the first). On phones a plain status sentence wraps so its text stays
   on screen; a long one (a blocker reason) in a free-text cell (.vr-wrap) always wraps instead of
   widening the table past its panel. Filled pills never wrap. */
.vr-table td .vr-status-plain {
  align-items: flex-start;
  white-space: normal;
}

@media (min-width: 768px) {
  .vr-table td .vr-status-plain {
    white-space: nowrap;
  }
}

.vr-table td.vr-wrap .vr-status-plain {
  max-width: 24rem;
  white-space: normal;
}

.vr-table td .vr-status-plain .vr-status-glyph {
  margin-top: 0.2em;
}

/* Two pills in one cell stack, so the row stays within two lines. */
.vr-table td > .vr-status ~ .vr-status {
  margin-top: var(--vr-space-1);
}

/* ================================================================ Data tables */

/* Tables are separated by fills, not rules: a rounded header row, a faint zebra, a hover fill and
   rounded row ends. Every cell paints its row's fill and bleeds it 1px right, so fractional
   column widths never show a hairline gap. A table panel insets everything by --vr-table-inset;
   its head, toolbar, chips and foot add a small step so their text lines up with the cells. */
.vr-table-card {
  padding: var(--vr-table-inset) var(--vr-table-inset) var(--vr-space-3);
}

.vr-table-card > .card-header {
  padding: 0 var(--vr-space-2) var(--vr-space-3);
  min-height: var(--vr-control-height-sm);
}

.vr-table-card > :is(.vr-table-body, .card-body:not(.vr-panel-body)) {
  padding: 0;
}

/* A section of a table panel ({% panel_section %}) keeps the panel inset as a whole. */
.vr-table-card > .vr-panel-body {
  padding: var(--vr-space-2) calc(var(--vr-panel-inset) - var(--vr-table-inset)) var(--vr-space-3);
}

.vr-table-card > .card-footer {
  padding: var(--vr-space-3) var(--vr-space-2) 0;
}

.vr-table-wrap {
  position: relative; /* clips absolutely positioned descendants (visually hidden text) too */
  overflow-x: auto;
  --vr-fade: var(--vr-space-8);
  scroll-padding-inline-start: 8rem; /* clear the sticky row identifier on keyboard focus */
}

/* A table wider than its panel scrolls inside it, never clipped: the scrollbar shows, and the
   edge with more columns beyond it fades (app.js marks which side), so hidden columns are never
   a silent loss. The mask reads only alpha: currentColor is just an opaque stop. */
.vr-table-wrap.vr-more-end {
  mask-image: linear-gradient(to right, currentColor calc(100% - var(--vr-fade)), transparent);
}

.vr-table-wrap.vr-more-start {
  mask-image: linear-gradient(to left, currentColor calc(100% - var(--vr-fade)), transparent);
}

.vr-table-wrap.vr-more-start.vr-more-end {
  mask-image: linear-gradient(to right, transparent, currentColor var(--vr-fade), currentColor calc(100% - var(--vr-fade)), transparent);
}

.vr-table {
  --vr-row-fill: transparent;
  margin: 0;
  font-size: var(--vr-font-size-4);
  border-collapse: separate;
  border-spacing: 0;
}

.vr-table > :not(caption) > * > * {
  --bs-table-bg: var(--vr-row-fill);
  padding: var(--vr-cell-py) var(--vr-cell-px);
  border: 0;
  background-color: var(--vr-row-fill);
  box-shadow: var(--vr-border-width) 0 0 var(--vr-row-fill);
}

/* The head row: one rounded fill, labels in small muted capitals. A long label wraps at its
   spaces (never inside a word) rather than widening the table past its panel. */
.vr-table > thead > tr > th {
  --vr-row-fill: var(--vr-th-bg);
  padding-top: var(--vr-space-2);
  padding-bottom: var(--vr-space-2);
  white-space: normal;
  overflow-wrap: normal;
  text-wrap: balance;
  vertical-align: middle;
}

.vr-table > :not(caption) > tr > :first-child {
  border-top-left-radius: var(--vr-radius-lg);
  border-bottom-left-radius: var(--vr-radius-lg);
}

.vr-table > :not(caption) > tr > :last-child {
  border-top-right-radius: var(--vr-radius-lg);
  border-bottom-right-radius: var(--vr-radius-lg);
  box-shadow: none;
}

.vr-table > tbody > tr > * {
  vertical-align: middle;
  white-space: nowrap;
}

.vr-table > tbody > tr:nth-child(even) > * {
  --vr-row-fill: var(--vr-row-stripe);
}

.vr-table.table-hover > tbody > tr:hover > *,
.vr-table > tbody > tr:has(.vr-row-link):hover > * {
  --vr-row-fill: var(--vr-row-hover);
  --bs-table-bg-state: var(--vr-row-hover);
}

/* Contextual rows (an error row in an entry grid) keep their tone's fill. */
.vr-table > tbody > tr:is(.table-danger, .table-success, .table-warning, .table-info, .table-secondary) > * {
  --vr-row-fill: var(--vr-row-bg);
}

/* Long free text (notes, descriptions) may wrap; everything else stays on one scannable line. */
.vr-table > tbody > tr > .vr-wrap {
  white-space: normal;
  min-width: 14rem;
}

/* Rows stay within two lines. A long free-text value sits in .vr-clamp and ends in an ellipsis
   after its second line; the cell's tooltip and the DOM keep the full text for every reader. */
.vr-table .vr-clamp {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* A name cell with a sub-line (supplier over site, material over grade): each keeps one line and
   ends in an ellipsis, taking the column's width instead of setting it; the full text is in the
   cell's tooltip and in the DOM for screen readers. */
.vr-table .vr-clip {
  width: 10rem; /* a table cell's width is its minimum */
}

@media (max-width: 1365.98px) {
  .vr-table .vr-clip {
    width: 14rem; /* low-priority columns give way below 1366px; the name takes their room */
  }
}

.vr-table .vr-clip > :is(.vr-clip-main, .vr-sub) {
  display: block;
  width: 0;
  min-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A muted sub-line under a cell value. */
.vr-sub {
  display: block;
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

/* Low-priority columns of tables without a Columns control (marked by app.js) give way while the
   table would not fit its own box with them (app.js marks it cramped), so the table fits at 1280
   or beside the help drawer; the record still holds the full data. Lists (data-vr-grid) hide them
   through grid.js, where the user can show them again. */
.vr-table.vr-table-cramped:not([data-vr-grid]) [data-vr-low],
.vr-table.vr-table-cramped-more:not([data-vr-grid]) [data-vr-medium] {
  display: none;
}

/* Evidence and note rows that span the table (preservation, preparation, revision notes) are
   sentences, not columns: they wrap instead of forcing a horizontal scroll. */
.vr-table > tbody > tr > td[colspan].small {
  white-space: normal;
}

/* Dashboard work queues: the label wraps so the count and age stay on screen on a phone. */
.vr-table.vr-queue-table > tbody > tr > .vr-wrap {
  min-width: 9rem;
}

/* The row's identifier link: the data voice, bold petrol, underlined only on hover. */
.vr-table .vr-row-link {
  color: var(--vr-pen);
  font-family: var(--vr-font-data);
  font-variant-numeric: tabular-nums slashed-zero;
  font-weight: var(--vr-font-weight-bold);
  text-decoration: none;
}

.vr-table .vr-row-link:hover {
  color: var(--vr-pen-hover);
  text-decoration: underline;
}

.vr-table caption {
  caption-side: top;
  padding: 0 var(--vr-space-2) var(--vr-space-2);
  color: var(--vr-text-muted);
}

/* Selected rows: the selection fill across the row, also while hovered and in DataTables-enhanced
   lists. */
.vr-table > tbody > tr:has(> * > input[type="checkbox"]:checked) > *,
.vr-table > tbody > tr:has(> * > .form-check > input[type="checkbox"]:checked) > * {
  --vr-row-fill: var(--vr-selection);
}

/* Keep the row identifier visible while a wide table scrolls sideways. */
.vr-table > thead > tr > th:first-child,
.vr-table > tbody > tr > th[scope="row"]:first-child {
  position: sticky;
  left: 0;
  z-index: var(--vr-z-raised);
}

.vr-table > tbody > tr > th[scope="row"]:first-child {
  --vr-row-fill: var(--vr-surface);
  color: var(--vr-text-strong);
  font-weight: var(--vr-font-weight-semibold);
}

.vr-table > tbody > tr:nth-child(even) > th[scope="row"]:first-child {
  --vr-row-fill: var(--vr-row-stripe);
}

.vr-table.table-hover > tbody > tr:hover > th[scope="row"]:first-child {
  --vr-row-fill: var(--vr-row-hover);
}

/* The stability pull schedule: storage conditions by time point; each cell is the pull's status,
   linked to the pull. Emphasis in tables is a pill, never a whole-cell fill. */
.vr-schedule > tbody > tr > td {
  white-space: normal;
}

.vr-schedule > tbody > tr > td > a {
  text-decoration: none;
}

.vr-schedule > tbody > tr > td > a:hover .vr-status {
  text-decoration: underline;
}

.vr-schedule > thead time {
  display: block;
  color: var(--vr-text-muted);
  font-weight: var(--vr-font-weight-regular);
  letter-spacing: 0;
  text-transform: none;
}

/* Inputs inside table cells: wide enough to read back typed values and dates. */
.vr-table .form-control,
.vr-table .form-select {
  min-width: 6.5rem;
}

.vr-table input[type="datetime-local"].form-control,
.vr-table input[type="date"].form-control {
  min-width: 12.5rem;
}

.vr-table input[type="number"].form-control {
  min-width: 5rem;
}

/* A select in a table cell (entry grids) takes the width of its longest option instead of
   shrinking with the column, so the chosen value stays readable. */
.vr-table .form-select {
  width: auto;
  max-width: 22rem;
}

/* Sortable headers: the sorted column is strong with its arrow; unsorted ones show the muted
   two-way arrow. */
.vr-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--vr-space-1);
  color: inherit;
  text-decoration: none;
}

.vr-sort:hover {
  color: var(--vr-text-strong);
  text-decoration: none;
}

[aria-sort] > .vr-sort {
  color: var(--vr-text-strong);
}

.vr-sort .vr-icon {
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

[aria-sort] > .vr-sort .vr-icon,
.vr-sort:hover .vr-icon,
.vr-sort:focus-visible .vr-icon {
  opacity: 1;
}

/* The foot of a list: the count left, Columns and rows per page, the pager right. */
.vr-table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--vr-space-2) var(--vr-space-3);
  padding: var(--vr-space-3) var(--vr-space-2) 0;
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-4);
}

.vr-count {
  margin: 0;
  color: var(--vr-text-muted);
}

.vr-count strong {
  color: var(--vr-text-strong);
}

/* Text placed in a flush table body beside the table (headings, notes, selection text) keeps
   the table's inset plus the cell padding. Sections of the panel (.vr-panel-body) inset as a
   whole instead. */
.vr-table-card > :is(.vr-table-body, .card-body:not(.vr-panel-body)) > :not(.vr-table-wrap, .vr-table-footer, .vr-grid-toolbar, .vr-bulkbar, .vr-chips, .vr-empty, table, ul, ol, .dt-container) {
  padding-left: var(--vr-space-2);
  padding-right: var(--vr-space-2);
}

.vr-table-card > :is(.vr-table-body, .card-body:not(.vr-panel-body)) > :is(h3, h4, .d-flex) {
  padding-bottom: var(--vr-space-1);
}

.vr-table-card > :is(.vr-table-body, .card-body:not(.vr-panel-body)) > p:last-child {
  padding-top: var(--vr-space-2);
  margin-bottom: 0;
}

.vr-table-card > :is(.vr-table-body, .card-body:not(.vr-panel-body)) > :is(ul, ol) {
  padding-left: calc(var(--vr-space-2) + var(--vr-space-5));
  padding-right: var(--vr-space-2);
}

/* ================================================================ Grid toolbar, filters, columns */

/* One row above the table that wraps: search, everyday filters, Apply and Clear all, then
   Columns. Search runs wider; fields stay between 150 and 200 pixels. */
.vr-grid-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--vr-space-3);
  padding: 0 var(--vr-space-2) var(--vr-space-4);
}

.vr-grid-toolbar .vr-field {
  margin: 0;
  min-width: 0;
  flex: 1 1 10.7rem;
  max-width: 14.3rem;
}

.vr-grid-toolbar .vr-grid-search {
  flex: 2 1 14.3rem;
  max-width: 20rem;
}

.vr-grid-search {
  position: relative;
}

/* The search icon sits inside the right of the field. */
.vr-grid-search .vr-icon {
  position: absolute;
  right: var(--vr-space-3);
  bottom: calc((var(--vr-control-height) - 1em) / 2); /* centred in the field */
  color: var(--vr-text-muted);
  pointer-events: none;
}

.vr-grid-search .form-control {
  padding-right: var(--vr-space-8);
}

.vr-filter-actions,
.vr-grid-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-2);
  align-items: center;
}

.vr-filter-actions .btn-primary {
  box-shadow: none;
}

.vr-grid-tools {
  margin-left: auto;
}

/* "More filters": a disclosure row under the toolbar. */
.vr-grid-more {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: var(--vr-space-3);
  padding-top: var(--vr-space-1);
}

.vr-grid-more[hidden] {
  display: none;
}

.vr-grid-more .vr-field {
  margin: 0;
}

/* Phones: one filter per row, tools beside the actions instead of on their own line. */
@media (max-width: 575.98px) {
  .vr-grid-toolbar .vr-field,
  .vr-grid-toolbar .vr-grid-search {
    flex: 1 1 100%;
    max-width: none;
  }

  .vr-grid-tools {
    margin-left: 0;
  }
}

/* Active filter chips under the toolbar, each removable; text states field and value. */
.vr-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-2);
  padding: 0 var(--vr-space-2) var(--vr-space-3);
  margin: 0;
  list-style: none;
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-4);
}

.vr-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--vr-space-1);
  padding: var(--vr-space-0-5) var(--vr-space-1) var(--vr-space-0-5) var(--vr-space-2-5);
  border-radius: var(--vr-radius-pill);
  background: var(--vr-selection);
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-semibold);
}

.vr-chip .vr-muted {
  color: inherit !important; /* the label sits on the selection fill, not on the page */
}

.vr-chip a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--vr-text-strong);
}

.vr-chip a:hover {
  background: var(--vr-surface-hover);
  color: var(--vr-text-strong);
}

/* Bulk action bar above a selectable table: target, action, selection count. */
.vr-bulkbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--vr-space-3) var(--vr-space-4);
  margin-bottom: var(--vr-space-3);
  padding: var(--vr-space-2) var(--vr-space-3);
  border-radius: var(--vr-radius-lg);
  background: var(--vr-surface-2);
}

.vr-bulkbar .vr-field {
  margin: 0;
}

/* Columns dialog: visibility checkbox, label and move controls per column, as wells. */
.vr-columns-list {
  display: grid;
  gap: var(--vr-space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.vr-columns-list > li {
  display: flex;
  align-items: center;
  gap: var(--vr-space-2);
  padding: var(--vr-space-1-5) var(--vr-space-2) var(--vr-space-1-5) var(--vr-space-3);
  border-radius: var(--vr-radius-lg);
  background: var(--vr-surface-2);
}

.vr-columns-list .form-check {
  flex: 1 1 auto;
  margin: 0;
}

.vr-columns-list .vr-col-locked {
  font-size: var(--vr-label-size);
  font-weight: var(--vr-font-weight-bold);
  letter-spacing: var(--vr-label-tracking);
  text-transform: var(--vr-label-case);
  color: var(--vr-text-muted);
}

/* DataTables chrome inside our table panel (Bootstrap 5 integration). */
.vr-table-card .dt-container {
  padding: 0;
}

/* The adapter wraps the table in a Bootstrap row/col (gutters, .mt-2); an enhanced list must sit
   exactly where the plain server-rendered table does. */
.vr-table-card .dt-container > .row {
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
  margin: 0 !important;
}

.vr-table-card .dt-container > .row > * {
  padding: 0;
  margin-top: 0;
}

/* DataTables repaints every cell with --bs-table-bg (the row fill, above) and lays a translucent
   overlay on striped and hovered rows; the row fills stay in charge. */
table.table.dataTable.vr-table > tbody > tr > *,
table.table.dataTable.vr-table.table-striped > tbody > tr:nth-of-type(2n+1) > *,
table.table.dataTable.vr-table.table-hover > tbody > tr:hover > * {
  box-shadow: var(--vr-border-width) 0 0 var(--vr-row-fill);
}

table.table.dataTable.vr-table > :not(caption) > tr > :last-child {
  box-shadow: none;
}

.vr-table-card .dt-container .dt-paging,
.vr-table-card .dt-container .dt-info,
.vr-table-card .dt-container .dt-length {
  font-size: var(--vr-font-size-3);
  color: var(--vr-text-muted);
}

.vr-table-card table.dataTable {
  margin: 0 !important;
}

.vr-table-card .dt-processing {
  background: var(--vr-raised);
  color: var(--vr-text);
  border: 0;
  border-radius: var(--vr-radius-lg);
  box-shadow: var(--vr-shadow-raised);
}

/* Column drag (ColReorder): its insertion marks and the dragged copy use the theme, not its blue
   and fixed white. */
table.dataTable tbody tr td.dtcr-moving-first {
  border-left: var(--vr-border-width-lg) solid var(--vr-ink);
}

table.dataTable tbody tr td.dtcr-moving-last {
  border-right: var(--vr-border-width-lg) solid var(--vr-ink);
}

table.dtcr-cloned.dataTable {
  background-color: var(--vr-raised);
  border: 0;
  border-radius: var(--vr-radius-lg);
  box-shadow: var(--vr-shadow-raised);
  opacity: 0.92;
}

/* ================================================================ Empty, loading, error */

/* Empty, no-results and error states inside the table panel: centred, an icon in a soft circle,
   the title, a short muted body and the next action. */
.vr-empty {
  padding: var(--vr-space-10) var(--vr-space-4);
  text-align: center;
}

.vr-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--vr-space-3);
  border-radius: 50%;
  background: var(--vr-surface-2);
  color: var(--vr-text-muted);
}

.vr-empty-icon > .vr-icon {
  width: 22px;
  height: 22px;
}

/* Inside a record panel (one with a visible head) the empty state is compact. */
.card:has(> .card-header) .vr-empty {
  padding: var(--vr-space-6) var(--vr-space-4);
}

.card:has(> .card-header) .vr-empty-icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--vr-space-2);
}

.card:has(> .card-header) .vr-empty-icon > .vr-icon {
  width: 18px;
  height: 18px;
}

.card:has(> .card-header) .vr-empty-title {
  font-size: var(--vr-font-size-5);
}

.vr-empty[data-kind="error"] .vr-empty-icon {
  color: var(--vr-danger-text);
}

.vr-empty-title {
  margin: 0 0 var(--vr-space-1);
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-6);
  font-weight: var(--vr-font-weight-bold);
}

.vr-empty-body {
  max-width: 60ch;
  margin: 0 auto var(--vr-space-4);
  color: var(--vr-text-muted);
}

.vr-empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--vr-space-2);
}

/* Loading rows: same height as data rows so nothing jumps when they arrive. */
.vr-skeleton {
  display: block;
  height: 0.875rem;
  border-radius: var(--vr-radius-sm);
  background: linear-gradient(90deg, var(--vr-surface-2) 0%, var(--vr-surface-hover) 50%, var(--vr-surface-2) 100%);
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .vr-skeleton {
    animation: vr-skeleton 1.4s ease-in-out infinite;
  }
}

@keyframes vr-skeleton {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

/* HTMX request indicators (htmx's own inline indicator styles are disabled in base.html). */
.htmx-indicator {
  visibility: hidden;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  visibility: visible;
}

[aria-busy="true"] {
  cursor: progress;
}

/* ================================================================ Forms */

.vr-form {
  max-width: var(--vr-form-width);
}

/* Grid-style forms (a table of inputs, e.g. result entry) use the full content width. */
.vr-form:has(.vr-table-card),
.vr-form.vr-form-wide {
  max-width: none;
}

/* A form with a table of inputs (quote lines, price list, report sample picker) uses the full
   content width for that table; its other sections keep the reading width. */
.vr-form-wide > .vr-form-section:not(:has(table)) {
  max-width: var(--vr-form-width);
}

/* A form page's form is one panel: the panel surface and inset at the reading width, its action
   row closing the panel at the bottom right. The panels and notices around it take the same
   width. Inside a panel, a signing card or the form dialog a form stays plain; a form that holds
   panels of its own (an entry grid) stays plain too. */
.vr-main > .vr-form:not(:has(.card)) {
  margin-bottom: var(--vr-stack);
  padding: var(--vr-panel-inset);
  border-radius: var(--vr-radius-xl);
  background: var(--vr-surface);
  box-shadow: var(--vr-shadow-panel);
}

.vr-main > .vr-form:not(:has(.card)) > .vr-form-section:last-of-type {
  margin-bottom: 0;
}

.vr-main:has(> .vr-form:not(.vr-form-wide)):not(:has(> .vr-form .card)) > :is(.card, .alert) {
  max-width: var(--vr-form-width);
}

/* Reading width for panels that sit with a form (history under an edit form) but are not one. */
.vr-narrow {
  max-width: var(--vr-form-width);
}

.vr-field {
  margin-bottom: var(--vr-space-4);
  min-width: 0;
}

.row > [class*="col"] > .vr-field {
  margin-bottom: 0;
}

.vr-field > fieldset > legend,
fieldset.vr-field > legend {
  margin-bottom: var(--vr-space-1);
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-bold);
}

.vr-req {
  color: var(--vr-pencil);
  margin-left: var(--vr-space-0-5);
}

/* A field's error: the icon and message under the field, danger text, no red fill. "Error:"
   prefixes each message for assistive technology without showing twice. */
.vr-field-errors {
  display: block;
  margin: var(--vr-space-1) 0 0;
  padding: 0;
  list-style: none;
  color: var(--vr-danger-text);
  font-weight: var(--vr-font-weight-medium);
  font-size: var(--vr-font-size-4);
}

.vr-field-errors li {
  display: flex;
  align-items: flex-start;
  gap: var(--vr-space-1-5);
}

.vr-field-errors li > .vr-icon {
  margin-top: 0.2em;
}

.vr-field-errors li::before {
  content: "Error: ";
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.vr-choices .form-check {
  margin-bottom: var(--vr-space-1);
}

.vr-multi {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-2);
}

.vr-multi > * {
  flex: 1 1 10rem;
}

/* Form sections: no wells. Each is a fieldset with a legend, sections well apart; from 768px the
   fields run in two columns, and anything that is not a single short field (text areas, choice
   lists, tables, notes, nested groups) spans both. */
.vr-form-section {
  min-width: 0;
  margin: 0 0 var(--vr-space-8);
  padding: 0;
  border: 0;
}

.vr-form-section > legend,
.vr-form-section > h2 {
  float: left; /* keeps a fieldset legend in flow instead of on its border */
  width: 100%;
  margin: 0 0 var(--vr-space-4);
  padding: 0;
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-6);
  font-weight: var(--vr-font-weight-bold);
}

/* Bootstrap floats <legend> and clears only "legend + *"; hidden inputs after a legend would
   leave following blocks (e.g. nested fieldsets) beside the float. */
.vr-form-section > legend ~ *,
.vr-form-section > h2 ~ *,
.vr-container > legend ~ * {
  clear: left;
}

@media (min-width: 768px) {
  .vr-form-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--vr-space-5);
    align-items: start;
  }

  .vr-form-section > :not(.vr-field),
  .vr-form-section > .vr-field:is(fieldset, .vr-wide, :has(textarea, .vr-choices, .vr-multi, table, .vr-drop)) {
    grid-column: 1 / -1;
  }

  /* A short field alone between full-width ones (a title before its description) takes the
     whole row rather than leaving the right column empty. */
  .vr-form-section > :is(legend, h2, input[type="hidden"], :not(.vr-field), fieldset.vr-field, .vr-field.vr-wide, .vr-field:has(textarea, .vr-choices, .vr-multi, table, .vr-drop))
    + .vr-field:not(fieldset, .vr-wide, :has(textarea, .vr-choices, .vr-multi, table, .vr-drop)):has(+ :not(.vr-field), + fieldset.vr-field, + .vr-wide, + .vr-field textarea, + .vr-field .vr-choices, + .vr-field .vr-multi, + .vr-field table, + .vr-field .vr-drop) {
    grid-column: 1 / -1;
  }
}

.vr-form .vr-field {
  margin-bottom: var(--vr-space-4);
}

.vr-form .row > [class*="col"] > .vr-field {
  margin-bottom: 0;
}

.vr-form textarea.form-control {
  height: 5.5rem;
}

.vr-form textarea.vr-announcement-input {
  height: 14rem;
}

/* Action row: a destructive action first, Cancel, then the primary at the end. On full pages it
   is plain, after the fields; only the form dialog makes it a sticky footer (form-dialog.js). */
.vr-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--vr-space-3);
  margin: 0;
  padding: var(--vr-space-2) 0 0;
}

.vr-form-actions-start {
  margin-right: auto;
}

/* In the form dialog a form takes the dialog's width; the dialog size sets the reading width. */
#vr-form-dialog .vr-form {
  max-width: none;
}

/* In the form dialog the dialog's own title names the form: the fetched page's heading is not
   shown twice (form-dialog.js copies it into the dialog title). */
#vr-form-dialog [data-vr-form-page] .vr-page-header .vr-page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* In the form dialog the action row is the dialog's footer: sticky, lifted by a shadow, and
   always the last element. */
#vr-form-dialog .vr-form-actions {
  position: sticky;
  bottom: calc(-1 * var(--vr-panel-inset));
  z-index: var(--vr-z-sticky);
  margin: var(--vr-space-4) calc(-1 * var(--vr-panel-inset)) calc(-1 * var(--vr-panel-inset));
  padding: var(--vr-space-4) var(--vr-panel-inset);
  background: var(--vr-raised);
  box-shadow: var(--vr-shadow-scroll-bottom);
}

/* A small dialog (sm in core/form_surfaces.py) keeps one column of fields. */
#vr-form-dialog .modal-dialog:not(.modal-lg, .modal-xl) .vr-form-section {
  display: block;
}

/* Signing in the form dialog: the signature card is the dialog's content, edge to edge under the
   header; its petrol band carries the title, so the dialog's own title is only announced. */
#vr-form-dialog [data-vr-form-page] > .vr-sign-card,
#vr-form-dialog [data-vr-form-page] > * > .vr-sign-card {
  margin: 0 calc(-1 * var(--vr-panel-inset));
  border-radius: 0;
  box-shadow: none;
}

#vr-form-dialog:has([data-vr-form-page] .vr-sign-card) .modal-header .modal-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.vr-form-note {
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

/* Reading a value from a connected balance or meter (static/js/device-readings.js): the read
   control and what was read or why it was refused, under the field. */
.vr-reading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-1) var(--vr-space-3);
  margin-top: var(--vr-space-2);
}

.vr-reading-status {
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

.vr-reading-status.vr-reading-error {
  color: var(--vr-danger-text);
}

/* What the device sent is evidence: shown whole, wrapping, never cut to fit a table cell. */
.vr-code.vr-reading-raw,
.vr-table .vr-code.vr-reading-raw {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* One container row of a receipt formset: a well. */
.vr-container {
  margin: 0 0 var(--vr-space-2);
  padding: var(--vr-space-3) var(--vr-space-4) var(--vr-space-1);
  border: 0;
  border-radius: var(--vr-radius-lg);
  background: var(--vr-surface-2);
}

.vr-container > legend {
  margin-bottom: var(--vr-space-2);
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-bold);
}

/* Filter box above long checkbox lists (added by app.js). */
.vr-choice-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-1-5) var(--vr-space-3);
  margin-bottom: var(--vr-space-2-5);
}

.vr-choice-filter .form-control {
  max-width: 20rem;
}

/* ================================================================ Record detail */

/* Panels stack one gap apart on every page. */
.vr-main > .card,
.vr-main > section.card,
.vr-main > form > .card {
  margin-bottom: var(--vr-stack);
}

/* Key facts on an aligned grid of equal tracks. The number of tracks follows the width of the
   panel the facts sit in (a container query), never the window: a track is never narrower than
   about 13rem, so labels and ordinary words never break inside a word. 1 track in a narrow panel
   or the record aside, then 2, 3 and 4 as the panel widens; a wide fact spans two tracks. */
.card,
.vr-record-aside {
  container: vr-panel / inline-size;
}

.vr-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--vr-space-4) var(--vr-space-6);
  margin: 0;
}

.vr-facts > div {
  min-width: 0;
}

@container vr-panel (min-width: 30rem) {
  .vr-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vr-facts > .vr-fact-wide {
    grid-column: span 2;
  }
}

@container vr-panel (min-width: 46rem) {
  .vr-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container vr-panel (min-width: 62rem) {
  .vr-facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.vr-facts dt {
  margin-bottom: var(--vr-space-0-5);
}

/* Words wrap at spaces; a single string breaks only when it alone is wider than its track
   (identifiers and hashes: below). */
.vr-facts :is(dt, dd) {
  overflow-wrap: break-word;
  word-break: normal;
}

.vr-facts dd {
  margin: 0;
  color: var(--vr-text-strong);
  font-weight: var(--vr-font-weight-medium);
}

/* Fact values always wrap; only a status pill keeps its line. Code-like values (references,
   hashes) may break between any two characters rather than stack one fragment per line. */
.vr-facts dd :is(.vr-id, .vr-data, code) {
  white-space: normal;
}

.vr-facts dd time {
  white-space: nowrap; /* a date or time never breaks at its hyphens */
}

.vr-facts dd .vr-status-plain {
  align-items: flex-start;
  white-space: normal; /* a plain status may carry a sentence (the next pull and its due date) */
}

.vr-facts dd .vr-status-plain .vr-status-glyph {
  margin-top: 0.2em;
}

.vr-facts dd :is(.vr-data, code) {
  word-break: break-all;
}

/* {% fact truncate=True %}: one line ending in an ellipsis; the full text stays in the DOM and in
   the shared tooltip. */
.vr-facts dd.vr-fact-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vr-facts dd small {
  display: block;
  margin-top: var(--vr-space-1);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-regular);
}

/* Record layout ({% record_layout %}): the lead panel with the aside beside it, then every other
   panel keeps stacking in the left column for as long as the aside runs beside it, and takes the
   full width once the aside has ended (owner rule, review 1). The lead and the aside float, and
   panels are their own formatting contexts (a .card is a flex container), so each sits beside the
   aside where it starts beside it and is full width where it starts below it: no gap is left
   beside a tall aside, and DOM order stays the reading order (lead, aside, the rest). The wide
   part (genuinely wide tables) always clears below the aside. Two columns only when the record
   is at least 60rem wide (a container query: the open help drawer narrows it); below that
   everything stacks in reading order. The aside never hides content silently: it grows with its
   content up to the viewport's height, then scrolls inside its own box with the scrollbar always
   shown and a fade while more lies below. */
.vr-record {
  display: flow-root;
  container: vr-record / inline-size;
}

.vr-record > *,
.vr-record-wide > * {
  margin-bottom: var(--vr-stack);
}

.vr-record-lead > .card,
.vr-record-aside-scroll > .card {
  margin-bottom: 0;
}

.vr-record-aside-scroll {
  display: flex;
  flex-direction: column;
  gap: var(--vr-stack);
}

@container vr-record (min-width: 60rem) {
  .vr-record-has-aside > .vr-record-lead {
    float: left;
    width: calc(100% - var(--vr-aside-width) - var(--vr-stack));
  }

  .vr-record-has-aside > .vr-record-aside {
    float: right;
    width: var(--vr-aside-width);
    margin-left: var(--vr-stack); /* the gutter, so panels beside it keep the lead's width */
  }

  /* A panel never squeezes into the gutter between the two floats: it starts under the lead. */
  .vr-record-has-aside > :not(.vr-record-lead, .vr-record-aside) {
    min-width: 20rem;
  }

  .vr-record-has-aside > .vr-record-wide {
    clear: both;
  }

  .vr-record-aside-scroll {
    max-height: calc(100dvh - var(--vr-topbar-height) - var(--vr-space-12));
    overflow-y: auto;
    border-radius: var(--vr-radius-xl);
  }

  /* The fade: sticky at the foot of the scroll region, so it shows over content still below and
     comes to rest over the panel's bottom padding at the end. */
  .vr-record-aside-scroll::after {
    content: "";
    position: sticky;
    bottom: 0;
    display: block;
    flex: none;
    height: var(--vr-space-6);
    margin-top: calc(-1 * var(--vr-space-6) - var(--vr-stack));
    border-radius: 0 0 var(--vr-radius-xl) var(--vr-radius-xl);
    background: linear-gradient(transparent, var(--vr-surface));
    pointer-events: none;
  }
}

/* The aside's scrollbar stays visible (not an overlay that appears only while scrolling). */
.vr-record-aside-scroll::-webkit-scrollbar-thumb {
  background-color: var(--vr-scrollbar-hover);
}

@supports not selector(::-webkit-scrollbar) {
  .vr-record-aside-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--vr-scrollbar-hover) transparent;
  }
}

.vr-record-aside-scroll:focus-visible {
  outline: var(--vr-focus-width) solid var(--vr-focus);
  outline-offset: var(--vr-focus-offset);
}

/* Two-factor setup: the QR code stays black on white in both themes so cameras read it. */
.vr-two-factor-key {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--vr-space-5);
  align-items: start;
}

@media (min-width: 48rem) {
  .vr-two-factor-key {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

.vr-qr-frame {
  justify-self: start;
  max-width: 100%;
  line-height: 0;
  padding: var(--vr-space-2);
  border-radius: var(--vr-radius-lg);
  background: var(--vr-surface-2);
}

.vr-qr-frame .vr-qr {
  display: block;
  width: 15rem;
  max-width: 100%;
  height: auto;
}

.vr-secret-key {
  overflow-wrap: anywhere;
  font-size: var(--vr-font-size-5);
}

.vr-recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--vr-space-2) var(--vr-space-6);
  padding-left: var(--vr-space-8);
}

.vr-recovery-codes code {
  font-size: var(--vr-font-size-5);
  overflow-wrap: anywhere;
}

/* Record foot line: the identifier, when this view was produced and by whom (printed with the
   page). */
.vr-record-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--vr-space-1) var(--vr-space-6);
  margin-top: var(--vr-space-6);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

.vr-record-foot :is(time, .vr-id) {
  font-size: inherit;
}

/* History and signatures: each entry is a well. A small icon circle, the body (title, changes,
   reason, who), and the time at the right in the data voice. */
.vr-timeline {
  display: grid;
  gap: var(--vr-space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.vr-timeline > li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: var(--vr-space-1) var(--vr-space-3);
  align-items: start;
  padding: var(--vr-space-3);
  border-radius: var(--vr-radius-lg);
  background: var(--vr-surface-2);
}

.vr-timeline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--vr-surface);
  color: var(--vr-text-muted);
}

.vr-timeline-icon > .vr-icon {
  width: 14px;
  height: 14px;
}

/* A signature: the icon circle in the signing petrol, the meaning in bold. */
.vr-timeline-icon.vr-sign-icon {
  background: var(--vr-sign);
  color: var(--vr-on-sign);
}

.vr-timeline-main {
  min-width: 0;
}

/* Items written without an icon or time (older partials) still read as one column. */
.vr-timeline > li > :only-child,
.vr-timeline > li > p,
.vr-timeline > li > .vr-timeline-head {
  grid-column: 1 / -1;
}

.vr-timeline-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-1) var(--vr-space-3);
  align-items: baseline;
}

/* An event name can be one long unbroken word (an audit action): it wraps inside the item
   instead of widening the page on a phone. */
/* Stored meanings ("reviewed") read as sentence case ("Reviewed"); the data is unchanged. */
.vr-timeline-title::first-letter,
.vr-timeline-title > strong::first-letter {
  text-transform: uppercase;
}

.vr-timeline-title > strong {
  display: inline-block;
}

.vr-timeline-title {
  min-width: 0;
  color: var(--vr-text-strong);
  font-weight: var(--vr-font-weight-semibold);
  overflow-wrap: anywhere;
}

.vr-timeline-meta {
  margin: var(--vr-space-0-5) 0 0;
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

.vr-timeline-time {
  margin: 0;
  white-space: nowrap;
}

.vr-timeline-body {
  margin: var(--vr-space-1) 0 0;
  font-size: var(--vr-font-size-4);
}

.vr-history-item p {
  margin-bottom: 0;
}

.vr-history-changes {
  margin-bottom: 0;
  padding-left: var(--vr-space-5);
}

/* Narrow screens: the time drops under the body. */
@media (max-width: 575.98px) {
  .vr-timeline > li {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .vr-timeline-time {
    grid-column: 2;
  }
}

/* The signing card: a solid petrol band carries the seal and the title, so a signature moment is
   unmistakable; the template's own sentences sit in a well under it. */
.vr-sign-card {
  overflow: hidden;
}

.vr-sign-band {
  display: flex;
  align-items: center;
  gap: var(--vr-space-3);
  padding: var(--vr-space-4) var(--vr-panel-inset);
  background: var(--vr-sign);
  color: var(--vr-on-sign);
}

.vr-sign-band :is(h1, h2, h3) {
  margin: 0;
  color: var(--vr-on-sign);
  font-size: var(--vr-font-size-8);
  font-weight: var(--vr-font-weight-heavy);
  font-stretch: var(--vr-font-stretch-title);
  line-height: var(--vr-line-height-tight);
}

.vr-sign-seal {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--vr-radius-lg);
  background: color-mix(in srgb, var(--vr-on-sign) 16%, transparent);
}

.vr-sign-seal > .vr-icon {
  width: 20px;
  height: 20px;
}

.vr-sign-summary {
  padding: var(--vr-space-4);
  border-radius: var(--vr-radius-xl);
  background: var(--vr-surface-2);
}

.vr-sign-summary > * {
  margin-top: 0;
  margin-bottom: 0;
}

/* The summary's parts (the facts, the Signer sentence, the PIN link) stack one gap apart. */
.vr-sign-summary > * + * {
  margin-top: var(--vr-stack);
}

.vr-sign-summary :is(.vr-id, .vr-data) {
  font-weight: var(--vr-font-weight-bold);
}

/* The signature dialog (signature-dialog.js moves the signing card into a native <dialog>): the
   dialog carries the surface, corners and shadow over the shared scrim, and scrolls inside the
   viewport when the card is taller than the screen (its shadow sits outside the box, so the
   scrolling never clips it). */
dialog:has(> [data-signature-dialog]) {
  overflow-y: auto;
  border-radius: var(--vr-radius-dialog);
  background: var(--vr-surface);
  box-shadow: var(--vr-shadow-dialog);
  color: var(--vr-text);
}

dialog::backdrop {
  background: var(--vr-backdrop);
}

/* Under every dialog the page dims and softens; without it where transparency is reduced. The
   scrim token carries its own alpha (Bootstrap sets these on .modal-backdrop itself, over :root). */
.modal-backdrop {
  --bs-backdrop-bg: var(--vr-backdrop);
  --bs-backdrop-opacity: 1;
}

.modal-backdrop,
dialog::backdrop {
  -webkit-backdrop-filter: blur(var(--vr-backdrop-blur));
  backdrop-filter: blur(var(--vr-backdrop-blur));
}

@media (prefers-reduced-transparency: reduce) {
  .modal-backdrop,
  dialog::backdrop {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

dialog > [data-signature-dialog].card {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/* The Signature PIN field: spaced figures, the lock icon inside at the right. */
.vr-sign-card input[type="password"] {
  letter-spacing: 0.3em;
}

/* A checklist (QC disposition blockers and prerequisites): one line each, icon first, text wraps. */
.vr-checklist {
  display: grid;
  gap: var(--vr-space-1-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.vr-checklist > li {
  min-width: 0;
}

.vr-checklist .vr-status {
  align-items: flex-start;
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-semibold);
  white-space: normal;
}

.vr-checklist .vr-status .vr-status-glyph {
  color: var(--vr-tone-text);
}

.vr-checklist .vr-status-glyph {
  margin-top: 0.2em;
}

/* Lab record-retention statement (core/record_retention.html): free text kept as entered. */
.vr-retention-statement > :last-child {
  margin-bottom: 0;
}

/* ================================================================ Emphasis kit

   What must not hide on a page (HIERARCHY.md "Emphasis kit"): what a material is, codes that are
   not the row's link, the one critical fact, structured values in words. */

/* Material tag: a kind-coloured icon tile, the name and an optional sub-line. */
.vr-mtag {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-1) var(--vr-space-2);
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.vr-mtag-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--vr-radius-tag);
  background: var(--vr-text-muted);
  color: var(--vr-on-kind);
}

.vr-mtag-icon > .vr-icon {
  width: 12px;
  height: 12px;
}

.vr-mtag[data-kind="raw"] .vr-mtag-icon {
  background: var(--vr-kind-raw);
}

.vr-mtag[data-kind="component"] .vr-mtag-icon {
  background: var(--vr-kind-component);
}

.vr-mtag[data-kind="packaging"] .vr-mtag-icon {
  background: var(--vr-kind-packaging);
}

.vr-mtag[data-kind="intermediate"] .vr-mtag-icon {
  background: var(--vr-kind-intermediate);
}

.vr-mtag[data-kind="finished"] .vr-mtag-icon {
  background: var(--vr-kind-finished);
}

.vr-mtag-name {
  min-width: 0;
  color: var(--vr-text-strong);
  font-weight: var(--vr-font-weight-bold);
}

.vr-mtag-sub {
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap; /* a code never breaks: when short of room it moves under the name */
}

.vr-mtag.is-lg .vr-mtag-icon {
  width: 24px;
  height: 24px;
}

.vr-mtag.is-lg .vr-mtag-icon > .vr-icon {
  width: 14px;
  height: 14px;
}

.vr-mtag.is-lg .vr-mtag-name {
  font-size: var(--vr-font-size-6);
}

.vr-mtag.is-sm .vr-mtag-icon {
  width: 18px;
  height: 18px;
}

/* In a table the tile stays on the name's first line and the name takes the column's room: one
   line while the column has it, two when it is narrow, and an ellipsis only after two lines (the
   shared tooltip shows the whole name; the full text stays in the page for assistive
   technology). The sub (a code) sits under the name. */
.vr-table .vr-mtag {
  display: inline-grid;
  grid-template-columns: auto minmax(0, max-content);
  align-items: start;
  min-width: 10rem;
}

.vr-table .vr-mtag-name {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.vr-table .vr-mtag-sub {
  grid-column: 2;
}

/* Code chip: a code or identifier that is not the row's link, in the data voice. */
.vr-code {
  display: inline-block;
  padding: 0 var(--vr-space-1-5);
  border-radius: var(--vr-radius-tag);
  background: var(--vr-surface-2);
  color: var(--vr-text-strong);
  font-family: var(--vr-font-data);
  font-size: var(--vr-font-size-3);
  font-variant-numeric: tabular-nums slashed-zero;
  font-weight: var(--vr-font-weight-semibold);
  line-height: var(--vr-line-height-snug);
  white-space: nowrap;
}

/* On a surface-2 well (history items, summaries, bulk bars) and on the page ground (the page
   header's key facts) the chip takes the panel surface, so it still reads as a chip. */
:is(.vr-timeline > li, .vr-sign-summary, .vr-bulkbar, .vr-container, .pagedocs-tips, .vr-page-header) .vr-code {
  background: var(--vr-surface);
}

.vr-code a {
  color: var(--vr-pen);
  text-decoration: none;
}

.vr-code a:hover {
  color: var(--vr-pen-hover);
  text-decoration: underline;
}

/* In a table a long code (a hash, a reference) keeps one line and ends in an ellipsis at 16
   characters; app.js gives a shortened one its full text as a tooltip. */
.vr-table .vr-code {
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

:is(.vr-sub, .vr-facts dd small) .vr-code {
  color: var(--vr-text-muted);
  font-weight: var(--vr-font-weight-medium);
}

/* Critical fact: the one fact that must not hide keeps the normal fact cell; its label takes the
   tone and its value is a filled status pill. */
.vr-facts > .vr-fact-critical[data-tone="neutral"] dt {
  color: var(--vr-neutral-text);
}

.vr-facts > .vr-fact-critical[data-tone="info"] dt {
  color: var(--vr-info-text);
}

.vr-facts > .vr-fact-critical[data-tone="progress"] dt {
  color: var(--vr-progress-text);
}

.vr-facts > .vr-fact-critical[data-tone="success"] dt {
  color: var(--vr-success-text);
}

.vr-facts > .vr-fact-critical[data-tone="warning"] dt {
  color: var(--vr-warning-text);
}

.vr-facts > .vr-fact-critical[data-tone="danger"] dt {
  color: var(--vr-danger-text);
}

.vr-facts > .vr-fact-critical[data-tone="hold"] dt {
  color: var(--vr-hold-text);
}

.vr-facts > .vr-fact-critical dd > .vr-status:not(.vr-status-plain) {
  padding: var(--vr-space-0-5) var(--vr-space-2-5) var(--vr-space-0-5) var(--vr-space-2);
  font-size: var(--vr-font-size-4);
  white-space: nowrap;
}

/* Structured values in words ({% value_list %}): label and value rows; a nested mapping is
   indented; the compact form for table cells is short "Label value" lines. Codes in a value wrap
   as chips. */
.vr-kv {
  display: grid;
  gap: var(--vr-space-2);
  margin: 0;
}

.vr-kv > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--vr-space-2);
  min-width: 0;
}

.vr-kv dt {
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-semibold);
}

.vr-kv dd {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-1);
  margin: 0;
  min-width: 0;
  color: var(--vr-text-strong);
  font-weight: var(--vr-font-weight-medium);
  overflow-wrap: break-word;
}

.vr-kv.is-nested {
  gap: var(--vr-space-1);
  padding-left: var(--vr-space-3);
}

.vr-kv.is-nested > div {
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: var(--vr-space-1);
}

.vr-kv.is-compact,
.vr-kv.is-compact > div {
  display: block;
}

.vr-kv.is-compact > div + div {
  margin-top: var(--vr-space-0-5);
}

.vr-kv.is-compact dt,
.vr-kv.is-compact dd {
  display: inline;
}

.vr-kv.is-compact dt::after {
  content: " ";
}

/* A list of chips in a fact value wraps with a small gap. */
.vr-facts dd .vr-chips,
.vr-facts dd:has(> .vr-code + .vr-code) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vr-space-1);
  padding: 0;
}

/* Text hierarchy: in a table only the row's identifier is bold; every other link is regular. */
.vr-table > tbody > tr > * a:not(.vr-id, .btn, .vr-code a) {
  font-weight: var(--vr-font-weight-regular);
}

/* A cell with a sub-line (supplier over its lot) may wrap its main text to a second line, so the
   table fits before anything is cut; the sub-line keeps one line. */
.vr-table > tbody > tr > td:has(> .vr-sub) {
  min-width: 8rem;
  white-space: normal;
}

/* A one-line value in a cell that ends in an ellipsis (the supplier name over its lot): it takes
   the column's width instead of setting it; its title carries the full text as a tooltip. */
.vr-table .vr-ellipsis {
  display: block;
  width: 0;
  min-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vr-table .vr-sub {
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vr-unit {
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

/* ================================================================ QC flow: routes

   Where a lot is, in six stages from lot to certificate ({% route %}, includes/route.html). The
   graphic is aria-hidden or carries the same words as text; the line is the accent, never a
   status. */

/* The lot record's route panel: six equal columns, each a bar over a label and a sub-line. */
.card > .vr-route {
  margin: var(--vr-space-5) var(--vr-panel-inset);
}

.vr-route {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--vr-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.vr-route-step {
  --vr-progress: 0%;
  --vr-route-fill: var(--vr-line);
  min-width: 0;
}

.vr-route-bar {
  display: block;
  height: 8px;
  margin-bottom: var(--vr-space-2);
  border-radius: var(--vr-radius-sm);
  background: var(--vr-line-pending);
}

.vr-route-step:first-child .vr-route-bar {
  border-top-left-radius: var(--vr-radius);
  border-bottom-left-radius: var(--vr-radius);
}

.vr-route-step:last-child .vr-route-bar {
  border-top-right-radius: var(--vr-radius);
  border-bottom-right-radius: var(--vr-radius);
}

.vr-route-step[data-state="done"] .vr-route-bar {
  background: var(--vr-line);
}

.vr-route-step:is([data-state="current"], [data-state="held"]) .vr-route-bar {
  background: linear-gradient(to right, var(--vr-route-fill) var(--vr-progress), var(--vr-line-pending) var(--vr-progress));
}

.vr-route-step[data-state="held"] {
  --vr-route-fill: var(--vr-hold-text);
}

.vr-route-step[data-state="rejected"] .vr-route-bar {
  background: var(--vr-danger-border);
}

.vr-route-step[data-progress="0"] {
  --vr-progress: 0%;
}

.vr-route-step[data-progress="10"] {
  --vr-progress: 10%;
}

.vr-route-step[data-progress="20"] {
  --vr-progress: 20%;
}

.vr-route-step[data-progress="30"] {
  --vr-progress: 30%;
}

.vr-route-step[data-progress="40"] {
  --vr-progress: 40%;
}

.vr-route-step[data-progress="50"] {
  --vr-progress: 50%;
}

.vr-route-step[data-progress="60"] {
  --vr-progress: 60%;
}

.vr-route-step[data-progress="70"] {
  --vr-progress: 70%;
}

.vr-route-step[data-progress="80"] {
  --vr-progress: 80%;
}

.vr-route-step[data-progress="90"] {
  --vr-progress: 90%;
}

.vr-route-step[data-progress="100"] {
  --vr-progress: 100%;
}

.vr-route-label {
  display: block;
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-2);
  font-weight: var(--vr-font-weight-heavy);
  letter-spacing: var(--vr-label-tracking);
  text-transform: var(--vr-label-case);
}

.vr-route-step[data-state="pending"] .vr-route-label {
  color: var(--vr-text-muted);
}

.vr-route-detail {
  display: block;
  margin-top: var(--vr-space-0-5);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

.vr-route-step[data-state="held"] .vr-route-detail {
  color: var(--vr-hold-text);
  font-weight: var(--vr-font-weight-bold);
}

@media (max-width: 767.98px) {
  .vr-route {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: var(--vr-space-3);
  }
}

/* Phones: two stages per row; a stage label never breaks inside a word. */
@media (max-width: 575.98px) {
  .vr-route {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vr-route-label {
    overflow-wrap: normal;
    word-break: keep-all;
    letter-spacing: 0.02em;
  }
}

/* The lots list's micro route: six small segments above one line of text. */
.vr-microroute-cell {
  display: flex;
  flex-direction: column;
  gap: var(--vr-space-1);
}

.vr-microroute {
  display: flex;
  align-items: center;
  gap: var(--vr-space-0-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.vr-microroute > li {
  width: 9px;
  height: 6px;
  border-radius: var(--vr-radius-xs);
  background: var(--vr-line-pending);
}

.vr-microroute > li[data-state="done"] {
  background: var(--vr-line);
}

.vr-microroute > li:is([data-state="current"], [data-state="held"]) {
  width: 14px;
  background: var(--vr-line);
  box-shadow: 0 0 0 var(--vr-border-width-lg) var(--vr-focus-halo);
}

.vr-microroute > li[data-state="held"] {
  background: var(--vr-hold-text);
}

.vr-microroute > li[data-state="rejected"] {
  background: var(--vr-danger-border);
}

.vr-microroute-text {
  font-size: var(--vr-font-size-3);
}

/* ================================================================ QC flow: dashboard

   The dashboard reads as the production floor's signage: a band of open work per stage, then one
   lane per stage in a fixed order from lot to certificate, with the flow line's arrows between
   them. Zero queues stay visible and muted: absence is information. */
.vr-flow-band {
  display: flex;
  flex-wrap: wrap; /* a segment that no longer fits its share starts a second row */
  gap: var(--vr-border-width-xl);
  margin: 0 0 var(--vr-space-4);
}

.vr-flow-segment {
  display: flex;
  flex: 1 1 0;
  align-items: baseline;
  gap: var(--vr-space-1-5);
  min-width: max-content; /* the count and label are never cut; the share of the width still varies */
  padding: var(--vr-space-2) var(--vr-space-2-5);
  border-radius: var(--vr-radius-sm);
  background: var(--vr-count);
  color: var(--vr-on-count);
  text-decoration: none;
}

.vr-flow-segment:first-child {
  border-top-left-radius: var(--vr-radius-lg);
  border-bottom-left-radius: var(--vr-radius-lg);
}

.vr-flow-segment:last-child {
  border-top-right-radius: var(--vr-radius-lg);
  border-bottom-right-radius: var(--vr-radius-lg);
}

.vr-flow-segment:hover {
  background: var(--vr-selection);
  color: var(--vr-on-count);
  text-decoration: none;
}

.vr-flow-segment[data-zero] {
  background: var(--vr-surface-2);
  color: var(--vr-text-muted);
}

.vr-flow-count {
  font-size: var(--vr-font-size-7);
  font-weight: var(--vr-font-weight-heavy);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.vr-flow-label {
  min-width: 0;
  overflow: hidden;
  font-size: var(--vr-font-size-2);
  font-weight: var(--vr-font-weight-bold);
  letter-spacing: var(--vr-label-tracking);
  text-overflow: ellipsis;
  text-transform: var(--vr-label-case);
  white-space: nowrap;
}

/* The lanes follow the width of the panel they sit in (a container query), never the window:
   one column in a narrow panel, three per row, then all six in one row with the flow line's
   arrow column between each once every lane has about 11.5rem. */
.vr-lanes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--vr-space-2);
  align-items: stretch;
}

.vr-lane-arrow {
  display: none;
}

@container vr-panel (min-width: 36rem) {
  .vr-lanes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container vr-panel (min-width: 74rem) {
  .vr-lanes {
    grid-template-columns: minmax(0, 1fr) repeat(5, 14px minmax(0, 1fr));
    gap: 0;
  }

  .vr-lane-arrow {
    display: flex;
  }
}

.vr-lane {
  min-width: 0;
  padding: var(--vr-space-2);
  border-radius: var(--vr-radius-lg);
  background: var(--vr-lane);
}

.vr-lane-head {
  display: flex;
  align-items: center;
  gap: var(--vr-space-2);
  padding: var(--vr-space-1) var(--vr-space-1) var(--vr-space-2);
}

.vr-lane-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--vr-radius-tag);
  background: var(--vr-ink);
  color: var(--vr-on-ink);
}

.vr-lane-icon > .vr-icon {
  width: 13px;
  height: 13px;
}

.vr-lane-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-2);
  font-weight: var(--vr-font-weight-heavy);
  letter-spacing: 0.06em;
  text-transform: var(--vr-label-case);
}

.vr-lane-arrow {
  align-items: flex-start;
  justify-content: center;
  padding-top: var(--vr-space-3-5);
  color: var(--vr-line);
}

.vr-lane-arrow > .vr-icon {
  width: 14px;
  height: 14px;
}

/* Queue rows: the label and a count badge, then the queue's status and how old its oldest item
   is. */
.vr-queues {
  display: flex;
  flex-direction: column;
  gap: var(--vr-space-0-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.vr-queue {
  border-radius: var(--vr-radius-lg);
}

.vr-queue:has(> .vr-queue-head > a:hover) {
  background: var(--vr-surface-hover);
}

.vr-queue-head {
  display: flex;
  align-items: flex-start;
  gap: var(--vr-space-2);
  padding: var(--vr-space-1-5);
}

.vr-queue-label {
  flex: 1;
  min-width: 0;
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-semibold);
  line-height: var(--vr-line-height-snug);
}

a.vr-queue-label:hover {
  color: var(--vr-text-strong);
}

.vr-queue[data-zero] .vr-queue-label {
  color: var(--vr-text-muted);
  font-weight: var(--vr-font-weight-regular);
}

.vr-queue-count {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: var(--vr-space-6);
  min-height: var(--vr-space-5);
  padding: 0 var(--vr-space-2);
  border-radius: var(--vr-radius-pill);
  background: var(--vr-count);
  color: var(--vr-on-count);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-bold);
  font-variant-numeric: tabular-nums;
}

.vr-queue-count[data-zero] {
  background: transparent;
  color: var(--vr-text-muted);
  font-weight: var(--vr-font-weight-regular);
}

.vr-queue-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-1) var(--vr-space-2);
  min-width: 0;
  padding: 0 var(--vr-space-1-5) var(--vr-space-1-5);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

/* A queue's status pill stays inside its narrow lane: its label wraps instead of poking out. */
.vr-queue-meta .vr-status {
  max-width: 100%;
  white-space: normal;
}

/* ================================================================ Entries and disclosures */

/* A heading inside a panel section (What's new: an impact group). */
.vr-section-title {
  margin: 0 0 var(--vr-space-3);
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-5);
  font-weight: var(--vr-font-weight-bold);
}

/* A list of entries, each a title, a line of facts, its text and an optional link (What's new). */
.vr-entries {
  margin: 0;
  padding: 0;
  list-style: none;
}

.vr-entries > li + li {
  margin-top: var(--vr-space-6);
}

.vr-entry-title {
  margin: 0 0 var(--vr-space-1);
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-5);
  font-weight: var(--vr-font-weight-semibold);
  line-height: var(--vr-line-height-snug);
}

.vr-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--vr-space-1) var(--vr-space-3);
  margin: 0 0 var(--vr-space-2);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
}

.vr-entry-meta .vr-kind-tag {
  margin-left: 0;
}

.vr-entry-body > :last-child,
.vr-disclosure-body > :last-child {
  margin-bottom: 0;
}

.vr-entry-link {
  margin: var(--vr-space-2) 0 0;
}

.vr-entry-link a {
  display: inline-flex;
  align-items: center;
  gap: var(--vr-space-1-5);
}

/* A quiet toggle for secondary detail: a chevron that turns when open, the detail in a well. */
.vr-disclosure {
  margin-top: var(--vr-space-2);
}

.vr-disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--vr-space-1-5);
  margin-left: calc(-1 * var(--vr-space-2));
  padding: var(--vr-space-1) var(--vr-space-2);
  border-radius: var(--vr-radius);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-4);
  font-weight: var(--vr-font-weight-medium);
  list-style: none;
  cursor: pointer;
}

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

.vr-disclosure > summary:hover {
  background: var(--vr-surface-hover);
  color: var(--vr-text);
}

.vr-disclosure > summary:focus-visible {
  outline: var(--vr-focus-width) solid var(--vr-focus);
  outline-offset: var(--vr-focus-offset);
}

.vr-disclosure-chevron {
  transition: transform var(--vr-motion-fast) var(--vr-ease);
}

.vr-disclosure[open] > summary .vr-disclosure-chevron {
  transform: rotate(90deg);
}

@media (prefers-reduced-motion: reduce) {
  .vr-disclosure-chevron {
    transition: none;
  }
}

.vr-disclosure-body {
  margin-top: var(--vr-space-2);
  padding: var(--vr-space-3) var(--vr-space-4);
  border-radius: var(--vr-radius-lg);
  background: var(--vr-surface-2);
  font-size: var(--vr-font-size-4);
  overflow-wrap: anywhere;
}

@media print {
  .vr-disclosure-body {
    padding: 0;
    background: none;
  }
}

/* ================================================================ Entrance pages */

/* Sign-in: the form on a panel over the shell's ground, beside the illustration. */
.vr-entrance {
  position: relative;
  display: grid;
  min-height: 100vh;
  background: var(--vr-topbar-bg);
}

.vr-entrance-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--vr-space-8) var(--vr-space-4);
}

.vr-entrance-theme {
  position: absolute;
  top: var(--vr-space-3);
  right: var(--vr-space-3);
}

.vr-entrance-brand,
.vr-entrance-brand:hover {
  display: flex;
  align-items: center;
  gap: var(--vr-space-3);
  margin-bottom: var(--vr-space-5);
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-6);
  font-weight: var(--vr-font-weight-bold);
  text-decoration: none;
}

.vr-entrance-brand img {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.vr-entrance-panel {
  position: relative;
  width: 100%;
  max-width: 28rem;
  padding: var(--vr-space-8);
  border-radius: var(--vr-radius-dialog);
  background-color: var(--vr-surface);
  box-shadow: var(--vr-shadow-raised);
}

@media (max-width: 575.98px) {
  .vr-entrance-panel {
    padding: var(--vr-space-6) var(--vr-space-5);
  }
}

.vr-entrance-panel h1 {
  font-size: var(--vr-font-size-9);
  font-weight: var(--vr-font-weight-heavy);
  font-stretch: var(--vr-font-stretch-title);
  letter-spacing: -0.005em;
  margin-bottom: var(--vr-space-1-5) !important;
}

.vr-entrance-lead {
  margin-bottom: var(--vr-space-5);
  color: var(--vr-text-muted);
}

.vr-entrance-panel .vr-form-actions {
  justify-content: stretch;
}

/* Sign-in announcement (accounts/includes/announcement.html): the administrator's notice on the
   sign-in sheet and its preview on the Sign-in announcement page. Its text is rendered from the
   page-documentation subset, so tables, lists and code need their own compact rules here: the
   documentation panel's stylesheet is not loaded before sign-in. */
.vr-announcement {
  margin-bottom: var(--vr-space-5);
  padding: var(--vr-space-3) var(--vr-space-4);
  border-radius: var(--vr-radius-xl);
  background: var(--vr-info-bg);
  color: var(--vr-text);
  font-size: var(--vr-font-size-3);
  line-height: var(--vr-line-height-base);
  overflow-wrap: break-word;
}

.vr-announcement-title {
  margin: 0 0 var(--vr-space-1-5);
  color: var(--vr-text-strong);
  font-size: var(--vr-font-size-5);
  font-weight: var(--vr-font-weight-bold);
}

.vr-announcement-body :is(h3, h4, h5, h6) {
  margin: var(--vr-space-3) 0 var(--vr-space-1);
  font-size: var(--vr-font-size-3);
  font-weight: var(--vr-font-weight-bold);
}

.vr-announcement-body :is(p, ul, ol, pre, .table-responsive, .pagedocs-note) {
  margin: 0 0 var(--vr-space-2);
}

.vr-announcement-body > :last-child {
  margin-bottom: 0;
}

.vr-announcement-body .table {
  --bs-table-bg: transparent;
  margin: 0;
  font-size: inherit;
}

.vr-announcement-body th {
  color: var(--vr-text-muted);
  font-weight: var(--vr-font-weight-semibold);
}

.vr-announcement-body code {
  color: inherit;
}

.vr-announcement-body pre {
  padding: var(--vr-space-1-5) var(--vr-space-2);
  border-radius: var(--vr-radius);
  background: var(--vr-surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.vr-announcement-preview {
  max-width: 28rem;
  margin-top: var(--vr-space-4);
}

.vr-announcement-preview > .vr-announcement {
  margin-bottom: 0;
}

.vr-announcement-evidence {
  margin: var(--vr-space-2) 0 0;
}

.vr-announcement-evidence dd {
  margin: 0 0 var(--vr-space-2);
}

.vr-announcement-evidence pre {
  margin: var(--vr-space-1) 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* "or" divider between password sign-in and the alternative methods */
.vr-entrance-or {
  display: flex;
  align-items: center;
  gap: var(--vr-space-3);
  margin: var(--vr-space-5) 0;
  color: var(--vr-text-muted);
}

.vr-entrance-or::before,
.vr-entrance-or::after {
  content: "";
  flex: 1;
  height: var(--vr-border-width);
  background: var(--vr-surface-2);
}

.vr-entrance-panel .btn .vr-icon {
  margin-right: var(--vr-space-1);
  vertical-align: -0.125em;
}

.vr-entrance-alt {
  margin: var(--vr-space-4) 0 0;
  font-size: var(--vr-font-size-3);
  text-align: center;
}

.vr-entrance-alt .vr-icon {
  margin-right: var(--vr-space-1);
  vertical-align: -0.125em;
}

.vr-entrance-foot {
  margin-top: var(--vr-space-4);
  color: var(--vr-text-muted);
  font-size: var(--vr-font-size-3);
  text-align: center;
}

/* ================================================================ Print

   Always the light print palette, whatever the screen mode: no shell, no shadows, panels flat on
   white, a light rule between table rows, pills as text and icon. */

@media print {
  body,
  .vr-app,
  .vr-main,
  .vr-app-footer {
    background: var(--vr-paper) !important; /* print only: the shell's ground is not printed */
  }

  .vr-topbar,
  .vr-sidenav,
  .vr-page-actions,
  .vr-grid-toolbar,
  .vr-chips,
  .vr-bulkbar,
  .vr-pagination,
  .vr-section-tabs,
  .vr-page-toc,
  .vr-skip,
  .vr-main .btn,
  .dt-layout-row:last-child {
    display: none !important; /* print only: beats Bootstrap's display utilities */
  }

  .vr-shell {
    display: block;
  }

  .vr-main {
    padding: 0;
    border-radius: 0;
  }

  .card {
    break-inside: avoid-page;
  }

  .vr-table > tbody > tr > * {
    box-shadow: inset 0 calc(-1 * var(--vr-border-width)) 0 var(--vr-print-rule);
  }
}
