/* =====================================================================
   OPIM admin: the design of Tameo.IO V3 Admin.Web on Django Unfold
   (.impeccable.md). Tokens are those of V3 wwwroot/css/src/tokens.css;
   the Unfold base and primary scales are set from them in core/settings.py
   (UNFOLD['COLORS']). This sheet styles what the scales cannot:
   - the dark teal top bar (sidebar branding + page header);
   - the teal-tinted sidebar with mono section titles;
   - General Sans, Fragment Mono for micro labels, tabular figures;
   - flat cards, dense tables, status dots, buttons, inputs;
   - the Overview (templates/admin/index.html, classes .ov-*).
   Unfold loads this sheet before its own: rules that must win use
   `html` in front of the selector for specificity, never !important
   unless Unfold sets the property with !important itself.
   ===================================================================== */

@font-face { font-family: 'General Sans'; src: url("../fonts/general-sans-400.82dccf33188f.woff2") format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url("../fonts/general-sans-500.5b10ff4d624f.woff2") format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url("../fonts/general-sans-600.f74baa005bd5.woff2") format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url("../fonts/general-sans-700.2bdfea05fe02.woff2") format('woff2'); font-weight: 700; font-display: swap; }

:root {
    --surface-0: oklch(98.8% 0.004 200);
    --surface-1: oklch(100% 0 0);
    --surface-2: oklch(97.2% 0.006 200);
    --surface-3: oklch(94.5% 0.009 200);
    --line-soft: oklch(94% 0.007 200);
    --line: oklch(89% 0.010 200);
    --line-strong: oklch(82% 0.013 200);
    --ink-1: oklch(20% 0.014 200);
    --ink-2: oklch(42% 0.012 200);
    --ink-3: oklch(58% 0.010 200);
    --ink-4: oklch(72% 0.008 200);
    --primary-900: oklch(27% 0.020 200);
    --primary-700: oklch(38% 0.028 200);
    --primary-100: oklch(92% 0.014 200);
    --accent-700: oklch(42% 0.115 145);
    --accent-600: oklch(53% 0.150 145);
    --accent-500: oklch(63.5% 0.165 145);
    --accent-50: oklch(97.5% 0.020 145);
    --dot-active: var(--accent-500);
    --dot-pending: oklch(76% 0.130 75);
    --dot-danger: oklch(58% 0.175 25);
    --dot-neutral: var(--ink-4);
    --dot-info: oklch(65% 0.110 230);
    --focus-ring: oklch(63.5% 0.110 200);
    --topbar-bg: var(--primary-900);
    --topbar-fg: oklch(96% 0.006 200);
    --topbar-fg-dim: oklch(89% 0.010 200);
    --topbar-line: oklch(36% 0.018 200);
    --topbar-hover: oklch(34% 0.022 200);
    --sidebar-bg: oklch(31% 0.022 200);
    --bottom-band: 48px;
    --sidebar-hover: oklch(35% 0.024 200);
    --sidebar-active: oklch(42% 0.030 200);
    --sidebar-icon: oklch(74% 0.016 200);
    --sidebar-heading: oklch(78% 0.110 145);
    --radius-sm: 4px;
    --radius-md: 6px;
    --fs-display: 1.375rem;
    --fs-base: 0.875rem;
    --fs-sm: 0.8125rem;
    --fs-xs: 0.75rem;
    --fs-2xs: 0.6875rem;
    --font-ui: 'General Sans', ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'Fragment Mono', ui-monospace, monospace;
    --dur-fast: 120ms;
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

@media (prefers-reduced-motion: reduce) {
    :root { --dur-fast: 0ms; }
}

/* Type ------------------------------------------------------------------ */

html:root {
    --font-sans: var(--font-ui);
}

html body {
    font-family: var(--font-ui);
    font-feature-settings: 'ss01', 'cv11', 'tnum';
    color: var(--ink-1);
    background: var(--surface-0);
}

/* Top bar: the sidebar branding and the page header form one dark band --- */

html #nav-sidebar-inner > div:first-child {
    height: 56px;
    margin-bottom: 0;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-line);
    color: var(--topbar-fg);
}

/* 56px in all, border included, as the page header next to it: one straight top band */
html #nav-sidebar-inner > div:first-child > div {
    height: 55px;
}

html #nav-sidebar-inner > div:first-child img {
    height: 28px;
}

html #nav-sidebar-inner > div:first-child #site-name,
html #nav-sidebar-inner > div:first-child #site-name a {
    color: var(--topbar-fg);
    font-weight: 600;
    letter-spacing: 0.01em;
}

html #nav-sidebar-inner > div:first-child .text-subtle,
html #nav-sidebar-inner > div:first-child .material-symbols-outlined {
    color: var(--topbar-fg-dim);
}

/* Sticky, as the menu next to it (fixed by Unfold): the top band stays when the page scrolls */
html #main > div:first-child {
    position: sticky;
    top: 0;
    margin-bottom: 24px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-line);
    color: var(--topbar-fg-dim);
}

html #main > div:first-child > div {
    height: 55px;
}

html #main > div:first-child h1,
html #main > div:first-child h1 a {
    color: var(--topbar-fg);
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: 0.01em;
}

html #main > div:first-child h1 a:hover {
    text-decoration: underline;
    text-decoration-color: var(--topbar-line);
    text-underline-offset: 4px;
}

/* The breadcrumb and the counter of Unfold: the page header below says both, with a link back */
html #main > div:first-child h1 {
    display: none;
}

html #main > div:first-child .material-symbols-outlined,
html #main > div:first-child .bg-base-200 {
    color: var(--topbar-fg-dim);
}

/* The separator before the breadcrumb goes with it */
html #main > div:first-child span.bg-base-200 {
    display: none;
}

/* Actions shown in the bar (History, Export, Validate...): ghost buttons on dark */
html #main > div:first-child ul > li > a {
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--topbar-fg-dim);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: background var(--dur-fast) var(--ease-out-quart), color var(--dur-fast) var(--ease-out-quart);
}

html #main > div:first-child ul > li > a:hover {
    background: var(--topbar-hover);
    color: var(--topbar-fg);
}

html #main > div:first-child ul {
    background: transparent;
    border: 0;
    gap: 4px;
}

/* Unfold draws the actions as one segmented group (rounded at its ends only): here each action is its own
   button, the primary one (Add disclosure...) in the impact green of V3 */
html #main > div:first-child ul > li {
    margin: 0;
    border: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

html #main > div:first-child ul > li.bg-primary-600 {
    background: var(--accent-600);
}

html #main > div:first-child ul > li.bg-primary-600 > a {
    color: oklch(99% 0.01 145);
}

html #main > div:first-child ul > li.bg-primary-600:hover > a,
html #main > div:first-child ul > li.bg-primary-600 > a:hover {
    background: var(--accent-700);
    color: oklch(99% 0.01 145);
}

/* Sidebar: one dark teal frame with the top bar, as the legacy OPIM screens --- */

