/* GovHub 2.0 — app.css, hand-authored (issue 571, ADR-0077 D8). Layers, lowest first: reset, tokens, base,
   components (one section per ui/ partial, then shell and feature components), archetypes, utilities.
   Components read semantic tokens only (no --clp-*, no hex/rgb outside the tokens layer). Status colour is
   --status-<kind> on a glyph, text stays neutral; the accent is never a status, series or category colour.
   Breakpoints: min-width 640px | 768px | 1024px, max-width 639.98px | 767.98px | 1023.98px. Every focus
   state draws var(--ring) or var(--ring-inset). Guarded by internal/view/css_classes_test.go + css_tokens_test.go. */

@layer reset, tokens, base, components, archetypes, utilities;

/* Self-hosted Inter 4 variable (opsz + wght), served from embed.FS — no CDN. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/InterVariable.woff2") format("woff2"); }

/* ============================================================ tokens */
@layer tokens {
:root {
  /* Raw palette: near-neutral greys. */
  --clp-white: #FFFFFF;
  /* Raw palette: brand blue (600 = the one accent). Read only inside this layer. */
  --clp-blue-700: #185873; --clp-blue-600: #1f6a86; --clp-blue-500: #3a83a0; --clp-blue-400: #6ea6ba; --clp-blue-300: #a6cbd8;
  --clp-blue-100: #e7f1f5; --clp-blue-50: #f1f7f9;
  /* Raw palette: near-neutral greys. */
  --clp-neutral-900: #17181c; --clp-neutral-600: #5b5d66; --clp-neutral-500: #666873; --clp-neutral-400: #a9abb3; --clp-neutral-300: #d8d8de;
  --clp-neutral-200: #e7e7eb; --clp-neutral-150: #ebebf0; --clp-neutral-100: #f1f1f4; --clp-neutral-50: #f6f6f8; --clp-neutral-25: #fcfcfd;
  /* Raw palette: yellow, landing page only. */
  --clp-yellow-700: #a56b06; --clp-yellow-500: #FFBB29; --clp-yellow-400: #ffc955; --clp-yellow-100: #fff3d6;
  --status-met: #1f8a50; /* glyph: covered, approved, published */
  --status-met-text: #176b3d;
  --status-review: #c27a00; /* glyph: in progress, changes requested, expiring */
  --status-review-text: #8a5600; --status-review-bg: #fdf8ee; --status-review-border: #ecd9aa;
  --status-open: #8b8e97; /* glyph: open, not started */
  --status-open-text: #5b5d66;
  --status-overdue: #d23f31; /* glyph: overdue, rejected, gaps */
  --status-overdue-text: #b3261e; --status-overdue-bg: #fdf4f3; --status-overdue-border: #f0cbc7;
  --status-draft: var(--status-open); /* glyph: draft (dashed ring; the shape tells it from open) */
  --status-submitted: #6b5bb5; /* glyph: submitted, in review, pending (never the accent) */
  --status-submitted-text: #54479a; --status-submitted-bg: #f5f3fb; --status-submitted-border: #d9d3ee;
  --status-withdrawn: var(--status-open); /* glyph: withdrawn, superseded (ring with a slash) */
  --bg-app: var(--clp-neutral-25); /* page canvas */
  --bg-sidebar: var(--clp-neutral-50); /* app-shell sidebar rail + group heads */
  --bg-surface: var(--clp-white); /* inputs, popovers, dialogs */
  --bg-subtle: var(--clp-neutral-100); /* inset wells, skeletons, segmented track */
  --bg-muted: var(--clp-blue-50); /* "you are here" row target */
  --bg-brand: var(--clp-neutral-900); /* identity mark (ink, not colour) */
  --bg-action: var(--clp-blue-600); /* primary button = the accent */
  --bg-action-hover: var(--clp-blue-700);
  --bg-brand-soft: var(--clp-blue-100); /* accent-soft: selection wash, AI mark */
  --bg-accent: var(--clp-yellow-500); /* warning-only highlight */
  --bg-hover: var(--clp-neutral-100); /* row / item hover */
  --bg-selected: var(--clp-neutral-150); /* current nav item, selected row */
  --bg-insert: #f3faf6; /* inserted text (track changes) */
  --fg-primary: var(--clp-neutral-900); /* text */
  --fg-body: var(--clp-neutral-600); /* text-2: secondary / descriptive */
  --fg-muted: var(--clp-neutral-500); /* text-3: meta, placeholders (AA on canvas) */
  --fg-subtle: var(--clp-neutral-400); /* text-4: diagram fallbacks, disabled marks */
  --fg-brand: var(--clp-blue-700);
  --fg-on-brand: var(--clp-white);
  --fg-on-action: var(--clp-white);
  --fg-on-accent: var(--clp-neutral-900);
  --fg-on-inverse: var(--clp-white);
  --fg-link: #175a73; /* accent-text: 7:1 on canvas */
  --fg-link-hover: var(--clp-blue-700);
  --border-subtle: var(--clp-neutral-200); /* the hairline (v3 --line) */
  --border-default: var(--clp-neutral-200); /* table heads, dividers */
  --border-control: var(--clp-neutral-300); /* inputs + buttons (v3 --line-strong) */
  --border-strong: var(--clp-neutral-300); /* hover / emphasis */
  --border-brand: var(--clp-blue-600);
  --border-action: var(--clp-blue-600);
  --border-rail: var(--clp-blue-400); /* platform → child tree rail */
  --ring-color: color-mix(in srgb, var(--clp-blue-600) 55%, transparent); /* the focus ring colour; read through --ring / --ring-inset only */
  --ring: 0 0 0 2px var(--bg-app), 0 0 0 4px var(--ring-color); /* focus: 2px canvas gap + 2px ring */
  --ring-inset: inset 0 0 0 2px var(--ring-color); /* focus inside clipped containers (table row links, tree rows) */
  --seg-open: #c9cbd1; /* open segment of the progress bar */
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-brand: 'PT Sans Narrow', var(--font-ui); /* login only */
  --font-features: "cv11", "ss01"; /* Inter single-storey a, straight 1 */
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Roboto Mono', monospace;
  --fs-display: 1.75rem; /* 28px — hero numbers, login */
  --fs-stat: 1.375rem; /* 22px — figures */
  --fs-h1: 1.375rem; /* 22px — page title (600, -0.015em) */
  --fs-h2: 1rem; /* 16px — section */
  --fs-h3: 0.875rem; /* 14px — group / subsection head (600) */
  --fs-h4: 0.8125rem; /* 13px — label-ish heading (600) */
  --fs-body: 0.875rem; /* 14px — base body */
  --fs-small: 0.8125rem; /* 13px — secondary, table cells */
  --fs-caption: 0.75rem; /* 12px — captions, table heads, meta */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.2;
  --lh-snug: 1.4;
  --lh-normal: 1.5;
  --lh-loose: 1.65;
  /* Letter spacing: no tracked capitals in the app. */
  --ls-wide: 0; --ls-tight: -0.015em; --ls-snug: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --radius-sm: 4px; /* kbd, keys, inline code */
  --radius-md: 6px; /* THE control radius (buttons, inputs, nav items) */
  --radius-lg: 8px; /* popovers, quote blocks, dialogs */
  --radius-xl: 10px; /* large overlays (lightbox) */
  --radius-pill: 999px; /* avatars, progress bars ONLY — never a status capsule */
  --shadow-xs: 0 1px 1px rgb(23 24 28 / 0.04), 0 1px 2px rgb(23 24 28 / 0.06);
  --shadow-sm: var(--shadow-xs);
  --shadow-md: 0 8px 24px rgb(23 24 28 / 0.10), 0 2px 6px rgb(23 24 28 / 0.06);
  --shadow-lg: 0 16px 40px rgb(23 24 28 / 0.14), 0 4px 12px rgb(23 24 28 / 0.08);
  --shadow-brand: 0 1px 2px rgb(23 90 115 / 0.25); /* primary button resting shadow */
  --scrim: rgb(23 24 28 / 0.2); /* dialog / sheet backdrop */
  --scrim-strong: rgb(15 20 25 / 0.5); /* modal backdrop */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms; /* hover, focus, toggles */
  --dur-base: 220ms; /* sheets, toasts, page transitions */
  /* Layout scale. */
  --layout-sidebar-w: 232px; --layout-sidebar-w-collapsed: 64px; --layout-topbar-h: 48px; --layout-content-max: 1320px;
  --layout-gutter: var(--space-10); --layout-aside-w: 288px; --layout-sheet-w: 480px; --layout-toast-w: 420px;
  --layout-palette-w: 640px; /* the command palette (issue 581) */
  --layout-flow-rail-w: 200px; /* guided flow: the step rail (issue 583) */
  /* Icon sizes. */
  --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px; --icon-btn: 30px;
  /* Stacking order. */
  --z-sticky: 100; --z-nav: 200; --z-dropdown: 300; --z-overlay: 400; --z-dialog: 401; --z-toast: 500;
  /* Category palette (chips, map edges, multi-series charts): never a status, never the accent. */
  --c-cat-1: #7a5c8a; --c-cat-1-bg: #f1ecf3; --c-cat-2: #66474c; --c-cat-2-bg: #f0eded; --c-cat-3: #478578; --c-cat-3-bg: #edf3f2; --c-cat-4: #6d81ba;
  --c-cat-4-bg: #f0f2f8; --c-cat-5: #778a60; --c-cat-5-bg: #f1f3ef; --c-cat-6: #917559; --c-cat-6-bg: #f4f1ee; --c-cat-7: #4eabbc;
  --c-cat-7-bg: #edf7f8; --c-cat-8: #b97e99; --c-cat-8-bg: #f8f2f5;
  /* Breakpoints (documentation only; @media repeats the literals: 640 / 768 / 1024). */
  --bp-sm: 640px; --bp-md: 768px; --bp-lg: 1024px;
  /* Compliance-flow diagram: ribbon slot N reads a category slot. */
  --sankey-ribbon-1: var(--c-cat-1); --sankey-ribbon-2: var(--c-cat-2); --sankey-ribbon-3: var(--c-cat-7); --sankey-ribbon-4: var(--c-cat-4);
  --sankey-ribbon-5: var(--c-cat-5); --sankey-ribbon-6: var(--c-cat-6); --sankey-ribbon-7: var(--c-cat-3); --sankey-ribbon-8: var(--c-cat-8);
  --sankey-node-bg: var(--bg-surface);
  /* Rich text. */
  --prose-list-indent: var(--space-6); --prose-quote-border: var(--border-strong); --prose-code-bg: var(--bg-subtle);
  --prose-code-border: var(--border-subtle);
  --shape-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --shape-met: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cmask id='m'%3E%3Crect width='14' height='14' fill='white'/%3E%3Cpath d='M4.1 7.3l2 1.9 3.8-4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3Ccircle cx='7' cy='7' r='7' mask='url(%23m)'/%3E%3C/svg%3E");
  --shape-review: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill-rule='evenodd' d='M7 0a7 7 0 100 14A7 7 0 007 0zm0 1.6a5.4 5.4 0 100 10.8A5.4 5.4 0 007 1.6zM7 3.2a3.8 3.8 0 010 7.6z'/%3E%3C/svg%3E");
  --shape-overdue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cmask id='m'%3E%3Crect width='14' height='14' fill='white'/%3E%3Cpath d='M7 3.6v4.1' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3Ccircle cx='7' cy='10.2' r='1' fill='black'/%3E%3C/mask%3E%3Ccircle cx='7' cy='7' r='7' mask='url(%23m)'/%3E%3C/svg%3E");
  --shape-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.4l3 3 5.8-6.4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --shape-dash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
@media (max-width: 1023.98px) {
:root {
  /* Layout scale. */
  --layout-gutter: var(--space-6);
}
}
}

/* ============================================================ reset */
@layer reset {
*::before, *::after { box-sizing: border-box; }
* { box-sizing: border-box; margin: 0; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }
body { min-height: 100vh; background: var(--bg-app); font-family: var(--font-ui); font-size: var(--fs-body); line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; color: var(--fg-primary); font-feature-settings: var(--font-features);
  font-optical-sizing: auto; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--border-strong) transparent; }
input, textarea { font: inherit; color: inherit; caret-color: var(--bg-action); }
:where(a) { color: var(--fg-link); }
select { appearance: none; -webkit-appearance: none; min-height: 30px; border: 1px solid var(--border-control); border-radius: var(--radius-md);
  background-color: var(--bg-surface); color: var(--fg-primary); font: inherit; font-size: var(--fs-small); cursor: pointer;
  padding-right: var(--space-8);
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - var(--space-4)) 50%, calc(100% - var(--space-3)) 50%; background-size: var(--space-1) var(--space-1);
  background-repeat: no-repeat; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
}

/* ============================================================ base */
@layer base {
/* ---------- Base: elements and typography ---------- */
h2 { font-family: var(--font-ui); font-weight: var(--fw-semibold); color: var(--fg-primary); line-height: var(--lh-tight); text-align: left;
  text-wrap: balance; letter-spacing: var(--ls-tight); font-size: var(--fs-h2); }
h3 { font-family: var(--font-ui); font-weight: var(--fw-semibold); color: var(--fg-primary); line-height: var(--lh-tight); text-align: left;
  text-wrap: balance; letter-spacing: var(--ls-tight); font-size: var(--fs-h3); }
h4 { font-family: var(--font-ui); font-weight: var(--fw-semibold); color: var(--fg-primary); line-height: var(--lh-tight); text-align: left;
  text-wrap: balance; letter-spacing: var(--ls-tight); font-size: var(--fs-h4); }
p { text-wrap: pretty; }
strong, b { font-weight: var(--fw-semibold); }
small { font-size: var(--fs-small); }
a { text-decoration: none; color: var(--fg-link); transition: color var(--dur-fast) var(--ease-out); }
:where(p, .field__help, .prose) a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
samp { font-family: var(--font-mono); font-size: .9em; }
::selection { background: var(--bg-brand-soft); color: var(--fg-primary); }
h1 { font-family: var(--font-ui); color: var(--fg-primary); text-align: left; text-wrap: balance; letter-spacing: var(--ls-tight);
  font-size: var(--fs-h1); font-weight: var(--fw-semibold); line-height: 1.25; }
kbd { font: var(--fw-medium) 11px/1 var(--font-ui); color: var(--fg-muted); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  padding: 2px var(--space-1); background: var(--bg-surface); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: var(--space-2); }
time { font-variant-numeric: tabular-nums; }
code { font-family: var(--font-ui); font-size: inherit; font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
pre code { font-family: var(--font-mono); font-size: .9em; font-weight: var(--fw-regular); }
/* Cross-document view transitions (issue 573, ADR-0077 D1): a same-origin
   navigation cross-fades instead of flashing white. It is opt-in on motion:
   with prefers-reduced-motion: reduce the navigation is a plain page swap
   (the reset layer's reduce rule covers every other animation). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-base); animation-timing-function: var(--ease-out); }
}
}

/* ============================================================ components */
@layer components {
/* ---------- Element states (attribute and pseudo-class selectors on bare elements) ---------- */
a:hover { color: var(--fg-link-hover); }
details[data-reveal][open] > *:not(summary), details.card__body[open] > *:not(summary) { margin-top: var(--space-3); }
[hidden] { display: none !important; }
[data-outline-active] { box-shadow: var(--ring-inset); outline: 2px solid transparent; }
input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; display: inline-grid; place-content: center; width: var(--icon-sm);
  height: var(--icon-sm); margin: 0; border: 1px solid var(--border-control); background: var(--bg-surface); vertical-align: middle; cursor: pointer;
  border-radius: var(--radius-sm); }
input[type="radio"] { appearance: none; -webkit-appearance: none; flex: none; display: inline-grid; place-content: center; width: var(--icon-sm);
  height: var(--icon-sm); margin: 0; border: 1px solid var(--border-control); background: var(--bg-surface); vertical-align: middle; cursor: pointer;
  border-radius: var(--radius-pill); }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--border-strong); }
input[type="checkbox"]:checked, input[type="radio"]:checked, input[type="checkbox"]:indeterminate { background: var(--bg-action); border-color: var(--bg-action); }
input[type="checkbox"]:checked::after { content: ""; width: var(--icon-sm); height: var(--icon-sm); background: var(--fg-on-action);
  -webkit-mask: var(--shape-tick) center / contain no-repeat; mask: var(--shape-tick) center / contain no-repeat; }
input[type="checkbox"]:indeterminate::after { content: ""; width: var(--icon-sm); height: var(--icon-sm); background: var(--fg-on-action);
  -webkit-mask: var(--shape-tick) center / contain no-repeat; mask: var(--shape-tick) center / contain no-repeat;
  -webkit-mask-image: var(--shape-dash); mask-image: var(--shape-dash); }
input[type="radio"]:checked::after { content: ""; width: var(--space-2); height: var(--space-2); border-radius: var(--radius-pill); background: var(--fg-on-action); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
input[type="checkbox"][disabled], input[type="radio"][disabled] { opacity: 0.5; cursor: not-allowed; }
select:hover { background-color: var(--bg-surface); border-color: var(--border-strong); }
select[disabled] { background-color: var(--bg-hover); color: var(--fg-muted); border-color: var(--border-subtle); cursor: not-allowed; }
select[multiple] { background-image: none; padding-right: var(--space-3); cursor: default; }
select:focus-visible { border-color: var(--border-control); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
/* ---------- Layout primitives ---------- */
.muted { color: var(--fg-muted); }
.caption { font-size: var(--fs-caption); color: var(--fg-muted); }
.stack { display: flex; flex-direction: column; gap: var(--space-6); }
.stack--tight { gap: var(--space-3); }
.stack--loose { gap: var(--space-8); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.split { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.link-row__icon { grid-area: icon; color: var(--fg-muted); }
.link-row__type { grid-area: type; }
.link-row__url { grid-area: url; }
.link-row__label { grid-area: label; }
.link-row__delete { grid-area: del; color: var(--fg-muted); }
.link-row__delete:hover { color: var(--status-overdue); }
.link-row .field__control { min-width: 0; }
.link-row.has-error { border-color: var(--status-overdue); }
.cluster__inline { display: inline-flex; align-items: center; }
.cluster--split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-3) var(--space-6); }
.meta-list__row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-list__value .chip { vertical-align: middle; }
.meta-list__hint { font-size: var(--fs-caption); color: var(--fg-muted); margin-top: 2px; }
.cluster--between { justify-content: space-between; width: 100%; }
.cluster--end { justify-content: flex-end; }
.linklist { list-style: none; padding: 0; margin: 0; }
.linklist__row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.linklist__row:last-child { border-bottom: 0; }
.linklist__row > .icon { width: var(--icon-sm); height: var(--icon-sm); color: var(--fg-brand); }
.linklist__label { color: var(--fg-link); font-size: var(--fs-small); }
.linklist__host { color: var(--fg-muted); }
.linklist__editor { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-3); }
.caption--link { text-decoration: underline; }
.eyebrow { font-weight: var(--fw-medium); font-size: var(--fs-caption); color: var(--fg-muted); }
.kbd { border-block-end-width: 2px; font: var(--fw-medium) 11px/1 var(--font-ui); color: var(--fg-muted); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 2px var(--space-1); background: var(--bg-surface); }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); display: flex; flex-wrap: wrap; gap: 1px; background: var(--border-subtle);
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); margin-inline-start: calc(-1 * var(--space-5));
  clip-path: inset(0 0 0 var(--space-5)); }
.link-row { display: grid; align-items: center; gap: var(--space-2);
  grid-template-columns: auto minmax(7rem, 8rem) minmax(0, 2fr) minmax(0, 1.2fr) auto; grid-template-areas: "icon type url label del";
  padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  border-color: var(--border-subtle); background: transparent; }
.dl dt, .meta-list__label { color: var(--fg-muted); font-size: var(--fs-small); font-weight: var(--fw-regular); }
.dl dd { font-size: var(--fs-small); color: var(--fg-primary); }
.meta-list__value { font-size: var(--fs-small); word-break: break-word; color: var(--fg-primary); }
.props { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-3); font-size: var(--fs-small); margin: 0; }
.props dt { color: var(--fg-muted); padding-top: 1px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.props dd .hint { display: block; color: var(--fg-muted); font-size: var(--fs-caption); margin-top: 2px; }
.person { display: inline-flex; align-items: center; gap: var(--space-2); }
.meta-list { display: flex; flex-direction: column; gap: var(--space-4); }
.sublabel { display: block; font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted); }
.props-block + .props-block { margin-top: var(--space-6); }
.props__title { margin: 0 0 var(--space-3); font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted); letter-spacing: 0; }
.props__src { display: flex; align-items: center; gap: var(--space-2); }
.props__src .icon { width: 13px; height: 13px; color: var(--fg-muted); }
.props dd .chip { margin-right: var(--space-1); white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.num, .n { font-variant-numeric: tabular-nums; }
.cluster--fill { align-items: stretch; flex-wrap: nowrap; }
.cluster--fill > .field__control { flex: 1 1 auto; width: auto; min-width: 0; }
.lede { max-width: 70ch; margin: 0 0 var(--space-4); font-size: var(--fs-small); color: var(--fg-muted); }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-7); margin: var(--space-4) 0 0; padding: 0; list-style: none;
  font-size: var(--fs-small); color: var(--fg-body); }
.facts b { display: block; font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--fg-primary); font-variant-numeric: tabular-nums; }
.icon-line { display: flex; align-items: flex-start; gap: var(--space-1); }
.icon-line > .icon { margin-top: calc(var(--space-1) / 2); }
a.icon-line { display: inline-flex; align-items: center; }
a.icon-line > .icon { margin-top: 0; }
.empty-line { margin: 0; padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-small); color: var(--fg-muted); }
.props dd { margin: 0; color: var(--fg-primary); min-width: 0; overflow-wrap: break-word; }
.person--lg { gap: var(--space-3); }
.cell-lines { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
@media (max-width: 767.98px) {
  .link-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon url del" "icon type type" "icon label label"; }
  .facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-5); }
}
@media (max-width: 639.98px) {
  .split.page-header { flex-wrap: wrap; }
  .cluster--split { grid-template-columns: 1fr; }
  .cluster--fill { flex-wrap: wrap; }
  .cluster--fill > .field__control { flex-basis: 100%; }
  .split.page-header:has(> .cluster--icons) { flex-wrap: nowrap; align-items: flex-start; }
  .split.page-header:has(> .cluster--icons) > .page-header__title { flex: 1; min-width: 0; }
  .split.page-header:has(> .cluster--icons) > .cluster--icons { flex: none; }
}
/* ---------- ui/icon ---------- */
.icon { width: var(--icon-md); height: var(--icon-md); flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; vertical-align: middle; }
.icon--sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon--lg { width: var(--icon-lg); height: var(--icon-lg); }
.icon-btn.topbar__menu-btn { display: none; }
.icon-btn--indicator { position: relative; }
.icon-btn__dot { position: absolute; top: 6px; right: 6px; }
.icon-btn__dot.glyph { width: 10px; height: 10px; }
.identity:hover { background: var(--bg-hover); }
.identity__name { font-size: var(--fs-small); font-weight: var(--fw-medium); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; background: transparent;
  cursor: pointer; transition: background var(--dur-fast) var(--ease-out); width: var(--icon-btn); height: var(--icon-btn);
  border-radius: var(--radius-md); color: var(--fg-body); }
.icon-btn:hover { background: var(--bg-hover); color: var(--fg-primary); }
.icon-btn.is-active { background: var(--bg-selected); color: var(--fg-primary); }
.icon-btn.is-active .icon { color: var(--fg-primary); }
.icon-btn[disabled] { color: var(--fg-muted); opacity: .4; background: transparent; cursor: not-allowed; pointer-events: none; }
.identity { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  border: 1px solid transparent; border-radius: var(--radius-md); }
.avatar { border-radius: var(--radius-pill); flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px;
  height: 22px; background: var(--bg-brand-soft); color: var(--fg-link); font-size: 10px; font-weight: var(--fw-semibold); }
