/* Amanah Alpha — Assurance Workspace
   Enterprise registry design system. Vanilla CSS, no external fonts (CSP). */

:root {
  color-scheme: light;
  --bg: #f3f4ef;
  --surface: #ffffff;
  --surface-2: #fafbf6;
  --surface-glass: rgba(255, 255, 255, .92);
  --ink: #182b23;
  --body: #3d4a42;
  --muted: #66746a;
  --faint: #8b968c;
  --line: #e3e6dc;
  --line-2: #d2d8c8;
  --brand: #143c31;
  --brand-hover: #1c4d3f;
  --brand-soft: #e9f0e7;
  --brand-softer: #f1f5ec;
  --gold: #a8842c;
  --gold-deep: #8a6a1f;
  --gold-soft: #f7f0dc;
  --gold-line: #e7dab4;
  --red: #ab3f36;
  --red-soft: #f9ece9;
  --red-line: #ecd2cc;
  --slate: #5c6b78;
  --slate-soft: #eef1f4;
  --slate-line: #d9e0e6;
  --ok: #2e7d4f;
  --radius: 12px;
  --radius-s: 8px;
  --shadow-s: 0 1px 2px rgba(24, 43, 35, .05);
  --shadow-m: 0 10px 30px -12px rgba(24, 43, 35, .18);
  --ring: 0 0 0 3px rgba(168, 132, 44, .28);
  --allow-soft: #edf5ea;
  --allow-line: #cfe0cd;
  --allow-ink: #256b46;
}

/* ---------- Dark institutional theme ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10171a;
  --surface: #171f23;
  --surface-2: #1c2529;
  --surface-glass: rgba(23, 31, 35, .92);
  --ink: #e8edea;
  --body: #c3cdc7;
  --muted: #93a09a;
  --faint: #6f7d76;
  --line: #263135;
  --line-2: #314046;
  --brand: #7fc4a4;
  --brand-hover: #93d2b3;
  --brand-soft: #1d332c;
  --brand-softer: #182a25;
  --gold: #d2ab54;
  --gold-deep: #e0bd6d;
  --gold-soft: #2e2817;
  --gold-line: #4d421f;
  --red: #e0837a;
  --red-soft: #331d1a;
  --red-line: #522e29;
  --slate: #9fb0bd;
  --slate-soft: #222c31;
  --slate-line: #37454c;
  --ok: #6cc793;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-m: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(210, 171, 84, .35);
  --allow-soft: #1b2e23;
  --allow-line: #2c4636;
  --allow-ink: #8fd0ab;
}
html[data-theme="dark"] body { background: var(--bg); }
html[data-theme="dark"] .topbar { background: var(--surface-glass); }
html[data-theme="dark"] .decision-badge { border-color: var(--allow-line); background: var(--allow-soft); color: var(--allow-ink); }
html[data-theme="dark"] .environment-pill { border-color: var(--allow-line); background: var(--allow-soft); color: var(--allow-ink); }
html[data-theme="dark"] .kpi--allow .kpi-chip { border-color: var(--allow-line); background: var(--allow-soft); color: var(--allow-ink); }
html[data-theme="dark"] .control-glyph.satisfied,
html[data-theme="dark"] .presence-tag.present,
html[data-theme="dark"] .state-pip.satisfied,
html[data-theme="dark"] .saved-icon,
html[data-theme="dark"] .timeline-tag.green,
html[data-theme="dark"] .state-chip.acknowledged { background: var(--allow-soft); color: var(--allow-ink); }
html[data-theme="dark"] .empty-inline { border-color: var(--allow-line); background: var(--brand-softer); color: var(--allow-ink); }
html[data-theme="dark"] .integrity-indicator { border-color: var(--allow-line); background: var(--allow-soft); color: var(--allow-ink); }
html[data-theme="dark"] .integrity-panel[data-changed="true"] .integrity-indicator { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold-deep); }
html[data-theme="dark"] .version-chip.to { border-color: var(--allow-line); background: var(--allow-soft); color: var(--allow-ink); }
html[data-theme="dark"] .stack-seg.unchanged, html[data-theme="dark"] .stack-legend-row .swatch.unchanged { background: #3a474d; }
html[data-theme="dark"] .state-chip.escalated { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
html[data-theme="dark"] .mandate-summary { background: linear-gradient(135deg, var(--brand-softer), var(--surface-2)); }
html[data-theme="dark"] .decision-banner { border-color: var(--allow-line); background: var(--brand-softer); }
html[data-theme="dark"] .decision-banner[data-decision="DENY"] { border-color: var(--red-line); background: var(--red-soft); }
html[data-theme="dark"] .decision-banner[data-decision="REVIEW_REQUIRED"] { border-color: var(--gold-line); background: var(--gold-soft); }
html[data-theme="dark"] .decision-banner[data-decision="UNVERIFIABLE"] { border-color: var(--slate-line); background: var(--slate-soft); }
html[data-theme="dark"] .control-top .icon { border-color: var(--allow-line); background: var(--allow-soft); color: var(--brand); }
html[data-theme="dark"] .toast { background: var(--brand); color: #10231b; }
html[data-theme="dark"] .nav-item.is-active .nav-count { background: var(--brand); border-color: var(--brand); color: #10231b; }
html[data-theme="dark"] .brand-mark { color: #10231b; }
html[data-theme="dark"] .brand-mark span { color: #c9b98a; }
html[data-theme="dark"] .overview-metrics { background: var(--surface); }
html[data-theme="dark"] .attention-item { border-top-color: var(--line); }
html[data-theme="dark"] .attention-item > .icon { color: var(--faint); }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
h1, h2, h3, h4, p { margin-top: 0; }
code, kbd, pre { font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
[hidden] { display: none !important; }

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  display: inline-block; width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; padding: 12px; background: white; z-index: 40; transform: translateY(-160%); border-radius: 8px; box-shadow: var(--shadow-m); }
.skip-link:focus { transform: translateY(0); }

/* ---------- Shell ---------- */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.main-shell { min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; width: 100%; max-width: 1760px; margin: 0 auto; padding: 26px 32px 44px; outline: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh;
  padding: 22px 16px 16px; border-right: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 6px 24px; text-decoration: none; }