html #nav-sidebar,
html #nav-sidebar > div,
html #nav-sidebar-inner {
    background: var(--sidebar-bg);
    border-color: var(--topbar-line);
    color: var(--topbar-fg-dim);
}

/* No line between the menu and the page: it would cut the top band in two */
html #nav-sidebar {
    border-right-width: 0;
}

/* The search sits below the band, aligned with the menu items */
html #nav-sidebar-inner > div:first-child + * {
    margin-top: 12px;
}

/* Section titles: small, calm, the impact green of the legacy "Evaluations" heading */
html #nav-sidebar-inner h2,
html #nav-sidebar-inner .text-font-important-light.font-semibold {
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-heading);
}

html #nav-sidebar-inner h2 .material-symbols-outlined {
    color: var(--topbar-fg-dim);
}

html #nav-sidebar-inner ol a {
    height: 36px;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--topbar-fg-dim);
    border-radius: var(--radius-md);
    transition: background var(--dur-fast) var(--ease-out-quart), color var(--dur-fast) var(--ease-out-quart);
}

html #nav-sidebar-inner ol a .material-symbols-outlined {
    font-size: 18px;
    color: var(--sidebar-icon);
}

html #nav-sidebar-inner ol a:hover {
    background: var(--sidebar-hover);
    color: var(--topbar-fg);
}

/* Selected item: a lighter teal pill, white text (no side stripe) */
html #nav-sidebar-inner ol a.active {
    background: var(--sidebar-active);
    color: oklch(98% 0.004 200);
    font-weight: 600;
}

html #nav-sidebar-inner ol a.active .material-symbols-outlined {
    color: oklch(98% 0.004 200);
}

/* Search of the sidebar on the dark frame */
html #nav-sidebar-inner input[type="search"],
html #nav-sidebar-inner input[type="text"] {
    font-size: var(--fs-sm);
    color: var(--topbar-fg);
}

html #nav-sidebar-inner form > div,
html #nav-sidebar-inner .bg-white {
    background: var(--sidebar-hover);
    border-color: var(--topbar-line);
    box-shadow: none;
}

html #nav-sidebar-inner input::placeholder {
    color: var(--sidebar-icon);
}

html #nav-sidebar-inner kbd {
    background: transparent;
    border-color: var(--topbar-line);
    color: var(--sidebar-icon);
}

/* The user block at the bottom: the height and the colour of the pagination bar next to it,
   so that the bottom of the screen is one dark band, as the top */
html #nav-sidebar-inner > div:last-child {
    padding-block: 0;
    background: var(--topbar-bg);
    border-color: var(--topbar-line);
}

html #nav-sidebar-inner > div:last-child,
html #nav-sidebar-inner > div:last-child * {
    color: var(--topbar-fg-dim);
}

html #nav-sidebar-inner > div:last-child > div.cursor-pointer {
    min-height: var(--bottom-band);
    height: var(--bottom-band);
    margin-block: 0;
    padding-block: 0;
    background: transparent;
}

html #nav-sidebar-inner > div:last-child > div.cursor-pointer:hover,
html #nav-sidebar-inner > div:last-child > div.cursor-pointer.bg-base-100 {
    background: var(--topbar-hover);
}

/* The avatar */
html #nav-sidebar-inner > div:last-child [class*="h-[38px]"] {
    height: 28px;
    width: 28px;
    min-width: 28px;
    background: var(--sidebar-active);
    color: var(--topbar-fg);
    font-size: var(--fs-xs);
}

/* Cards and surfaces: flat, one line, no shadow ------------------------ */

html #content .shadow-xs,
html #content .shadow-sm {
    box-shadow: none;
}

html #content .rounded-default {
    border-radius: var(--radius-md);
}

html #content .border-base-200 {
    border-color: var(--line);
}

/* Tables: small-caps sans headers, 40px rows, soft lines, no stripes, tabular figures */

html #result_list,
html #content table {
    font-size: var(--fs-base);
    font-variant-numeric: tabular-nums;
}

html #result_list thead th,
html #content table thead th {
    background: var(--surface-2);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-2);
    border-bottom: 1px solid var(--line);
}

/* Unfold stripes every other row: V3 and the legacy app do not */
html #result_list tbody.bg-base-50 {
    background: transparent;
}

html #result_list thead th a {
    color: var(--ink-2);
}

@media (min-width: 1024px) {
    html #result_list tbody td,
    html #result_list tbody th {
        padding-block: 8px;
        height: 40px;
        border-top-color: var(--line-soft);
    }
}

html #result_list tbody tr {
    transition: background var(--dur-fast) var(--ease-out-quart);
}

html #result_list tbody tr:hover {
    background: var(--surface-2);
}

html #result_list tbody th a,
html #content a.text-primary-600 {
    color: var(--ink-1);
    font-weight: 500;
}

html #result_list tbody th a:hover {
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}

/* Status labels of Unfold (@display(label=...)): plain text, as the legacy lists (no pill, no dot) */

html span[class*="text-[11px]"][class*="uppercase"] {
    display: inline;
    height: auto;
    padding: 0;
    background: transparent;
    font-size: var(--fs-sm);
    font-weight: 400;
    line-height: 1.45;
    text-transform: capitalize;
    color: var(--ink-1);
}

/* The environment badge of the top bar stays a quiet chip */
html #main > div:first-child span[class*="text-[11px]"][class*="uppercase"] {
    padding: 2px 8px;
    border: 1px solid var(--topbar-line);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dot-pending);
}

/* Buttons: the primary action is the impact green (V3 .btn-primary) ---- */

html button.bg-primary-600,
html a.bg-primary-600,
html input.bg-primary-600 {
    min-height: 36px;
    background: var(--accent-600);
    border-color: transparent;
    color: oklch(99% 0.01 145);
    font-weight: 500;
    border-radius: var(--radius-md);
}

html button.bg-primary-600:hover,
html a.bg-primary-600:hover,
html input.bg-primary-600:hover {
    background: var(--accent-700);
}

html button:focus-visible,
html a:focus-visible,
html input:focus-visible,
html select:focus-visible,
html textarea:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Forms: 4px radius, teal focus with a soft 3px ring --------------------- */

html #content input[type="text"],
html #content input[type="number"],
html #content input[type="email"],
html #content input[type="url"],
html #content input[type="date"],
html #content input[type="search"],
html #content select,
html #content textarea {
    border-color: var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-1);
    box-shadow: none;
}

html #content input[type="text"]:hover,
html #content select:hover,
html #content textarea:hover {
    border-color: var(--line-strong);
}

html #content input[type="text"]:focus,
html #content input[type="number"]:focus,
html #content input[type="url"]:focus,
html #content select:focus,
html #content textarea:focus {
    border-color: var(--primary-700);
    box-shadow: 0 0 0 3px oklch(from var(--primary-700) l c h / 0.08);
    outline: none;
}

html #content label {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-2);
}

/* Fieldset titles: V3 section titles, mono micro labels */
html #content fieldset > h2 {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    border-top-style: solid;
    border-color: var(--line-soft);
}