.avatar--lg { width: 32px; height: 32px; font-size: var(--fs-small); }
@media (max-width: 767.98px) {
  .icon-btn.topbar__menu-btn { display: inline-flex; }
  .identity__name, .identity > .icon { display: none; }
}
/* ---------- ui/button ---------- */
.btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.back-link .icon { width: var(--icon-sm); height: var(--icon-sm); }
.back-link { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-small); color: var(--fg-body); font-weight: var(--fw-medium); }
.back-link:hover { color: var(--fg-primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; font-family: var(--font-ui);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  min-height: 30px; padding: 0 var(--space-3); gap: var(--space-2); border-radius: var(--radius-md); font-weight: var(--fw-medium);
  font-size: var(--fs-small); letter-spacing: 0; line-height: var(--lh-snug); }
.btn .icon { width: 14px; height: 14px; }
.btn--primary { background: var(--bg-action); color: var(--fg-on-action); box-shadow: var(--shadow-brand); }
.btn--primary:hover { background: var(--bg-action-hover); box-shadow: var(--shadow-brand); color: var(--fg-on-action); }
.btn--primary:focus-visible, .btn--primary:active, .btn--primary:visited { color: var(--fg-on-action); }
.btn--secondary { background: var(--bg-surface); color: var(--fg-primary); border-color: var(--border-control); box-shadow: var(--shadow-xs); }
.btn--secondary .icon { color: var(--fg-body); }
.btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-control); color: var(--fg-primary); }
.btn--secondary:focus-visible, .btn--secondary:active, .btn--secondary:visited { color: var(--fg-primary); }
.btn--ghost { background: transparent; color: var(--fg-body); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--fg-primary); }
.btn--ghost:focus-visible, .btn--ghost:active { color: var(--fg-primary); }
.btn--ghost:visited { color: var(--fg-body); }
.btn--danger { background: var(--bg-surface); color: var(--status-overdue-text); border-color: var(--status-overdue-border); box-shadow: var(--shadow-xs); }
.btn--danger:hover { background: var(--status-overdue-bg); color: var(--status-overdue-text); }
.btn--danger:focus-visible, .btn--danger:active, .btn--danger:visited { color: var(--status-overdue-text); }
.btn--sm { min-height: 26px; padding: 0 var(--space-2); font-size: var(--fs-caption); }
.btn--lg { min-height: 36px; padding: 0 var(--space-4); font-size: var(--fs-body); }
.btn--ghost.btn--flush { margin-inline-start: calc(-1 * var(--space-3)); }
.btn--ghost.btn--flush.btn--sm { margin-inline-start: calc(-1 * var(--space-2)); }
.btn[disabled] .icon, .btn[aria-disabled="true"] .icon { color: var(--fg-muted); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 1; background: var(--bg-hover); border-color: var(--border-subtle); box-shadow: none;
  cursor: not-allowed; pointer-events: none; color: var(--fg-muted); }
.btn--ghost[disabled], .btn--ghost[aria-disabled="true"] { background: transparent; border-color: transparent; }
.btn:active { transform: translateY(0.5px); }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: var(--radius-pill); animation: spin var(--dur-base) linear infinite; color: var(--fg-on-action); }
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after { color: var(--fg-primary); }
/* ---------- ui/field ---------- */
.searchbox .icon { color: var(--fg-muted); width: var(--icon-sm); height: var(--icon-sm); }
.searchbox input { flex: 1; border: 0; background: transparent; outline: none; font-size: var(--fs-small); min-width: 0; }
.field--readonly .field__label .caption { font-style: italic; }
.scope-group { display: flex; flex-direction: column; gap: var(--space-2); }
.scope-group__label { font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--fg-muted); }
.scope-toggle { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.scope-toggle__btn .icon { width: var(--icon-sm); height: var(--icon-sm); color: var(--fg-muted); }
.scope-toggle__btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.entry-toggle { flex: 1; min-width: 0; }
.entry-toggle__summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: var(--space-3);
  flex-wrap: wrap; padding: var(--space-2); margin: calc(-1 * var(--space-2)); border-radius: var(--radius-md); }
.entry-toggle__summary::-webkit-details-marker { display: none; }
.entry-toggle__summary:hover { background: var(--bg-hover); }
.entry-toggle__chevron { color: var(--fg-muted); flex-shrink: 0; transition: transform var(--dur-fast) var(--ease-out); }
.entry-toggle:not([open]) .entry-toggle__chevron { transform: rotate(-90deg); }
.entry-toggle__label { font-weight: var(--fw-semibold); color: var(--fg-primary); }
.add-field[open] > summary { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip: rect(0 0 0 0);
  clip-path: inset(50%); white-space: nowrap; }
.add-field__card { margin-top: var(--space-3); }
.tag-filter { max-width: 22rem; min-height: 32px; padding: var(--space-1) var(--space-2); font-size: var(--fs-small); }
.field__error .icon { width: 14px; height: 14px; }
.value-row .field__control { min-width: 0; }
.value-row__color::-webkit-color-swatch-wrapper { padding: 0; }
.value-row__color::-webkit-color-swatch, .value-row__color::-moz-color-swatch { border: none; border-radius: var(--radius-sm); }
.value-row__actions { display: inline-flex; align-items: center; gap: var(--space-1); }
.form-section + .form-section { border-top: 1px solid var(--border-subtle); padding-top: var(--space-6); margin-top: var(--space-6); }
.form-section__head { margin-bottom: var(--space-4); }
.form-section__head p { font-size: var(--fs-caption); color: var(--fg-muted); margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-4); align-items: start; }
.form-grid__full { grid-column: 1 / -1; }
.matrix__head:first-child { border-top-left-radius: var(--radius-md); }
.matrix__head:nth-child(2) { border-top-right-radius: var(--radius-md); text-align: center; }
.matrix__row { display: contents; }
.matrix__name { padding: var(--space-3) var(--space-4); font-size: var(--fs-small); color: var(--fg-primary); border-top: 1px solid var(--border-subtle); }
.matrix__name .caption { display: block; color: var(--fg-muted); font-size: var(--fs-caption); margin-top: 2px; }
.matrix__toggle { padding: var(--space-3); text-align: center; border-top: 1px solid var(--border-subtle); }
.matrix__toggle--unavailable { color: var(--fg-muted); font-style: italic; font-size: var(--fs-caption); }
.segmented__item .icon { width: var(--icon-sm); height: var(--icon-sm); }
.segmented__item:hover { color: var(--fg-primary); }
.segmented__item input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.segmented__count { font-weight: var(--fw-semibold); color: var(--fg-muted); }
.checklist { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.checklist__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2); border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--fs-small); }
.checklist__item:hover { background: var(--bg-hover); }
.checklist__item .icon { width: var(--icon-sm); height: var(--icon-sm); color: var(--fg-muted); }
.checklist--columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px var(--space-5); max-height: none; overflow: visible; }
.tokeninput input { flex: 1; min-width: 80px; border: 0; outline: none; background: transparent; font-size: var(--fs-small); padding: var(--space-1); }
.numpreview { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-subtle); padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2); }
.numpreview__row { display: flex; align-items: baseline; gap: var(--space-3); font-size: var(--fs-small); color: var(--fg-body); }
.numpreview__row--l2 { padding-inline-start: var(--space-6); }
.numpreview__row--l3 { padding-inline-start: calc(var(--space-6) * 2); }
.searchbox { display: flex; align-items: center; gap: var(--space-2); padding-inline: var(--space-3); min-width: 240px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); background: var(--bg-surface);
  border: 1px solid var(--border-control); border-radius: var(--radius-md); min-height: 30px; color: var(--fg-muted); }
.searchbox:focus-within { border-color: var(--border-control); background: var(--bg-surface); outline: 2px solid transparent; outline-offset: 2px;
  box-shadow: var(--ring); }
.searchbox input::placeholder { color: var(--fg-muted); }
.scope-fields { background: transparent; }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field__label { font-weight: var(--fw-medium); font-size: var(--fs-small); color: var(--fg-primary); }
.field__label .req { color: var(--status-overdue-text); }
.field__control { width: 100%; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); min-height: 30px;
  padding: var(--space-1) var(--space-3); border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--bg-surface);
  color: var(--fg-primary); font-size: var(--fs-small); }
.field__control::placeholder { color: var(--fg-muted); }
.field__control:hover { border-color: var(--border-strong); }
.field__control:focus-visible { border-color: var(--border-control); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.field__control[disabled] { cursor: not-allowed; background: var(--bg-hover); color: var(--fg-muted); border-color: var(--border-subtle); }
textarea.field__control { min-height: 88px; padding: var(--space-2) var(--space-3); }
.field__help { font-size: var(--fs-caption); color: var(--fg-muted); }
.field__error { font-size: var(--fs-caption); display: flex; align-items: center; gap: var(--space-1); color: var(--status-overdue-text); }
.field.has-error .richtext, .field.has-error .field__control { border-color: var(--status-overdue); }
.tokeninput { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); padding: var(--space-1) var(--space-2); background: var(--bg-surface); border-color: var(--border-control);
  min-height: 30px; }
.tokeninput:focus-within { border-color: var(--border-control); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.form-section__head h3 { font-weight: var(--fw-semibold); color: var(--fg-primary); font-size: var(--fs-h3); }
.matrix { display: grid; grid-template-columns: minmax(0, 1fr) 120px; column-gap: var(--space-4); row-gap: var(--space-3); align-items: center;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.matrix__head { font-size: var(--fs-caption); color: var(--fg-muted); padding: var(--space-2) var(--space-4); background: var(--bg-sidebar);
  font-weight: var(--fw-medium); }
.scope-toggle__btn { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-3);
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--fg-body); font-family: var(--font-ui);
  font-size: var(--fs-small); cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  border-radius: var(--radius-md); border-color: var(--border-control); font-weight: var(--fw-medium); }
.scope-toggle__btn.is-selected { font-weight: var(--fw-semibold); background: var(--bg-brand-soft); color: var(--fg-link); border-color: var(--border-brand); }
.scope-toggle__btn.is-selected .icon { color: var(--fg-link); }
.checklist__item input { width: 16px; height: 16px; flex: none; accent-color: var(--bg-action); }
.segmented__item[aria-current="true"], .segmented__item[aria-pressed="true"], .segmented__item:has(input:checked) { background: var(--bg-surface);
  color: var(--fg-primary); box-shadow: var(--shadow-xs); }
.segmented__item:focus-within { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.segmented__item:has(input:disabled) { color: var(--fg-muted); cursor: not-allowed; }
.segmented__item:has(input:disabled):hover { color: var(--fg-muted); }
.inline-lock { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.segmented { display: inline-flex; flex: none; white-space: nowrap; padding: 2px; gap: 2px; background: var(--bg-hover); border: 0;
  border-radius: var(--radius-md); max-width: 100%; flex-wrap: wrap; }
.segmented__item { display: inline-flex; align-items: center; gap: var(--space-1); background: transparent; border: 0; cursor: pointer;
  font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-body); padding: 0 var(--space-2); min-height: 24px;
  border-radius: var(--radius-sm); white-space: nowrap; }
select.field__control { padding-right: var(--space-8);
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - var(--space-4)) 50%, calc(100% - var(--space-3)) 50%; background-size: var(--space-1) var(--space-1);
  background-repeat: no-repeat; background-color: var(--bg-surface); appearance: none; -webkit-appearance: none; cursor: pointer; }
select.field__control:hover { background-color: var(--bg-surface); border-color: var(--border-strong); }
select.field__control[disabled] { background-color: var(--bg-hover); color: var(--fg-muted); border-color: var(--border-subtle); cursor: not-allowed; }
select.field__control[multiple] { background-image: none; padding-right: var(--space-3); cursor: default; }
select.field__control:focus-visible { border-color: var(--border-control); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
select.field__control[aria-invalid="true"], .field.has-error select.field__control { border-color: var(--status-overdue); }
.numpreview__num { font-size: var(--fs-caption); color: var(--fg-brand); font-weight: var(--fw-medium); min-inline-size: 5.5rem;
  font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.value-rows { display: flex; flex-direction: column; gap: 0; }
.value-row { display: grid; align-items: center; gap: var(--space-3); grid-template-columns: auto minmax(0, 1fr) auto; border: 0;
  border-bottom: 1px solid var(--border-subtle); border-radius: 0; background: transparent; padding: var(--space-2) 0; }
.value-row__color { flex: none; border-radius: var(--radius-md); cursor: pointer; inline-size: var(--space-6); block-size: var(--space-6); padding: 0;
  border: 0; background: transparent; filter: saturate(0.55); }
.form-section > .field + .dl, .form-section > .callout + .meta-list { margin-top: var(--space-4); }
.rolepick { border-top: 1px solid var(--border-subtle); }
.rolepick__opt { display: grid; grid-template-columns: 1.125rem minmax(0, 1fr) auto; gap: var(--space-3); align-items: start;
  padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--border-subtle); cursor: pointer;
  transition: background-color var(--dur-fast); }
.rolepick__opt:hover { background: var(--bg-hover); }
.rolepick__opt:has(input:checked) { background: var(--bg-brand-soft); }
.rolepick__opt:has(input:disabled) { cursor: default; }
.rolepick__opt input { margin: 3px 0 0; accent-color: var(--bg-action); width: 16px; height: 16px; }
.rolepick__text { display: grid; gap: 2px; min-width: 0; }
.rolepick__name { font-weight: var(--fw-semibold); }
.rolepick__desc { font-size: var(--fs-small); color: var(--fg-muted); }
.rolepick__mark { font-size: var(--fs-caption); color: var(--fg-muted); font-weight: var(--fw-medium); padding-top: 3px; text-align: right; }
@media (max-width: 767.98px) {
  .value-row--option > .field__control { grid-column: 1 / -1; }
  .value-row--option > .value-row__actions { grid-column: 2; justify-self: end; }
  .searchbox { min-width: 0; }
}
@media (max-width: 639.98px) { .form-grid { grid-template-columns: 1fr; } }
/* ---------- ui/menu (+ ui/filter_menu) ---------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__item .icon { width: var(--icon-sm); height: var(--icon-sm); color: var(--fg-muted); }
.menu__item:hover { background: var(--bg-hover); color: var(--fg-primary); }
.menu__sep { height: 1px; background: var(--border-subtle); margin: var(--space-1) 0; }
.menu__form { margin: 0; padding: 0; }
.locale-switch { display: flex; justify-content: center; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--fs-caption); color: var(--fg-muted); }
.locale-switch__option { background: none; border: 0; padding: 0; font: inherit; color: var(--fg-link); cursor: pointer; }
.locale-switch__option:hover { color: var(--fg-link-hover); }
.locale-switch__option[aria-current="true"] { color: var(--fg-muted); cursor: default; }
.menu__header { display: flex; flex-direction: column; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-1); }
.menu__header strong { font-size: var(--fs-small); }
.menu__hint { padding: var(--space-1) var(--space-3) var(--space-2); font-size: var(--fs-caption); color: var(--fg-muted); margin: 0;
  max-width: 240px; white-space: normal; }
.menu__header small { color: var(--fg-muted); }
.menu__panel > .filter-editor__body { border-top: 0; margin-top: 0; }
.menu__group-label { padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--fs-caption); color: var(--fg-muted); font-weight: var(--fw-semibold); }
.menu__panel--views { width: min(20rem, calc(100vw - 2 * var(--space-4))); }
.menu__panel--views .field { padding: var(--space-2) var(--space-3) 0; }
.menu__panel--views .filter-editor__actions { padding-inline: var(--space-3); }
.menu__panel--views .menu__item[aria-current="true"] { color: var(--fg-primary); font-weight: var(--fw-medium); }
.menu__panel--views .menu__item .caption { margin-inline-start: auto; white-space: nowrap; flex-shrink: 0; }
.menu__panel--views .menu__item-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__check { visibility: hidden; color: var(--bg-action); }
.menu__item[aria-current="true"] .menu__check { visibility: visible; color: var(--bg-action); }
.menu__form > summary.menu__item { list-style: none; cursor: pointer; }
.menu__form > summary.menu__item::-webkit-details-marker { display: none; }
.menu__summary-label { display: inline-block; min-width: 0; max-width: min(16rem, calc(100vw - 9rem)); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom; }
@media (max-width: 767.98px) { .menu__panel--views { left: 0; } }
.menu__panel--columns { width: max-content; max-width: min(26rem, calc(100vw - 2 * var(--space-4))); }
.menu__panel--columns .value-rows { padding-inline: var(--space-3); }
.menu__panel--columns .value-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.menu__panel--columns .value-row label { overflow-wrap: anywhere; }
.menu__panel--columns .menu__scroll { max-height: max(12rem, calc(100vh - 25rem)); border-block-end: 1px solid var(--border-subtle); overflow-y: auto;
  overscroll-behavior: contain; }
.menu__panel--columns .filter-editor__actions { padding-inline: var(--space-3); }
.menu__panel { position: absolute; right: 0; top: calc(100% + var(--space-1)); min-width: 200px; background: var(--bg-surface);
  padding: var(--space-1); z-index: var(--z-dropdown); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); }
.menu__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); color: var(--fg-body);
  font-size: var(--fs-small); width: 100%; background: none; border: 0; cursor: pointer; text-align: left; border-radius: var(--radius-sm); }
.menu__item--danger, .menu__item--danger .icon { color: var(--status-overdue-text); }
@media (max-width: 767.98px) { .menu__panel--start { right: auto; left: 0; } }
/* ---------- ui/status ---------- */
.chip__remove { display: inline-flex; cursor: pointer; color: var(--fg-muted); background: none; border: 0; padding: 0; }
.chip__remove:hover { color: var(--fg-primary); }
.chip__remove .icon { width: 13px; height: 13px; }
.chip--readonly { opacity: 0.6; cursor: not-allowed; }
.chip--readonly input { pointer-events: none; }
.chip--toggle { cursor: pointer; user-select: none;
  transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.chip--toggle:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.chip--toggle[aria-pressed="false"] { opacity: 0.42; color: var(--fg-muted); background: var(--bg-surface); border-style: dashed; }
.chip--toggle[aria-disabled="true"] { cursor: not-allowed; opacity: 0.62; background: var(--bg-subtle); }
.chip--toggle[aria-disabled="true"]:hover { background: var(--bg-subtle); border-color: var(--border-subtle); }
.covbar__seg { width: var(--seg, 0%); }
.chip--filter strong { font-weight: var(--fw-semibold); }
.glyph { width: 14px; height: 14px; flex: none; fill: none; stroke: none; }
.glyph--met { color: var(--status-met); }
.glyph--review { color: var(--status-review); }
.glyph--open { color: var(--status-open); }
.glyph--overdue { color: var(--status-overdue); }
.status { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-small); color: var(--fg-body); white-space: nowrap;
  font-weight: var(--fw-regular); line-height: var(--lh-snug); letter-spacing: normal; }
.status--emphasis { color: var(--status-overdue-text); font-weight: var(--fw-medium); }
.glyph--submitted { color: var(--status-submitted); }
.glyph--withdrawn { color: var(--status-withdrawn); }
.rel-badge { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--fg-body); font-size: var(--fs-small); font-weight: var(--fw-regular); line-height: var(--lh-snug); white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 1px var(--space-2); border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--border-subtle); color: var(--fg-body); font-size: var(--fs-caption); font-weight: var(--fw-medium);
  white-space: nowrap; }
.chip--filter { font-weight: var(--fw-medium); background: transparent; color: var(--fg-body); border-color: var(--border-control); }
.chip--warning { background: transparent; color: var(--fg-body); border-color: var(--status-review); }
.chip--toggle:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.chip[style*="--chip-color"]::before { content: ""; flex: none; width: var(--space-2); height: var(--space-2); border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--chip-color) 22%, var(--fg-muted)); }
.progress { display: flex; flex-direction: column; gap: var(--space-3); }
.progress__bar { display: flex; gap: 2px; height: 8px; border-radius: var(--radius-pill); overflow: hidden; background: var(--border-subtle); }
.progress__bar > span { width: var(--seg, 0%); transition: opacity var(--dur-fast) var(--ease-out); }
.seg--met { background: var(--status-met); }
.seg--review { background: var(--status-review); }
.seg--open { background: var(--seg-open); }
.seg--overdue { background: var(--status-overdue); }
.progress__legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); list-style: none; padding: 0; font-size: var(--fs-small); color: var(--fg-body); }
.progress__legend li { display: flex; align-items: center; gap: var(--space-2); }
.covbar { display: flex; border-radius: var(--radius-pill); overflow: hidden; min-width: 120px; height: 8px; gap: 2px; background: var(--border-subtle); }
.covbar__seg--ok { background: var(--status-met); }
.covbar__seg--await { background: var(--status-review); }
.covbar__seg--rework { background: var(--status-overdue); }
.covbar__seg--todo { background: var(--seg-open); }
.cov { display: flex; align-items: center; gap: var(--space-3); white-space: nowrap; }
.src-tag { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-caption); color: var(--fg-muted); white-space: nowrap;
  vertical-align: baseline; }
.src-tag .icon { width: var(--icon-sm); height: var(--icon-sm); }
.progress__bar > span[style*="--n"] { width: auto; flex: var(--n) 1 0%; }
a:hover > .status { color: var(--fg-primary); text-decoration: underline; text-underline-offset: 3px; }
.tag { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0; border: 0; border-radius: 0; background: transparent;
  font-size: var(--fs-small); font-weight: var(--fw-regular); line-height: var(--lh-snug); white-space: nowrap; color: var(--fg-body); }
.tag .icon { width: 14px; height: 14px; color: var(--fg-muted); }
.chip[style*="--chip-color"] { background: transparent; color: var(--fg-body); display: inline-flex; align-items: center; gap: var(--space-2);
  border-color: var(--border-subtle); }