.brand-mark {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 11px; background: var(--brand); color: #f2eeda; font: 24px/1 Georgia, serif;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 2px 6px rgba(20, 60, 49, .25);
}
.brand-mark span { position: absolute; right: 4px; bottom: 3px; font-size: 10px; color: #c9b98a; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.4px; line-height: 1.05; display: flex; flex-direction: column; }
.brand-alpha { color: var(--faint); font-weight: 500; font-size: 13px; letter-spacing: 0; }
.workspace-switch { display: flex; align-items: center; gap: 10px; margin: 0 2px 22px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.workspace-symbol { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; }
.workspace-switch strong { display: block; font-size: 12px; font-weight: 650; }
.workspace-switch div > span { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }

.nav-label { margin: 4px 12px 8px; color: var(--faint); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-label--group { margin-top: 16px; }
.side-nav { display: grid; gap: 3px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 38px; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); text-align: left; font-size: 12.5px; font-weight: 570;
  transition: background .14s, color .14s;
}
.nav-item .icon { width: 17px; height: 17px; color: var(--faint); transition: color .14s; }
.nav-item:hover { background: var(--brand-softer); color: var(--ink); }
.nav-item:hover .icon { color: var(--brand); }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav-item.is-active .icon { color: var(--brand); }
.nav-item.is-active::before {
  content: ''; position: absolute; left: -16px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-count {
  display: grid; place-items: center; margin-left: auto; min-width: 19px; height: 19px;
  padding: 0 5px; border-radius: 6px; background: var(--gold-soft); border: 1px solid var(--gold-line);
  color: var(--gold-deep); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.nav-item.is-active .nav-count { background: var(--brand); border-color: var(--brand); color: #f2f6ee; }

.sidebar-bottom { margin-top: auto; padding-top: 22px; }
.reference-notice { padding: 13px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(46, 125, 79, .14); }
.reference-notice .status-dot { margin-right: 6px; }
.reference-notice strong { font-size: 10.5px; }
.reference-notice p { margin: 8px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.reference-notice a { display: flex; justify-content: space-between; align-items: center; text-decoration: none; font-size: 10.5px; font-weight: 620; color: var(--brand); }
.reference-notice a:hover { text-decoration: underline; }
.reference-notice .icon { width: 12px; height: 12px; }
.session-card { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 13px 2px 0; border-top: 1px solid var(--line); }
.session-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; background: var(--brand-soft); border: 1px solid var(--line-2); border-radius: 50%; color: var(--brand); font-size: 11px; font-weight: 700; }
.session-avatar .icon { width: 15px; height: 15px; }
.session-card strong { display: block; font-size: 11px; font-weight: 640; }
.session-card div > span { display: block; margin-top: 2px; color: var(--faint); font-size: 9px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 22px; min-height: 58px; padding: 8px 32px;
  border-bottom: 1px solid var(--line); background: var(--surface-glass); backdrop-filter: blur(8px);
}
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 12px; white-space: nowrap; }
.breadcrumb > span { color: var(--line-2); }
.breadcrumb strong { color: var(--ink); font-weight: 620; }
.crumb-root { padding: 3px 7px; margin-left: -7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 570; }
.crumb-root:hover { background: var(--brand-softer); color: var(--brand); }
.global-search { position: relative; display: flex; align-items: center; gap: 9px; width: min(520px, 100%); justify-self: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--faint); transition: border-color .14s, box-shadow .14s; }
.global-search:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: var(--ring); }
.global-search .icon { width: 15px; height: 15px; }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12.5px; }
.global-search input::placeholder { color: var(--faint); }
.global-search kbd { padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--faint); font-size: 10px; }
.search-results {
  position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 50;
  max-height: 400px; overflow: auto; padding: 6px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-m);
}
.search-group { margin: 8px 8px 4px; color: var(--faint); font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.search-option { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.search-option:hover, .search-option.is-active { background: var(--brand-softer); }
.search-option .icon { width: 15px; height: 15px; color: var(--faint); }
.search-option div { min-width: 0; }
.search-option strong { display: block; font-size: 12px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-option span { display: block; color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { padding: 16px; color: var(--muted); font-size: 12px; text-align: center; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.bundle-pill { padding: 5px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 10.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.environment-pill { display: inline-flex; align-items: center; padding: 5px 10px; border: 1px solid #cfe0cd; border-radius: 7px; background: #edf5ea; color: #256b46; font-size: 10.5px; font-weight: 620; white-space: nowrap; }
.environment-pill .status-dot { margin-right: 6px; width: 6px; height: 6px; box-shadow: none; }
.heading-link-wrap { display: inline-flex; align-items: center; gap: 12px; }
.heading-link-wrap .text-button { padding: 2px 0; }
.copyable { cursor: copy; }
.copyable:hover { border-color: var(--brand); color: var(--brand); }
.icon-link { display: grid; place-items: center; width: 32px; height: 32px; color: var(--muted); border-radius: 8px; }
.icon-link:hover { background: var(--brand-softer); color: var(--brand); }
.icon-link .icon { width: 16px; height: 16px; }
.topbar-avatar { width: 30px; height: 30px; }

/* ---------- Page heading ---------- */
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 7px; color: var(--gold-deep); font-size: 9.5px; font-weight: 750; letter-spacing: .16em; }
.page-heading h1 { margin: 0 0 7px; font-size: clamp(22px, 1.9vw, 28px); font-weight: 680; letter-spacing: -.9px; line-height: 1.12; }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 12.5px; }

/* ---------- Buttons ---------- */
.primary-button, .secondary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: #f6f8f2; font-size: 11.5px; font-weight: 640; text-decoration: none;
  transition: background .14s, border-color .14s, transform .14s;
}
.primary-button:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.primary-button:active, .secondary-button:active { transform: translateY(1px); }
.secondary-button { border-color: var(--line-2); background: var(--surface); color: var(--brand); }
.secondary-button:hover { background: var(--brand-softer); border-color: #c2cdb6; }
.primary-button .icon, .secondary-button .icon { width: 14px; height: 14px; }
.ghost-button { min-height: 36px; padding: 8px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 620; }
.ghost-button:hover { background: var(--slate-soft); color: var(--ink); }
.text-button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 0; border: 0; background: transparent; color: var(--brand); font-size: 11px; font-weight: 650; white-space: nowrap; }
.text-button .icon { width: 13px; height: 13px; }
.text-button:hover { color: var(--brand-hover); text-decoration: underline; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--brand); }
.icon-button:hover { background: var(--brand-softer); }

/* ---------- Panels ---------- */
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.sub-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.sub-panel-heading h3 { margin: 0; font-size: 12.5px; font-weight: 680; letter-spacing: -.15px; }
.quiet-label { color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.panel-note { margin: 0; padding: 11px 18px 13px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; line-height: 1.6; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Badges & tags ---------- */
.decision-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
  border: 1px solid #cfe0cd; border-radius: 7px; background: #edf5ea; color: #256b46;
  font-size: 9.5px; font-weight: 720; letter-spacing: .05em; white-space: nowrap;
}
.decision-badge::before { content: ''; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.decision-badge.deny { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.decision-badge.review { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold-deep); }
.decision-badge.unverifiable { border-color: var(--slate-line); background: var(--slate-soft); color: var(--slate); }
.verification-tag { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-size: 10px; font-weight: 650; white-space: nowrap; }
.verification-tag::before { content: '✓'; font-size: 11px; font-weight: 700; }
.verification-tag.unverified { color: var(--gold-deep); }
.verification-tag.unverified::before { content: '—'; }
.severity-chip, .state-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px;
  border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 9px; font-weight: 720; letter-spacing: .05em; white-space: nowrap;
}
.severity-chip::before, .state-chip::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.severity-chip.high { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.severity-chip.medium { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold-deep); }
.severity-chip.info { border-color: var(--slate-line); background: var(--slate-soft); color: var(--slate); }
.state-chip.open { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.state-chip.acknowledged { border-color: #cfe0cd; background: #edf5ea; color: #256b46; }
.state-chip.follow_up_required { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold-deep); }
.state-chip.escalated { border-color: #e0b7b1; background: #f6ded9; color: #8f2f27; }
.profile-pill { padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 700; letter-spacing: .06em; }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  display: flex; flex-direction: column; gap: 12px; min-height: 108px; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-s); text-align: left; color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
button.kpi:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-m); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-chip { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--brand); }
.kpi-chip .icon { width: 17px; height: 17px; }
.kpi--allow .kpi-chip { border-color: #cfe0cd; background: #edf5ea; color: #256b46; }
.kpi--deny .kpi-chip { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.kpi--review .kpi-chip { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold-deep); }
.kpi--unverifiable .kpi-chip { border-color: var(--slate-line); background: var(--slate-soft); color: var(--slate); }
.kpi--findings .kpi-chip { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold-deep); }
.kpi-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi-body { display: flex; align-items: baseline; gap: 9px; }
.kpi-body strong { font-size: 30px; font-weight: 640; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--faint); font-size: 10.5px; }

/* ---------- Registry toolbar / tabs / filters ---------- */
.registry-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.view-tabs { display: flex; gap: 2px; overflow-x: auto; }
.view-tabs button {
  position: relative; display: flex; align-items: center; gap: 7px; padding: 10px 13px;
  border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.view-tabs button:hover { color: var(--ink); }
.view-tabs button[aria-pressed="true"] { color: var(--brand); font-weight: 680; border-bottom-color: var(--brand); }
.tab-count { display: grid; place-items: center; min-width: 17px; height: 16px; padding: 0 4px; border-radius: 5px; background: var(--slate-soft); color: var(--slate); font-size: 9.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.view-tabs button[aria-pressed="true"] .tab-count { background: var(--brand-soft); color: var(--brand); }
.result-count { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-field { display: flex; align-items: center; gap: 8px; width: min(320px, 100%); min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--faint); }
.search-field:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.search-field .icon { width: 14px; height: 14px; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-field input::placeholder { color: var(--faint); }
.filter-field { display: flex; align-items: center; gap: 8px; }
.filter-field > label { color: var(--faint); font-size: 10.5px; font-weight: 620; white-space: nowrap; }
select {
  max-width: 100%; min-height: 36px; padding: 7px 26px 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 11.5px; font-weight: 570;
}

/* ---------- Registry table ---------- */
.registry-layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 18px; align-items: start; }
.registry-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.table-scroll { overflow-x: auto; }
.registry-table { width: 100%; border-collapse: collapse; text-align: left; }
.registry-table th {
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  color: var(--faint); font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap;
}
.th-sort { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.th-sort::after { content: ''; width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; opacity: .25; }
.th-sort:hover { color: var(--brand); }
th[aria-sort="ascending"] .th-sort { color: var(--brand); }
th[aria-sort="ascending"] .th-sort::after { border-bottom: 4.5px solid currentColor; opacity: 1; }
th[aria-sort="descending"] .th-sort { color: var(--brand); }
th[aria-sort="descending"] .th-sort::after { border-top: 4.5px solid currentColor; opacity: 1; }
.registry-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.registry-table tbody tr { transition: background .12s; }
.registry-table tbody tr:hover { background: var(--surface-2); }
.registry-table tbody tr.is-selected { background: var(--brand-softer); box-shadow: inset 3px 0 0 var(--brand); }
.registry-table tbody tr:last-child td { border-bottom: 0; }
.registry-table th:first-child, .registry-table td:first-child { padding-left: 18px; }
.registry-table th:last-child, .registry-table td:last-child { padding-right: 18px; }
.registry-table td.empty-cell { padding: 30px 18px; color: var(--muted); text-align: center; font-size: 12px; }
.cell-case { min-width: 190px; }
.cell-case strong { display: block; font-size: 12.5px; font-weight: 640; letter-spacing: -.1px; }
.cell-case code { display: block; margin-top: 2px; color: var(--faint); font-size: 9.5px; }
.cell-asset { white-space: nowrap; }
.asset-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--gold-line); border-radius: 7px; background: var(--gold-soft); color: var(--gold-deep); font-size: 10.5px; font-weight: 700; }
.asset-chip .asset-glyph { font-size: 11px; }
.asset-chip.eth { border-color: var(--slate-line); background: var(--slate-soft); color: var(--slate); }
.cell-venue { color: var(--muted); font-size: 10px; white-space: nowrap; }
.cell-findings { white-space: nowrap; }
.finding-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 620; }
.finding-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.finding-pill.medium::before { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.finding-pill.info-only::before { background: var(--slate); box-shadow: 0 0 0 3px var(--slate-soft); }
.finding-pill.none { color: var(--faint); font-weight: 570; }
.finding-pill.none::before { background: var(--line-2); box-shadow: none; }
.finding-pill small { color: var(--faint); font-weight: 570; }
.cell-evidence { white-space: nowrap; }
.evidence-meter { display: flex; align-items: center; gap: 8px; }
.evidence-meter strong { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.evidence-meter .meter { width: 44px; height: 5px; border-radius: 3px; background: var(--slate-soft); overflow: hidden; }
.evidence-meter .meter i { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.evidence-meter.incomplete .meter i { background: var(--gold); }
.cell-review .state-chip { font-size: 8.5px; }
.row-action { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--faint); }
.row-action:hover { background: var(--brand-soft); color: var(--brand); }
.row-action .icon { width: 14px; height: 14px; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); color: var(--faint); font-size: 10px; }
.table-footer .status-dot { width: 6px; height: 6px; box-shadow: none; }

/* ---------- Workbench ---------- */
.workbench { min-width: 0; }
.workbench-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding: 18px 20px; margin-bottom: 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s);
}
.workbench-title .eyebrow { margin-bottom: 5px; }
.workbench-title h2 { margin: 0 0 5px; font-size: 19px; font-weight: 670; letter-spacing: -.5px; }
.workbench-title p { margin: 0; color: var(--muted); font-size: 11.5px; }
.workbench-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; flex-shrink: 0; }
.workbench-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.workbench-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); gap: 16px; }
.workbench-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.workbench-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 16px; color: var(--faint); font-size: 10px; }
.workbench-footnote .icon { width: 13px; height: 13px; }