/* Overview (templates/admin/index.html) ---------------------------------- */

.ov {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 1440px;
}

.ov-micro {
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
}

/* The three legacy KPIs: one band, the figures are the heroes */
.ov-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.ov-kpi {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 24px;
    text-align: center;
}

.ov-kpi + .ov-kpi {
    border-inline-start: 1px solid var(--line-soft);
}

.ov-kpi__value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink-1);
    font-variant-numeric: tabular-nums;
}

.ov-kpi__unit {
    margin-inline-start: 4px;
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: 400;
    letter-spacing: 0;
    color: var(--ink-3);
}

.ov-kpi__label {
    font-size: var(--fs-sm);
    color: var(--ink-2);
}

.ov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.ov-card {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.ov-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.ov-card__title {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--ink-1);
}

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

.ov-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    min-height: 40px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--line-soft);
}

.ov-list li:last-child {
    border-bottom: 0;
}

.ov-list a {
    color: var(--ink-1);
    font-weight: 500;
}

.ov-list a:hover {
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}

.ov-meta {
    font-size: var(--fs-sm);
    color: var(--ink-3);
    white-space: nowrap;
}

/* What waits: rows of counts, the count right-aligned */
.ov-todo a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    font-weight: 400;
}

.ov-todo__count {
    font-size: var(--fs-lg, 1rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink-1);
}

.ov-todo__count[data-zero] {
    color: var(--ink-4);
    font-weight: 400;
}

.ov-status {
    font-size: var(--fs-sm);
    color: var(--ink-3);
}

/* Figures align right in the lists (V3 .cell-right): one class per numeric column */
html #result_list td.field-covered_assets,
html #result_list td.field-page_count,
html #result_list td.field-practice_count,
html #result_list td.field-key_practice_count,
html #result_list td.field-score_count,
html #result_list td.field-manual_count,
html #result_list td.field-weight_count,
html #result_list td.field-evaluation_count,
html #result_list td.field-verification_count,
html #result_list td.field-length,
html #result_list td.field-ai_score,
html #result_list td.field-manual_score,
html #result_list td.field-tokens_in,
html #result_list td.field-tokens_out,
html #result_list td.field-cost_usd,
html #result_list td.field-latency_ms,
html #result_list th.column-covered_assets,
html #result_list th.column-page_count,
html #result_list th.column-practice_count,
html #result_list th.column-key_practice_count,
html #result_list th.column-score_count,
html #result_list th.column-manual_count,
html #result_list th.column-weight_count,
html #result_list th.column-evaluation_count,
html #result_list th.column-verification_count,
html #result_list th.column-length,
html #result_list th.column-ai_score,
html #result_list th.column-manual_score,
html #result_list th.column-tokens_in,
html #result_list th.column-tokens_out,
html #result_list th.column-cost_usd,
html #result_list th.column-latency_ms {
    text-align: right;
    justify-content: flex-end;
}

/* Delete: a quiet danger button (V3 has no loud red button, destructive actions stay discreet) */
html a.bg-red-600,
html button.bg-red-600 {
    min-height: 36px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--dot-danger);
    font-weight: 500;
    border-radius: var(--radius-md);
}

html a.bg-red-600:hover,
html button.bg-red-600:hover {
    background: oklch(from var(--dot-danger) l c h / 0.08);
    border-color: oklch(from var(--dot-danger) l c h / 0.4);
}

/* "Filters" is not the primary action: with filters on it shows pressed, as V3's filter chips */
html a.bg-primary-600[x-on\:click="filterOpen = true"] {
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    color: var(--ink-1);
}

html a.bg-primary-600[x-on\:click="filterOpen = true"]:hover {
    background: var(--surface-2);
}

/* Page header (templates/admin/opim/page_header.html): eyebrow, title with count, description,
   then the quick filters of the list as segmented toggles with counts (legacy screens, V3 chips) */

.ph {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.ph-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ph-eyebrow {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent-700);
}

a.ph-eyebrow:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ph-title {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--ink-1);
}

.ph-count {
    margin-inline-start: 6px;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.ph-description {
    max-width: 75ch;
    font-size: var(--fs-base);
    color: var(--ink-2);
}

.ph-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ph-segment {
    display: inline-flex;
    overflow: hidden;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.ph-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease-out-quart), color var(--dur-fast) var(--ease-out-quart);
}

.ph-chip + .ph-chip {
    border-inline-start: 1px solid var(--line);
}

.ph-chip:hover {
    background: var(--surface-2);
    color: var(--ink-1);
}

.ph-chip[aria-current="true"] {
    background: var(--primary-900);
    color: oklch(98% 0.004 200);
}

.ph-chip__count {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.ph-chip[aria-current="true"] .ph-chip__count {
    color: var(--topbar-fg-dim);
}

/* Yes / no columns (@display(boolean=True)): a quiet tick, a red cross, no green disc on every row */
html #result_list div[title="True"][class*="bg-green-100"] {
    background: transparent;
    color: var(--ink-3);
}

html #result_list div[title="False"][class*="bg-red-100"] {
    background: oklch(from var(--dot-danger) l c h / 0.10);
    color: var(--dot-danger);
}

/* Dates and short codes stay on one line */
html #result_list td[class*="field-"][class*="date"],
html #result_list td.field-last_disclosure,
html #result_list td.field-last_verification,
html #result_list td.field-planned_verification,
html #result_list td.field-published_at,
html #result_list td.field-value_date,
html #result_list td.field-action_time {
    white-space: nowrap;
}

/* The year links of the date drill-down: quiet text links */
html #content-main a[href*="__year="] {
    font-size: var(--fs-sm);
    color: var(--ink-2);
}

html #content-main a[href*="__year="]:hover {
    color: var(--ink-1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* The page header comes before the tabs of a form (General, Documents...), which Unfold renders first */
html #content:has(> .ph) {
    display: flex;
    flex-direction: column;
}

html #content > .ph {
    order: -1;
}

/* Full width: Unfold centres the page in a max-width container, so folding the menu
   left a blank band instead of giving the room to the tables */
html #main .container {
    max-width: none;
}

/* Icon rail: folding the menu (the dock button of the top bar) keeps a 64px column of icons,
   the labels become tooltips (static/opim/js/sidebar.js). Unfold folds by adding xl:hidden!
   to the wrapper of #nav-sidebar; above 1280px we keep it, narrowed. */
/* Unfold hides with an !important utility inside a Tailwind cascade layer, and a layered !important
   beats an unlayered one: this layer is declared before Unfold's (this sheet loads first), and for
   !important declarations the earliest layer wins. */
@layer opim-rail {
    @media (min-width: 1280px) {
        html div[class~="xl:hidden!"]:has(#nav-sidebar) {
            display: block !important;
        }
    }
}