.progress__legend b { color: var(--fg-primary); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.progress--inline { flex: 1 1 220px; max-width: 360px; }
.progress--inline .progress__bar { height: 6px; }
.progress__bar--mini { flex: none; width: 44px; height: 4px; gap: 1px; }
.glyph--draft { color: var(--status-draft); }
.seg--rest { background: transparent; }
@media print { .progress__bar > span, .glyph { print-color-adjust: exact; -webkit-print-color-adjust: exact; } }
/* ---------- ui/table (+ ui/row_actions) ---------- */
.toolbar__search { flex: 1 1 260px; }
.table-wrap:has(details.menu[open]) { overflow: visible; }
.table td.table__actions:has(details.menu[open]) { z-index: var(--z-dropdown); }
.table thead th a { color: inherit; display: inline-flex; align-items: center; gap: var(--space-1); }
.table thead th a:hover { color: var(--fg-body); }
.table thead th a .icon { width: 13px; height: 13px; opacity: .7; }
.table tbody tr { transition: background var(--dur-fast) var(--ease-out); position: relative; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:target:hover, .table--zebra tbody tr:nth-child(even):target:hover { background: var(--bg-muted); }
.table__rowlink::after { content: ""; position: absolute; inset: 0; cursor: pointer; }
.table__rowlink:focus-visible { border-radius: var(--radius-sm); outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.table td .menu, .table td .icon-btn, .table td .btn, .table td .chip[href], .table td a:not(.table__rowlink) { position: relative; z-index: 1; }
.table__actions { text-align: right; width: 1%; white-space: nowrap; }
.table td.table__actions { position: relative; z-index: 1; text-align: right; }
.table th.table__num, .table td.table__num { text-align: right; }
.table__nowrap { white-space: nowrap; }
.evidence-link { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 11rem; vertical-align: top; }
.evidence-link .icon { flex: none; }
.evidence-link__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.evidence-reason { margin: 0 0 var(--space-1); max-width: 16rem; font-size: var(--fs-caption); color: var(--fg-muted); line-height: var(--lh-snug);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.pagination { display: flex; align-items: center; gap: var(--space-1); }
.pagination a:hover { background: var(--bg-hover); }
.toolbar > .filterbar { flex: 1; }
.table td.workload-name { position: relative; --tree-rail: var(--border-rail); }
.table tr.wl-row--platform > td { background: var(--bg-muted); }
.table tr.wl-row--platform:hover > td { background: var(--bg-brand-soft); }
.table td .workload-name__mark { display: inline-block; width: var(--icon-sm); height: var(--icon-sm); color: var(--fg-link); vertical-align: -3px;
  margin-right: var(--space-2); }
.wl-row--platform .table__rowlink { font-weight: var(--fw-semibold); }
.workload-name__kind { margin-left: var(--space-2); font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-link); }
.table tr.wl-row--d1 > td.workload-name--d1 { padding-left: calc(var(--space-4) + var(--space-6) + var(--space-3)); }
.table td.workload-name--d1::before { content: ""; position: absolute; left: calc(var(--space-4) + var(--icon-sm) / 2 - 1px); width: 2px;
  background: var(--tree-rail); top: 0; bottom: 0; }
.table tr.wl-row--d1:not(:has(+ tr.wl-row--d1)) td.workload-name--d1::before { bottom: auto; height: 22px; }
.table td.workload-name--d1::after { content: ""; position: absolute; top: 12px; height: 10px; left: calc(var(--space-4) + var(--icon-sm) / 2 - 1px);
  width: var(--space-4); border: 0 solid var(--tree-rail); border-width: 0 0 2px 2px; border-bottom-left-radius: 6px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-small);
  font-weight: var(--fw-medium); min-width: 30px; min-height: 30px; border-radius: var(--radius-md); color: var(--fg-body); }
.pagination a[aria-current="page"] { background: var(--bg-selected); color: var(--fg-primary); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; }
.table-wrap { overflow-x: auto; background: transparent; border: 0; border-radius: 0; background-image: none; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th { text-align: left; vertical-align: middle; padding: 0 var(--space-3) 0 0; border-bottom: 1px solid var(--border-subtle); }
.table th:first-child, .table td:first-child { padding-left: var(--space-2); }
.table thead th { background: transparent; height: 32px; font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-muted);
  border-bottom: 1px solid var(--border-subtle); white-space: nowrap; padding-block: 0; }
.table thead th[aria-sort] a { color: var(--fg-primary); }
.table td { text-align: left; vertical-align: middle; padding: 0 var(--space-3) 0 0; border-bottom: 1px solid var(--border-subtle); height: 48px; color: var(--fg-body); }
.table tbody tr:last-child td { border-bottom: 1px solid var(--border-subtle); }
.table__rowlink { color: var(--fg-primary); font-weight: var(--fw-medium); font-size: var(--fs-body); }
.table__rowlink:hover { color: var(--fg-primary); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.table--zebra tbody tr:nth-child(even) { background: transparent; }
.table--zebra tbody tr:nth-child(even):hover { background: var(--bg-hover); }
.table tbody tr:target, .table--zebra tbody tr:nth-child(even):target { background: var(--bg-muted); }
.table .t-code { color: var(--fg-muted); font-weight: var(--fw-medium); white-space: nowrap; }
.table .t-sub { display: block; font-size: var(--fs-caption); color: var(--fg-muted); margin-top: 2px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) 0; font-size: var(--fs-small); color: var(--fg-muted); }
@media (max-width: 767.98px) { .toolbar { padding-bottom: var(--space-1); } }
.table .t-title { color: var(--fg-primary); font-weight: var(--fw-medium); font-size: var(--fs-body); }
.table .item__unread { display: inline-block; vertical-align: middle; margin: 0 var(--space-2) 0 0; flex: none; }
.table td .cluster .chip { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.table__num { text-align: right; font-variant-numeric: tabular-nums; }
td.table__num, th.table__num { font-variant-numeric: tabular-nums; }
.table td.table__actions .cluster { flex-wrap: nowrap; justify-content: flex-end; }
.list-more { margin: var(--space-3) 0 0; font-size: var(--fs-small); }
.table--roles { table-layout: fixed; }
.table--roles th:nth-child(1) { width: 14rem; }
.table--roles th:nth-child(3) { width: 6rem; }
.table--roles th:nth-child(4) { width: 20rem; }
.table-wrap:has(> .perm-matrix) { overflow-x: auto; max-width: 100%; }
.toolbar--wrap { align-items: flex-end; gap: var(--space-3); padding: var(--space-4) 0 var(--space-2); }
.toolbar--wrap .field { flex: 1 1 14rem; max-width: 24rem; min-width: 0; }
.table tr:has(.cell-lines > :nth-child(2)) > td { vertical-align: top; padding-block: var(--space-2); }
.table .cell-lines__sub { display: none; }
@media (max-width: 1023.98px) { .table .hide-md { display: none; } }
@media (max-width: 767.98px) {
  .table thead { display: none; }
  .table tbody { display: block; width: 100%; }
  .table td::before { content: attr(data-label); font-size: var(--fs-caption); color: var(--fg-muted); font-weight: var(--fw-semibold); }
  .table td.workload-name { display: block; }
  .table { display: block; width: 100%; }
  .table .hide-sm { display: none; }
  .table-wrap { overflow: visible; }
  .table tr { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; margin: 0;
    padding: var(--space-3) var(--space-2); position: relative; }
  .table th, .table tbody tr:last-child td { border-bottom: 0; }
  .table td { width: 100%; border: 0; display: flex; gap: var(--space-4); border-bottom: 0; height: auto; padding: var(--space-1) 0;
    justify-content: flex-start; align-items: baseline; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
  .table td:first-child { padding-left: 0; }
  .table td[data-label]::before { flex: 0 0 40%; }
  .table td:not([data-label])::before { display: none; }
  .table td.table__actions { justify-content: flex-end; }
  .table td[data-label] { flex-wrap: nowrap; }
  .table td[data-label] > * { min-width: 0; }
  .table td[data-label] .status { white-space: normal; }
  .table td:has(> .table__rowlink), .table td[data-card="title"] { display: block; }
  .table td:has(> .table__rowlink)::before, .table td[data-card="title"]::before { margin-right: var(--space-2); }
  .table td.table__actions:has(> details.menu:only-child) { position: absolute; top: var(--space-3); right: 0; padding: 0; }
  .table tr:has(> td.table__actions > details.menu:only-child) > :is(td:has(> .table__rowlink), td[data-card="title"]) { padding-right: var(--space-8); }
  .table td.table__num[data-label] { justify-content: space-between; text-align: left; }
  .table--roles { table-layout: auto; }
  .table--roles th:nth-child(1) { width: auto; }
  .toolbar--wrap .field { flex-basis: 100%; max-width: none; }
  .table .cell-lines__sub { display: block; }
  .table td:has(> .cell-lines) { flex-direction: column; align-items: stretch; gap: var(--space-1); }
  .table td[data-label]:has(> .cell-lines)::before { flex: none; }
}
@media (min-width: 768px) { .table .cell-lines > span { white-space: nowrap; } }
/* ---------- ui/form_footer (+ ui/confirm_footer) ---------- */
.form-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); }
/* The commit bar of a long form (ADR-0077 D5): sticky-commit.js sets the hook
   to "on" once the form is longer than 1.5 viewports; shorter forms keep the
   footer in flow. */
.form-footer[data-sticky-commit="on"] { position: sticky; bottom: 0; z-index: var(--z-sticky); padding-bottom: var(--space-4); background: var(--bg-app); }
/* ---------- ui/section (+ ui/disclosure) ---------- */
.stat__label .icon { width: var(--icon-sm); height: var(--icon-sm); }
.card__header > .filterbar { flex: 1; }
.card:has(> .card__body.doc) > .card__header { scroll-margin-block-start: var(--space-8); }
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--fs-body); color: var(--fg-body); }
.summary b, .summary strong { color: var(--fg-primary); font-weight: var(--fw-medium); }
.summary__sep { width: 3px; height: 3px; border-radius: var(--radius-pill); background: var(--border-strong); }
.stat { display: flex; flex-direction: column; flex: 1 1 200px; background: var(--bg-app); border: 0; border-radius: 0;
  padding: var(--space-4) var(--space-5); gap: 2px; }
.stat__label { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--fw-regular); color: var(--fg-muted); font-size: var(--fs-small); }
.stat__sub { font-size: var(--fs-caption); color: var(--fg-muted); }
.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: var(--space-3); border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle); }
.stat-strip__item { display: flex; padding: var(--space-3) var(--space-4); border: 0; border-radius: 0; background: transparent; flex-direction: column; gap: 2px; }
.stat-strip__item + .stat-strip__item { border-left: 1px solid var(--border-subtle); }
.stat-strip__num--ok { display: inline-flex; align-items: center; gap: var(--space-2); --glyph-shape: var(--shape-met); }
.stat-strip__num--warn, .stat-strip__num--info { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--fg-primary);
  --glyph-shape: var(--shape-review); }
.stat-strip__num--danger { display: inline-flex; align-items: center; gap: var(--space-2); --glyph-shape: var(--shape-overdue); }
.stat-strip__num--ok::before { content: ""; width: 14px; height: 14px; -webkit-mask: var(--glyph-shape) center / contain no-repeat;
  mask: var(--glyph-shape) center / contain no-repeat; background: var(--status-met); }
.stat-strip__num--warn::before, .stat-strip__num--info::before { content: ""; width: 14px; height: 14px;
  -webkit-mask: var(--glyph-shape) center / contain no-repeat; mask: var(--glyph-shape) center / contain no-repeat; background: var(--status-review); }
.stat-strip__num--danger::before { content: ""; width: 14px; height: 14px; -webkit-mask: var(--glyph-shape) center / contain no-repeat;
  mask: var(--glyph-shape) center / contain no-repeat; background: var(--status-overdue); }
.stat-strip__label { color: var(--fg-muted); font-size: var(--fs-small); }
.stat-strip--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
a.stat-strip__item--link { color: inherit; text-decoration: none; transition: background-color var(--dur-fast) var(--ease-out); }
a.stat-strip__item--link:hover { background: var(--bg-hover); }
a.stat-strip__item--link:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
@media (max-width: 767.98px) {
  .stat-strip--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip--4 > .stat-strip__item:nth-child(3) { border-left: 0; }
  .stat-strip--4 > .stat-strip__item:nth-child(n + 3) { border-top: 1px solid var(--border-subtle); }
}
/* ---------- Home (issue 579): setup checklist, Your work, side-panel feed ---------- */
.home-setup { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.home-setup__step { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  min-height: 40px; padding: var(--space-1) 0; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-body); color: var(--fg-muted); }
.home-setup__step > .status { grid-column: 1; }
.home-setup__label { grid-column: 2; min-width: 0; }
.home-setup__step--done { color: var(--fg-body); }
.home-setup__step--now { color: var(--fg-primary); font-weight: var(--fw-medium); }
.home-group + .home-group { margin-top: var(--space-6); }
.home-group__head { display: flex; align-items: baseline; gap: var(--space-2); margin: 0 0 var(--space-1); font-size: var(--fs-small);
  font-weight: var(--fw-semibold); color: var(--fg-primary); }
.home-group__more { display: inline-block; margin-top: var(--space-2); font-size: var(--fs-small); }
.home-tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.home-task { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.home-task__body { min-width: 0; }
.home-task__title { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--fg-primary); overflow-wrap: anywhere; }
.home-task__sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 2px 0 0;
  font-size: var(--fs-small); color: var(--fg-muted); }
.home-feed { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.home-feed__item { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-small); color: var(--fg-body); }
.home-feed__date { font-size: var(--fs-caption); color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.home-feed__text { min-width: 0; overflow-wrap: anywhere; }
.home-feed__text strong { color: var(--fg-primary); font-weight: var(--fw-medium); }
.card { background: transparent; border: 0; border-top: 1px solid var(--border-subtle); border-radius: 0; }
.card__header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) 0 var(--space-2); border-bottom: 0;
  background: transparent; gap: var(--space-3); }
.card__header h2, .card__header h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); letter-spacing: 0; }
.card__body { padding: var(--space-2) 0 var(--space-4); }
.card__footer { padding: var(--space-4) 0 0; border-top: 1px solid var(--border-subtle); background: transparent; border-radius: 0; }
.card .card { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.card .card > .card__header { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.card .card > .card__body { padding: var(--space-4); }
.card .card > .card__footer { padding: var(--space-3) var(--space-4); }
.group { border-top: 1px solid var(--border-subtle); }
.group__head { display: flex; align-items: center; gap: var(--space-2); height: 36px; padding: 0 var(--space-2); font-size: var(--fs-small);
  font-weight: var(--fw-semibold); color: var(--fg-primary); background: var(--bg-sidebar); border-bottom: 1px solid var(--border-subtle); }
.group__head .icon { width: 14px; height: 14px; color: var(--fg-muted); }
.group__head .n { color: var(--fg-muted); font-weight: var(--fw-medium); }
.section { margin-top: var(--space-8); }
.section__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.section__head h2 { font-size: var(--fs-body); font-weight: var(--fw-semibold); letter-spacing: 0; }
.section__head .meta { font-size: var(--fs-small); color: var(--fg-muted); }
.section__head .tools { margin-left: auto; display: flex; gap: var(--space-1); }
.group__head .group__action { margin-left: auto; }
.group__head .status { font-weight: var(--fw-regular); }
.group__body { padding: var(--space-3) var(--space-2) var(--space-4); }
.section--list { margin-top: var(--space-8); }
.section--list .section__head h2 { font-size: var(--fs-body); }
.section--list .section__head .meta { margin-left: var(--space-2); }
.card > .section__head { flex-wrap: wrap; margin: 0; padding: var(--space-3) 0 var(--space-2); }
.section__head > p { flex-basis: 100%; margin: 0; font-size: var(--fs-small); color: var(--fg-muted); }
.section__head--split { justify-content: space-between; }
.card .card > .section__head { margin: 0; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.stat__value { color: var(--fg-primary); line-height: var(--lh-tight); font-size: var(--fs-stat); font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight); font-variant-numeric: tabular-nums; }
.stat-strip__num { font-weight: var(--fw-semibold); line-height: 1; font-size: var(--fs-h2); color: var(--fg-primary); font-variant-numeric: tabular-nums; }
.group__chev { width: 12px; height: 12px; flex: none; transition: transform var(--dur-fast) var(--ease-out); }
.group:not([open]) > .group__head .group__chev { transform: rotate(-90deg); }
.group__code { min-width: 40px; font-family: var(--font-mono); font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted); }
.group__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group__fw { color: var(--fg-muted); font-weight: var(--fw-medium); }
.group__count { font-size: var(--fs-caption); font-weight: var(--fw-regular); color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.how { margin-top: var(--space-3); font-size: var(--fs-caption); color: var(--fg-muted); }
.how summary { display: inline-flex; align-items: center; gap: var(--space-1); cursor: pointer; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary:hover { color: var(--fg-body); }
.how summary:focus-visible { border-radius: var(--radius-sm); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.how summary .icon { width: 12px; height: 12px; transition: transform var(--dur-fast) var(--ease-out); }
.how[open] summary .icon { transform: rotate(90deg); }
.how p { max-width: 72ch; margin: var(--space-2) 0 0; line-height: var(--lh-normal); }
.section--list .section__head { flex-wrap: wrap; }
.card__body > .impact:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 767.98px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-strip__item:nth-child(odd) { border-left: 0; }
  .card__footer.split { flex-wrap: wrap; row-gap: var(--space-1); }
  .summary { flex-wrap: wrap; column-gap: var(--space-3); }
  .summary__sep { display: none; }
  [data-detail-kind="access-member"] .section__head { flex-wrap: wrap; }
  [data-detail-kind="access-member"] .section__head h2 { white-space: nowrap; }
  [data-detail-kind="access-member"] .section__head .meta { flex-basis: 100%; order: 3; }
}
/* ---------- ui/page_header ---------- */
.page-header { gap: var(--space-4); align-items: flex-start; }
.page-header__title { display: flex; flex-direction: column; gap: var(--space-1); }
.page-header > .cluster { flex-shrink: 0; }
.page-header__title h1 { display: flex; align-items: center; gap: var(--space-3); letter-spacing: var(--ls-tight); }
.page-header__count { font-weight: var(--fw-regular); color: var(--fg-muted); font-size: var(--fs-h2); }
.chain { list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.chain + .chain { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border-subtle); }
.chain__step { position: relative; padding: 0 0 var(--space-4) var(--space-6); }
.chain__step::before { content: ""; position: absolute; left: var(--space-1); top: var(--space-2); width: var(--space-2); height: var(--space-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--bg-surface); }
.chain__step::after { content: ""; position: absolute; left: calc(var(--space-2) - 0.5px); top: var(--space-4); bottom: 0; border-left: 1px solid var(--border-subtle); }
.chain__step:last-child { padding-bottom: 0; }
.chain__step:last-child::after { display: none; }
.chain__kind { display: block; font-size: var(--fs-caption); color: var(--fg-muted); }
.chain__code { color: var(--fg-muted); font-weight: var(--fw-medium); }
.chain__note { margin: var(--space-1) 0 0; font-size: var(--fs-caption); color: var(--fg-muted); }
.chain__workloads { list-style: none; margin: var(--space-1) 0 0; padding: 0; }
.chain__workload { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); padding: var(--space-2) 0;
  border-top: 1px solid var(--border-subtle); }
.chain__workload:first-child { border-top: 0; padding-top: 0; }
.chain__atoms { font-size: var(--fs-caption); color: var(--fg-muted); }
.chain__workload .caption--link { margin-left: auto; }
@media (max-width: 767.98px) {
  .page-header { flex-wrap: wrap; }
  .page-header > .cluster { flex-shrink: 1; flex-wrap: wrap; }
}
@media (max-width: 639.98px) {
  .summary--plain .summary__sep { display: none; }
  .page-header > .cluster > :has(+ .menu:last-child) { margin-right: calc(var(--icon-btn) + var(--space-3)); }
  .page-header > .cluster > .menu:last-child:not(:first-child) { margin-left: calc(-1 * (var(--icon-btn) + var(--space-3))); }
}
/* ---------- ui/empty ---------- */
.empty-state p { max-width: 42ch; }
.skeleton--row { margin-bottom: var(--space-2); }
.error-state { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-5); background: var(--bg-sidebar);
  border: 1px solid var(--status-overdue-border); color: var(--fg-primary); border-radius: var(--radius-md); }
.error-state .icon { flex: none; margin-top: 2px; color: var(--status-overdue); }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); color: var(--fg-muted);
  padding: var(--space-16) var(--space-6); }
.empty-state__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--border-subtle); color: var(--fg-muted); }
.empty-state__icon .icon { width: 20px; height: 20px; }
.empty-state__title { color: var(--fg-primary); font-size: var(--fs-h2); font-weight: var(--fw-semibold); }
.empty-state--filter-required .empty-state__icon { background: transparent; color: var(--fg-muted); }
.skeleton { border-radius: var(--radius-md); height: 1em; animation: shimmer 1.4s var(--ease-in-out) infinite;
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-selected) 37%, var(--bg-hover) 63%); background-size: 400% 100%; }
.empty-state .contact-card { align-self: stretch; width: 100%; max-width: 42ch; margin-inline: auto; text-align: start; }
.dash-empty { margin: 0; padding: var(--space-6) var(--space-2); border-top: 1px solid var(--border-subtle); font-size: var(--fs-small); color: var(--fg-muted); }
/* ---------- ui/modal ---------- */
.dialog { border: 0; padding: 0; max-width: 480px; width: calc(100% - var(--space-8)); margin: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.dialog[open]:not(:modal) { position: static; margin: 0; }
.dialog__body { padding: var(--space-6); }
.dialog__title { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.dialog__actions { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-6); }
.dialog--form { max-width: 720px; }
.dialog--form .dialog__body { padding: var(--space-5) var(--space-6); max-height: calc(100vh - 14rem); overflow-y: auto; }
.confirm { max-width: 480px; margin-inline: auto; }
.slidepanel { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw; background: var(--bg-surface);
  border-left: 1px solid var(--border-default); display: flex; flex-direction: column; z-index: var(--z-dialog); transform: translateX(100%);
  transition: transform var(--dur-base) var(--ease-out); visibility: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.slidepanel:target, .slidepanel[aria-hidden="false"] { transform: translateX(0); visibility: visible; }
.slidepanel[aria-hidden="true"] { transform: translateX(100%); visibility: hidden; }
.slidepanel__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle); }
.slidepanel__brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.slidepanel__brand--stacked { flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.slidepanel__footer-spacer { flex: 1; }
.slidepanel__title { margin: 0; font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--fg-primary); line-height: 1.3; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slidepanel__body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-5); }
.slidepanel__footer { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle); }
.modal { position: fixed; inset: 0; z-index: var(--z-dialog); display: flex; align-items: center; justify-content: center; padding: var(--space-6);
  background: var(--scrim-strong); backdrop-filter: blur(2px); visibility: hidden; opacity: 0; transition: opacity var(--dur-base) var(--ease-out); }
.modal:target, .modal.is-open { visibility: visible; opacity: 1; }
.modal__panel { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - var(--space-8)); background: var(--bg-surface);
  display: flex; flex-direction: column; transform: translateY(8px); transition: transform var(--dur-base) var(--ease-out);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal__panel--wide { max-width: 640px; }
.modal:target .modal__panel, .modal.is-open .modal__panel { transform: none; }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle); }
.modal__brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.modal__title { margin: 0; font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--fg-primary); line-height: 1.3; overflow: hidden;
  text-overflow: ellipsis; }
.modal__body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-5); }
.modal__footer { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-subtle); background: var(--bg-subtle);
  border-bottom-left-radius: var(--radius-xl); border-bottom-right-radius: var(--radius-xl); }
.slidepanel__chip, .modal__chip { font-size: var(--fs-caption); padding: var(--space-1) var(--space-2); border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--border-subtle); color: var(--fg-muted); font-weight: var(--fw-medium); }
.dialog .card, .modal__panel .card, .slidepanel .card { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.dialog .card > .card__header, .slidepanel .card > .card__header { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.dialog .card > .card__body, .slidepanel .card > .card__body { padding: var(--space-4); }
.dialog .card > .card__footer, .slidepanel .card > .card__footer { padding: var(--space-3) var(--space-4); }
.dialog::backdrop { background: var(--scrim); backdrop-filter: none; }
.modal__backdrop { position: absolute; inset: 0; cursor: default; background: var(--scrim); }
.confirm__icon { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-md); background: transparent;
  border: 1px solid var(--border-subtle); color: var(--status-overdue); width: 40px; height: 40px; }
.dialog .card > .section__head, .slidepanel .card > .section__head { margin: 0; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.slidepanel .card[data-peek-kind] { border: 0; border-radius: 0; background: transparent; }
.slidepanel .card[data-peek-kind] > .section__head { padding: 0 0 var(--space-2); border-bottom: 0; }
.slidepanel .card[data-peek-kind] > .card__body { padding: var(--space-2) 0 0; }
.confirm .sidebar__brand { justify-content: flex-start; min-height: 0; padding: 0; }
.confirm .sidebar__brand span { display: inline-flex; }
.confirm .sidebar__mark { display: inline-flex; flex: none; }
@media (max-width: 767.98px) {
  .slidepanel { width: 100vw; }
  .modal { padding: var(--space-4); }
  .modal__panel { max-height: calc(100vh - var(--space-6)); }
}
/* ---------- ui/sheet (issue 573, ADR-0077 D2) ---------- */
.sheet { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: var(--layout-sheet-w); max-width: 100vw; height: 100dvh;
  max-height: 100dvh; border: 0; border-left: 1px solid var(--border-default); background: var(--bg-surface); color: var(--fg-primary);
  box-shadow: var(--shadow-lg); transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out); }
.sheet[open]:not(:modal) { position: static; width: 100%; max-width: var(--layout-sheet-w); height: auto; max-height: none;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: none; }
.sheet::backdrop { background: var(--scrim); }
@starting-style { .sheet[open]:modal { transform: translateX(var(--space-6)); opacity: 0; } }
.sheet__form, .sheet__panel { display: flex; flex-direction: column; height: 100%; }
.sheet__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-subtle); }
.sheet__title { margin: 0; font-size: var(--fs-h3); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.sheet__body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-5); }
.sheet__footer { position: sticky; bottom: 0; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border-subtle); background: var(--bg-surface); }
@media (max-width: 767.98px) {
  .sheet { width: 100vw; border-left: 0; }
}
/* ---------- ui/palette + ui/keymap (issue 581, ADR-0077 D3) ----------
   The command palette: a centred dialog in the upper third, a borderless
   input over hairline-separated groups, the active option on the selection
   tint, keycap hints in a quiet footer. */