.decision-banner { margin: 16px 18px 0; padding: 14px 16px; border: 1px solid #cfe0cd; border-left: 3px solid var(--ok); border-radius: 9px; background: #f2f8ee; }
.decision-banner__label { margin: 0 0 5px; color: var(--muted); font-size: 8.5px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.decision-banner h4 { margin: 0 0 5px; font-size: 13.5px; font-weight: 670; letter-spacing: -.2px; }
.decision-banner p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.decision-banner[data-decision="DENY"] { border-color: var(--red-line); border-left-color: var(--red); background: #fbf1ee; }
.decision-banner[data-decision="REVIEW_REQUIRED"] { border-color: var(--gold-line); border-left-color: var(--gold); background: #fbf6e7; }
.decision-banner[data-decision="UNVERIFIABLE"] { border-color: var(--slate-line); border-left-color: var(--slate); background: #f2f5f8; }

.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 6px 18px 12px; }
.fact { padding: 10px 0 9px; border-bottom: 1px solid var(--line); }
.fact dt { margin: 0 0 3px; color: var(--faint); font-size: 9.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.fact dd { margin: 0; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.controls-list { display: flex; flex-direction: column; margin: 0; padding: 4px 18px 8px; list-style: none; }
.controls-list li { display: flex; align-items: center; gap: 11px; padding: 9px 8px; margin: 0 -8px; border: 0; border-bottom: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: background .12s; }
.controls-list li:hover { background: var(--brand-softer); }
.controls-list li:focus-visible { box-shadow: var(--ring); }
.controls-list li:last-child { border-bottom: 0; }
.control-glyph { display: grid; place-items: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 7px; font-size: 11px; font-weight: 800; }
.control-glyph.satisfied { background: #e7f2e6; color: var(--ok); }
.control-glyph.violated { background: var(--red-soft); color: var(--red); }
.control-glyph.review { background: var(--gold-soft); color: var(--gold-deep); }
.control-glyph.insufficient { background: var(--slate-soft); color: var(--slate); }
.controls-list .control-name { flex: 1; min-width: 0; }
.controls-list .control-name strong { display: block; font-size: 11.5px; font-weight: 620; }
.controls-list .control-name span { display: block; margin-top: 1px; color: var(--faint); font-size: 9.5px; }
.control-state { font-size: 8.5px; font-weight: 720; letter-spacing: .06em; white-space: nowrap; }
.control-state.satisfied { color: var(--ok); }
.control-state.violated { color: var(--red); }
.control-state.review { color: var(--gold-deep); }
.control-state.insufficient { color: var(--slate); }

.manifest-table { width: 100%; border-collapse: collapse; }
.manifest-table th { padding: 9px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.manifest-table td { padding: 10px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.manifest-table tbody tr:hover td { background: var(--brand-softer); }
.manifest-table tr:last-child td { border-bottom: 0; }
.manifest-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.manifest-line strong { font-size: 11.5px; font-weight: 630; text-transform: capitalize; }
.manifest-table td > code { display: block; margin-top: 3px; color: var(--faint); font-size: 9.5px; overflow-wrap: anywhere; }
.presence-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 8.5px; font-weight: 720; letter-spacing: .06em; }
.presence-tag.present { background: #e7f2e6; color: var(--ok); }
.presence-tag.missing { background: var(--red-soft); color: var(--red); }
.presence-tag.present::before { content: '✓'; font-size: 10px; }
.presence-tag.missing::before { content: '—'; font-size: 10px; }

.finding-count { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red); font-size: 10px; font-weight: 720; font-variant-numeric: tabular-nums; }
.finding-count.clear { background: #e7f2e6; border-color: #cfe0cd; color: var(--ok); }
.case-findings { display: flex; flex-direction: column; margin: 0; padding: 6px 18px 10px; list-style: none; }
.case-findings li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.case-findings li:last-child { border-bottom: 0; }
.finding-dot { width: 8px; height: 8px; flex-shrink: 0; margin-top: 5px; border-radius: 50%; }
.finding-dot.high { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.finding-dot.medium { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.finding-dot.info { background: var(--slate); box-shadow: 0 0 0 3px var(--slate-soft); }
.case-findings .finding-body { flex: 1; min-width: 0; }
.case-findings strong { display: block; font-size: 12px; font-weight: 640; letter-spacing: -.1px; }
.case-findings .finding-detail { display: block; margin: 3px 0 7px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.finding-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.finding-meta .category { padding: 2px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 8.5px; font-weight: 720; letter-spacing: .07em; }
.finding-meta code { color: var(--faint); font-size: 9.5px; }
.case-findings .state-chip { align-self: flex-start; margin-top: 2px; }
.empty-inline { display: flex; align-items: flex-start; gap: 10px; margin: 12px 18px 14px; padding: 13px 14px; border: 1px dashed #cfe0cd; border-radius: 9px; background: #f4f9f0; color: #3c6b4f; }
.empty-inline .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--ok); }
.empty-inline p { margin: 0; font-size: 11.5px; line-height: 1.6; }

.timeline { display: flex; flex-direction: column; margin: 0; padding: 14px 18px 12px; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.timeline li:last-child { padding-bottom: 2px; }
.timeline li::before { content: ''; position: absolute; left: 6.5px; top: 16px; bottom: -2px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline-dot { width: 15px; height: 15px; margin-top: 2px; border-radius: 50%; border: 3.5px solid var(--brand); background: var(--surface); z-index: 1; }
.timeline-dot.gold { border-color: var(--gold); }
.timeline-dot.green { border-color: var(--ok); }
.timeline-dot.slate { border-color: var(--slate); }
.timeline-dot.red { border-color: var(--red); }
.timeline-body { min-width: 0; }
.timeline-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.timeline-top strong { font-size: 12px; font-weight: 640; }
.timeline-tag { padding: 2px 7px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 8.5px; font-weight: 750; letter-spacing: .05em; white-space: nowrap; }
.timeline-tag.gold { background: var(--gold-soft); color: var(--gold-deep); }
.timeline-tag.green { background: #e7f2e6; color: var(--ok); }
.timeline-tag.slate { background: var(--slate-soft); color: var(--slate); }
.timeline-tag.red { background: var(--red-soft); color: var(--red); }
.timeline-body p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.timeline-body code { display: block; margin-top: 4px; color: var(--faint); font-size: 9.5px; overflow-wrap: anywhere; }
.timeline-action { margin-top: 7px; }
.findings-table tbody tr.is-clickable { cursor: pointer; }
.go-control { text-transform: none; letter-spacing: 0; }
.go-control code { color: inherit; font-size: 9.5px; }

.review-panel .review-lede { margin: 0; padding: 13px 18px 0; color: var(--muted); font-size: 11.5px; }
.review-panel .review-lede strong { color: var(--ink); }
.review-form { display: grid; gap: 13px; padding: 13px 18px 4px; }
.form-field { display: grid; gap: 6px; }
.form-field > label, .label-row label { color: var(--ink); font-size: 11.5px; font-weight: 640; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.label-row > span { color: var(--faint); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.review-form select { max-width: 260px; }
.review-form textarea { width: 100%; min-height: 74px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 12px; line-height: 1.6; }
.review-form textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: var(--ring); }
.review-form textarea::placeholder { color: var(--faint); }
.field-help { margin: 0; font-size: 9.5px; color: var(--faint); }
.review-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.session-label { display: inline-flex; align-items: center; color: var(--faint); font-size: 9.5px; }
.session-label .status-dot { width: 6px; height: 6px; box-shadow: none; }
.review-status { margin: 12px 18px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.review-status[data-tone="error"] { border-color: var(--red-line); background: var(--red-soft); color: var(--red); }
.saved-review { margin: 13px 18px 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.saved-review-body { display: flex; align-items: flex-start; gap: 11px; }
.saved-icon { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: #e7f2e6; color: var(--ok); }
.saved-icon .icon { width: 15px; height: 15px; }
.saved-review-body strong { font-size: 11.5px; }
.saved-review-body p { margin: 4px 0; font-size: 11px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.saved-review-body div > span { color: var(--faint); font-size: 9.5px; }
.saved-review > button { margin: 11px 0 0 39px; }

/* ---------- Right rail ---------- */
.registry-rail { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rail-card-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.rail-card-heading h3 { margin: 0; font-size: 12.5px; font-weight: 680; }
.rail-status { display: flex; flex-direction: column; margin: 0; padding: 6px 16px 10px; list-style: none; }
.rail-status li { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 12px; }
.rail-status li:last-child { border-bottom: 0; }
.rail-status .status-dot { width: 8px; height: 8px; margin: 0; flex-shrink: 0; }
.rail-status .status-dot.allow { background: var(--ok); box-shadow: 0 0 0 3px #e7f2e6; }
.rail-status .status-dot.deny { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.rail-status .status-dot.review { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.rail-status .status-dot.unverifiable { background: var(--slate); box-shadow: 0 0 0 3px var(--slate-soft); }
.rail-status-label { flex: 1; color: var(--body); font-weight: 590; }
.rail-status-row { display: flex; align-items: center; gap: 9px; flex: 1; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; font-size: 12px; }
button.rail-status-row:hover .rail-status-label { text-decoration: underline; }
.rail-status-count { font-size: 15px; font-weight: 680; font-variant-numeric: tabular-nums; }
.rail-status-total { border-top: 1px solid var(--line); margin-top: 2px; padding-top: 10px !important; }
.rail-status-total .rail-status-label { font-weight: 680; color: var(--ink); }
.rail-integrity { display: flex; flex-direction: column; margin: 0; padding: 6px 16px 12px; list-style: none; }
.rail-integrity li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.rail-integrity li:last-child { border-bottom: 0; }
.rail-integrity .row-label { color: var(--muted); }
.rail-integrity .row-value { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.rail-integrity .row-value.ok { color: var(--ok); }
.rail-digest { margin: 0 16px 14px; }
.rail-digest span { display: block; margin-bottom: 5px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.rail-digest code { display: block; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 9.5px; line-height: 1.7; overflow-wrap: anywhere; }
.rail-contents { display: flex; flex-direction: column; margin: 0; padding: 6px 16px 12px; list-style: none; }
.rail-contents li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.rail-contents li:last-child { border-bottom: 0; }
.rail-contents .icon { width: 13px; height: 13px; color: var(--ok); }
.rail-contents .file-name { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-contents .included { color: var(--faint); font-size: 8.5px; font-weight: 720; letter-spacing: .07em; }

/* ---------- Findings view ---------- */
.kpi-grid--findings { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.findings-table .cell-finding { min-width: 280px; }
.findings-table .cell-finding strong { display: block; font-size: 12px; font-weight: 630; letter-spacing: -.1px; }
.findings-table .cell-finding span { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.55; max-width: 480px; }
.findings-table .cell-control code { display: block; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.findings-table .cell-control span { display: block; margin-top: 2px; color: var(--faint); font-size: 9.5px; }

/* ---------- Evidence view ---------- */
.evidence-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.evidence-toolbar .session-label { margin-left: auto; }
.evidence-layout { display: grid; grid-template-columns: 1.08fr .92fr; gap: 18px; align-items: start; }
.integrity-panel > p { margin: 14px 18px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.integrity-indicator { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #cfe0cd; border-radius: 9px; background: #e7f2e6; color: var(--ok); }
.integrity-indicator .icon { width: 17px; height: 17px; }
.integrity-panel[data-changed="true"] .integrity-indicator { border-color: var(--gold-line); background: var(--gold-soft); color: var(--gold-deep); }
.comparison-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 16px 18px 4px; }
.comparison-grid > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.comparison-grid code { display: block; margin-top: 6px; color: var(--body); font-size: 10px; overflow-wrap: anywhere; }
.comparison-grid .quiet-label { font-size: 8px; }
.compare-arrow { color: var(--faint); }
.comparison-grid div.is-changed { border-color: var(--gold-line); background: var(--gold-soft); }
.digest-row { margin: 14px 18px 0; padding-top: 13px; border-top: 1px solid var(--line); }
.digest-row > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.digest-row span:first-child { color: var(--body); font-size: 11px; font-weight: 620; }
.digest-row code { display: block; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.hash-label { color: var(--faint); font-size: 8.5px; font-weight: 700; letter-spacing: .08em; }
.hash-label.match { color: var(--ok); }
.hash-label.mismatch { color: var(--gold-deep); }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 18px 4px; }
.small-note { margin: 12px 18px 16px; color: var(--faint); font-size: 10px; line-height: 1.7; }
.evidence-summary { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin: 14px 18px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.evidence-record-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 14px 18px 4px; }
.evidence-record-meta > div { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.evidence-record-meta span { display: block; color: var(--faint); font-size: 9px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.evidence-record-meta strong { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 620; overflow-wrap: anywhere; }
.json-details { border-top: 1px solid var(--line); margin-top: 12px; }
.json-details summary { padding: 13px 18px; color: var(--brand); font-size: 11px; font-weight: 650; cursor: pointer; }
.json-details summary:hover { background: var(--surface-2); }
.json-details pre { max-height: 320px; margin: 0 18px 16px; padding: 13px; overflow: auto; border-radius: 9px; background: #12271f; color: #d9e8cf; font-size: 10px; line-height: 1.7; }

/* ---------- Mandate view ---------- */
.mandate-summary { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 26px; border: 1px solid var(--line-2); border-radius: var(--radius); background: linear-gradient(135deg, #f0f5ea, #fbfcf6); box-shadow: var(--shadow-s); }
.mandate-summary h2 { max-width: 560px; margin-bottom: 8px; font-size: 24px; font-weight: 640; letter-spacing: -.7px; }
.mandate-summary p:last-child { margin: 0; color: var(--muted); font-size: 10.5px; }
.mandate-summary-meta { display: grid; gap: 10px; justify-items: end; flex-shrink: 0; }
.version-pill { padding: 6px 11px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--brand); font-size: 11px; font-weight: 650; }
.mandate-summary-meta > span:last-child { font-size: 10.5px; color: var(--muted); }
.authority-strip { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.authority-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.authority-icon .icon { width: 17px; height: 17px; }
.authority-strip strong { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 620; }
.authority-strip code { margin-left: auto; color: var(--faint); font-size: 10px; }
.section-heading { margin: 26px 0 16px; }
.section-heading h2 { margin-bottom: 5px; font-size: 18px; font-weight: 650; letter-spacing: -.45px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.control-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.control-card { display: flex; flex-direction: column; padding: 17px 18px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.control-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.control-top .icon { width: 30px; height: 30px; padding: 6px; border: 1px solid #cfe0cd; border-radius: 9px; background: #eef5ea; color: var(--brand); }
.control-top span { color: var(--gold-deep); font-size: 10px; font-weight: 650; }
.control-card h3 { margin-bottom: 11px; font-size: 12.5px; font-weight: 660; letter-spacing: -.15px; }
.control-values { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; flex: 1; margin-bottom: 15px; }
.control-values > span { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--body); font-size: 10.5px; overflow-wrap: anywhere; }
.control-values > .control-number { padding: 0; border: 0; background: none; color: var(--ink); font-size: 26px; font-weight: 620; letter-spacing: -.7px; line-height: 1.1; }
.control-card > code { padding-top: 11px; border-top: 1px solid var(--line); color: var(--faint); font-size: 9.5px; }

/* ---------- States, misc ---------- */
.loading-state { display: flex; gap: 10px; align-items: center; padding: 26px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: 12px; }
.loading-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: blink .7s ease-in-out infinite alternate; }
@keyframes blink { to { opacity: .3; } }
.error-message { padding: 22px; margin-bottom: 18px; border: 1px solid var(--red-line); border-radius: var(--radius); background: var(--red-soft); color: var(--red); }
.error-message p { margin: 6px 0 12px; font-size: 12px; }
.empty-state { padding: 34px 20px; text-align: center; }
.empty-state > .icon { width: 24px; height: 24px; color: var(--faint); }
.empty-state h3 { margin: 12px 0 4px; font-size: 13.5px; }
.empty-state p { margin: 0 0 6px; font-size: 11.5px; color: var(--muted); }
.scope-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.scope-note > .icon { width: 15px; height: 15px; margin-top: 2px; flex-shrink: 0; color: var(--faint); }
.scope-note p { margin: 0; font-size: 11px; line-height: 1.7; }
.app-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 16px 32px; border-top: 1px solid var(--line); background: var(--surface); color: var(--faint); font-size: 10px; }
.footer-separator { margin: 0 6px; color: var(--line-2); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 11px 18px; border-radius: 9px; background: var(--brand); color: #f3f5e7; box-shadow: var(--shadow-m); font-size: 12px; z-index: 60; }
.view { animation: enter .18s ease-out; }
@keyframes enter { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Analytics cards (donut, bars, impact) ---------- */
.analytics-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; margin-bottom: 20px; }
.analytics-card { display: flex; flex-direction: column; }
.analytics-body { flex: 1; padding: 16px 18px; }
#distribution-body, #severity-donut-body { display: flex; flex-direction: column; justify-content: center; }
.analytics-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 16px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.analytics-footer span { color: var(--faint); font-size: 9.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.analytics-footer code { color: var(--muted); font-size: 9.5px; overflow-wrap: anywhere; text-align: right; }
.donut-flex { display: flex; align-items: center; gap: 20px; }
.donut { flex-shrink: 0; }
.donut-seg { transition: stroke-dasharray .5s ease, stroke-dashoffset .5s ease, opacity .2s ease, stroke-width .2s ease; }
.donut:hover .donut-seg { opacity: .38; }
.donut:hover .donut-seg:hover { opacity: 1; stroke-width: 21; }
.donut-value { font-size: 26px; font-weight: 680; letter-spacing: -1px; fill: var(--ink); }
.donut-label { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; fill: var(--faint); }
.donut-legend { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.donut-legend-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 11.5px; }
.donut-legend-row:last-child { border-bottom: 0; }
.donut-legend-row .status-dot { width: 8px; height: 8px; margin: 0; flex-shrink: 0; }
.donut-legend-row .status-dot.allow { background: var(--ok); }
.donut-legend-row .status-dot.deny { background: var(--red); }
.donut-legend-row .status-dot.review { background: var(--gold); }
.donut-legend-row .status-dot.unverifiable { background: var(--slate); }
.donut-legend-row .status-dot.high { background: var(--red); }
.donut-legend-row .status-dot.medium { background: var(--gold); }
.donut-legend-row .status-dot.info { background: var(--slate); }
.donut-legend-label { flex: 1; color: var(--body); font-weight: 590; min-width: 0; }
.donut-legend-count { font-size: 13px; font-weight: 680; font-variant-numeric: tabular-nums; color: var(--ink); }
.donut-legend-pct { color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; width: 38px; text-align: right; }
button.donut-legend-row:hover .donut-legend-label { text-decoration: underline; }

.graph-bars { display: flex; flex-direction: column; gap: 9px; }
.graph-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 4px 10px; align-items: center; }
.graph-bar-label { color: var(--body); font-size: 11px; font-weight: 590; }
.graph-bar-count { color: var(--ink); font-size: 11px; font-weight: 680; text-align: right; font-variant-numeric: tabular-nums; }
.graph-bar-track { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--slate-soft); overflow: hidden; }
.graph-bar-fill { height: 100%; border-radius: 4px; background: var(--brand); transition: width .5s ease; }

.impact-flow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.version-chip { padding: 6px 11px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface-2); color: var(--body); font-size: 11px; font-weight: 660; font-variant-numeric: tabular-nums; }
.version-chip.to { border-color: #cfe0cd; background: #edf5ea; color: #256b46; }
.impact-flow .icon { width: 14px; height: 14px; color: var(--faint); }
.impact-changed { margin: 0 0 14px; font-size: 11.5px; color: var(--muted); }
.impact-changed strong { color: var(--ink); font-weight: 660; }
.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--slate-soft); }
.stack-seg { height: 100%; transition: width .5s ease; }
.stack-seg.changed { background: var(--red); }
.stack-seg.unchanged { background: #b9c4bb; }
.stack-legend { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.stack-legend-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--body); }
.stack-legend-row .swatch { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.stack-legend-row .swatch.changed { background: var(--red); }
.stack-legend-row .swatch.unchanged { background: #b9c4bb; }
.stack-legend-row .stack-count { margin-left: auto; font-weight: 680; color: var(--ink); font-variant-numeric: tabular-nums; }

.impact-cases { display: flex; flex-direction: column; margin: 0 18px 14px; border-top: 1px solid var(--line); }
.impact-case-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 11px; }
button.impact-case-row:hover .impact-case-id { text-decoration: underline; }
.impact-case-id { color: var(--brand); font-weight: 650; font-family: ui-monospace, Menlo, monospace; font-size: 10px; }
.impact-transition { display: inline-flex; align-items: center; gap: 6px; color: var(--body); font-weight: 600; }
.impact-transition .decision-badge { padding: 2px 6px; font-size: 8px; }
.impact-transition .arrow { color: var(--faint); }
.impact-case-rule { margin-left: auto; color: var(--faint); font-size: 9px; font-family: ui-monospace, Menlo, monospace; white-space: nowrap; }
.impact-unchanged { padding: 9px 0 0; color: var(--faint); font-size: 10.5px; }

/* ---------- Control × case matrix ---------- */
.matrix-panel { margin-top: 16px; }
.matrix-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.matrix-table th { padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.matrix-table th.case-col { text-align: center; }
.matrix-table th.case-col code { display: block; margin-top: 2px; color: var(--faint); font-size: 8.5px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.matrix-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.matrix-table tr:last-child td { border-bottom: 0; }
.matrix-table .matrix-control strong { display: block; font-size: 11.5px; font-weight: 620; }
.matrix-table .matrix-control code { display: block; margin-top: 1px; color: var(--faint); font-size: 9px; }
.matrix-table td.case-col { text-align: center; }
.state-pip { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 8px; font-size: 11px; font-weight: 800; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.state-pip:hover { transform: scale(1.12); box-shadow: 0 0 0 3px rgba(20, 60, 49, .12); }
.state-pip.satisfied { background: #e7f2e6; color: var(--ok); }
.state-pip.violated { background: var(--red-soft); color: var(--red); }
.state-pip.review { background: var(--gold-soft); color: var(--gold-deep); }
.state-pip.insufficient { background: var(--slate-soft); color: var(--slate); }
.control-card.is-highlighted { animation: control-highlight 1.8s ease; }
@keyframes control-highlight {
  0%, 55% { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(168, 132, 44, .3); }
  100% { border-color: var(--line); box-shadow: var(--shadow-s); }
}

/* ---------- Signals gauges ---------- */
.signals-panel { grid-column: 1 / -1; }
.signals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding: 16px 18px; }
.signal { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 14px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; text-align: center; transition: border-color .14s, background .14s, transform .14s; }
button.signal:hover { border-color: var(--line-2); background: var(--surface); transform: translateY(-1px); }
.gauge { position: relative; }
.gauge-value { font-size: 15px; font-weight: 680; fill: var(--ink); }
.signal-label { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; }
.signal-sub { font-size: 10px; color: var(--faint); text-align: center; line-height: 1.5; }

/* ---------- Findings top ---------- */
.findings-top { display: grid; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.kpi-grid--findings { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.kpi-grid--findings .kpi { min-height: 0; }

/* ---------- Mandate authority chips ---------- */
.authority-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.authority-chips span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 9.5px; font-family: ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }

/* ---------- Responsive ---------- */
@media (max-width: 1460px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-grid--findings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .registry-layout { grid-template-columns: 1fr; }
  .registry-rail { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: start; }
  .findings-top { grid-template-columns: 1fr; }
  .findings-top .kpi-grid--findings { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .content { padding: 22px 22px 36px; }
  .topbar { padding: 8px 22px; gap: 14px; }
  .evidence-layout { grid-template-columns: 1fr; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: relative; height: auto; padding: 14px 16px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 0 12px; }
  .brand-name { flex-direction: row; gap: 5px; align-items: baseline; }
  .workspace-switch, .sidebar-bottom, .nav-label { display: none; }
  .side-nav { display: flex; gap: 5px; overflow-x: auto; }
  .nav-item { width: auto; flex-shrink: 0; min-height: 36px; padding: 8px 11px; font-size: 11.5px; }
  .nav-item.is-active::before { display: none; }
  .nav-count { display: none; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .breadcrumb { display: none; }
  .global-search { justify-self: stretch; width: auto; }
  .bundle-pill { display: none; }
  .kpi-grid, .kpi-grid--findings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .registry-toolbar { flex-wrap: wrap; }
  .workbench-header { flex-direction: column; }
  .workbench-side { align-items: flex-start; }
  .workbench-actions { justify-content: flex-start; }
  .filter-bar .search-field { width: 100%; }
  .app-footer { padding: 14px 22px; }
}
@media (max-width: 560px) {
  .content { padding: 18px 14px 30px; }
  .topbar { padding: 8px 14px; }
  .kpi-grid, .kpi-grid--findings { grid-template-columns: 1fr 1fr; }
  .kpi-body strong { font-size: 24px; }
  .kpi-sub { display: none; }
  .registry-table { min-width: 760px; }
  .fact-grid { grid-template-columns: 1fr; }
  .review-form select { max-width: none; }
  .review-form-actions { flex-direction: column; align-items: flex-start; gap: 10px; }
  .review-form-actions button { width: 100%; }
  .mandate-summary { display: block; }
  .mandate-summary-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
  .authority-strip { flex-wrap: wrap; }
  .authority-strip code { margin-left: 46px; flex-basis: 100%; }
  .comparison-grid { grid-template-columns: 1fr; }
  .compare-arrow { display: none; }
  .evidence-toolbar .session-label { margin-left: 0; }
  .toast { width: calc(100% - 32px); text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Theme toggle ---------- */
.theme-toggle { position: relative; }
.theme-toggle .icon { position: absolute; transition: opacity .16s, transform .16s; }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-40deg); }
.theme-toggle .icon-sun { opacity: 1; }
html[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0); }
html[data-theme="dark"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(40deg); }

/* ---------- Ops strip (dashboard context) ---------- */
.ops-strip {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  padding: 16px 20px; margin-bottom: 18px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-softer), var(--surface) 55%);
  box-shadow: var(--shadow-s);
}
.ops-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ops-mark { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--allow-line); border-radius: 10px; background: var(--allow-soft); color: var(--allow-ink); }
.ops-mark .icon { width: 18px; height: 18px; }
.ops-identity strong { display: block; font-size: 14px; font-weight: 680; letter-spacing: -.2px; }
.ops-identity span { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ops-facts { display: flex; gap: 26px; margin: 0; flex-wrap: wrap; }
.ops-facts dt { color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ops-facts dd { margin: 3px 0 0; font-size: 11.5px; font-weight: 620; font-variant-numeric: tabular-nums; }
.ops-facts dd code { color: var(--muted); font-size: 10px; }
.ops-actions { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ops-actions .primary-button { min-height: 34px; padding: 7px 13px; font-size: 11px; }
.ops-boundary { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-size: 9.5px; }
.ops-boundary .icon { width: 12px; height: 12px; color: var(--ok); }

/* ---------- Ops analytics row ---------- */
.ops-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 20px; }
.ops-panel--wide .analytics-body { padding: 14px 16px 8px; }
.ts-chart { display: block; width: 100%; height: auto; }
.ts-axis-label { font-size: 9px; font-weight: 620; fill: var(--faint); font-variant-numeric: tabular-nums; }
.ts-seg { transition: opacity .15s; }
.ts-hit:hover ~ .ts-seg, .ts-seg:hover { opacity: .82; }
.ts-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.ts-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9.5px; font-weight: 620; text-transform: uppercase; letter-spacing: .04em; }
.ts-swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.health-list { display: flex; flex-direction: column; gap: 4px; }
.health-row { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 8px 6px; border: 0; border-radius: 8px; background: transparent; text-align: left; transition: background .13s; }
.health-row:hover { background: var(--brand-softer); }
.health-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.health-label { color: var(--body); font-size: 11px; font-weight: 600; }
.health-rate { color: var(--ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.health-track { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--slate-soft); }
.health-seg { display: block; height: 100%; }
.health-seg.satisfied { background: var(--ok); }
.health-seg.violated { background: var(--red); }
.health-seg.review { background: var(--gold); }
.health-seg.insufficient { background: var(--slate); }

.mix-heading { margin: 0 0 7px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.mix-heading + .mix-heading { margin-top: 14px; }
.mix-list { display: flex; flex-direction: column; gap: 3px; }
.mix-row { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 2px 10px; align-items: center; width: 100%; padding: 5px 6px; border: 0; border-radius: 7px; background: transparent; text-align: left; transition: background .13s; }
.mix-row:hover { background: var(--brand-softer); }
.mix-row:hover .mix-label { text-decoration: underline; text-underline-offset: 3px; }
.mix-label { color: var(--body); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-count { color: var(--ink); font-size: 11px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.mix-track { grid-column: 1 / -1; display: block; height: 5px; border-radius: 3px; background: var(--slate-soft); overflow: hidden; }
.mix-fill { display: block; height: 100%; border-radius: 3px; background: var(--brand); }

/* ---------- Registry toolbar right / pagination / density ---------- */
.registry-toolbar-right { display: flex; align-items: center; gap: 9px; }
.toolbar-action { min-height: 30px; padding: 5px 10px; font-size: 10.5px; }
.toolbar-action .icon { width: 13px; height: 13px; }
.pagination { display: flex; align-items: center; gap: 9px; }
.pagination-state { color: var(--muted); font-size: 10.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pagination-button { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--brand); font-size: 12px; }
.pagination-button:hover:not(:disabled) { background: var(--brand-softer); }
body[data-density="compact"] .registry-table td { padding: 7px 14px; }
body[data-density="compact"] .registry-table th { padding: 8px 14px; }
body[data-density="compact"] .cell-case strong { font-size: 11.5px; }

/* ---------- Review queue additions ---------- */
.queue-empty { display: flex; align-items: flex-start; gap: 10px; padding: 18px 0; }
.queue-empty .icon { width: 16px; height: 16px; margin-top: 2px; color: var(--ok); }
.queue-empty p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.queue-more { display: flex; align-items: center; gap: 8px; width: 100%; padding: 13px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--brand); font-size: 11px; font-weight: 650; text-align: left; }
.queue-more .icon { width: 13px; height: 13px; }
.queue-more:hover { text-decoration: underline; }
.saved-review-actions { display: flex; align-items: center; gap: 18px; margin: 11px 0 0 39px; flex-wrap: wrap; }
.saved-review > .saved-review-actions { margin: 11px 0 0 39px; }
.text-button.danger { color: var(--red); }

/* ---------- Matrix totals column ---------- */
.matrix-table th.matrix-totals, .matrix-table td.matrix-totals { border-left: 1px solid var(--line); background: var(--surface-2); }
.matrix-total-pips { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.matrix-total { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 6px; font-size: 9px; font-weight: 750; font-variant-numeric: tabular-nums; }
.matrix-total.satisfied { background: var(--allow-soft); color: var(--allow-ink); }
.matrix-total.violated { background: var(--red-soft); color: var(--red); }
.matrix-total.review { background: var(--gold-soft); color: var(--gold-deep); }
.matrix-total.insufficient { background: var(--slate-soft); color: var(--slate); }

@media (max-width: 1280px) {
  .ops-row { grid-template-columns: 1fr 1fr; }
  .ops-panel--wide { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .ops-strip { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ops-actions { margin-left: 0; align-items: flex-start; }
  .ops-facts { gap: 18px; }
  .registry-toolbar-right { flex-wrap: wrap; }
  .ops-row { grid-template-columns: 1fr; }
}

/* ---------- Dark theme: experience layer components ---------- */
html[data-theme="dark"] .presentation-button { border-color: var(--line-2); background: var(--surface-2); color: var(--brand); }
html[data-theme="dark"] .presentation-button:hover { background: var(--brand-softer); border-color: var(--brand); }
html[data-theme="dark"] .section-kicker { color: var(--muted); }
html[data-theme="dark"] .sample-label, html[data-theme="dark"] .dashboard-panel-heading > .icon { color: var(--faint); }
html[data-theme="dark"] .outcome-tab { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
html[data-theme="dark"] .outcome-tab:hover { border-color: var(--line-2); }
html[data-theme="dark"] .outcome-tab[aria-pressed=true] { background: var(--allow-soft); color: var(--allow-ink); border-color: var(--allow-line); box-shadow: none; }
html[data-theme="dark"] .outcome-tab.deny[aria-pressed=true] { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }
html[data-theme="dark"] .outcome-tab.review[aria-pressed=true] { color: var(--gold-deep); background: var(--gold-soft); border-color: var(--gold-line); }
html[data-theme="dark"] .outcome-tab.unverifiable[aria-pressed=true] { color: var(--slate); background: var(--slate-soft); border-color: var(--slate-line); }
html[data-theme="dark"] .outcome-count { background: var(--slate-soft); color: var(--muted); }
html[data-theme="dark"] .outcome-preview { background: var(--surface-2); }
html[data-theme="dark"] .outcome-preview[data-decision=DENY] { background: var(--red-soft); }
html[data-theme="dark"] .outcome-preview[data-decision=REVIEW_REQUIRED] { background: var(--gold-soft); }
html[data-theme="dark"] .outcome-preview[data-decision=UNVERIFIABLE] { background: var(--slate-soft); }
html[data-theme="dark"] .preview-id, html[data-theme="dark"] .preview-explanation, html[data-theme="dark"] .preview-facts span,
html[data-theme="dark"] .preview-footer > span { color: var(--muted); }
html[data-theme="dark"] .preview-heading h3 { color: var(--ink); }
html[data-theme="dark"] .preview-evidence-item { background: var(--surface); border-color: var(--line); color: var(--body); }
html[data-theme="dark"] .preview-evidence-item.missing { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
html[data-theme="dark"] .attention-copy small, html[data-theme="dark"] .attention-copy > span { color: var(--muted); }
html[data-theme="dark"] .attention-copy strong { color: var(--ink); }
html[data-theme="dark"] .attention-item:hover { background: var(--brand-softer); }
html[data-theme="dark"] .dashboard-panel-note { color: var(--muted); background: var(--surface-2); border-top-color: var(--line); }
html[data-theme="dark"] .proof-panel { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .proof-intro .section-kicker, html[data-theme="dark"] .proof-intro > p:not(.section-kicker),
html[data-theme="dark"] .proof-details dt, html[data-theme="dark"] .proof-details > p { color: var(--muted); }
html[data-theme="dark"] .proof-intro h2 { color: var(--ink); }
html[data-theme="dark"] .proof-action { border-bottom-color: var(--line-2); color: var(--brand); }
html[data-theme="dark"] .proof-action:hover { border-color: var(--brand); }
html[data-theme="dark"] .proof-steps > span { color: var(--body); }
html[data-theme="dark"] .proof-steps .icon, html[data-theme="dark"] .proof-steps b { color: var(--faint); }
html[data-theme="dark"] .proof-steps > span .icon { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
html[data-theme="dark"] .proof-details dl > div { border-top-color: var(--line); }
html[data-theme="dark"] .proof-details dd { color: var(--body); }
html[data-theme="dark"] .open-specifications p:not(.section-kicker) { color: var(--muted); }
html[data-theme="dark"] .specification-links a { background: var(--surface); border-color: var(--line); color: var(--body); }
html[data-theme="dark"] .specification-links a:hover { border-color: var(--brand); }
html[data-theme="dark"] .specification-links small, html[data-theme="dark"] .specification-links a > .icon:last-child { color: var(--faint); }
html[data-theme="dark"] .chapter-banner { background: var(--surface-2); border-bottom-color: var(--line); }
html[data-theme="dark"] .chapter-number, html[data-theme="dark"] .chapter-banner p, html[data-theme="dark"] .chapter-boundary { color: var(--muted); border-color: var(--line); }
html[data-theme="dark"] .chapter-banner h2 { color: var(--ink); }
html[data-theme="dark"] .presentation-controls { border-color: var(--line-2); background: var(--surface-glass); box-shadow: var(--shadow-m); }
html[data-theme="dark"] .tour-icon-button { background: var(--surface-2); color: var(--body); border-color: var(--line); }
html[data-theme="dark"] .tour-chapter { color: var(--faint); border-bottom-color: var(--line); }
html[data-theme="dark"] .tour-chapter.is-complete { color: var(--muted); border-bottom-color: var(--line-2); }
html[data-theme="dark"] .tour-chapter[aria-current=step] { color: var(--ink); border-bottom-color: var(--brand); }
html[data-theme="dark"] .tour-next { border-color: var(--brand); background: var(--brand); color: #10231b; }
html[data-theme="dark"] .tour-options { border-left-color: var(--line); }
html[data-theme="dark"] .tour-options button { color: var(--muted); }
html[data-theme="dark"] .tour-options button:hover { color: var(--ink); }
html[data-theme="dark"] .tour-options kbd { border-color: var(--line); }
html[data-theme="dark"] .presenter-notes { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-m); }
html[data-theme="dark"] .presenter-notes select { border-color: var(--line); background: var(--surface-2); color: var(--body); }
html[data-theme="dark"] .presenter-notes p { color: var(--body); }
html[data-theme="dark"] .presenter-notes > span { border-top-color: var(--line); color: var(--faint); }
html[data-theme="dark"] .ops-strip { background: linear-gradient(135deg, var(--brand-softer), var(--surface) 55%); }