@media (min-width: 1280px) {
    html div[class~="xl:hidden!"]:has(#nav-sidebar) {
        width: 64px;
    }

    html div[class~="xl:hidden!"] #nav-sidebar {
        width: 64px;
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner > div:first-child {
        padding-inline: 0;
        justify-content: center;
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner > div:first-child > div {
        justify-content: center;
        padding-inline: 0;
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner > div:first-child > div > div:not(.shrink-0),
    html div[class~="xl:hidden!"] #nav-sidebar-inner > div:first-child + * {
        display: none;
    }

    /* Group titles become thin separators; every group stays open */
    html div[class~="xl:hidden!"] #nav-sidebar-inner h2 {
        height: 0;
        margin: 8px 14px;
        padding: 0;
        overflow: hidden;
        border-top: 1px solid var(--topbar-line);
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner ol {
        display: flex !important;
        padding-inline: 10px;
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner ol a {
        justify-content: center;
        margin-inline: 0;
        padding-inline: 0;
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner ol a > span:not(.material-symbols-outlined) {
        display: none;
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner ol a .material-symbols-outlined {
        margin-right: 0;
    }

    /* The user block keeps its avatar */
    html div[class~="xl:hidden!"] #nav-sidebar-inner > div:last-child > div {
        justify-content: center;
        padding-inline: 0;
        margin-inline: 0;
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner > div:last-child > div > :not(:first-child) {
        display: none;
    }

    html div[class~="xl:hidden!"] #nav-sidebar-inner > div:last-child {
        padding-inline: 0;
    }
}

/* The keyboard-shortcut hints of Unfold's search fields ("/" and "t") read as stray characters */
html #changelist-search kbd,
html #nav-sidebar-inner kbd {
    display: none;
}

/* Sign-in (templates/admin/login.html): the auth shell of V3 Admin.Web (auth.css),
   a brand-led teal gradient with one quiet card */

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 32px 16px 48px;
    background: radial-gradient(120% 80% at 50% 0%, oklch(38% 0.030 200) 0%, oklch(27% 0.020 200) 60%, oklch(22% 0.015 200) 100%);
    background-attachment: fixed;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 24px 48px -16px oklch(0% 0 0 / 0.40), 0 4px 12px -4px oklch(0% 0 0 / 0.18);
}

.auth-card__brand {
    align-self: center;
}

.auth-card__brand img {
    display: block;
    height: 28px;
    width: auto;
}

.auth-card__eyebrow {
    margin-bottom: -10px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--ink-3);
}

.auth-card__title {
    margin: 0 0 4px;
    font-size: var(--fs-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--ink-1);
}

.auth-card__form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-card__form input[type="text"],
.auth-card__form input[type="password"] {
    height: 40px;
    background: var(--surface-2);
    border-color: var(--line);
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.auth-card__form input:focus {
    border-color: var(--primary-700);
    box-shadow: 0 0 0 3px oklch(from var(--primary-700) l c h / 0.08);
    outline: none;
}

.auth-card__form label {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-2);
}

.auth-submit,
.auth-sso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 40px;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out-quart), border-color var(--dur-fast) var(--ease-out-quart);
}

/* The primary action: Microsoft when it is configured, else the local log in */
.auth-sso,
.auth-card:not(:has(.auth-sso)) .auth-submit {
    background: var(--accent-600);
    border: 1px solid transparent;
    color: oklch(99% 0.01 145);
}

.auth-sso:hover,
.auth-card:not(:has(.auth-sso)) .auth-submit:hover {
    background: var(--accent-700);
}

/* With Microsoft on top, the password form is the secondary path */
.auth-card:has(.auth-sso) .auth-submit {
    background: var(--surface-1);
    border: 1px solid var(--line);
    color: var(--ink-1);
}

.auth-card:has(.auth-sso) .auth-submit:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
}

.auth-submit {
    margin-top: 12px;
}

/* The folded break-glass form of production: a quiet link under the Microsoft button */
.auth-breakglass {
    margin-top: 1.25rem;
    text-align: center;
}

.auth-breakglass > summary {
    display: inline-block;
    cursor: pointer;
    font-size: var(--fs-xs);
    color: var(--ink-3);
    list-style: none;
}

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

.auth-breakglass > summary:hover,
.auth-breakglass > summary:focus-visible {
    color: var(--ink-1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-breakglass__note {
    margin: 0.75rem 0;
    font-size: var(--fs-xs);
    color: var(--ink-3);
}

.auth-breakglass .auth-card__form {
    text-align: left;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 0;
    font-size: var(--fs-xs);
    color: var(--ink-3);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

.auth-footer {
    font-size: var(--fs-xs);
    color: oklch(78% 0.012 200);
}

/* Documents lists (DocumentAdmin): the PDF icon, the site of the original URL, deleted rows */
.doc-pdf {
    display: inline-flex;
    color: var(--ink-2);
}

.doc-pdf:hover {
    color: var(--primary-700);
}

.doc-pdf .material-symbols-outlined {
    font-size: 20px;
}

.doc-missing {
    font-size: var(--fs-xs);
    color: var(--dot-danger);
}

html #content a.doc-source {
    max-width: 11rem;
    color: var(--ink-2);
    font-weight: 400;
}

html #content a.doc-source:hover {
    color: var(--ink-1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* As the legacy list: a deleted document is struck through */
.doc-deleted {
    color: var(--ink-3);
    text-decoration: line-through;
}

/* Verifications, as the legacy row: a deleted document's whole row is struck through in red */
.doc-row-deleted {
    color: var(--dot-danger);
}

html #result_list tr:has(.doc-row-deleted) td,
html #result_list tr:has(.doc-row-deleted) td a {
    text-decoration: line-through;
    text-decoration-color: var(--dot-danger);
    text-decoration-thickness: 2px;
}

html #result_list td.field-pdf_link,
html #result_list th.column-pdf_link {
    text-align: center;
}

.doc-ellipsis {
    display: inline-block;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Status badges of the legacy Disclosures screen (documents/admin.py badge()): small tinted pills,
   centred in their column, in the light palette of this admin */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.badge[data-tone="success"] { background: oklch(94% 0.045 145); color: oklch(40% 0.110 145); }
.badge[data-tone="warning"] { background: oklch(94% 0.060 75); color: oklch(45% 0.110 60); }
.badge[data-tone="info"] { background: oklch(94% 0.030 230); color: oklch(42% 0.080 235); }
.badge[data-tone="neutral"] { background: var(--surface-3); color: var(--ink-2); }

html #result_list td.field-access_label,
html #result_list td.field-sections_label,
html #result_list td.field-score_label,
html #result_list th.column-access_label,
html #result_list th.column-sections_label,
html #result_list th.column-score_label {
    text-align: center;
}

/* Pagination bar (templates/unfold/helpers/pagination.html, admin/pagination.html), after V3 page.css:
   a solid bar under the table, the range on the left, boxed page numbers on the right */
.pager {
    position: sticky;
    bottom: 0;
    z-index: 40;
    background: var(--topbar-bg);
    border-top: 1px solid var(--topbar-line);
}

/* As high as the user block of the menu (--bottom-band), on the colour of the top bar */
.pager__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: var(--bottom-band);
    padding: 0 16px;
}