.cmdk { width: var(--layout-palette-w); max-width: calc(100vw - var(--space-8)); margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--fg-primary);
  box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk[open]:not(:modal) { position: static; margin: 0; max-width: 100%; }
.cmdk::backdrop { background: var(--scrim); }
.cmdk__bar { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-subtle); }
.cmdk__bar > .icon { flex: none; color: var(--fg-muted); }
.cmdk__input { flex: 1; min-width: 0; padding: var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-primary);
  font: inherit; font-size: var(--fs-body); outline: none; }
.cmdk__input::placeholder { color: var(--fg-muted); }
/* The styleguide palette shows the ring the live input carries while open. */
.cmdk[open]:not(:modal) .cmdk__input[data-focused] { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.cmdk__list { max-height: min(60vh, calc(100dvh - 12vh - var(--space-16))); overflow-y: auto; padding-block: var(--space-1); }
.cmdk__group { padding: var(--space-2); }
.cmdk__group + .cmdk__group, .cmdk__group[hidden] + .cmdk__group { border-top: 1px solid var(--border-subtle); }
.cmdk__heading { padding: var(--space-1) var(--space-2); font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted); }
.cmdk__item { display: flex; align-items: center; gap: var(--space-3); min-height: var(--icon-btn); padding: var(--space-2);
  border-radius: var(--radius-md); color: var(--fg-primary); font-size: var(--fs-small); text-decoration: none; cursor: pointer; }
.cmdk__item:hover { color: var(--fg-primary); text-decoration: none; }
.cmdk__item[aria-selected="true"] { background: var(--bg-selected); }
.cmdk__item > .icon { flex: none; width: var(--icon-sm); height: var(--icon-sm); color: var(--fg-muted); }
.cmdk__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk__meta { flex: none; min-width: 0; max-width: 45%; margin-inline-start: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--fg-muted); font-size: var(--fs-caption); }
.cmdk__keys { display: inline-flex; gap: var(--space-1); margin-inline-start: auto; }
.cmdk__meta + .cmdk__keys { margin-inline-start: var(--space-2); }
.cmdk__group--all { padding-block: var(--space-1); }
.cmdk__empty { margin: 0; padding: var(--space-4); color: var(--fg-muted); font-size: var(--fs-small); }
.cmdk__foot { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border-subtle); background: var(--bg-sidebar); color: var(--fg-muted); font-size: var(--fs-caption); }
.cmdk__hint { display: inline-flex; align-items: center; gap: var(--space-1); }
.keymap { max-width: var(--layout-sheet-w); }
.keymap__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.keymap__group + .keymap__group { margin-top: var(--space-2); }
.keymap__heading { margin: 0 0 var(--space-2); font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted); }
.keymap__list { margin: 0; }
.keymap__row { display: flex; align-items: center; gap: var(--space-4); padding-block: var(--space-2); border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-small); }
.keymap__row dt { display: inline-flex; gap: var(--space-1); min-width: var(--space-16); }
.keymap__row dd { margin: 0; color: var(--fg-body); }
@media (max-width: 639.98px) {
  .cmdk { margin-top: var(--space-4); }
  .cmdk__foot { display: none; }
}
/* ---------- ui/filter_bar ---------- */
.filter-bar__label { font-size: var(--fs-caption); color: var(--fg-muted); margin-right: var(--space-2); }
.filter-chip__remove { all: unset; cursor: pointer; padding: 2px; border-radius: var(--radius-pill); display: inline-flex; }
.filter-chip__remove:hover { background: var(--bg-hover); }
.filter-chip__remove .icon { width: 12px; height: 12px; }
.filterbar__spacer { flex: 1; }
.filter-add summary { list-style: none; }
.filter-add summary::-webkit-details-marker { display: none; }
.filter-editor { border-radius: var(--radius-sm); }
.filter-editor > summary { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); font-size: var(--fs-small); color: var(--fg-body); cursor: pointer; list-style: none; }
.filter-editor > summary::-webkit-details-marker { display: none; }
.filter-editor > summary .icon { width: var(--icon-sm); height: var(--icon-sm); color: var(--fg-muted); }
.filter-editor > summary:hover { background: var(--bg-hover); }
.filter-editor__body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3);
  border-top: 1px solid var(--border-subtle); margin-top: var(--space-1); }
.filter-editor__title { font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--fg-muted); }
.filter-editor__actions { display: flex; justify-content: flex-end; gap: var(--space-2); padding-top: var(--space-1); }
.tab .icon { width: var(--icon-sm); height: var(--icon-sm); }
.filter-chip { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-caption); border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--border-control); color: var(--fg-body); padding: 2px var(--space-2) 2px var(--space-3);
  font-weight: var(--fw-medium); }
.tab { display: inline-flex; align-items: center; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: var(--fs-small);
  white-space: nowrap; padding: 0; height: 36px; font-weight: var(--fw-medium); color: var(--fg-body); gap: var(--space-2); }
.tab:hover { color: var(--fg-primary); }
.tab[aria-selected="true"], .tab[aria-current="page"], .tab[aria-current="true"] { color: var(--fg-primary); border-bottom-color: var(--fg-primary);
  font-weight: var(--fw-medium); }
.tab .n { color: var(--fg-muted); font-weight: var(--fw-medium); }
.tabs { display: flex; overflow-x: auto; overflow-y: hidden; gap: var(--space-5); border-bottom: 1px solid var(--border-subtle); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; padding: var(--space-3) 0; gap: var(--space-2); }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.filter-editor[open] > summary { color: var(--fg-primary); font-weight: var(--fw-semibold); background: var(--bg-hover); }
.filterbar > * { min-width: 0; }
.filterbar .searchbox { max-width: 100%; }
@media (max-width: 767.98px) {
  .tabs { gap: var(--space-4); overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
    background: linear-gradient(to right, var(--bg-app) 30%, transparent) left center / var(--space-6) 100% no-repeat local, linear-gradient(to left, var(--bg-app) 30%, transparent) right center / var(--space-6) 100% no-repeat local, linear-gradient(to right, color-mix(in srgb, var(--fg-primary) 14%, transparent), transparent) left center / var(--space-3) 100% no-repeat scroll, linear-gradient(to left, color-mix(in srgb, var(--fg-primary) 14%, transparent), transparent) right center / var(--space-3) 100% no-repeat scroll;
  }
}
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-5); }
.dash-filters__meta { margin-left: auto; font-size: var(--fs-small); color: var(--fg-muted); }
.fsel { position: relative; display: inline-flex; align-items: center; min-width: 0; height: 30px; border: 1px solid var(--border-control);
  border-radius: var(--radius-md); background: var(--bg-surface); box-shadow: var(--shadow-xs); font-size: var(--fs-small);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.fsel:hover { background: var(--bg-hover); }
.fsel:focus-within { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.fsel label { padding-left: var(--space-3); color: var(--fg-muted); white-space: nowrap; }
.fsel select { appearance: none; -webkit-appearance: none; min-width: 0; height: 28px; padding: 0 var(--space-6) 0 var(--space-2); border: 0;
  background: transparent; color: var(--fg-primary); font: inherit; font-weight: var(--fw-medium); cursor: pointer; outline: none;
  text-overflow: ellipsis; }
.fsel > .icon { position: absolute; right: var(--space-2); width: 12px; height: 12px; color: var(--fg-muted); pointer-events: none; }
.fsel.is-set { border-color: var(--border-brand); background: var(--bg-brand-soft); }
.fsel.is-set label { color: var(--fg-brand); }
.dash-tabs { margin-top: var(--space-5); overflow-x: auto; }
.dash-tabs .tab { white-space: nowrap; }
.letter-jump { display: flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-2) 0; border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle); }
.letter-jump a { min-width: var(--space-8); text-align: center; padding: var(--space-1) var(--space-2); border-radius: var(--radius-md);
  font-size: var(--fs-small); font-weight: var(--fw-medium); text-decoration: none; }
.letter-jump a:hover { background: var(--bg-hover); }
.letter-jump span { min-width: var(--space-8); text-align: center; padding: var(--space-1) var(--space-2); border-radius: var(--radius-md);
  font-size: var(--fs-small); font-weight: var(--fw-medium); text-decoration: none; color: var(--border-strong); }
@media (max-width: 767.98px) {
  .tab { flex: none; scroll-snap-align: start; white-space: nowrap; }
  .dash-filters__meta { margin-left: 0; width: 100%; }
  .dash-filters .fsel { flex: 1 1 calc(50% - var(--space-2)); }
  .fsel select { flex: 1; }
}
/* ---------- ui/banner (issue 573, ADR-0077 D6): one persistent message per page ---------- */
.banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-size: var(--fs-small);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-sidebar); color: var(--fg-primary); }
.banner > .icon { flex: none; }
.banner--info > .icon { color: var(--fg-link); }
.banner__text { flex: 1 1 auto; min-width: 0; margin: 0; }
.banner--warning { border-color: var(--status-review-border); }
.banner--warning > .icon { color: var(--status-review); }
.banner--danger { border-color: var(--status-overdue-border); }
.banner--danger > .icon { color: var(--status-overdue); }
/* ---------- ui/toast (issue 573, ADR-0077 D6): bottom-left confirmations ---------- */
.toast-region { position: fixed; left: var(--space-5); bottom: var(--space-5); z-index: var(--z-toast); display: flex; flex-direction: column;
  gap: var(--space-2); width: max-content; max-width: min(var(--layout-toast-w), calc(100vw - var(--space-8))); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; max-width: var(--layout-toast-w); gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--fg-primary);
  font-size: var(--fs-small); box-shadow: var(--shadow-md);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
@starting-style { .toast { opacity: 0; transform: translateY(var(--space-2)); } }
.toast.is-leaving { opacity: 0; transform: translateY(var(--space-2)); }
.toast > .icon { flex: none; color: var(--status-met); }
.toast__message { flex: 1 1 auto; min-width: 0; margin: 0; }
.toast__undo { flex: none; }
.toast__action { padding: var(--space-1) var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-link);
  font-weight: var(--fw-semibold); cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.toast__action:hover { background: var(--bg-hover); }
.toast__dismiss { flex: none; }
@media (max-width: 767.98px) {
  .toast-region { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); width: auto; max-width: none; }
}
/* ---------- Banners: flash and callout ---------- */
.ai-suggestion { display: flex; flex-direction: column; gap: var(--space-3); }
.flash { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-size: var(--fs-small);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-sidebar); color: var(--fg-primary); }
.callout { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); background: var(--bg-sidebar); color: var(--fg-primary); }
.flash .icon { flex: none; color: var(--fg-muted); }
.callout .icon { flex: 0 0 auto; width: var(--icon-md); height: var(--icon-md); margin-top: 2px; color: var(--fg-muted); }
.flash--success, .flash--warning, .flash--info, .callout--info, .callout--warning { color: var(--fg-primary); background: var(--bg-sidebar);
  border-color: var(--border-subtle); }
.flash--danger, .callout--danger { color: var(--fg-primary); background: var(--bg-sidebar); border-color: var(--status-overdue-border); }
.flash--success .icon { color: var(--status-met); }
.callout--danger .icon, .flash--danger .icon { color: var(--status-overdue); }
.callout--warning .icon, .flash--warning .icon { color: var(--status-review); }
.callout--info .icon, .flash--info .icon { color: var(--fg-link); }
.ai-suggestion .callout { background: var(--bg-sidebar); border-color: var(--border-subtle); }
.next-step { display: flex; align-items: flex-start; flex-wrap: wrap; gap: var(--space-3) var(--space-6); padding: var(--space-3) 0;
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.next-step__main { flex: 1 1 24ch; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.next-step__lead { margin: 0; font-weight: var(--fw-semibold); color: var(--fg-primary); }
.next-step__facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4);
  font-size: var(--fs-small); color: var(--fg-muted); }
.next-step__fact { display: inline-flex; align-items: center; gap: var(--space-2); }
.next-step__fact > .icon { flex: none; }
.next-step__action { flex: none; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.callout-gap { margin-top: var(--space-5); }
/* ---------- Shell ---------- */
.skip-link { position: absolute; left: var(--space-3); top: -100%; z-index: var(--z-toast); background: var(--bg-surface); color: var(--fg-link);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.skip-link:focus { top: var(--space-3); }
.shell { display: grid; grid-template-columns: var(--layout-sidebar-w) 1fr; min-height: 100vh; }
.shell__main { display: flex; flex-direction: column; min-width: 0; }
.sidebar__group-toggle::-webkit-details-marker { display: none; }
.sidebar__group-body[open] > .sidebar__group-toggle .icon { transform: rotate(90deg); }
.sidebar__footer .icon { color: var(--fg-muted); }
.sidebar__footer small { display: block; color: var(--fg-muted); }
.topbar__spacer { flex: 1; }
.elevated-context-bar__icon { flex: none; }
.elevated-context-bar__text { flex: 1 1 auto; min-width: 0; }
.elevated-context-bar__action { flex: none; }
.js-on .js\:hidden { display: none !important; }
.shell__sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: var(--z-nav);
  background: var(--bg-sidebar); border-right: 1px solid var(--border-subtle); }
.shell__content { width: 100%; max-width: var(--layout-content-max); margin-inline: auto; padding: var(--space-7) var(--layout-gutter) var(--space-16); }
.sidebar__brand { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  min-height: var(--layout-topbar-h); font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--fg-primary); letter-spacing: 0; }
.sidebar__mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: var(--radius-md); background: var(--bg-brand); color: var(--fg-on-brand); font-size: 11px; font-weight: var(--fw-bold); }
.sidebar__nav { display: flex; flex-direction: column; flex: 1; overflow-y: auto; gap: 1px; padding: var(--space-1) var(--space-3); }
.sidebar__section { padding: var(--space-4) var(--space-2) var(--space-2); font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted); }
.sidebar__link { display: flex; align-items: center; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); min-height: 30px; padding: 0 var(--space-2);
  gap: var(--space-3); border-radius: var(--radius-md); font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-body); }
.sidebar__link .icon { width: var(--icon-sm); height: var(--icon-sm); color: var(--fg-muted); }
.sidebar__link:hover { background: var(--bg-hover); color: var(--fg-primary); }
.sidebar__link:hover .icon { color: var(--fg-body); }
.sidebar__link[aria-current="page"] { background: var(--bg-selected); color: var(--fg-primary); font-weight: var(--fw-medium); }
.sidebar__link[aria-current="page"] .icon { color: var(--fg-primary); }
.sidebar__count { margin-left: auto; font-size: var(--fs-caption); background: transparent; border-radius: 0; padding: 0; min-width: 0;
  font-weight: var(--fw-medium); color: var(--fg-muted); text-align: right; }
.sidebar__group { position: relative; display: flex; flex-direction: column; gap: 1px; }
.sidebar__group-body { display: flex; flex-direction: column; gap: 1px; }
.sidebar__group > .sidebar__link { padding-right: var(--space-8); }
.sidebar__group-toggle { position: absolute; top: 0; right: 0; display: flex; align-items: center; justify-content: center; list-style: none;
  cursor: pointer; border-radius: var(--radius-md); color: var(--fg-muted); width: 30px; height: 30px; }
.sidebar__group-toggle .icon { transition: transform var(--dur-fast) var(--ease-out); width: var(--icon-sm); height: var(--icon-sm); }
.sidebar__group-toggle:hover { background: var(--bg-hover); color: var(--fg-primary); }
.sidebar__link--nested { padding-left: calc(var(--space-2) + var(--icon-sm) + var(--space-3)); }
.sidebar__group-rail { display: none; }
.sidebar__link--back { font-weight: var(--fw-medium); margin-bottom: var(--space-1); border-bottom: 1px solid var(--border-subtle); border-radius: 0; }
.sidebar__link--foot { margin-top: auto; border-top: 1px solid var(--border-subtle); border-radius: 0; }
.sidebar__footer { display: flex; align-items: center; gap: var(--space-3); color: var(--fg-body); font-size: var(--fs-small); margin: 0;
  padding: var(--space-3) var(--space-4); border: 0; border-top: 1px solid var(--border-subtle); border-radius: 0; background: transparent; }
.topbar { display: flex; align-items: center; gap: var(--space-4); height: var(--layout-topbar-h); padding-inline: var(--layout-gutter);
  position: sticky; top: 0; z-index: var(--z-sticky); background: color-mix(in srgb, var(--bg-app) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border-subtle); }
.breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-small); color: var(--fg-body); }
.breadcrumb a { color: var(--fg-body); }
.breadcrumb a:hover { color: var(--fg-primary); }
.breadcrumb .icon { width: var(--icon-sm); height: var(--icon-sm); color: var(--border-strong); }
.breadcrumb [aria-current="page"] { color: var(--fg-primary); font-weight: var(--fw-medium); }
.topbar > .breadcrumb { min-width: 0; overflow: hidden; }
.breadcrumb__list { display: flex; align-items: center; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; list-style: none; }
.breadcrumb__item { display: flex; align-items: center; gap: var(--space-2); min-width: 0; white-space: nowrap; }
.breadcrumb__item > a { display: inline-flex; align-items: center; gap: var(--space-1); }
.breadcrumb__item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb__back { display: none; }
.topbar__search-link { display: none; }
.elevated-context-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-6); font-family: var(--font-ui); font-size: var(--fs-small); background: var(--bg-sidebar);
  color: var(--fg-primary); border-bottom: 1px solid var(--border-subtle); }
.elevated-context-bar--admin { background: var(--bg-sidebar); color: var(--fg-primary); border-bottom-color: var(--status-overdue-border); }
.elevated-context-bar .icon { color: var(--status-review); }
.elevated-context-bar--admin .icon { color: var(--status-overdue); }
.shell__content:has(.row[data-st="overdue"]:hover) .progress__bar > span:not(.seg--overdue),
.shell__content:has(.row[data-st="review"]:hover) .progress__bar > span:not(.seg--review),
.shell__content:has(.row[data-st="open"]:hover) .progress__bar > span:not(.seg--open),
.shell__content:has(.row[data-st="met"]:hover) .progress__bar > span:not(.seg--met) { opacity: 0.25; }
.shell__scrim { display: none; }
.breadcrumb--page { margin-bottom: var(--space-3); flex-wrap: wrap; }
.breadcrumb--page [aria-current="page"] { color: var(--fg-muted); font-weight: var(--fw-regular); }
@media (max-width: 1023.98px) {
  .shell { grid-template-columns: var(--layout-sidebar-w-collapsed) 1fr; }
  .sidebar__link span, .sidebar__footer > :not(.icon), .sidebar__brand span { display: none; }
  .sidebar__brand { justify-content: center; }
  .sidebar__section { display: none; }
  .sidebar__link { justify-content: center; }
  .sidebar__count, .sidebar__group-body { display: none; }
  .sidebar__group > .sidebar__link { padding-right: var(--space-2); }
  .sidebar__group-rail { display: flex; flex-direction: column; gap: 1px; border-block: 1px solid var(--border-default); margin-block: var(--space-1);
    padding-block: var(--space-1); }
  .sidebar__footer { justify-content: center; }
}
@media (max-width: 767.98px) {
  .shell { grid-template-columns: 1fr; }
  .shell__sidebar.is-open .sidebar__link span, .shell__sidebar.is-open .sidebar__count, .shell__sidebar.is-open .sidebar__section,
  .shell__sidebar.is-open .sidebar__brand span, .shell__sidebar.is-open .sidebar__footer > :not(.icon) { display: revert; }
  .shell__sidebar.is-open .sidebar__link { justify-content: flex-start; padding-inline: var(--space-3); }
  .shell__sidebar.is-open .sidebar__brand { justify-content: flex-start; padding-inline: var(--space-5); }
  .sidebar__group-rail { display: none; }
  .shell__sidebar.is-open .sidebar__group-body { display: flex; }
  .shell__sidebar.is-open .sidebar__group > .sidebar__link { padding-right: var(--space-8); }
  .shell__sidebar.is-open .sidebar__link--nested { padding-left: calc(var(--space-3) + var(--icon-sm) + var(--space-3)); }
  .topbar { gap: var(--space-2); }
  .topbar__spacer { display: none; }
  .topbar .searchbox { flex: 1 1 0; min-width: 0; }
  .shell__sidebar { position: fixed; left: -100%; width: var(--layout-sidebar-w); box-shadow: var(--shadow-lg); visibility: hidden;
    z-index: var(--z-dialog); transition: left var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base); }
  .shell__sidebar.is-open { left: 0; box-shadow: var(--shadow-md); visibility: visible; transition-delay: 0s; }
  .shell__sidebar.is-open + .shell__scrim { display: block; position: fixed; inset: 0; z-index: var(--z-overlay); background: var(--scrim); }
  .shell__content { padding: var(--space-5) var(--space-4) var(--space-12); }
}
@media (max-width: 639.98px) {
  .elevated-context-bar__action { flex-basis: 100%; }
  .breadcrumb__item, .breadcrumb__sep { display: none; }
  .breadcrumb__item--back { display: flex; }
  .breadcrumb__back { display: inline-block; flex-shrink: 0; }
  .topbar > .breadcrumb { flex: 1 1 auto; }
  .breadcrumb__item--back > a { min-width: 0; overflow: hidden; }
  .breadcrumb__item--back > a > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar .searchbox { display: none; }
  .topbar__search-link { display: inline-flex; margin-inline-start: auto; }
}
@media print {
  .shell__sidebar, .topbar { display: none; }
  .shell { display: block; }
}
/* ---------- Rich text and reading ---------- */
.reading-row { --reading-row-measure: 68ch; border-bottom: 1px solid var(--border-subtle); }
.reading-row:last-child { border-bottom: 0; }
.reading-row__summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: var(--space-3);
  flex-wrap: wrap; padding-block: var(--space-3); padding-inline: calc(var(--space-4) + var(--depth, 0) * var(--space-6)) var(--space-4); }
.reading-row__summary::-webkit-details-marker { display: none; }
.reading-row__summary:hover { background: var(--bg-hover); }
.reading-row__summary:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.reading-row__chevron { color: var(--fg-muted); flex-shrink: 0; transition: transform var(--dur-fast) var(--ease-out); }
.reading-row[open] > .reading-row__summary .reading-row__chevron { transform: rotate(90deg); }
.reading-row__title { min-width: 0; color: var(--fg-primary); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.reading-row--withdrawn .reading-row__title { color: var(--fg-muted); }
.reading-row__body { padding-block: 0 var(--space-4);
  padding-inline: calc(var(--space-4) + var(--icon-sm) + var(--space-3) + var(--depth, 0) * var(--space-6)) var(--space-4); }
.reading-row__body p { max-inline-size: var(--reading-row-measure); font-size: var(--fs-body); line-height: var(--lh-loose); color: var(--fg-body); }
.reading-row__body p + p { margin-top: var(--space-3); }
.reading-row__body .prose { max-inline-size: var(--reading-row-measure); }
.reading-row__note { font-size: var(--fs-small); color: var(--fg-muted); }
.prose { color: var(--fg-body); font-size: var(--fs-body); line-height: var(--lh-loose); }
.prose > * + * { margin-block-start: var(--space-3); }
.prose p { margin: 0; }
.prose strong { font-weight: var(--fw-semibold); color: var(--fg-primary); }
.prose em { font-style: italic; }
.prose li + li, .prose li > ul, .prose li > ol { margin-block-start: var(--space-1); }
.prose ul { margin: 0; padding-inline-start: var(--prose-list-indent); list-style: disc; }
.prose ul ul { list-style: circle; }
.prose ol { margin: 0; padding-inline-start: var(--prose-list-indent); list-style: decimal; }
.prose a { text-decoration: underline; }
.prose a:hover { color: var(--fg-link-hover); }
.prose blockquote { margin: 0; padding-inline-start: var(--space-4); border-inline-start: 1px solid var(--prose-quote-border); color: var(--fg-muted); }
.compare-pane__text.prose { font-family: var(--font-ui); font-size: var(--fs-body); line-height: var(--lh-loose); white-space: normal; }
.richtext__surface.prose { outline: none; }
.richtext__sep { inline-size: 1px; block-size: var(--space-5); background: var(--border-default); }
.richtext__surface { padding: var(--space-4); min-block-size: 18rem; }
.richtext--compact .richtext__surface { min-block-size: 9rem; }
.reqtext { --reqtext-measure: 64ch; margin-top: var(--space-1); }
.reqtext__summary { list-style: none; cursor: pointer; width: fit-content; display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-link); }
.reqtext__summary::-webkit-details-marker { display: none; }
.reqtext__summary:hover { color: var(--fg-link-hover); }
.reqtext__summary .icon { transition: transform var(--dur-fast) var(--ease-out); }
.reqtext[open] > .reqtext__summary .icon { transform: rotate(90deg); }
.reqtext__body { margin-top: var(--space-2); padding: var(--space-3); background: var(--bg-subtle);
  border-inline-start: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.reqtext__body p { max-inline-size: var(--reqtext-measure); font-size: var(--fs-small); line-height: var(--lh-loose); color: var(--fg-body); }
.reqtext__body p + p { margin-top: var(--space-3); }
.reqtext__body .prose { max-inline-size: var(--reqtext-measure); font-size: var(--fs-small); }
.compare-grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr 1fr; align-items: start; }
.compare-pane { display: flex; flex-direction: column; gap: var(--space-3); background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: var(--space-4); min-width: 0; }
.compare-pane > form, form.compare-pane { background: var(--bg-surface); }
.compare-pane__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.compare-pane__text { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: var(--fs-small); line-height: var(--lh-tight); }
.diff { table-layout: fixed; }
.diff td, .diff th { vertical-align: top; }
.diff__text { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-small); line-height: var(--lh-tight); }
.diff tr[data-diff-kind="add"] td:nth-child(3), .diff tr[data-diff-kind="add"] td:nth-child(4) { background: var(--bg-insert); }
.diff tr[data-diff-kind="delete"] td:nth-child(1), .diff tr[data-diff-kind="delete"] td:nth-child(2) { background: var(--status-overdue-bg); }
.diff tr[data-diff-kind="change"] td { background: var(--status-review-bg); }
.diff tr[data-diff-kind="equal"] td { color: var(--fg-muted); }
.trackchanges ins { background: var(--bg-insert); color: var(--status-met-text); text-decoration: none; border-radius: 2px; padding: 0 2px; }
.trackchanges del { background: var(--status-overdue-bg); color: var(--status-overdue-text); text-decoration: line-through; border-radius: 2px; padding: 0 2px; }
.trackchanges__legend { display: inline-flex; gap: var(--space-3); align-items: center; }
.doc { --doc-measure: 68ch; }
.doc__group + .doc__group { margin-block-start: var(--space-8); }
.doc__heading { display: flex; align-items: baseline; gap: var(--space-3); padding-block-end: var(--space-2);
  border-block-end: 1px solid var(--border-default); scroll-margin-block-start: var(--space-8); }
.doc__heading-title { margin: 0; font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--fg-primary); letter-spacing: var(--ls-snug); }
.doc__heading--sub { border-block-end: 0; padding-block-end: 0; margin-block-start: var(--space-5); }
.doc__heading--sub .doc__heading-title { font-size: var(--fs-h4); }
.doc__req { display: grid; grid-template-columns: minmax(0, 1fr) 152px; column-gap: var(--space-6); padding-block: var(--space-4);
  border-block-end: 1px solid var(--border-subtle); scroll-margin-block-start: var(--space-8); }
.doc__req-title { margin: var(--space-1) 0 var(--space-2); font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.doc__req-text { margin: 0; max-inline-size: var(--doc-measure); font-size: var(--fs-body); line-height: var(--lh-loose); color: var(--fg-body); }
.doc__req-meta { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding-block-start: var(--space-1); }
.doc__req--indent { padding-inline-start: var(--space-6); }
.doc-toc { display: flex; flex-direction: column; gap: 2px; }
.doc-toc__link { display: flex; gap: var(--space-2); align-items: baseline; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm);
  color: var(--fg-body); font-size: var(--fs-small); text-decoration: none; }
.doc-toc__link:hover { background: var(--bg-hover); color: var(--fg-link); }
.doc-toc__link[aria-current="true"] .doc-toc__num { color: var(--fg-brand); }
.doc-toc__link--sub { padding-inline-start: var(--space-5); }
.doc-toc__link--sub .doc-toc__num { min-inline-size: 46px; }
.commentthread-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-5); }
.commentthread { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.commentthread__summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-lg); }
.commentthread__summary::-webkit-details-marker { display: none; }
.commentthread__summary:hover { background: var(--bg-hover); }
.commentthread__summary:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.commentthread__summary .icon { color: var(--fg-muted); }
details[open] > .commentthread__summary { border-bottom: 1px solid var(--border-subtle); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.commentthread__chevron { margin-inline-start: auto; }
details[open] > .commentthread__summary .commentthread__chevron { transform: rotate(180deg); }
.commentthread__comment { display: grid; grid-template-columns: auto 1fr; column-gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.commentthread__comment--deleted { grid-template-columns: 1fr; }
.commentthread__reply { margin-inline-start: var(--space-10); padding-inline-start: var(--space-4); border-inline-start: 1px solid var(--border-subtle); }
.commentthread__reply .avatar { width: var(--icon-lg); height: var(--icon-lg); }
.commentthread__main { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.commentthread__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-small); }
.commentthread__author { color: var(--fg-primary); font-weight: var(--fw-semibold); }
.commentthread__time, .commentthread__hint { font-size: var(--fs-caption); color: var(--fg-muted); }
.commentthread__menu { margin-inline-start: auto; }
.commentthread__body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: var(--fs-small); color: var(--fg-body); line-height: var(--lh-normal); }
.commentthread--resolved .commentthread__body { color: var(--fg-muted); }
.commentthread__deleted { margin: 0; font-size: var(--fs-small); color: var(--fg-muted); font-style: italic; }
.commentthread__reactions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; }
button.commentthread__reaction { cursor: pointer; }
button.commentthread__reaction:hover { background: var(--bg-hover); border-color: var(--border-strong); }
button.commentthread__reaction:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.commentthread__reaction[aria-pressed="true"] { background: var(--bg-brand-soft); border-color: var(--border-brand); color: var(--fg-brand); }
span.commentthread__reaction { background: var(--bg-subtle); }
.commentthread__addreaction .menu__panel { right: auto; left: 0; }
.commentthread__actions { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-subtle); }
.commentthread__replybox { flex: 1; min-width: 0; }
.commentthread__replybox > summary { list-style: none; display: inline-flex; }
.commentthread__replybox > summary::-webkit-details-marker { display: none; }
.commentthread__replyform { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-3); }
.mention-suggest__option { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); cursor: pointer; }
.mention-suggest__option:hover { background: var(--bg-hover); }
.mention-suggest__option[aria-selected="true"] { background: var(--bg-brand-soft); }
.mention-suggest__text { display: flex; flex-direction: column; min-width: 0; }
.mention-suggest__name { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-primary); }
.mention-suggest__email { font-size: var(--fs-caption); color: var(--fg-muted); }
.citation-list { display: flex; flex-direction: column; gap: var(--space-4); }
.citation__quote { margin: 0; padding-inline-start: var(--space-4); border-inline-start: 1px solid var(--prose-quote-border); color: var(--fg-body);
  font-size: var(--fs-body); font-style: italic; }
.citation__source-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.citation__source { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.citation__source .icon { flex: none; color: var(--fg-muted); }
.citation__source-title { font-weight: var(--fw-medium); color: var(--fg-primary); }
.richtext { border: 1px solid var(--border-default); background: var(--bg-surface); overflow: hidden; border-color: var(--border-control);
  border-radius: var(--radius-md); }
.richtext:focus-within { border-color: var(--border-control); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.richtext__toolbar { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2);
  border-block-end: 1px solid var(--border-subtle); flex-wrap: wrap; background: var(--bg-sidebar); }
.richtext__toolbar .icon-btn[aria-pressed="true"] { background: var(--bg-selected); color: var(--fg-primary); }
.doc-toc__link[aria-current="true"] { background: var(--bg-brand-soft); font-weight: var(--fw-medium); color: var(--fg-primary); }
.doc-toc__link.is-active { color: var(--fg-primary); }
.citation { border: 1px solid var(--border-subtle); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2);
  border-radius: var(--radius-lg); background: transparent; }
.quote { margin: 0 0 var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); overflow: hidden; }
.quote blockquote { margin: 0; padding: var(--space-3) var(--space-4); font-size: var(--fs-body); color: var(--fg-primary); }
.quote mark { background: var(--status-review-bg); color: inherit; border-radius: 2px; padding: 0; }
.quote code { font-family: var(--font-mono); font-size: var(--fs-small); }
.prose code { border: 1px solid var(--prose-code-border); border-radius: var(--radius-sm); padding: 0 var(--space-1); font-family: var(--font-mono);
  font-size: var(--fs-small); background: var(--bg-hover); border-color: var(--border-subtle); }
.mention-suggest { list-style: none; margin: var(--space-2) 0 0; padding: var(--space-1); background: var(--bg-surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); border: 1px solid var(--border-subtle); }
.commentthread__reaction { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2);
  font-size: var(--fs-caption); transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  background: transparent; border: 1px solid var(--border-subtle); color: var(--fg-muted); font-weight: var(--fw-medium);
  border-radius: var(--radius-md); }
.commentthread--resolved { background: var(--bg-subtle); opacity: 0.8; }
:is(.prose, .quote, .field__help, .caption, .chip, .tag, pre, .callout) code { font-family: var(--font-mono); font-size: .9em; font-weight: var(--fw-regular); }
.reading-row__label { flex-shrink: 0; font-size: var(--fs-caption); color: var(--fg-muted); border: 1px solid var(--border-subtle);
  padding: 2px var(--space-2); white-space: nowrap; background: transparent; border-radius: var(--radius-sm); font-family: var(--font-ui);
  font-variant-numeric: tabular-nums; }
.doc__heading-num { color: var(--fg-brand); font-size: var(--fs-small); font-weight: var(--fw-semibold); white-space: nowrap;
  font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.doc__req-num { font-size: var(--fs-caption); color: var(--fg-muted); font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.doc-toc__num { font-size: var(--fs-caption); color: var(--fg-muted); white-space: nowrap; min-inline-size: 64px; font-family: var(--font-ui);
  font-variant-numeric: tabular-nums; }
.reqbody { max-width: 66ch; color: var(--fg-body); line-height: var(--lh-loose); white-space: pre-line; }
.reqbody.prose { white-space: normal; }
.reqbody.is-clamped { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.diff-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.diff-inline del { color: var(--fg-muted); }
.diff-inline ins { text-decoration: none; font-weight: var(--fw-medium); color: var(--fg-primary); }
.prose .term-link { color: inherit; text-decoration: underline dotted; text-decoration-color: var(--fg-muted); text-decoration-thickness: 1px;
  text-underline-offset: 0.2em; }
.prose .term-link:hover { color: var(--fg-link-hover); text-decoration-color: var(--fg-link-hover); }
@media (max-width: 1023.98px) { .compare-grid { grid-template-columns: 1fr; } }
/* ---------- Search ---------- */
.search-result:focus-visible { border-color: var(--border-brand); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.search-result__title { grid-column: 2; grid-row: 1; font-size: var(--fs-body); font-weight: var(--fw-semibold); color: var(--fg-primary);
  line-height: var(--lh-snug); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.search-result__snippet { grid-column: 2; grid-row: 2; font-size: var(--fs-small); color: var(--fg-muted); line-height: var(--lh-snug);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }
.search-result__chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); font-size: var(--fs-caption);
  line-height: var(--lh-snug); flex: none; grid-column: 1; grid-row: 1; border-radius: var(--radius-md); background: transparent;
  border: 1px solid var(--border-subtle); color: var(--fg-muted); font-weight: var(--fw-medium); }
.search-result__snippet mark { font-weight: var(--fw-medium); background: var(--status-review-bg); color: inherit; border-radius: 2px; padding: 0; }
.search-result { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: var(--space-2) var(--space-3);
  color: var(--fg-primary); text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); background: transparent; border: 0;
  border-bottom: 1px solid var(--border-subtle); border-radius: 0; padding: var(--space-3) var(--space-2); }
.search-result + .search-result { margin-block-start: 0; }
.search-result:hover { background: var(--bg-hover); border-color: var(--border-subtle); }
.search-result--faq .search-result__chip { background: transparent; color: var(--fg-muted); }
/* ---------- Evidence and proofs ---------- */
.capture-form .capture-risk { display: none; border: 0; margin: 0; padding: 0; min-width: 0; }
.capture-form .capture-evidence { border: 0; margin: 0; padding: 0; min-width: 0; }
.capture-form .capture-evidence > legend { width: 100%; padding: var(--space-4) 0 var(--space-3); border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.restriction-form .control-new, .restriction-form:has(input[name="control_mode"][value="new"]:checked) .control-existing { display: none; }
.restriction-form:has(input[name="control_mode"][value="new"]:checked) .control-new { display: block; }
.add-source-form .kind-fields { display: none; }
.add-source-form:has(input[name="kind"][value="confluence_page"]:checked) .kind-fields[data-kind="confluence_page"],
.add-source-form:has(input[name="kind"][value="github_repo"]:checked) .kind-fields[data-kind="github_repo"],
.add-source-form:has(input[name="kind"][value="url"]:checked) .kind-fields[data-kind="url"],
.add-source-form:has(input[name="kind"][value="upload"]:checked) .kind-fields[data-kind="upload"] { display: block; }
.cloud-connection-form .auth-help { display: none; }
.cloud-connection-form:has(select[name="auth_method"] option[value="service_account_key"]:checked) .auth-help[data-auth="service_account_key"],
.cloud-connection-form:has(select[name="auth_method"] option[value="workload_identity"]:checked) .auth-help[data-auth="workload_identity"] { display: block; }
.evidence-group { display: flex; flex-direction: column; gap: var(--space-2); }
.evidence-group__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.evidence-group__title { margin: 0; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.evidence-rows { display: flex; flex-direction: column; gap: var(--space-2); }
.evidence-row__icon .icon { width: 16px; height: 16px; }
.evidence-row__delete { color: var(--fg-muted); }
.evidence-row__delete:hover { color: var(--status-overdue-text); background: var(--bg-hover); }
.evidence-row .field__control { min-width: 0; }
.evidence-row.has-error { border-color: var(--status-overdue); }
.evidence-row__filename { font-size: var(--fs-small); color: var(--fg-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.evidence-row__trailing { display: inline-flex; align-items: center; gap: var(--space-2); justify-self: end; }
.evidence-row--upload:hover { border-color: var(--border-brand); background: var(--bg-surface); }
.evidence-row__upload-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.evidence-row__upload-label strong { font-size: var(--fs-small); color: var(--fg-primary); }
.evidence-row__upload-hint { font-size: var(--fs-caption); color: var(--fg-muted); }
.evidence-row__upload-input { display: none; }
.evidence-row { display: grid; align-items: center; gap: var(--space-3); grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  padding: var(--space-2) var(--space-3); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); border-color: var(--border-subtle);
  background: transparent; }
@media (max-width: 767.98px) { .evidence-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon main del" "icon sub sub"; } }
.evidence-row:focus-within { border-color: var(--border-control); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.evidence-row__icon { width: 32px; height: 32px; border-radius: var(--radius-md); color: var(--fg-muted); display: inline-flex; align-items: center;
  justify-content: center; flex: none; background: var(--bg-hover); }
.evidence-row--upload { grid-template-columns: auto minmax(0, 1fr) auto; cursor: pointer; border-style: dashed; background: transparent; }
.capture-form:has(.capture-assessment option[value="risk_accepted"]:checked) .capture-risk { display: flex; flex-direction: column;
  gap: var(--space-4); background: transparent; border: 1px solid var(--border-control); }
.capture-form .capture-risk > legend { width: 100%; padding: var(--space-4) 0 var(--space-3); border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.proof-rev { border: 0; border-top: 1px solid var(--border-subtle); border-radius: 0; background: transparent; padding: var(--space-4) 0 0; }
.decide { position: sticky; bottom: 0; display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-8); padding: var(--space-3) 0;
  background: var(--bg-app); border-top: 1px solid var(--border-subtle); }
.decide__note { margin-left: auto; font-size: var(--fs-caption); color: var(--fg-muted); }
@media (max-width: 767.98px) { .decide { position: static; flex-wrap: wrap; } }
.proofs-summary { margin-top: var(--space-5); gap: var(--space-4); }
.proofs-toolbar { margin-top: var(--space-4); }
.proofs-filter { gap: var(--space-2); }
.proofs-hint { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-1); }
.proofs-back { display: none; margin-bottom: var(--space-3); }
.proofs-context { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.proofs-title { margin: var(--space-2) 0 0; font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.3; font-weight: var(--fw-semibold); text-wrap: balance; }
.proofs-title a { color: inherit; }
.proofs-status { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); font-size: var(--fs-small); color: var(--fg-body); }
.proofs-actions { margin-top: var(--space-5); }
.proofs-form { margin-top: var(--space-5); gap: var(--space-4); }
.decide--form { flex-wrap: wrap; margin-top: var(--space-4); padding: var(--space-3) 0 var(--space-1); z-index: 1; }
.decide--form .decide__note { order: -1; flex: 1 1 100%; margin: 0; }
.decide__end { margin-left: auto; gap: var(--space-2); }
.review-part { border-block-start: 1px solid var(--border-subtle); padding: var(--space-4) 0 0; margin-top: var(--space-4); }
.review-part h4 { margin: 0; }
@media (max-width: 1023.98px) {
  .proofs-back { display: inline-flex; }
  .proofs-hint { display: none; }
}
@media (max-width: 767.98px) {
  .evidence-row > .evidence-row__icon { grid-area: icon; }
  .evidence-row > .evidence-row__delete { grid-area: del; }
  .evidence-row > .evidence-row__url, .evidence-row > .evidence-row__filename, .evidence-row > .evidence-row__upload-label { grid-area: main; }
  .evidence-row > .evidence-row__label { grid-area: sub; }
  .decide__note { margin-left: 0; width: 100%; }
}
@media print { .decide { display: none; } }
/* ---------- Timeline and activity ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.timeline__item { display: grid; grid-template-columns: var(--space-5) 1fr; gap: var(--space-3); position: relative; }
.timeline__title { font-weight: var(--fw-semibold); }
.timeline__meta { font-size: var(--fs-caption); color: var(--fg-muted); }
.timeline__item:not(:last-child)::before { content: ""; position: absolute; left: calc(var(--space-3) - 1px); top: var(--space-5);
  bottom: calc(-1 * var(--space-4)); width: 1px; background: var(--border-subtle); }
.timeline__dot { border-radius: 50%; margin-top: var(--space-1); justify-self: center; width: 10px; height: 10px; background: transparent;
  border: 1.5px solid var(--border-strong); box-shadow: 0 0 0 3px var(--bg-app); }
.timeline__dot[data-kind="success"] { background: var(--status-met); border-color: var(--status-met); }
.timeline__dot[data-kind="warning"] { background: var(--status-review); border-color: var(--status-review); }
.timeline__dot[data-kind="info"] { background: var(--bg-action); border-color: var(--bg-action); }
.timeline__dot[data-kind="neutral"] { background: var(--bg-app); border-color: var(--border-strong); }
.timeline__comment { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); border-left: 1px solid var(--border-default);
  background: transparent; border-radius: var(--radius-sm); color: var(--fg-body); font-style: normal; }
.threads { margin: 0; padding: 0; list-style: none; }
.threads > li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: start; gap: var(--space-3); padding: var(--space-3) 0;
  font-size: var(--fs-small); color: var(--fg-body); }
.threads > li + li { border-top: 1px solid var(--border-subtle); }
.threads .qlegend__swatch { margin-top: var(--space-1); }
.threads b { color: var(--fg-primary); font-weight: var(--fw-medium); }
.threads__body { min-width: 0; }
.threads__text { margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
.threads__text .status { margin-left: var(--space-2); font-size: var(--fs-caption); }
.threads__time { font-size: var(--fs-caption); color: var(--fg-muted); white-space: nowrap; }
@media (max-width: 767.98px) {
  .threads > li { grid-template-columns: 10px minmax(0, 1fr); }
  .threads__time { grid-column: 2; }
}
/* ---------- Lifecycle and stages ---------- */
.steps { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }
.steps__item { display: flex; align-items: center; gap: var(--space-2); color: var(--fg-muted); font-size: var(--fs-small); }
.steps__num { width: 24px; height: 24px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-default); font-size: var(--fs-caption); }
.steps__item a { color: inherit; text-decoration: none; }
.steps__item--skipped .steps__num { border-style: dashed; }
.gate-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--space-2); list-style: none; padding: 0; margin: 0; }
.gate-chain__stage:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
a.gate-chain__stage:hover { background: var(--bg-hover); }
.gate-chain__icon { flex: none; color: var(--fg-muted); }
.gate-chain__label { font-weight: var(--fw-semibold); color: var(--fg-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gate-chain__status { color: var(--fg-muted); font-size: var(--fs-caption); white-space: nowrap; }
.gate-chain__connector { display: inline-flex; align-items: center; color: var(--border-strong); flex: none; align-self: center; }
.gate-chain__connector .icon { width: var(--icon-sm); height: var(--icon-sm); }
.builder { display: grid; grid-template-columns: 300px minmax(0, 1fr); border-block: 1px solid var(--border-subtle); background: transparent; }
.builder:has(details.menu[open]) { overflow: visible; }
.builder__rail { background: transparent; border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; }
.builder__pane { min-width: 0; display: flex; flex-direction: column; }
.builder__pane-head { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: flex-start;
  justify-content: space-between; gap: var(--space-4); }
.builder__pane-body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5); }
.builder__rail-head { padding: var(--space-4) var(--space-4) var(--space-2); display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.builder__rail-foot { margin-top: auto; padding: var(--space-4); border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: var(--space-2); }
.step:hover { background: var(--bg-hover); }
.step__grip .icon { width: var(--icon-sm); height: var(--icon-sm); }
.step__num .icon { width: 12px; height: 12px; }
.step--entry .step__label { color: var(--fg-muted); font-weight: var(--fw-medium); }
.step__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; text-decoration: none; color: inherit; }
a.step__body:hover .step__label { color: var(--fg-link); }
.step__body:focus-visible { border-radius: var(--radius-sm); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.step__label { font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.step__meta { font-size: var(--fs-caption); color: var(--fg-muted); }
.qlist { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.qlist:has(details.menu[open]) { overflow: visible; }
.qrow { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); }
.qrow:not(.qrow--section):not(.qrow--add):hover { background: var(--bg-hover); }
.qrow:last-child { border-bottom: 0; }
.qrow__grip { color: var(--border-strong); flex: none; background: none; border: 0; padding: 0; cursor: grab; }
.qrow__grip .icon { width: var(--icon-sm); height: var(--icon-sm); }
.qrow__label { flex: 1; min-width: 0; font-size: var(--fs-small); color: var(--fg-primary); font-weight: var(--fw-medium); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.qrow__type { font-size: var(--fs-caption); color: var(--fg-muted); white-space: nowrap; }
.qrow--section { background: var(--bg-app); padding-block: var(--space-2); }
.qrow--section .qrow__label { font-size: var(--fs-caption); color: var(--fg-muted); font-weight: var(--fw-semibold); }
.qrow--add { background: var(--bg-app); padding: 0; }
.qrow--add form { width: 100%; }
.qrow--add > form > button, .qrow--add > button { display: flex; align-items: center; gap: var(--space-2); width: 100%;
  padding: var(--space-3) var(--space-4); background: none; border: 0; cursor: pointer; font: inherit; color: var(--fg-link);
  font-weight: var(--fw-semibold); }
.qitem { border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); }
.qitem:last-child { border-bottom: 0; }
.qitem > summary.qrow { border-bottom: 0; cursor: pointer; user-select: none; list-style: none; }
.qitem > summary.qrow::-webkit-details-marker { display: none; }
.qitem > summary.qrow:hover { background: var(--bg-hover); }
.qitem > summary.qrow:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.qitem[open] > summary.qrow { background: var(--bg-subtle); }
.qitem__chevron { color: var(--fg-muted); flex: none; transition: transform var(--dur-fast) var(--ease-out); }
.qitem:not([open]) .qitem__chevron { transform: rotate(-90deg); }
.qitem__body { padding: var(--space-4); background: var(--bg-app); border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column;
  gap: var(--space-3); }
.rule-builder { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); background: var(--bg-surface);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.rule-builder__head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rule-builder__head .field__label { margin: 0; }
.rule-builder__rows { display: flex; flex-direction: column; gap: var(--space-2); }
.rule-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rule-row > .field__control { flex: 1 1 12ch; min-width: 0; }
.rule-builder__comb { flex: 0 0 auto; width: auto; }
.rule-row__op { flex: 0 1 16ch; }
.rule-row__bound { flex: 0 1 12ch; }
.rule-builder__empty { font-size: var(--fs-caption); color: var(--fg-muted); }
.approvers-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.approvers-list__item { display: grid; grid-template-columns: var(--icon-md) 1fr auto; align-items: center; column-gap: var(--space-3);
  row-gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
.approvers-list__item:hover { background: var(--bg-hover); }
.approvers-list__icon { display: inline-flex; align-items: center; justify-content: center; width: var(--icon-md); height: var(--icon-md); }
.approvers-list__icon .icon { width: var(--icon-md); height: var(--icon-md); color: var(--fg-muted); }
.approvers-list__name { color: var(--fg-primary); font-size: var(--fs-small); }
.approvers-list__meta { justify-content: flex-end; row-gap: var(--space-1); }
.approvers-list__comment { grid-column: 2 / -1; margin: 0; padding: var(--space-2) var(--space-3); border-left: 1px solid var(--border-default);
  color: var(--fg-body); font-size: var(--fs-small); background: var(--bg-subtle); border-radius: var(--radius-sm); }
.steps__item[aria-current="step"] { font-weight: var(--fw-semibold); color: var(--fg-primary); }
.steps__item[aria-current="step"] .steps__num { background: var(--bg-action); border-color: transparent; color: var(--fg-on-action); }
.steps__item--done .steps__num { color: var(--fg-on-action); border-color: transparent; background: var(--status-met-text); }
.steps__item a:hover { text-decoration: underline; color: var(--fg-primary); }
/* Flow rail (ui/flow_rail, archetype flow, issue 583): numbered steps, nested sub-steps on a 1px guide. */
.flow-rail { position: sticky; top: calc(var(--layout-topbar-h) + var(--space-6)); font-size: var(--fs-small); }
.flow-rail__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.flow-rail__step { display: grid; grid-template-columns: var(--icon-lg) minmax(0, 1fr); column-gap: var(--space-3); align-items: center; color: var(--fg-muted); }
.flow-rail__mark { width: var(--icon-lg); height: var(--icon-lg); border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-caption); font-variant-numeric: tabular-nums; background: var(--bg-app); }
.flow-rail__mark .icon { width: var(--space-3); height: var(--space-3); }
.flow-rail__label a, .flow-rail__substep a { color: inherit; text-decoration: none; }
.flow-rail__label a:hover, .flow-rail__substep a:hover { color: var(--fg-primary); text-decoration: underline; text-underline-offset: 3px; }
.flow-rail__step--current > .flow-rail__label { color: var(--fg-primary); font-weight: var(--fw-semibold); }
.flow-rail__step--current > .flow-rail__mark { background: var(--bg-action); border-color: transparent; color: var(--fg-on-action); }
.flow-rail__step--done > .flow-rail__mark { border-color: var(--border-default); color: var(--status-met-text); }
.flow-rail__step--done > .flow-rail__label { color: var(--fg-body); }
.flow-rail__sub { list-style: none; margin: var(--space-2) 0 0; padding: 0; grid-column: 2; display: flex; flex-direction: column; gap: var(--space-1); }
.flow-rail__substep { padding: var(--space-1) 0 var(--space-1) var(--space-3); border-left: 1px solid var(--border-subtle); color: var(--fg-muted); }
.flow-rail__substep--done { color: var(--fg-body); }
.flow-rail__substep[aria-current="step"] { color: var(--fg-primary); font-weight: var(--fw-semibold); border-left-color: var(--border-action); }
/* Flow panel (ui/flow_panel): the live preview, hairline groups, no card chrome. */
.flow-panel { position: sticky; top: calc(var(--layout-topbar-h) + var(--space-6)); display: flex; flex-direction: column; gap: var(--space-5);
  border-left: 1px solid var(--border-subtle); min-width: 0; }
.flow-panel__title { margin: 0; font-size: var(--fs-h2); }
.flow-panel__group { display: flex; flex-direction: column; gap: var(--space-2); }
.flow-panel__group + .flow-panel__group { padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); }
.flow-panel__group h3 { margin: 0; font-size: var(--fs-h3); }
.flow-panel__group p { margin: 0; }
.flow-panel__value { color: var(--fg-primary); font-weight: var(--fw-semibold); }
.flow-panel__rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--fs-small); }
.flow-panel__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-3); color: var(--fg-primary); }
.flow-panel__count { color: var(--fg-body); font-variant-numeric: tabular-nums; text-align: right; }
.flow-panel__detail { grid-column: 1 / -1; color: var(--fg-muted); font-size: var(--fs-caption); }
.flow-panel__row--total { padding-top: var(--space-2); border-top: 1px solid var(--border-subtle); font-weight: var(--fw-semibold); }
@media (max-width: 1023.98px) {
  .flow-rail { position: static; }
  .flow-rail__list { flex-direction: row; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
  .flow-rail__sub { display: none; }
  .flow-panel { position: static; padding: var(--space-6) 0 0; border-left: 0; border-top: 1px solid var(--border-subtle); }
}
@media (max-width: 639.98px) {
  .flow-rail__list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-2); }
  .flow-rail__step { column-gap: var(--space-2); }
}
.lifecycle { list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); }
.lifecycle__step { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center;
  padding: var(--space-2) 0; color: var(--fg-body); }