.pager__info {
    font-size: var(--fs-sm);
    color: var(--topbar-fg-dim);
    font-variant-numeric: tabular-nums;
}

.pager__pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-inline-start: auto;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}

.pager__pages > a,
.pager__pages > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    color: var(--topbar-fg-dim);
}

.pager__pages > a:not(.pager__all) {
    border: 1px solid var(--topbar-line);
}

.pager__pages > a:not(.pager__all):hover {
    background: var(--topbar-hover);
    color: var(--topbar-fg);
}

/* The current page (unfold/helpers/pagination_current_item.html) */
.pager__pages > span.font-medium {
    background: var(--sidebar-active);
    border: 1px solid var(--sidebar-active);
    color: oklch(98% 0.004 200);
    font-weight: 500;
}

.pager__all {
    margin-inline-start: 8px;
    color: var(--topbar-fg-dim);
}

.pager__all:hover {
    color: var(--topbar-fg);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pager__save {
    padding: 0 16px;
}

/* Side drawer (templates/admin/opim/drawer.html, static/opim/js/drawer.js): the legacy "Add ... statement"
   drawers, opening on the right, label on the left and field on the right */

body.drawer-open {
    overflow: hidden;
}

.drawer {
    position: fixed;
    inset: 0;
    z-index: 100;
}

.drawer[hidden] {
    display: none;
}

.drawer__overlay {
    position: absolute;
    inset: 0;
    background: oklch(27% 0.020 200 / 0.32);
    backdrop-filter: blur(1px);
    animation: drawer-fade var(--dur-fast) var(--ease-out-quart);
}

.drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(46rem, 100vw);
    display: flex;
    flex-direction: column;
    background: var(--surface-1);
    border-left: 1px solid var(--line);
    box-shadow: 0 10px 30px -12px oklch(27% 0.020 200 / 0.30), 0 2px 8px -2px oklch(27% 0.020 200 / 0.12);
    animation: drawer-in 220ms var(--ease-out-quart);
}

@keyframes drawer-in {
    from { transform: translateX(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes drawer-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .drawer__panel,
    .drawer__overlay {
        animation: none;
    }
}

.drawer__body,
.drawer__form {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: var(--sidebar-bg);
    color: var(--topbar-fg);
}

.drawer__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--topbar-fg);
}

.drawer__subtitle {
    margin-top: 4px;
    font-size: var(--fs-sm);
    color: var(--topbar-fg-dim);
}

.drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--topbar-line);
    border-radius: var(--radius-md);
    color: var(--topbar-fg);
    cursor: pointer;
}

.drawer__close:hover {
    background: var(--sidebar-hover);
}

.drawer__fields {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px;
}

.drawer__error {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: oklch(from var(--dot-danger) l c h / 0.08);
    color: var(--dot-danger);
    font-size: var(--fs-sm);
}

.drawer-row {
    display: grid;
    grid-template-columns: minmax(10rem, 2fr) 3fr;
    gap: 16px;
    align-items: start;
    padding: 14px 0;
    border-bottom: 1px solid var(--line-soft);
}

.drawer-row:last-child {
    border-bottom: 0;
}

.drawer-row__label {
    display: flex;
    flex-direction: column;
    padding-top: 9px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-2);
}

.drawer-row__required {
    margin-left: 4px;
    color: var(--dot-danger);
}

.drawer-row__label .drawer-row__hint {
    font-weight: 400;
}

.drawer-row__hint {
    margin-top: 4px;
    font-size: var(--fs-xs);
    color: var(--ink-3);
}

.drawer-row__control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* A read-only row of a detail drawer: the value as text, a long one under its label. */
.drawer-row__value {
    padding-top: 9px;
    font-size: var(--fs-sm);
    color: var(--ink-1);
    overflow-wrap: anywhere;
}

.drawer-row--long {
    grid-template-columns: 1fr;
    gap: 6px;
}

.drawer-row--long .drawer-row__label,
.drawer-row--long .drawer-row__value {
    padding-top: 0;
}

.drawer-text {
    white-space: pre-wrap;
    line-height: 1.5;
}

.drawer-code {
    max-height: 22rem;
    overflow: auto;
    margin: 0;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    white-space: pre-wrap;
}

.drawer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.drawer-list__meta {
    display: block;
    font-size: var(--fs-xs);
    color: var(--ink-3);
}

.drawer-row__message {
    font-size: var(--fs-xs);
    color: var(--dot-danger);
}

.drawer-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    color: var(--ink-1);
}

select.drawer-input {
    padding-right: 32px;
}

textarea.drawer-input {
    height: auto;
    min-height: 80px;
    padding: 8px 12px;
    resize: vertical;
}

.drawer-input:hover {
    border-color: var(--line-strong);
}

.drawer-input:focus {
    border-color: var(--primary-700);
    box-shadow: 0 0 0 3px oklch(from var(--primary-700) l c h / 0.08);
    outline: none;
}

.drawer-row--error .drawer-input,
.drawer-row--error .dropzone {
    border-color: var(--dot-danger);
}

/* PDF drop zone */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    font-size: var(--fs-sm);
    color: var(--ink-2);
    text-align: center;
    cursor: pointer;
}

.dropzone .material-symbols-outlined {
    font-size: 24px;
    color: var(--ink-3);
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone--over {
    border-color: var(--primary-700);
    background: var(--surface-3);
}

.dropzone--filled {
    border-style: solid;
    color: var(--ink-1);
    font-weight: 500;
}

.dropzone__button {
    margin-left: 4px;
    font-weight: 600;
    color: var(--primary-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.drawer__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
}

.drawer__cancel,
.drawer__save {
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
}

.drawer__cancel {
    border: 1px solid var(--line);
    background: var(--surface-1);
    color: var(--ink-1);
}

.drawer__cancel:hover {
    background: var(--surface-3);
}

.drawer__save {
    border: 1px solid transparent;
    background: var(--accent-600);
    color: oklch(99% 0.01 145);
}

.drawer__save:hover {
    background: var(--accent-700);
}

.drawer__save:disabled {
    opacity: 0.6;
    cursor: progress;
}

.drawer-row[hidden] {
    display: none;
}

/* The "?" help of a field, with its text as a tooltip (the legacy balloons) */
.help-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    color: var(--ink-3);
    cursor: help;
    vertical-align: 1px;
}

.help-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    z-index: 10;
    width: 16rem;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--primary-900);
    color: var(--topbar-fg);
    font-size: var(--fs-xs);
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    box-shadow: 0 12px 28px -10px oklch(27% 0.020 200 / 0.22);
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease-out-quart);
}

.help-tip:hover::after,
.help-tip:focus::after {
    opacity: 1;
    visibility: visible;
}

/* Date fields: a text input in YYYY-MM-DD with a calendar icon, and the flatpickr popup in the
   tokens of this admin (both from V3 Admin.Web app.css) */