.lifecycle__step + .lifecycle__step::before { content: ""; position: absolute; left: 8px; top: -6px; height: 12px; width: 1px; background: var(--border-strong); }
.lifecycle__step a { color: inherit; }
.lifecycle__step a:hover { color: var(--fg-primary); text-decoration: underline; text-underline-offset: 3px; }
.lifecycle__mark { width: 14px; height: 14px; border-radius: var(--radius-pill); border: 1.5px solid var(--border-strong); background: var(--bg-app);
  justify-self: center; }
.lifecycle__step--done .lifecycle__mark { border-color: var(--status-met); background: var(--status-met); box-shadow: inset 0 0 0 3px var(--bg-app); }
.lifecycle__step--stop .lifecycle__mark { border-color: var(--status-overdue); background: var(--status-overdue); box-shadow: inset 0 0 0 3px var(--bg-app); }
.lifecycle__step--now { color: var(--fg-primary); font-weight: var(--fw-semibold); }
.lifecycle__step--now .lifecycle__mark { border-color: var(--bg-action); background: var(--bg-brand-soft); box-shadow: inset 0 0 0 3px var(--bg-action); }
.lifecycle__when { font-size: var(--fs-caption); color: var(--fg-muted); font-weight: var(--fw-regular); }
.gate-chain__stage { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); border: 1px solid var(--border-subtle); color: var(--fg-body); font-size: var(--fs-small); text-decoration: none;
  min-width: 0; max-width: 100%; background: transparent; border-color: var(--border-subtle); }
.gate-chain__stage--auto-passed, .gate-chain__stage--withdrawn, .gate-chain__stage--superseded { color: var(--fg-muted); background: transparent;
  border-color: var(--border-subtle); }
.gate-chain__stage--approved { color: var(--fg-primary); background: transparent; border-color: var(--border-subtle); }
.gate-chain__stage--rejected { background: transparent; border-color: var(--border-subtle); }
.gate-chain__stage--upcoming { border-style: dashed; color: var(--fg-muted); background: transparent; border-color: var(--border-subtle); }
.gate-chain__stage--active .gate-chain__label, .gate-chain__stage--approved .gate-chain__label, .gate-chain__stage--rejected .gate-chain__label,
.gate-chain__stage .gate-chain__label { color: var(--fg-primary); }
.gate-chain__stage--auto-passed .gate-chain__label, .gate-chain__stage--upcoming .gate-chain__label { font-weight: var(--fw-medium); color: var(--fg-muted); }
.gate-chain__stage--withdrawn .gate-chain__label, .gate-chain__stage--superseded .gate-chain__label, .gate-chain__stage--active .gate-chain__status,
.gate-chain__stage--approved .gate-chain__status, .gate-chain__stage--rejected .gate-chain__status, .gate-chain__stage .gate-chain__status { color: var(--fg-muted); }
.gate-chain__stage--auto-passed .gate-chain__icon, .gate-chain__stage--approved .gate-chain__icon { color: var(--status-met); }
.gate-chain__stage--active .gate-chain__icon { color: var(--status-review); }
.gate-chain__stage--rejected .gate-chain__icon { color: var(--status-overdue); }
.gate-chain__stage--active { color: var(--fg-primary); background: transparent; border-color: var(--fg-primary); }
.steplist { display: flex; flex-direction: column; list-style: none; margin: 0; gap: 0; padding: var(--space-2); }
.step { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); position: relative; border: 0;
  border-radius: var(--radius-md); box-shadow: none; }
.step.is-selected { background: var(--bg-selected); border: 0; box-shadow: none; }
.step__num { flex: none; font-size: var(--fs-caption); display: inline-flex; align-items: center; width: auto; min-width: var(--space-5);
  height: auto; border-radius: 0; background: transparent; color: var(--fg-muted); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums;
  justify-content: flex-start; }
.step.is-selected .step__num { background: transparent; color: var(--fg-primary); }
.step--entry .step__num { color: var(--fg-muted); background: transparent; }
.step__rule { position: absolute; left: 33px; top: 38px; bottom: -4px; width: 1px; background: var(--border-default); display: none; }
.step__grip { margin-top: 1px; flex: none; background: none; border: 0; padding: 0; cursor: grab; color: var(--fg-muted); }
.step--add { padding-block: var(--space-3) var(--space-2); }
.step--add:hover { background: transparent; }
.step__meta--warning { color: var(--fg-body); }
.lifecycle__step:not(.lifecycle__step--now):not(.lifecycle__step--done):not(.lifecycle__step--stop) .lifecycle__mark { width: var(--space-2);
  height: var(--space-2); border: 0; background: var(--border-strong); }
.rule-join { margin: var(--space-1) 0; color: var(--fg-muted); }
.assign-list, .alist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.assign { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.assign__main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.assign__name { font-weight: var(--fw-semibold); }
.assign__desc { font-size: var(--fs-small); color: var(--fg-muted); }
.alist > li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem) minmax(0, 14rem) 2rem; align-items: center; gap: var(--space-3);
  min-height: 52px; padding: var(--space-2) 0; border-bottom: 1px solid var(--border-subtle); }
.alist__what { display: grid; gap: 1px; min-width: 0; }
.alist__sub { font-size: var(--fs-caption); color: var(--fg-muted); }
.alist__role { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); min-width: 0; margin: 0; }
.alist__role .field__control { min-width: 0; }
.alist__role-text { font-size: var(--fs-small); color: var(--fg-primary); }
.alist__src { font-size: var(--fs-small); color: var(--fg-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.alist__end { display: flex; justify-content: flex-end; margin: 0; }
.alist__what .person { min-width: 0; }
.alist__what .person > span:last-child { min-width: 0; overflow-wrap: anywhere; display: grid; }
.alist--people > li { grid-template-columns: minmax(0, 1fr) minmax(0, 16rem) minmax(0, 14rem); }
.alist--people .alist__src { text-align: right; }
@media (max-width: 1023.98px) {
  .builder { grid-template-columns: 1fr; }
  .builder__rail { border-right: 0; border-bottom: 1px solid var(--border-subtle); }
}
@media (max-width: 767.98px) {
  .gate-chain { flex-direction: column; align-items: stretch; }
  .gate-chain__connector { display: none; }
  .gate-chain__stage { width: 100%; }
  .assign { flex-wrap: wrap; }
  .alist > li { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-2); }
  .alist__role { grid-column: 1; grid-row: 2; max-width: 20rem; }
  .alist__src { grid-column: 2; grid-row: 2; justify-self: end; max-width: 12rem; }
  .alist__src--manual { display: none; }
  .alist__end { grid-column: 2; grid-row: 1; }
  .alist--people > li { grid-template-columns: minmax(0, 1fr) auto; }
  .alist--people .alist__what { grid-column: 1; grid-row: 1; }
  .alist--people .alist__src { grid-column: 2; grid-row: 1; }
  .alist--people .alist__role { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .alist--people .alist__role:has(> .alist__role-text:empty) { display: none; }
}
@media (max-width: 639.98px) {
  .rule-row { display: grid; grid-template-columns: minmax(0, 1fr); padding: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
  .rule-row .field__control { width: 100%; min-width: 0; }
}
/* ---------- Framework outline and crosswalk ---------- */
.crosswalk { display: grid; grid-template-columns: 1fr minmax(64px, 96px) 1fr; align-items: start; gap: 0; position: relative; margin: 0; }
.crosswalk__pane { position: relative; z-index: 1; min-width: 0; }
.crosswalk__pane--target { border-right: 1px solid var(--border-subtle); }
.crosswalk__pane--source { border-left: 1px solid var(--border-subtle); }
.crosswalk__pane-head { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4);
  background: var(--bg-subtle); border-bottom: 1px solid var(--border-subtle); }
.crosswalk__pane-head strong { color: var(--fg-primary); font-size: var(--fs-body); }
.crosswalk__pane .outline { padding: var(--space-2) var(--space-3); }
.crosswalk__pane .outline__row { cursor: pointer; grid-template-columns: var(--icon-md) minmax(0, auto) minmax(0, 1fr) auto;
  grid-template-rows: auto auto; padding-inline: calc(var(--space-3) + var(--depth, 0) * var(--space-4)) var(--space-3);
  background: var(--cat-bg, transparent); }
.crosswalk__pane .outline__row > .crosswalk__pick { grid-column: 1; grid-row: 1; align-self: center; }
.crosswalk__pane .outline__row > .outline__num { grid-column: 2; grid-row: 1; }
.crosswalk__pane .outline__row > .outline__body { grid-column: 3; grid-row: 1; }
.crosswalk__pane .outline__row > .menu { grid-column: 4; grid-row: 1; }
.crosswalk__pane .outline__trail { grid-column: 2 / -1; grid-row: 2; flex-wrap: wrap; margin-block-start: var(--space-1); }
.crosswalk__pane .outline__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.crosswalk__pane .outline__row[style*="--cat"] { border-left: 1px solid var(--cat); }
.crosswalk__gutter { position: relative; align-self: stretch; }
.crosswalk__edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crosswalk__edges path.crosswalk__edge { fill: none; stroke-width: 1.5px; stroke: var(--cat, var(--border-strong)); opacity: 0.65; }
.crosswalk__edges path.crosswalk__edge--pending { stroke: var(--bg-action); stroke-dasharray: 6 4; stroke-width: 2px; opacity: 1; }
.crosswalk__pick { flex: none; accent-color: var(--bg-action); margin-inline-end: var(--space-1); }
.crosswalk__direction { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.crosswalk__direction select { max-width: 22ch; }
.crossmap__col-head { display: flex; align-items: baseline; gap: var(--space-2); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.crossmap__col-head strong { color: var(--fg-primary); }
.crossmap__node:hover { box-shadow: var(--shadow-sm); }
.crossmap__node:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.crossmap__node--open { border: 1px dashed var(--status-review); }
.crossmap__node--unused { border: 1px dashed var(--border-subtle); }
.crossmap__num { font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); color: var(--fg-primary); flex: none; }
.crossmap__node > * { min-width: 0; }
.crossmap__group-head { font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--fg-muted); margin: 0 0 var(--space-1) 0;
  min-height: var(--crossmap-unit); display: flex; align-items: flex-end; }
.crossmap { display: grid; grid-template-columns: 1fr minmax(64px, 120px) 1fr; align-items: start; gap: 0 var(--space-6); margin: 0;
  padding: var(--space-4); position: relative; --crossmap-unit: 26px; }
.crossmap[data-density="overview"] { --crossmap-unit: 20px; }
.crossmap[data-density="detail"] { --crossmap-unit: 34px; }
.crossmap__group { display: flex; flex-direction: column; gap: 0; }
.crossmap__col { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; gap: 0; }
.crossmap__gutter { position: relative; align-self: stretch; }
.crossmap__edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crossmap__edges path.crossmap__edge { fill: none; stroke-width: 1.5px; stroke: var(--cat, var(--border-strong)); opacity: 0.7; }
.crossmap[data-density="overview"] .crossmap__node { padding: 2px var(--space-1); gap: var(--space-1); }
.crossmap[data-density="overview"] .crossmap__col { gap: var(--space-2); }
.crossmap[data-density="detail"] .crossmap__node { font-size: var(--fs-body); padding: var(--space-2) var(--space-3); gap: var(--space-3); }
.crossmap[data-density="detail"] .crossmap__col { gap: var(--space-6); }
.attach-results__list { list-style: none; padding: 0; margin: 0; }
.attach-results__item { display: grid; grid-template-columns: minmax(6rem, auto) 1fr auto; gap: var(--space-3); align-items: baseline; width: 100%;
  padding: var(--space-2) var(--space-3); background: transparent; border: 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer;
  text-align: left; font-size: var(--fs-small); color: var(--fg-body); }
.attach-results__item:last-child { border-bottom: 0; }
.attach-results__item:hover { background: var(--bg-hover); }
.attach-results__item:focus-visible { background: var(--bg-hover); outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.attach-results__item.is-selected { background: var(--bg-brand-soft); box-shadow: inset 2px 0 0 var(--fg-brand); }
.attach-results__item:has([data-outline-active]) { background: var(--bg-hover); }
.attach-results__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.outline__item { list-style: none; }
.outline__grip { color: var(--border-strong); cursor: grab; display: inline-flex; padding-block-start: 2px; }
.outline__row:hover .outline__grip { color: var(--fg-muted); }
.outline__num--manual { font-weight: var(--fw-medium); }
.outline__body { min-width: 0; display: block; }
.outline__title { display: block; color: var(--fg-primary); font-size: var(--fs-small); font-weight: var(--fw-medium); text-decoration: none; }
.outline__excerpt { display: block; margin-block-start: 2px; min-width: 0; color: var(--fg-muted); font-size: var(--fs-caption);
  line-height: var(--lh-snug); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-inline-size: 60ch; }
.outline__row--heading .outline__num { color: var(--fg-brand); font-weight: var(--fw-semibold); font-size: var(--fs-small);
  background: var(--bg-brand-soft); border-color: var(--border-brand); }
.outline__row--heading .outline__title { font-size: var(--fs-body); font-weight: var(--fw-semibold); letter-spacing: var(--ls-snug); }
.outline__trail { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; padding-block-start: 1px; }
.outline__field { inline-size: 100%; font: inherit; font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-primary);
  background: var(--bg-surface); border: 1px solid var(--border-action); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); }
.outline__hints { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); color: var(--fg-muted); font-size: var(--fs-caption);
  padding-block: var(--space-2) var(--space-3);
  padding-inline: calc(var(--space-3) + var(--icon-md) + var(--space-3) + var(--depth, 0) * var(--space-6)) var(--space-3);
  border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface); }
.outline__picker { margin-inline-start: calc(var(--space-3) + var(--icon-md) + var(--space-3) + var(--depth, 0) * var(--space-6));
  margin-block: 0 var(--space-3); max-inline-size: 35rem; background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: hidden; }
.outline__picker-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3);
  border-block-end: 1px solid var(--border-subtle); color: var(--fg-muted); font-size: var(--fs-caption); }
.outline__picker-search { padding: var(--space-3); }
.outline__picker-create { display: flex; align-items: center; gap: var(--space-2); inline-size: 100%; text-align: start; padding: var(--space-3);
  border: 0; border-block-start: 1px solid var(--border-subtle); background: var(--bg-subtle); color: var(--fg-link); cursor: pointer;
  font-size: var(--fs-small); font-weight: var(--fw-medium); }
.outline__add { display: flex; align-items: center; gap: var(--space-2); inline-size: 100%; text-align: start; padding: var(--space-3);
  color: var(--fg-muted); font-size: var(--fs-small); background: none; border: 0; border-block-end: 1px solid var(--border-subtle); cursor: pointer; }
.outline__add:hover { color: var(--fg-link); background: var(--bg-hover); }
.outline__row--ghost { background: var(--bg-app); }
.outline__row--ghost .outline__title { color: var(--fg-body); }
.outline__row--selected { box-shadow: inset 3px 0 0 var(--fg-brand); background: var(--bg-selected); }
.crosswalk__pane .outline__row--heading, .outline__row--heading { background: var(--bg-sidebar); }
.outline__row { display: grid; grid-template-columns: var(--icon-md) minmax(84px, auto) minmax(0, 1fr) auto auto; align-items: start;
  column-gap: var(--space-3); padding-block: var(--space-3); padding-inline: calc(var(--space-3) + var(--depth, 0) * var(--space-6)) var(--space-3);
  border-bottom: 1px solid var(--border-subtle); position: relative; border-radius: var(--radius-md); }
.outline__row:hover { background: var(--bg-hover); }
.crossmap__node { display: flex; gap: var(--space-2); padding: var(--space-1) var(--space-2); font-size: var(--fs-small); color: var(--fg-body);
  text-decoration: none; border-left: 1px solid var(--cat, var(--border-subtle)); transition: box-shadow var(--dur-fast) var(--ease-out);
  min-height: var(--crossmap-unit); align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: transparent; border-radius: var(--radius-sm); }
.attach-results__code { color: var(--fg-muted); font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.outline__num { font-size: var(--fs-caption); color: var(--fg-muted); background: var(--bg-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 2px var(--space-2); white-space: nowrap; text-align: center; justify-self: start;
  font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.outline__code { font-size: var(--fs-caption); color: var(--fg-muted); font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
  .crosswalk { grid-template-columns: 1fr; }
  .crosswalk__gutter { display: none; }
  .crosswalk__pane--target, .crosswalk__pane--source { border: 0; }
  .crossmap { grid-template-columns: 1fr; gap: var(--space-4) 0; }
  .crossmap__gutter { display: none; }
}
/* ---------- Compliance flow diagram ---------- */
.diagram--sankey { margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); background: var(--sankey-node-bg); }
.diagram__scroll { overflow: auto; max-height: 78vh; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--sankey-node-bg); }
.diagram--sankey__svg { display: block; width: 100%; height: auto; min-height: 320px; }
.diagram--sankey__svg .col-head { fill: var(--fg-muted); font-family: var(--font-ui); font-size: 10.5px; font-weight: var(--fw-semibold); }
.diagram--sankey__svg .node rect { fill: var(--node-fill, var(--fg-muted)); stroke: color-mix(in srgb, var(--fg-primary) 18%, transparent); stroke-width: .5px; }
.diagram--sankey__svg .node:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.diagram--sankey__svg .node:focus-visible rect { stroke: var(--border-action); stroke-width: 2px; }
.diagram--sankey__svg .node.is-dim { opacity: .16; }
.diagram--sankey__svg .node text { fill: var(--fg-body); font-family: var(--font-ui); font-size: 12px; font-weight: var(--fw-medium);
  paint-order: stroke; stroke: var(--sankey-node-bg); stroke-width: 3px; stroke-linejoin: round; }
.diagram--sankey__svg .node text .label-code { font-weight: var(--fw-semibold); }
.diagram--sankey__svg .node text .label-dim { fill: var(--fg-muted); font-weight: var(--fw-regular); }
.diagram--sankey__svg path.link { fill: none; stroke: var(--ribbon, var(--fg-subtle)); stroke-opacity: .3; mix-blend-mode: multiply;
  transition: stroke-opacity .12s ease; }
.diagram--sankey__svg path.link:hover, .diagram--sankey__svg path.link.is-hover { stroke-opacity: .62; }
.diagram--sankey__svg path.link.is-dim { stroke-opacity: .05; }
.diagram--sankey__svg path.link--flow-crossref { stroke-opacity: .46; }
.diagram--sankey__svg path.link--flow-crossref:hover { stroke-opacity: .74; }
.diagram--sankey__svg .rel-badge circle { fill: var(--sankey-node-bg); stroke: var(--chord-color, var(--fg-muted)); stroke-width: 1.5px; }
.diagram--sankey__svg .rel-badge text { fill: var(--chord-color, var(--fg-body)); font-family: var(--font-ui); font-size: 10px; font-weight: var(--fw-bold); }
.diagram--sankey__svg .rel-badge { pointer-events: none; }
.diagram--sankey__svg .rel-badge.is-dim { opacity: .12; }
.diagram--sankey__svg path.chord { fill: none; stroke: var(--chord-color, var(--fg-muted)); stroke-width: 1.5px; stroke-dasharray: 5 4; opacity: .75;
  transition: opacity .12s ease; }
.diagram--sankey__svg path.chord--equivalent_to { stroke-dasharray: 1.5 3.5; stroke-linecap: round; }
.diagram--sankey__svg path.chord:hover { opacity: 1; stroke-width: 2px; }
.diagram--sankey__svg path.chord.is-dim { opacity: .1; }
.diagram--sankey__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.diagram--sankey__toolbar-label { color: var(--fg-muted); font-size: var(--fs-caption); font-weight: var(--fw-semibold); }
.diagram--sankey__legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.diagram--sankey__legend-chip::before { content: ""; width: 10px; height: 10px; border-radius: 3px; flex: none;
  background: var(--ribbon, var(--chord-color, var(--fg-subtle))); }
.diagram--sankey__legend-chip[aria-pressed="false"]::before { opacity: .35; }
.diagram--sankey__skeleton { display: flex; gap: var(--space-8); justify-content: space-between; padding: var(--space-6); min-height: 320px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.diagram--sankey__skeleton span { flex: 1; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-hover) 37%, var(--bg-subtle) 63%); background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite; }
.funnel-filter__panel { min-width: 320px; }
.funnel-filter__section { border-top: 1px solid var(--border-subtle); padding: var(--space-2) 0; }
.funnel-filter__section-title { padding: var(--space-1) var(--space-3); font-weight: var(--fw-semibold); font-size: var(--fs-small); color: var(--fg-primary); }
.funnel-filter__section-body { padding: var(--space-2) var(--space-3); }
.funnel-filter__footer { padding: var(--space-3); border-top: 1px solid var(--border-subtle); display: flex; gap: var(--space-2); justify-content: flex-end; }
.funnel-diagram__source { margin: 0; margin-top: var(--space-3); }
.diagram--sankey__legend-chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2);
  font-size: var(--fs-caption); line-height: 18px; user-select: none; border-radius: var(--radius-md); background: transparent;
  border: 1px solid var(--border-subtle); color: var(--fg-muted); font-weight: var(--fw-medium); }
@media (max-width: 767.98px) {
  .diagram--sankey { overflow-x: auto; }
  .diagram--sankey__svg { min-width: 640px; }
}
/* ---------- Inbox ---------- */
.cols { display: grid; grid-template-columns: var(--row-cols, 16px 80px minmax(0, 1fr) 112px 84px 112px); align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2); height: 28px; font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted); }
.cols > :last-child { text-align: right; }
.rows { list-style: none; padding: 0; margin: 0; }
.row { display: grid; grid-template-columns: var(--row-cols, 16px 80px minmax(0, 1fr) 112px 84px 112px); align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2); position: relative; min-height: 44px; border-bottom: 1px solid var(--border-subtle); font-size: var(--fs-small);
  transition: background-color var(--dur-fast) var(--ease-out); }
.row:hover, .row:focus-within { background: var(--bg-hover); }
.row__title { color: var(--fg-primary); font-weight: var(--fw-medium); font-size: var(--fs-body); min-width: 0; padding: var(--space-3) 0; line-height: 1.35; }
a.row__title:hover { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: calc(100vh - var(--layout-topbar-h)); }
.inbox__list { border-right: 1px solid var(--border-subtle); }
.inbox__head { display: flex; align-items: center; gap: var(--space-2); height: var(--layout-topbar-h); padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-subtle); }
.items { list-style: none; padding: var(--space-1); margin: 0; }
.item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: var(--space-1) var(--space-3); padding: var(--space-3);
  border-radius: var(--radius-md); transition: background-color var(--dur-fast) var(--ease-out); }
.item:hover { background: var(--bg-hover); }
.item[aria-current="true"] { background: var(--bg-selected); }
.item__unread { width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--bg-action); margin-top: var(--space-1); }
.item__title { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-primary); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.item__meta { grid-column: 2 / -1; font-size: var(--fs-caption); color: var(--fg-muted); display: flex; align-items: center; gap: var(--space-2); }
@media (max-width: 767.98px) { .inbox { grid-template-columns: 1fr; } }
.inbox--embedded { min-height: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.inbox--embedded .inbox__head { height: auto; padding: var(--space-3); }
.inbox--embedded .inbox__head .searchbox { flex: 1 1 auto; min-width: 0; }
.inbox--embedded .items { max-height: 70vh; overflow-y: auto; }
.inbox--embedded .item { grid-template-columns: minmax(0, 1fr); color: inherit; text-decoration: none; }
.inbox--embedded .item__meta { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.inbox__note { padding: var(--space-3); }
.inbox__pane { min-width: 0; padding: var(--space-6); }
.row__status { color: var(--fg-body); }
.row__proof { color: var(--fg-body); min-width: 0; overflow-wrap: anywhere; line-height: var(--lh-snug); }
.row__due { text-align: right; color: var(--fg-body); font-variant-numeric: tabular-nums; }
.row__code { color: var(--fg-muted); font-weight: var(--fw-medium); white-space: nowrap; font-size: var(--fs-caption); letter-spacing: 0; }
.inbox--workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); margin-top: var(--space-3); border: 0;
  border-top: 1px solid var(--border-subtle); border-radius: 0; background: transparent; min-height: 60vh; }
.inbox--workspace .inbox__list { max-height: 76vh; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--space-3) var(--space-4) 0; }
.inbox--workspace .inbox__pane { max-height: 76vh; overflow-y: auto; padding: var(--space-6) var(--space-7) var(--space-8); }
.inbox--workspace .group { border-top: 0; padding-top: var(--space-1); }
.inbox--workspace .group__head { position: sticky; top: 0; z-index: 1; padding: 0 var(--space-3); list-style: none; cursor: pointer; user-select: none; }
.inbox--workspace .group__head::-webkit-details-marker { display: none; }
.inbox--workspace .group__head:hover { background: var(--bg-hover); }
.inbox--workspace .row { --row-cols: 16px 56px minmax(0, 1fr) auto; height: 40px; min-height: 0; padding: 0 var(--space-3); color: inherit;
  text-decoration: none; scroll-margin-top: 36px; }
.inbox--workspace .row[aria-current] { background: var(--bg-selected); }
.inbox--workspace .row:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.inbox--workspace .row__code { font-family: var(--font-mono); font-size: var(--fs-caption); font-weight: var(--fw-regular); }
.inbox--workspace .row__title { min-width: 0; padding: 0; font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { font-size: var(--fs-caption); color: var(--fg-muted); white-space: nowrap; }
.inbox--workspace .callout { margin-top: var(--space-4); }
.inbox--workspace .flash { margin-top: 0; margin-bottom: var(--space-4); }
.inbox__section { margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.inbox__section > h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 var(--space-2); font-size: var(--fs-h3);
  font-weight: var(--fw-semibold); }
.inbox--workspace .props { grid-template-columns: 140px minmax(0, 1fr); gap: var(--space-2) var(--space-4); }
@media (max-width: 1023.98px) {
  .cols, .row { --row-cols: 16px 56px minmax(0, 1fr) 84px 100px; }
  .cols .c-why, .row__status { display: none; }
  .inbox--workspace { grid-template-columns: 1fr; min-height: 0; }
  .inbox--workspace .inbox__list { border-right: 0; max-height: none; overflow: visible; padding: 0 0 var(--space-4); }
  .inbox--workspace .inbox__pane { max-height: none; overflow: visible; padding: var(--space-4) 0 var(--space-6); }
  .inbox--workspace[data-view="list"] .inbox__pane, .inbox--workspace[data-view="pane"] .inbox__list, .inbox--workspace .row__meta { display: none; }
  .inbox--workspace .props { grid-template-columns: 110px minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .cols { display: none; }
  .row { --row-cols: 16px minmax(0, 1fr) auto; row-gap: 2px; padding: var(--space-3) var(--space-2); }
  .row__title { grid-column: 2; grid-row: 1; padding: 0; }
  .inbox__list { border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .inbox--embedded .items { max-height: 40vh; }
  .inbox__pane { padding: var(--space-4); }
  .row__status { display: none; }
  .row__proof { grid-column: 2; grid-row: 3; font-size: var(--fs-caption); white-space: normal; }
  .row__due { grid-column: 3; grid-row: 1 / span 2; }
  .row__code { grid-column: 2; grid-row: 2; }
}
/* ---------- Reports and dashboard ---------- */
.portal-help { margin-bottom: var(--space-6); }
.portal-help .prose { font-size: var(--fs-small); color: var(--fg-muted); }
.contact-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle); }
.contact-card__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.contact-card__item { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.contact-card__item > .icon { color: var(--fg-muted); flex: none; }
.contact-card__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.contact-card__name { min-width: 0; font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-primary); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.contact-card__detail { font-size: var(--fs-caption); color: var(--fg-muted); }
.contact-card__mail { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; font-size: var(--fs-small); }
.entry-tiles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.entry-tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: var(--space-4) var(--space-6);
  padding: var(--space-4) var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.entry-tile:hover, .entry-tile:focus-within { background: var(--bg-hover); }
.entry-tile__main { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.entry-tile__name { color: var(--fg-primary); font-size: var(--fs-body); font-weight: var(--fw-semibold); }
.entry-tile__name:hover { color: var(--fg-brand); }
.entry-tile__name::after { content: ""; position: absolute; inset: 0; cursor: pointer; }
.entry-tile__name:focus-visible { border-radius: var(--radius-sm); outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.entry-tile__intro { font-size: var(--fs-small); color: var(--fg-muted); }
.entry-tile__phases { display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--fs-small); color: var(--fg-body); }
.entry-tile__contacts { min-width: 0; }
.entry-tile__contacts .contact-card { border: 0; padding: 0; }
.flow .entry-tile { grid-template-columns: minmax(0, 1fr); }
.entry-tile__intro a, .entry-tile__contacts a { position: relative; z-index: 1; }
.dash-progress { margin-top: var(--space-6); }
.cov-matrix-wrap { overflow-x: auto; }
.cov-matrix { width: 100%; min-width: 620px; border-collapse: collapse; }
.cov-matrix thead th { padding: 0 var(--space-2) var(--space-2); font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted);
  text-align: left; white-space: nowrap; }
.cov-matrix tbody th { width: 12rem; min-width: 8rem; max-width: 12rem; padding: var(--space-2) var(--space-4) var(--space-2) var(--space-2);
  border-top: 1px solid var(--border-subtle); font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-primary); text-align: left;
  overflow-wrap: anywhere; }
.cov-matrix tbody th small { display: block; font-size: var(--fs-caption); font-weight: var(--fw-regular); color: var(--fg-muted); }
.cov-matrix td { padding: var(--space-1); border-top: 1px solid var(--border-subtle); border-left: 1px solid var(--border-subtle); vertical-align: top; }
.cov-matrix thead td { border: 0; }
.cov-matrix tbody td { min-width: 9rem; }
.mcell { display: grid; gap: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); color: inherit; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out); }
a.mcell:hover { background: var(--bg-hover); }
a.mcell:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
a.mcell[aria-current="true"] { background: var(--bg-brand-soft); }
.mcell__top { display: flex; align-items: baseline; gap: var(--space-2); }
.mcell__pc { font-size: 20px; font-weight: var(--fw-semibold); letter-spacing: -0.01em; color: var(--fg-primary); font-variant-numeric: tabular-nums; }
.mcell__pc small { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-muted); }
.mcell__flag { display: inline-flex; align-items: center; gap: var(--space-1); margin-left: auto; font-size: var(--fs-caption);
  font-weight: var(--fw-medium); color: var(--fg-body); font-variant-numeric: tabular-nums; }
.mcell__meta { font-size: var(--fs-caption); color: var(--fg-muted); }
.mcell .progress__bar { height: 6px; }
.mcell--empty { display: block; padding: var(--space-3); font-size: var(--fs-caption); color: var(--fg-muted); }
.olist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border-subtle); }
.olist__cols { display: grid; grid-template-columns: 16px 5.25rem minmax(0, 1fr) 8rem 11rem 6.5rem; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2); padding-bottom: var(--space-2); font-size: var(--fs-caption); font-weight: var(--fw-medium); color: var(--fg-muted); }
.olist__cols > :last-child { text-align: right; }
.orow { display: grid; grid-template-columns: 16px 5.25rem minmax(0, 1fr) 8rem 11rem 6.5rem; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2); min-height: 46px; border-bottom: 1px solid var(--border-subtle); color: inherit; text-decoration: none;
  font-size: var(--fs-small); transition: background-color var(--dur-fast) var(--ease-out); }
.orow:hover { background: var(--bg-hover); }
.orow:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.orow__code { min-width: 0; font-weight: var(--fw-medium); color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow__title { min-width: 0; font-size: var(--fs-body); font-weight: var(--fw-medium); color: var(--fg-primary); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.orow__fw { min-width: 0; color: var(--fg-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow__share { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-2); color: var(--fg-body); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.orow__share .progress__bar--mini { width: auto; height: 6px; }
.orow__age { color: var(--fg-body); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qlegend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); margin: 0 0 var(--space-3); padding: 0; list-style: none;
  font-size: var(--fs-small); color: var(--fg-body); }
.qlegend li { display: inline-flex; align-items: center; gap: var(--space-2); }
.qlegend b { color: var(--fg-primary); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.qlegend__swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.qbars { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.qbar { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 2.5rem; align-items: center; gap: var(--space-3); min-height: 34px;
  padding: 0 var(--space-2); border-radius: var(--radius-md); color: inherit; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out); }
.qbar:hover { background: var(--bg-hover); }
.qbar:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.qbar__label { min-width: 0; font-size: var(--fs-small); color: var(--fg-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbar__code { margin-right: var(--space-2); font-weight: var(--fw-medium); color: var(--fg-muted); }
.qbar__track { display: flex; gap: 2px; width: calc(var(--w, 0) * 1%); height: 10px; }
.qbar__seg { display: block; flex: var(--n, 1) 1 0%; min-width: 2px; }
.qbar__seg:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.qbar__seg--review { background: var(--c-cat-1); }
.qbar__seg--inquiry { background: var(--c-cat-2); }
.qbar__seg--comment { background: var(--c-cat-3); }
.qbar__total { text-align: right; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--fg-primary); font-variant-numeric: tabular-nums; }
.qlegend__swatch--dot { border-radius: 50%; background: var(--fg-primary); }
.qlegend__swatch--iqr { background: var(--seg-open); }
.qlegend__swatch--line { width: 14px; height: 2px; border-radius: 1px; background: var(--border-strong); }
.qlegend__swatch--s1 { background: var(--c-cat-1); }
.qlegend__swatch--s2 { background: var(--c-cat-2); }
.qlegend__swatch--s3 { background: var(--c-cat-3); }
.ttc-range { position: relative; display: grid; gap: 2px; overflow: hidden; isolation: isolate; }
.ttc-range__row { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr) 7.5rem; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2); min-height: 34px; border-radius: var(--radius-md); color: inherit; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out); }
.ttc-range__row:hover { background: var(--bg-hover); }
.ttc-range__row:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.ttc-range__name { min-width: 0; font-size: var(--fs-small); color: var(--fg-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttc-range__plot { position: relative; height: 18px; }
.ttc-range__whisk { position: absolute; top: 8px; left: 0; width: calc(var(--w, 0) * 1%); height: 2px; border-radius: 1px; background: var(--border-strong); }
.ttc-range__iqr { position: absolute; top: 5px; left: calc(var(--l, 0) * 1%); width: calc(var(--w, 0) * 1%); min-width: 2px; height: 8px;
  border-radius: var(--radius-sm); background: var(--seg-open); }
.ttc-range__med { position: absolute; top: 3px; left: calc(var(--l, 0) * 1%); width: 12px; height: 12px; transform: translateX(-50%);
  border-radius: 50%; background: var(--fg-primary); box-shadow: 0 0 0 2px var(--bg-app); }
.ttc-range__val { font-size: var(--fs-small); color: var(--fg-body); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ttc-range__val b { color: var(--fg-primary); font-weight: var(--fw-semibold); }
.ttc-axis { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr) 7.5rem; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-2); height: 22px; margin-top: var(--space-1); }
.ttc-axis__scale { position: relative; height: 100%; }
.ttc-axis__tick { position: absolute; top: 4px; left: calc(var(--l, 0) * 1%); transform: translateX(-50%); font-size: var(--fs-caption);
  color: var(--fg-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ttc-axis__grid { position: absolute; top: -100vh; bottom: 100%; left: calc(var(--l, 0) * 1%); z-index: -1; width: 1px; background: var(--border-subtle); }
.ttc-trend { position: relative; max-width: 40rem; }
.ttc-trend-chart { display: block; width: 100%; height: auto; overflow: visible; color: var(--fg-primary); }
.ttc-trend-chart text { font-family: var(--font-ui); font-size: 11px; font-weight: var(--fw-medium); fill: var(--fg-muted); font-variant-numeric: tabular-nums; }
.ttc-trend__gl { stroke: var(--border-subtle); stroke-width: 1; }
.ttc-trend__series { color: var(--fg-primary); }
.ttc-trend__series--s1 { color: var(--c-cat-1); }
.ttc-trend__series--s2 { color: var(--c-cat-2); }
.ttc-trend__series--s3 { color: var(--c-cat-3); }
.ttc-trend__ln { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ttc-trend__dot { fill: currentColor; }
.ttc-trend__end { fill: currentColor; stroke: var(--bg-app); stroke-width: 2; }
.ttc-trend-chart text.ttc-trend__lbl { fill: var(--fg-primary); font-weight: var(--fw-semibold); }
.ttc-trend__xh { stroke: var(--border-strong); stroke-width: 1; }
.ttc-trend__hit { fill: transparent; }
.ttc-hist { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; gap: var(--space-2); height: 150px;
  margin: var(--space-6) 0 0; padding: 0 2px; list-style: none; border-bottom: 1px solid var(--border-strong); }
.ttc-hist__bar { position: relative; height: calc(var(--h, 0) * 1%); min-height: 2px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--c-cat-1); }
.ttc-hist__bar--zero { min-height: 0; }
.ttc-hist__bar > span[aria-hidden] { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: var(--fs-caption);
  font-weight: var(--fw-medium); color: var(--fg-body); font-variant-numeric: tabular-nums; }
.ttc-hist__x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-2); padding: var(--space-2) 2px 0;
  font-size: var(--fs-caption); color: var(--fg-muted); text-align: center; font-variant-numeric: tabular-nums; }
.ttc-hist__unit { margin-top: var(--space-1); font-size: var(--fs-caption); color: var(--fg-muted); text-align: right; }
.chart-tip { position: fixed; z-index: var(--z-dropdown); min-width: 160px; max-width: 280px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface); box-shadow: var(--shadow-md);
  font-size: var(--fs-caption); color: var(--fg-body); pointer-events: none; }
.chart-tip[hidden] { display: none; }
.chart-tip__title { display: block; margin-bottom: var(--space-1); font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.chart-tip__row { display: flex; justify-content: space-between; gap: var(--space-3); padding: 1px 0; }
.chart-tip__row b { color: var(--fg-primary); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.chart-tip__note { margin-top: var(--space-1); color: var(--fg-muted); }
.drill { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
.drill h2 { margin: 0; font-size: var(--fs-h3); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.drill .meta { font-size: var(--fs-small); color: var(--fg-muted); }
.drill__form { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; min-width: 0; }
.drill__open { margin: var(--space-3) 0 0; font-size: var(--fs-small); }
.orow--static:hover { background: transparent; }
.hchart { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hrow { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 2.5rem; align-items: center; gap: var(--space-3); min-height: 34px;
  padding: 0 var(--space-2); border-radius: var(--radius-md); color: inherit; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out); }
.hrow:hover { background: var(--bg-hover); }
.hrow:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.hrow[aria-current="true"] { background: var(--bg-brand-soft); }
.hrow__label { min-width: 0; font-size: var(--fs-small); color: var(--fg-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow__track { display: block; width: calc(var(--w, 0) * 1%); min-width: 2px; height: 10px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--fg-muted); }
.hrow__total { text-align: right; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--fg-primary); font-variant-numeric: tabular-nums; }
.dash-wl th, .dash-wl td { padding-inline: var(--space-2); }
.dash-wl thead th { white-space: normal; vertical-align: bottom; hyphens: manual; }
.dash-wl thead th.dash-wl__hy { hyphens: auto; }
.dash-wl__name { min-width: 11rem; }
.dash-wl__gates { max-width: 9.5rem; }
.dash-wl__gates .cluster { flex-wrap: nowrap; }
.dash-wl__gates .status { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dash-wl__gates .status .glyph { display: inline-block; vertical-align: -2px; margin-right: var(--space-2); }
@media (max-width: 1023.98px) {
  .olist__cols, .orow { grid-template-columns: 16px 5.25rem minmax(0, 1fr) 10rem 6rem; }
  .orow__fw, .olist__col-fw { display: none; }
}
@media (max-width: 767.98px) {
  .entry-tile { grid-template-columns: minmax(0, 1fr); }
  .drill__form { margin-left: 0; flex-basis: 100%; }
  .drill__form .fsel { flex: 1; }
  .olist__cols { display: none; }
  .orow { grid-template-columns: 16px minmax(0, 1fr) auto; row-gap: 2px; padding: var(--space-2); }
  .orow__title { grid-column: 2; grid-row: 1; white-space: normal; }
  .orow__code { grid-column: 2; grid-row: 2; font-size: var(--fs-caption); }
  .orow__share { grid-column: 2; grid-row: 3; }
  .orow__age { grid-column: 3; grid-row: 1 / span 3; }
  .qbar { grid-template-columns: minmax(0, 1fr) 2rem; row-gap: var(--space-1); padding: var(--space-2); }
  .qbar__track { grid-column: 1 / -1; grid-row: 2; }
  .orow--static .orow__fw { display: block; grid-column: 2; grid-row: 4; font-size: var(--fs-caption); color: var(--fg-muted); }
  .hrow { grid-template-columns: minmax(0, 1fr) 2rem; row-gap: var(--space-1); padding: var(--space-2); }
  .hrow__track { grid-column: 1 / -1; grid-row: 2; }
  .ttc-range__row { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr); row-gap: 2px; padding: var(--space-1) var(--space-6) var(--space-1) var(--space-2); }
  .ttc-axis { grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr); row-gap: 2px; padding-right: var(--space-6); }
  .ttc-trend-chart text { font-size: 19px; }
  .ttc-trend-chart text.ttc-trend__name, .ttc-trend-chart text.ttc-trend__x--thin { display: none; }
  .ttc-range__val { grid-column: 1 / -1; text-align: left; }
  .ttc-axis > :last-child { display: none; }
}
@media (min-width: 768px) {
  .dash-wl th:last-child, .dash-wl td:last-child { position: sticky; right: 0; z-index: 2; background: var(--bg-app); box-shadow: inset 1px 0 0 var(--border-subtle); }
  .dash-wl tbody tr:hover td:last-child { background: var(--bg-hover); }
  .dash-wl tbody tr:target td:last-child { background: var(--bg-muted); }
  .orow--static { grid-template-columns: 16px 7rem minmax(0, 1fr) 8rem 11rem 6.5rem; }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
  .dash-wl .dash-wl__p2, .dash-wl .dash-wl__p1 { display: none; }
  .orow--static { grid-template-columns: 16px 7rem minmax(0, 1fr) 7rem 10rem 6rem; }
  .orow--static .orow__fw { display: block; }
}
/* ---------- Access and permissions ---------- */
.support-details > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-1); }
.support-details > summary::-webkit-details-marker { display: none; }
.support-details > summary::before { content: ""; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: var(--shape-chevron) center / contain no-repeat; mask: var(--shape-chevron) center / contain no-repeat;
  transition: transform var(--dur-fast) var(--ease-out); }
.support-details[open] > summary::before { transform: rotate(90deg); }
.eff { border-top: 1px solid var(--border-subtle); }
.eff__group { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-subtle); }
.eff__area { margin: 2px 0 0; font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.eff__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.eff__list > li { display: grid; grid-template-columns: var(--icon-sm) minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-3); align-items: baseline;
  font-size: var(--fs-small); }
.eff__list .icon { width: 14px; height: 14px; align-self: start; margin-top: 2px; }
.eff__list .eff__ok { color: var(--status-met); }
.eff__cap { color: var(--fg-primary); }
.eff__via { display: grid; gap: 2px; color: var(--fg-primary); }
.eff__more-origin, .eff__no .eff__via { color: var(--fg-muted); }
.eff__scope { display: block; font-size: var(--fs-caption); color: var(--fg-muted); }
.eff__no .eff__cap { color: var(--fg-muted); }
.eff__list .eff__no .icon { color: var(--fg-muted); stroke: currentColor; stroke-width: 2; opacity: 1; }
.eff__more { margin: var(--space-3) 0 0; font-size: var(--fs-small); color: var(--fg-muted); }
.eff__more > summary { cursor: pointer; display: inline; list-style: none; color: var(--fg-link); }
.eff__more > summary::-webkit-details-marker { display: none; }
.eff__more > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.eff__more[open] > summary { margin-bottom: var(--space-3); }
.eff__hidden, .grants { border-top: 1px solid var(--border-subtle); }
.grant { display: grid; grid-template-columns: 1.125rem minmax(0, 1fr); gap: var(--space-3); align-items: start;
  padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--border-subtle); cursor: pointer;
  transition: background-color var(--dur-fast); }
.grant:hover { background: var(--bg-hover); }
.grant input { margin: 3px 0 0; accent-color: var(--bg-action); width: 16px; height: 16px; }
.grant__text { display: grid; gap: 2px; min-width: 0; }
.grant__name { font-weight: var(--fw-semibold); }
.grant__desc { font-size: var(--fs-small); color: var(--fg-muted); }
.grant--static { cursor: default; }
.grant--static:hover { background: transparent; }
.grant--static .icon { width: 14px; height: 14px; margin-top: var(--space-1); }
.grant--static .icon.grant__on { color: var(--fg-primary); }
.grant--static .icon.grant__off { color: var(--fg-muted); }
.grants__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding-top: var(--space-4); }
.grants:has(.impact) .grants__foot .meta { display: none; }
.grants__foot .meta { font-size: var(--fs-small); color: var(--fg-muted); min-width: 0; overflow-wrap: anywhere; }
.perm-matrix { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: var(--fs-small); min-width: 36rem; }
.perm-matrix thead th { height: 32px; font-weight: var(--fw-medium); color: var(--fg-muted); white-space: nowrap; }
.perm-matrix thead th:first-child { text-align: left; padding-left: 0; }
.perm-matrix tbody th { text-align: left; padding-left: 0; font-weight: var(--fw-medium); color: var(--fg-primary); }
.perm-matrix__col-area { width: 34%; }
.perm-matrix th, .perm-matrix td { border-bottom: 1px solid var(--border-subtle); height: 48px; padding: var(--space-2) var(--space-3);
  text-align: center; vertical-align: middle; position: relative; }