.input--date {
    padding-inline-end: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7780' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.flatpickr-calendar {
    font-family: var(--font-ui);
    font-size: var(--fs-sm);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-1);
    box-shadow: 0 12px 28px -10px oklch(27% 0.020 200 / 0.22), 0 1px 3px oklch(27% 0.020 200 / 0.06);
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
    display: none;
}

.flatpickr-calendar .flatpickr-month,
.flatpickr-calendar .flatpickr-current-month,
.flatpickr-calendar .flatpickr-monthDropdown-months,
.flatpickr-calendar .flatpickr-weekday {
    color: var(--ink-1);
    fill: var(--ink-1);
}

.flatpickr-calendar .flatpickr-current-month {
    font-size: var(--fs-base);
    font-weight: 600;
}

.flatpickr-calendar .flatpickr-weekday {
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ink-3);
}

.flatpickr-calendar .flatpickr-day {
    color: var(--ink-1);
    border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums;
}

.flatpickr-calendar .flatpickr-day:hover {
    background: var(--surface-2);
    border-color: var(--surface-2);
}

.flatpickr-calendar .flatpickr-day.today {
    border-color: var(--primary-700);
    color: var(--primary-700);
}

.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.selected:hover {
    background: var(--primary-900);
    border-color: var(--primary-900);
    color: var(--surface-1);
}

.flatpickr-calendar .flatpickr-day.flatpickr-disabled,
.flatpickr-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar .flatpickr-day.nextMonthDay {
    color: var(--ink-4);
}

.flatpickr-calendar .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-next-month {
    color: var(--ink-3);
    fill: var(--ink-3);
}

.flatpickr-calendar .flatpickr-prev-month:hover svg,
.flatpickr-calendar .flatpickr-next-month:hover svg {
    fill: var(--primary-700);
}

/* The padlock of the original fields (static/opim/js/locks.js), as the legacy document form */
.lock-field {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.lock-field > input {
    flex: 1;
    min-width: 0;
}

html .lock-field > input.is-locked {
    background: var(--surface-2);
    color: var(--ink-2);
    cursor: not-allowed;
}

.lock-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-1);
    color: var(--ink-3);
    cursor: pointer;
}

.lock-toggle:hover {
    border-color: var(--line-strong);
    color: var(--ink-1);
}

.lock-toggle[aria-pressed="true"] {
    color: var(--accent-700);
}

.lock-toggle .material-symbols-outlined {
    font-size: 18px;
}

/* The Principles drawer (templates/admin/opim/principles_drawer.html): one tab per principle */
.ptabs {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    border-bottom: 1px solid var(--line);
}

.ptabs__tab {
    position: relative;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
}

.ptabs__tab:hover {
    color: var(--ink-1);
}

.ptabs__tab[aria-selected="true"] {
    border-bottom-color: var(--accent-600);
    color: var(--ink-1);
}

/* A principle without text: its tab in a lighter ink */
.ptabs__tab--empty {
    color: var(--ink-4);
    font-style: italic;
}

.ptext {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0 24px;
}

.ptext__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--ink-1);
}

.ptext__title span {
    font-size: var(--fs-sm);
    font-weight: 400;
    color: var(--ink-2);
}

textarea.drawer-input.ptext__area {
    min-height: 22rem;
    line-height: 1.5;
}

textarea.drawer-input[readonly],
select.drawer-input:disabled {
    background: var(--surface-2);
    color: var(--ink-2);
}

/* The record name that opens the edit drawer (DocumentAdmin.signatory_drawer) */
html #result_list a.doc-open {
    color: var(--ink-1);
    font-weight: 500;
}

html #result_list a.doc-open:hover {
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}

.drawer-row__control select:disabled,
.drawer-row__control input:disabled,
.drawer-row__control textarea:disabled {
    background: var(--surface-2);
    color: var(--ink-2);
    cursor: default;
}

/* Unfold renders no header cell above the row-actions column ("..."): an empty one, so the header
   band of the table runs to its end */
@media (min-width: 1024px) {
    html #result_list:has(td.field-actions_holder) thead tr::after {
        content: '';
        display: table-cell;
        background: var(--surface-2);
        border-bottom: 1px solid var(--line);
    }
}

/* The Principles cards (templates/admin/framework/principle/change_list.html), as the legacy screen */
.principle-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 16px;
    padding-top: 16px;
}

.principle-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

a.principle-card {
    transition: border-color var(--dur-fast) var(--ease-out-quart), background var(--dur-fast) var(--ease-out-quart);
}

a.principle-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}

.principle-card__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: var(--fs-lg, 1rem);
    font-weight: 600;
    color: var(--ink-1);
}

.principle-card__title .material-symbols-outlined {
    font-size: 16px;
    color: var(--ink-4);
}

.principle-card__subtitle {
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--ink-1);
}

.principle-card__definition {
    font-size: var(--fs-sm);
    line-height: 1.55;
    color: var(--ink-2);
}

/* The Audit log timeline (templates/admin/legacy/legacyauditlog/change_list.html), as the legacy screen */
.timeline {
    position: relative;
    margin: 16px 0 0;
    padding: 0 0 0 40px;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 15px;
    width: 1px;
    background: var(--line);
}

.timeline__day {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 28px;
}

.timeline__marker {
    position: absolute;
    top: -4px;
    left: -40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: var(--primary-900);
    color: var(--topbar-fg);
    font-size: 15px;
}

.timeline__date {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink-1);
}

.timeline__card {
    max-width: 60rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.timeline__signatory {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--ink-1);
}

.timeline__messages {
    margin: 0;
    padding: 10px 14px 10px 30px;
    list-style: disc;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    color: var(--primary-700);
}

.timeline__messages li + li {
    margin-top: 4px;
}

.timeline__error {
    color: var(--dot-danger);
    font-weight: 500;
}

.timeline__empty {
    font-size: var(--fs-sm);
    color: var(--ink-3);
}

/* The Evaluations matrix (templates/admin/scoring/evaluation/matrix.html), as the legacy screen */
.matrix-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.matrix-toolbar__label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink-1);
}

.matrix-toolbar__select {
    max-width: 24rem;
}

.matrix-toolbar__exports {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* The legacy "Export all" / "Export (signatory)" buttons */
.matrix-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-1);
    font-size: var(--fs-sm);
    font-weight: 500;
    font-family: inherit;
    color: var(--ink-1);
    cursor: pointer;
}

.matrix-export:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
}

.matrix-export .material-symbols-outlined {
    font-size: 18px;
    color: var(--ink-2);
}

.matrix-export[aria-busy="true"] {
    cursor: progress;
    color: var(--ink-2);
    background: var(--surface-2);
}

.matrix-export.is-failed {
    border-color: oklch(0.6 0.17 25);
    color: oklch(0.5 0.17 25);
}

.is-spinning {
    animation: opim-spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .is-spinning { animation-duration: 2.4s; }
}

.matrix-export__note {
    font-size: var(--fs-xs);
    color: var(--ink-3);
}