.perm-matrix__desc { display: block; font-weight: var(--fw-regular); font-size: var(--fs-caption); color: var(--fg-muted); }
.perm-matrix td > .icon, .perm-matrix td > .glyph { display: block; margin-inline: auto; }
.perm-matrix .icon { width: var(--icon-sm); height: var(--icon-sm); }
.perm-matrix__on { color: var(--status-met); }
.perm-matrix__off { color: var(--fg-muted); opacity: .7; }
.perm-matrix__note { display: block; margin-top: 2px; font-size: var(--fs-caption); color: var(--fg-muted); }
.perm-matrix__legend { margin: var(--space-2) 0 0; font-size: var(--fs-caption); color: var(--fg-muted); }
.perm-matrix--edit tbody th { vertical-align: top; padding-top: var(--space-4); }
.perm-matrix--edit thead th { text-align: left; }
.perm-matrix--edit thead th:first-child { padding-left: 0; }
.perm-matrix--edit { min-width: 52rem; }
.perm-matrix--edit td { text-align: left; vertical-align: top; height: auto; padding-top: var(--space-3); padding-bottom: var(--space-3); }
.perm-matrix__opt { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-1) 0; cursor: pointer; }
.perm-matrix__opt input { margin: 2px 0 0; accent-color: var(--bg-action); width: 16px; height: 16px; flex: none; }
.perm-matrix__opt:has(input:disabled) { cursor: default; color: var(--fg-muted); }
.perm-matrix__hint { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-caption); color: var(--fg-muted); }
.impact { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border-strong); }
.impact__title { margin: 0 0 var(--space-3); font-size: var(--fs-h2); font-weight: var(--fw-semibold); }
.impact .callout { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
  font-size: var(--fs-small); }
.impact .callout .icon { flex: none; margin-top: 2px; }
.impact__none { margin: 0; font-size: var(--fs-small); color: var(--fg-muted); }
.impact__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-4) var(--space-8); }
.impact__group + .impact__group, .impact__cols + .impact__group { margin-top: var(--space-4); }
.impact__h { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.impact__h .icon { width: 14px; height: 14px; }
.impact__h .impact__plus { color: var(--status-met); }
.impact__h .impact__minus { color: var(--status-overdue); }
.impact__h .impact__shift { color: var(--fg-muted); }
.impact__list { margin: 0; padding-left: var(--space-5); display: grid; gap: var(--space-1); font-size: var(--fs-small); color: var(--fg-body); }
.impact__list--empty { list-style: none; color: var(--fg-muted); }
.impact__note { display: block; color: var(--fg-muted); font-size: var(--fs-small); }
.impact__keep { display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-4) 0 0; font-size: var(--fs-small); color: var(--fg-muted); }
.impact__keep .icon { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.impact__people { margin: var(--space-4) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); font-size: var(--fs-small);
  color: var(--fg-body); }
.impact__people-h { margin: 0 0 var(--space-1); font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.result-sum { margin: 0; font-size: var(--fs-small); color: var(--fg-body); }
.result-block { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.result-block > .caption { margin: calc(-1 * var(--space-1)) 0 0; }
.result-sum strong { color: var(--fg-primary); font-weight: var(--fw-semibold); }
@media (max-width: 767.98px) {
  .eff__group { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .eff__list > li { grid-template-columns: var(--icon-sm) minmax(0, 1fr); }
  .eff__via { grid-column: 2; }
  .perm-matrix { min-width: 34rem; }
  .perm-matrix--edit { min-width: 0; display: block; }
  .perm-matrix--edit thead { display: none; }
  .perm-matrix--edit tbody { display: block; width: auto; }
  .perm-matrix--edit tr { display: block; width: auto; border-bottom: 1px solid var(--border-subtle); padding: var(--space-3) 0; }
  .perm-matrix--edit th, .perm-matrix--edit td { display: block; width: auto; border-bottom: 0; height: auto; padding: var(--space-1) 0; }
  .perm-matrix--edit td.perm-matrix__na { display: none; }
  .perm-matrix--edit td[data-col]::before { content: attr(data-col); display: block; margin-top: var(--space-2); font-size: var(--fs-caption);
    font-weight: var(--fw-medium); color: var(--fg-muted); }
}
@media (max-width: 639.98px) { .impact__cols { grid-template-columns: minmax(0, 1fr); } }
/* ---------- Help center ---------- */
.help-topbar { display: grid; grid-template-columns: 1fr minmax(0, calc(var(--layout-sidebar-w) * 2)) 1fr; align-items: center; gap: var(--space-4);
  height: var(--layout-topbar-h); padding: 0 var(--space-6); background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); }
.help-topbar__brand { display: flex; align-items: center; gap: var(--space-2); color: var(--fg-primary); font-weight: var(--fw-semibold); text-decoration: none; }
.help-topbar__brand:hover { color: var(--fg-primary); }
.help-topbar__sep { color: var(--border-control); font-weight: var(--fw-regular); }
.help-topbar__section { color: var(--fg-body); font-weight: var(--fw-medium); }
.help-topbar__search-link { display: none; }
.help-topbar__end { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-5); }
.help-topbar__back { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--fs-small); text-decoration: none; white-space: nowrap; }
.help-lang { display: flex; gap: var(--space-2); font-size: var(--fs-small); color: var(--fg-muted); }
.help-lang a { color: var(--fg-body); text-decoration: none; }
.help-lang a:hover { color: var(--fg-primary); }
.help-lang [aria-current="true"] { color: var(--fg-primary); font-weight: var(--fw-semibold); }
.help-lang form { display: contents; }
.help-lang button { background: none; border: 0; padding: 0; font: inherit; color: var(--fg-body); cursor: pointer; }
.help-lang button:hover { color: var(--fg-primary); }
.help-body { display: grid; align-content: start; grid-template-columns: var(--layout-sidebar-w) minmax(0, 1fr) var(--layout-sidebar-w); flex: 1; }
.help-body--no-toc { grid-template-columns: var(--layout-sidebar-w) minmax(0, 1fr); }
.help-disclosure { background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); }
.help-disclosure > summary { display: flex; justify-content: space-between; align-items: center; padding: var(--space-3) var(--space-4);
  font-weight: var(--fw-medium); color: var(--fg-primary); cursor: pointer; list-style: none; }
.help-disclosure > summary::-webkit-details-marker { display: none; }
.help-disclosure[open] > summary .icon { transform: rotate(180deg); }
.help-nav { display: flex; flex-direction: column; gap: var(--space-1); padding: 0 var(--space-4) var(--space-3); }
.on-page-toc { display: flex; flex-direction: column; padding: 0 var(--space-4) var(--space-3); }
.on-page-toc__title { display: none; font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--fg-primary); margin-bottom: var(--space-2); }
.on-page-toc__link { display: block; padding: var(--space-1) var(--space-3); border-left: 1px solid var(--border-subtle); color: var(--fg-body);
  font-size: var(--fs-small); text-decoration: none; }
.on-page-toc__link--sub { padding-left: var(--space-6); }
.on-page-toc__link:hover { color: var(--fg-primary); }
.on-page-toc__link[aria-current="true"] { border-left-color: var(--border-action); color: var(--fg-link); font-weight: var(--fw-medium); }
.help-main { padding: var(--space-10) var(--space-10) var(--space-16); }
.help-article { display: flex; flex-direction: column; gap: var(--space-4); }
.help-article--spaced { gap: var(--space-8); }
.help-article > * { max-width: var(--help-measure); }
.help-article > .diagram-figure { max-width: none; }
.help-article h1 { font-size: var(--fs-display); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); font-weight: var(--fw-semibold);
  color: var(--fg-primary); }
.help-article__header { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.help-article__lead { font-size: var(--fs-h2); line-height: var(--lh-loose); color: var(--fg-body); }
.help-article__heading { font-size: var(--fs-h2); font-weight: var(--fw-semibold); color: var(--fg-primary); line-height: var(--lh-snug); margin-bottom: var(--space-3); }
.help-article .prose h2 { font-size: var(--fs-h2); font-weight: var(--fw-semibold); color: var(--fg-primary); line-height: var(--lh-snug);
  margin-block-start: var(--space-8); }
.help-article .prose > h2:first-child { margin-block-start: 0; }
.help-article > :is(.diagram-figure, .task-steps, .callout) + .prose > h2:first-child { margin-block-start: var(--space-4); }
.help-article .prose h3 { margin-block-start: var(--space-6); }
.term-link { color: inherit; text-decoration: underline dotted; text-decoration-color: var(--fg-muted); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.term-link:hover { color: var(--fg-link-hover); text-decoration-color: var(--fg-link-hover); }
.help-entry-list { list-style: none; padding: 0; border-top: 1px solid var(--border-subtle); }
.help-entry-list > li { border-bottom: 1px solid var(--border-subtle); }
.help-entry-list__link { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-2); text-decoration: none; color: var(--fg-body); }
.help-entry-list__link:hover { background: var(--bg-hover); }
.help-entry-list__link .icon { color: var(--fg-muted); }
.help-entry-list__text { flex: 1; min-width: 0; }
.help-entry-list__name { display: block; color: var(--fg-primary); font-weight: var(--fw-medium); }
.help-entry-list__desc { display: block; font-size: var(--fs-small); color: var(--fg-muted); }
.help-entry-list__desc mark { background: var(--status-review-bg); color: inherit; border-radius: var(--radius-sm); }
.help-article__search { display: none; }
.help-teaser { display: flex; gap: var(--space-8); align-items: center; padding: var(--space-5) 0; border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle); }
.help-teaser__text { flex: 1; display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.help-teaser .help-article__heading { margin-bottom: 0; }
.help-teaser__text p { color: var(--fg-body); }
.task-steps { flex-direction: column; align-items: stretch; gap: var(--space-4); }
.task-steps .steps__item { align-items: flex-start; gap: var(--space-3); color: var(--fg-body); font-size: var(--fs-body); }
.task-steps .steps__num { flex: none; }
.task-steps strong { color: var(--fg-primary); font-weight: var(--fw-semibold); }
.task-steps .steps__item > span > strong:first-child { display: block; }
.diagram-figure { --dg-u: 1px; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); padding: var(--space-3); }
.diagram-figure figcaption { margin-top: var(--space-2); font-size: var(--fs-caption); color: var(--fg-muted); }
.diagram-figure__hint { display: none; }
.diagram-figure__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.diagram-figure__title { font-size: var(--fs-small); font-weight: var(--fw-medium); color: var(--fg-primary); }
.diagram-figure__scroll { overflow-x: auto; border-radius: var(--radius-md); }
.diagram-figure__scroll:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.diagram-figure__svg { display: block; width: calc(var(--w) * var(--dg-u)); max-width: none; height: auto; overflow: visible; font-family: inherit; }
.diagram-figure--full .diagram-figure__svg { width: 100%; min-width: calc(var(--w) * var(--dg-u)); }
.diagram-figure__card rect { fill: var(--bg-surface); stroke: var(--border-control); stroke-width: 1; rx: var(--radius-md); }
.diagram-figure__card--group rect { fill: var(--bg-sidebar); }
.diagram-figure__name { font-size: var(--fs-small); font-weight: var(--fw-semibold); fill: var(--fg-primary); text-anchor: middle; }
.diagram-figure__sub { font-size: var(--fs-caption); fill: var(--fg-muted); text-anchor: middle; }
.diagram-figure__label { font-size: var(--fs-caption); fill: var(--fg-muted); }
.diagram-figure__label--center { text-anchor: middle; }
.diagram-figure__decision { font-size: var(--fs-caption); font-weight: var(--fw-semibold); fill: var(--fg-primary); text-anchor: middle; }
.diagram-figure__line { stroke: var(--fg-muted); stroke-width: 1.5; fill: none; }
.diagram-figure__head-fill { fill: var(--fg-muted); }
.diagram-figure__diamond { fill: var(--bg-surface); stroke: var(--border-control); stroke-width: 1; }
.diagram-thumb { --dg-u: 1px; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--bg-surface); width: calc(var(--layout-sidebar-w) * 1.4); max-width: 100%; }
.diagram-thumb .diagram-figure__svg { width: 100%; }
.help-feedback { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-8); padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle); }
.help-feedback__title, .help-related__title { font-size: var(--fs-h3); font-weight: var(--fw-semibold); color: var(--fg-primary); }
.help-feedback .btn[aria-pressed="true"] { border-color: var(--border-action); color: var(--fg-link); background: var(--bg-brand-soft); }
.help-feedback__form { display: flex; flex-direction: column; gap: var(--space-3); max-width: calc(var(--layout-sidebar-w) * 2); }
.help-related { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-6); }
.help-related ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.help-related a { display: inline-flex; align-items: center; gap: var(--space-2); }
.glossary__letter { font-size: var(--fs-h2); color: var(--fg-primary); padding: var(--space-6) 0 var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.glossary__entry { padding: var(--space-4) 0; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: var(--space-1); }
.glossary__term { font-weight: var(--fw-semibold); color: var(--fg-primary); font-size: var(--fs-body); }
.glossary__def { margin: 0; color: var(--fg-body); line-height: var(--lh-loose); }
.glossary__used { margin: 0; font-size: var(--fs-small); color: var(--fg-muted); }
@media (max-width: 1023.98px) {
  .diagram-figure:not(.diagram-figure--full) .diagram-figure__scroll { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-2); }
  .diagram-figure__hint { display: inline; }
  .diagram-figure--full .diagram-figure__svg { min-width: 0; }
  .help-body, .help-body--no-toc { grid-template-columns: minmax(0, 1fr); }
  .help-main { padding: var(--space-6) var(--space-4) var(--space-12); }
  .help-article h1 { font-size: var(--fs-h1); }
  .help-article__lead { font-size: var(--fs-body); }
  .help-feedback { margin-top: var(--space-6); }
}
@media (max-width: 767.98px) {
  .help-topbar { display: flex; gap: var(--space-2); padding: 0 var(--space-4); }
  .help-topbar__brand { margin-right: auto; }
  .help-topbar > .searchbox { display: none; }
  .help-topbar__search-link { display: inline-flex; }
  .help-topbar__end { gap: var(--space-3); }
  .help-topbar__back { justify-content: center; width: 30px; height: 30px; border-radius: var(--radius-md); color: var(--fg-body); }
  .help-topbar__back:hover { background: var(--bg-hover); color: var(--fg-primary); }
  .help-topbar__back .icon { width: var(--icon-md); height: var(--icon-md); }
  .help-topbar__back-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .help-article__search { display: flex; }
  .help-teaser { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
}
@media (min-width: 1024px) {
  .help-body { align-content: stretch; }
  .help-main { grid-column: 2; grid-row: 1; }
  .help-disclosure--nav { grid-column: 1; grid-row: 1; background: var(--bg-sidebar); border-bottom: 0; border-right: 1px solid var(--border-subtle); }
  .help-disclosure--toc { grid-column: 3; grid-row: 1; background: transparent; border-bottom: 0; position: sticky; top: 0; align-self: start; }
}
@media (min-width: 1024px) {
  @supports selector(::details-content) {
    .help-disclosure::details-content { content-visibility: visible; display: contents; }
    .help-disclosure > summary { display: none; }
    .help-nav { padding: var(--space-4) var(--space-3); }
    .on-page-toc { padding: var(--space-10) var(--space-4) var(--space-6); }
    .on-page-toc__title { display: block; }
  }
}
/* ---------- Focus: the one ring (var(--ring), var(--ring-inset) in clipped containers) ---------- */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
}

/* ============================================================ archetypes */
@layer archetypes {
/* ---------- Archetypes: detail, form, centered and help pages ---------- */
.form-shell { max-width: 720px; margin-inline: auto; width: 100%; display: flex; flex-direction: column; gap: var(--space-6); }
/* Flow (archetype flow, ADR-0077 D2, issue 583): rail · step · live panel. */
.flow { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: flex-start; overflow-x: clip; }
/* Wrapping, not a breakpoint: rail · step · panel side by side only while the
   step keeps 28rem; on a laptop the panel wraps under the step at full width
   (the step's flex-grow takes the slack in the three-column row). The panel's
   hairline sits half a gap left of it; when it starts its own row that
   hairline lies outside the box and is clipped. */
.flow > .flow-rail { flex: 0 0 var(--layout-flow-rail-w); }
.flow__main { flex: 999 1 28rem; display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.flow > .flow-panel { flex: 1 0 var(--layout-aside-w); margin-left: calc(-1 * var(--space-4) - 1px); padding-left: var(--space-4); }
@media (max-width: 1023.98px) {
  .flow { gap: var(--space-6); }
  .flow > .flow-rail, .flow__main { flex-basis: 100%; }
  .flow > .flow-panel { margin-left: 0; padding-left: 0; }
}
.page-centered { display: grid; place-items: center; padding: var(--space-6); }
.page-centered > main { width: 100%; }
.detail-grid__main { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.detail-grid__aside-collapse { display: flex; flex-direction: column; min-width: 0; }
.detail-grid:has(.detail-grid__aside-collapse:not([open])) { grid-template-columns: minmax(0, 1fr) auto; }
.detail-grid__aside-toggle::-webkit-details-marker { display: none; }
.detail-grid__aside-toggle:hover { color: var(--fg-primary); border-color: var(--border-strong); background: var(--bg-hover); }
.detail-grid__aside-toggle:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
.detail-grid__aside-toggle .icon { transition: transform var(--dur-fast) var(--ease-out); }
.detail-grid__aside-collapse:not([open]) .detail-grid__aside-toggle .icon { transform: rotate(180deg); }
.detail-grid__aside-toggle-label { display: none; }
.detail-grid__aside > .card:has(.doc-toc) { position: sticky; top: var(--layout-topbar-h); }
.form-shell > .card { border-top: 0; }
.form-shell > .card > .card__body { padding-top: 0; }
.form-shell > .section { border-top: 1px solid var(--border-subtle); padding-top: var(--space-6); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 30%, 360px); align-items: start; gap: 0 var(--space-8); }
.detail-grid__aside { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; padding-left: var(--space-5);
  border-left: 1px solid var(--border-subtle); }
.detail-grid__aside-toggle { display: inline-flex; align-items: center; justify-content: center; align-self: flex-end; list-style: none;
  cursor: pointer; user-select: none; width: 32px; height: 32px; margin-bottom: var(--space-2); border: 1px solid var(--border-subtle);
  color: var(--fg-muted); border-color: var(--border-control); background: var(--bg-surface); border-radius: var(--radius-md); }
.form-shell > .steps ~ form > .flash { margin-bottom: var(--space-6); }
.detail-grid__main > .section:first-child { margin-top: var(--space-6); }
.detail-grid__aside-collapse:has(> .detail-grid__aside > .props-block:first-child) > .detail-grid__aside-toggle { position: relative; z-index: 1;
  margin-bottom: calc(-1 * var(--space-8)); width: var(--space-8); height: var(--space-8); }
.detail-grid__aside > .props-block:first-child { min-height: var(--space-8); }
.detail-grid__aside > .props-block:first-child .props__title { padding-right: var(--space-10); line-height: var(--space-8); margin: 0; }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 0 var(--space-10); }
.dash-grid > .section { min-width: 0; }
.form-shell form > .flash { margin-block-end: var(--space-5); }
.form-shell--wide { max-width: 60rem; }
.form-shell > .tabs + form > .card, .form-shell > .tabs + form .form-section:first-child { border-top: 0; }
.form-shell--wide > form, .form-shell--wide .card, .form-shell--wide .card__body, .form-shell--wide .form-section { min-width: 0; max-width: 100%; }
.help-shell { --help-measure: calc(var(--layout-sidebar-w) * 3); min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-app); }
/* ---------- Archetype: home (ADR-0077 D2, issue 579) — main 2/3, panel 1/3 from 1024px; stacked below ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.home__main { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
.home__main > .stat-strip { margin-top: 0; }
.home__setup { display: contents; }
.home__panel { display: flex; flex-direction: column; gap: var(--space-6); min-width: 0; }
@media (max-width: 1023.98px) {
  .detail-grid:has(.detail-grid__aside-collapse:not([open])) { grid-template-columns: 1fr; }
  .detail-grid__aside-collapse { border-top: 1px solid var(--border-subtle); padding-top: var(--space-4); }
  .detail-grid__aside { padding-left: 0; border-left: 0; border-top: 0; padding-top: 0; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1024px) {
  .home { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .home__panel { padding-left: var(--space-5); border-left: 1px solid var(--border-subtle); }
  .detail-grid { grid-template-columns: minmax(0, 1fr) var(--layout-aside-w); }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid .orow__fw, .dash-grid .olist__col-fw { display: none; }
  .dash-grid .olist__cols, .dash-grid .orow { grid-template-columns: 16px 5.25rem minmax(0, 1fr) 8rem 5rem; }
}
}

/* ============================================================ utilities */
@layer utilities {
/* ---------- Utilities ---------- */
.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0; }
}