.matrix-empty {
    font-size: var(--fs-sm);
    color: var(--ink-3);
}

.matrix-scroll {
    overflow-x: auto;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

table.matrix {
    border-collapse: collapse;
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
}

.matrix th,
.matrix td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: middle;
}

.matrix thead th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-2);
}

.matrix thead th.matrix__corner {
    min-width: 22rem;
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--fs-base);
    color: var(--ink-1);
}

.matrix__caption {
    margin-right: 8px;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
}

.matrix th.matrix__date,
.matrix .matrix__head2 th:not(:first-child),
.matrix td {
    text-align: center;
    white-space: nowrap;
}

.matrix th.matrix__date {
    min-width: 9rem;
    font-size: var(--fs-sm);
    letter-spacing: 0;
    color: var(--ink-1);
}

.matrix__status th {
    font-weight: 400;
    color: var(--ink-2);
}

.matrix tbody th {
    max-width: 26rem;
    font-weight: 400;
    white-space: normal;
}

.matrix td.matrix__weight,
.matrix th.matrix__weight {
    min-width: 6rem;
    color: var(--ink-2);
}

.matrix__row--principle th,
.matrix__row--principle td {
    background: var(--surface-2);
    border-bottom-color: var(--line);
}

.matrix__toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--ink-1);
    cursor: pointer;
}

.matrix__toggle .material-symbols-outlined {
    transition: transform var(--dur-fast) var(--ease-out-quart);
}

.matrix__toggle .material-symbols-outlined.is-closed {
    transform: rotate(-90deg);
}

.matrix__row--practice th {
    padding-left: 32px;
}

.matrix__practice {
    display: block;
    font-weight: 600;
    color: var(--ink-1);
}

.matrix__definition {
    display: block;
    font-size: var(--fs-xs);
    color: var(--ink-2);
}

.matrix__row--key_practice th {
    padding-left: 48px;
    color: var(--ink-1);
}

.matrix__score {
    display: inline-block;
    min-width: 5.5rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--ink-1);
    font-weight: 500;
}

/* The legacy colours: principle and practice scores stand out, key-practice scores are neutral */
.matrix__row--principle .matrix__score {
    background: oklch(92% 0.06 75);
    color: oklch(40% 0.10 60);
    font-weight: 600;
}

.matrix__row--practice .matrix__score {
    background: oklch(95% 0.04 75);
    color: oklch(45% 0.09 60);
}

.matrix__score--none {
    background: transparent;
    color: var(--ink-4);
}

.matrix__trend {
    display: inline-block;
    width: 1.25rem;
    margin-left: 6px;
    font-weight: 700;
}

.matrix__trend--up { color: var(--accent-600); }
.matrix__trend--down { color: var(--dot-danger); }
.matrix__trend--same { color: var(--ink-3); }

.matrix-menu {
    position: relative;
    display: inline-block;
}

.matrix-menu__button {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--ink-3);
    cursor: pointer;
}

.matrix-menu__button:hover {
    background: var(--surface-3);
    color: var(--ink-1);
}

.matrix-menu__items {
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 12rem;
    padding: 4px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 28px -10px oklch(27% 0.020 200 / 0.22);
    transform: translateX(-50%);
    text-align: left;
}

.matrix-menu__items a,
.matrix-menu__items button {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink-1);
}

.matrix-menu__items form {
    display: flex;
    margin: 0;
}

.matrix-menu__items button {
    flex: 1;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    cursor: pointer;
}

.matrix-menu__items a:hover,
.matrix-menu__items button:hover {
    background: var(--surface-2);
}

/* Error pages (templates/errors/base.html): the auth shell, one card, two actions */
body.error-page {
    margin: 0;
}

.error-card {
    text-align: center;
}

.error-card__text {
    margin: 0 auto;
    max-width: 34ch;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--ink-2);
}

.error-card__reference {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--ink-3);
}

.error-card__reference strong {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--ink-1);
}

.error-card__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.error-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-1);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-1);
    text-decoration: none;
}

.error-card__button:hover {
    background: var(--surface-2);
}

.error-card__button--primary {
    border-color: transparent;
    background: var(--accent-600);
    color: oklch(99% 0.01 145);
}

.error-card__button--primary:hover {
    background: var(--accent-700);
}

/* Administration screens -------------------------------------------------------------------------- */

/* One sort at a time, by clicking the header: no multi-sort toggles nor priorities (Django's). */
#result_list .sortoptions,
#result_list .sortpriority {
    display: none;
}

.mono {
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--ink-2);
}

.list-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 32px 24px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.list-empty__title {
    font-size: var(--fs-base, 15px);
    font-weight: 600;
    color: var(--ink-1);
}

.list-empty__text {
    font-size: var(--fs-sm);
    color: var(--ink-3);
}

.list-empty__reset {
    margin-top: 6px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-1);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* The review screen (templates/admin/scoring/evaluation/review.html, static/opim/js/review.js): the scores on
   the left, the PDF page of the selected quote on the right with its paragraph highlighted */
.badge[data-tone="danger"] { background: oklch(94% 0.040 25); color: oklch(45% 0.150 25); }

.rv-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.rv-head .ph-title .badge {
    margin-left: 8px;
    vertical-align: middle;
    font-size: var(--fs-sm);
}

.rv-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rv-actions form {
    margin: 0;
}

.matrix-export[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* The one primary action of the page: the impact green */
.rv-publish {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--accent-600);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: white;
    cursor: pointer;
}

.rv-publish:hover {
    background: var(--accent-700);
}

.rv-publish .material-symbols-outlined {
    font-size: 18px;
}

.rv-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
}

.rv-banner[data-tone="info"] { background: oklch(96% 0.020 230); color: oklch(38% 0.080 235); }
.rv-banner[data-tone="danger"] { background: oklch(96% 0.030 25); color: oklch(42% 0.150 25); }
.rv-banner[data-tone="neutral"] { background: var(--surface-2); color: var(--ink-2); }

/* The counters: figures first; "To check" and "Corrected" filter the list */
.rv-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    margin-bottom: 16px;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.rv-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 9rem;
    padding: 12px 18px;
    border: 0;
    border-right: 1px solid var(--line-soft);
    background: transparent;
    font-family: inherit;
    text-align: left;
}

.rv-stat--filter {
    cursor: pointer;
}

.rv-stat--filter:hover,
.rv-stat--filter.is-on {
    background: var(--surface-2);
}

.rv-stat__value {
    font-size: var(--fs-display);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ink-1);
}

.rv-stat__value small {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-3);
}

.rv-stat__value.is-warning {
    color: oklch(50% 0.12 60);
}

.rv-stat__label {
    font-size: var(--fs-xs);
    color: var(--ink-3);
}

.rv-stat__label a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rv-filters {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 0 14px;
}

.rv-filters button {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-1);
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
}

.rv-filters button.is-on {
    background: var(--primary-100);
    border-color: var(--line-strong);
    color: var(--ink-1);
}

/* The filters (data-filter on .rv): a key practice shows when it matches, a principle or a practice while one of
   its key practices does */
.rv[data-filter="check"] .rv-kp:not([data-check="1"]),
.rv[data-filter="corrected"] .rv-kp:not([data-corrected="1"]),
.rv[data-filter="evidence"] .rv-kp:not([data-evidence="1"]),
.rv[data-filter="check"] .rv-group:not(:has(.rv-kp[data-check="1"])),
.rv[data-filter="corrected"] .rv-group:not(:has(.rv-kp[data-corrected="1"])),
.rv[data-filter="evidence"] .rv-group:not(:has(.rv-kp[data-evidence="1"])) {
    display: none;
}

/* Two panes: the page stays in view while the scores scroll */
.rv-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
    gap: 20px;
    align-items: start;
}

@media (max-width: 1100px) {
    .rv-body { grid-template-columns: minmax(0, 1fr); }
}

.rv-scores {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rv-principle {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.rv-principle__head {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    background: oklch(97% 0.025 75);
    border: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.rv-principle__head .material-symbols-outlined.is-closed {
    transform: rotate(-90deg);
}

.rv-principle__title {
    flex: 1;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--ink-1);
}

.rv-num {
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    font-weight: 400;
    color: var(--ink-3);
    white-space: nowrap;
}

.rv-figure {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-size: 1.125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: oklch(40% 0.10 60);
}

.rv-figure--small {
    font-size: var(--fs-base);
    color: oklch(45% 0.09 60);
}

.rv-ref {
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--ink-3);
}

.rv-ref::before {
    content: 'ref ';
}

.rv-practice {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 14px 6px;
    border-top: 1px solid var(--line-soft);
    background: oklch(98.5% 0.012 75);
}

.rv-practice__title {
    flex: 1;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--ink-1);
}

.rv-kp {
    padding: 10px 14px 12px 28px;
    border-top: 1px solid var(--line-soft);
    scroll-margin-top: 80px;
}

.rv-kp.has-flags {
    background: oklch(98.6% 0.018 75);
}

.rv-kp__head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.rv-kp__definition {
    flex: 1;
    font-size: var(--fs-sm);
    color: var(--ink-1);
}

.rv-kp__scores {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
}

.rv-score {
    min-width: 2.5rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    font-size: var(--fs-base);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: var(--ink-1);
}

.rv-score__ai {
    font-size: var(--fs-xs);
    color: var(--ink-3);
    text-decoration: line-through;
}

.rv-delta {
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    color: var(--ink-3);
}

.rv-delta.is-large {
    color: oklch(50% 0.12 60);
    font-weight: 600;
}

.rv-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.rv-flags li {
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    background: oklch(94% 0.060 75);
    font-size: var(--fs-2xs);
    font-weight: 500;
    color: oklch(45% 0.110 60);
}

.rv-kp__rationale {
    margin-top: 6px;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--ink-2);
}

.rv-quotes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.rv-quote {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-family: inherit;
    font-size: var(--fs-sm);
    text-align: left;
    color: var(--ink-1);
    cursor: pointer;
}

.rv-quote:hover {
    border-color: var(--line-strong);
}

.rv-quote.is-selected {
    border-color: oklch(70% 0.14 85);
    background: oklch(96% 0.07 95);
}

.rv-quote.is-unverified .rv-quote__meta {
    color: var(--dot-danger);
}

.rv-quote__meta {
    flex: none;
    width: 7.5rem;
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    line-height: 1.8;
    color: var(--ink-3);
}

.rv-quote__text {
    font-style: italic;
    line-height: 1.45;
}

.rv-kp__manual {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    font-size: var(--fs-sm);
    color: var(--ink-1);
}

.rv-kp__manual .material-symbols-outlined {
    font-size: 18px;
    color: var(--ink-3);
}

.rv-kp__edit {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--primary-700);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.rv-correct {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 8px 12px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--ink-2);
}

.rv-correct label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rv-correct textarea.drawer-input {
    min-height: 56px;
}

.rv-correct__buttons {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rv-correct__buttons .rv-publish,
.rv-correct__buttons .matrix-export {
    height: 32px;
}

.rv-correct__error {
    color: var(--dot-danger);
    font-weight: 500;
}

.rv-viewer {
    position: sticky;
    top: 72px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 96px);
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.rv-viewer__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--line-soft);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
}

.rv-viewer__open {
    margin-left: auto;
    font-size: var(--fs-xs);
    color: var(--primary-700);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rv-icon {
    display: inline-flex;
    padding: 2px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink-2);
    cursor: pointer;
}

.rv-icon:hover:not([disabled]) {
    background: var(--surface-3);
}

.rv-icon[disabled] {
    opacity: 0.35;
    cursor: default;
}

.rv-viewer__page {
    position: relative;
    overflow: auto;
    background: var(--surface-3);
}

.rv-viewer__page img {
    display: block;
    width: 100%;
    height: auto;
}

.rv-viewer__mark {
    position: absolute;
    border: 2px solid oklch(70% 0.16 85);
    border-radius: 3px;
    background: oklch(88% 0.17 95 / 0.28);
    pointer-events: none;
}

.rv-others {
    margin-top: 24px;
    font-size: var(--fs-sm);
    color: var(--ink-2);
}

.rv-others h3 {
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--ink-1);
}

.rv-others a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* The confirmation dialog (static/opim/js/confirm.js), in place of the browser's confirm() */
dialog.confirm {
    width: min(28rem, calc(100vw - 32px));
    /* The admin's reset puts margin 0 on every element: auto margins center the modal again. */
    margin: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-1);
    color: var(--ink-1);
    box-shadow: 0 10px 30px -12px oklch(27% 0.020 200 / 0.30), 0 2px 8px -2px oklch(27% 0.020 200 / 0.12);
}

dialog.confirm[open] {
    animation: drawer-fade var(--dur-fast) var(--ease-out-quart);
}

dialog.confirm::backdrop {
    background: oklch(27% 0.020 200 / 0.32);
    backdrop-filter: blur(1px);
}

.confirm__body {
    padding: 20px 20px 16px;
}

.confirm__title {
    font-size: 1rem;
    font-weight: 600;
}

.confirm__message {
    margin-top: 8px;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--ink-2);
}

.confirm__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.confirm__ok[data-tone="danger"],
.drawer__save[data-tone="danger"] {
    background: oklch(52% 0.170 25);
}

.confirm__ok[data-tone="danger"]:hover,
.drawer__save[data-tone="danger"]:hover {
    background: oklch(46% 0.170 25);
}

/* A scoring under way or failed, under the score status of a disclosure (Evaluations screen) */
.matrix-scoring {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: var(--fs-xs);
    color: oklch(38% 0.080 235);
    white-space: nowrap;
}

.matrix-scoring .material-symbols-outlined {
    font-size: 16px;
}

.matrix-scoring[data-tone="danger"] {
    color: oklch(42% 0.150 25);
}

.matrix-scoring:hover span:last-child {
    text-decoration: underline;
    text-underline-offset: 2px;
}
