/* ==========================================================================
   The review workspace: the section navigation, the panels (the brief,
   findings, screening, checks with DD History, sign-off), finding and gap
   rows, the evidence drawer, and the live research screen.
   ========================================================================== */

.workspace {
  --stick: calc(var(--topbar-h) + var(--dossier-h) + var(--sp-4));
  display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); gap: var(--sp-5); align-items: start;
}
/* the section navigation is for the findings: beside the other panels it steps aside */
.workspace:not(:has(#findings:target, #findings :target)) { grid-template-columns: minmax(0, 1fr); }
.workspace:not(:has(#findings:target, #findings :target)) > .section-nav { display: none; }
/* the evidence drawer is a third column only while the findings are shown */
.workspace > .drawer { display: none; }
.workspace:has(#findings:target, #findings :target) { grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--drawer-w); }
.workspace:has(#findings:target, #findings :target) > .drawer { display: block; }

/* ---------------------------------------------------------------- section navigation */

.section-nav {
  position: sticky; top: var(--stick); max-height: calc(100vh - var(--stick) - var(--sp-4));
  overflow: auto; padding: 0 var(--sp-1) var(--sp-4) 0; scrollbar-width: thin;
}
.nav-title { font: 400 var(--fs-xl)/1.2 var(--display); color: var(--text); padding: var(--sp-1) var(--sp-3) 0; }
.nav-heading { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); padding: var(--sp-5) var(--sp-3) var(--sp-2); text-transform: uppercase; letter-spacing: .04em; }
.nav-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.nav-empty { padding: var(--sp-2) var(--sp-3); color: var(--text-3); font-size: var(--fs-sm); list-style: none; }
.nav-section {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 34px; padding: 6px var(--sp-3);
  border-radius: var(--r-md); color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); font-weight: 400;
  position: relative; transition: background-color .12s var(--ease), color .12s var(--ease);
}
.nav-section:hover { background: var(--surface-3); color: var(--text); }
.nav-section[aria-current="true"] { background: var(--surface-3); color: var(--text); font-weight: 500; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.nav-label { min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.nav-meta { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.badge-progress { min-width: 32px; text-align: right; font-size: var(--fs-xs); color: var(--text-3); }
.nav-section.is-complete .badge-progress { color: var(--high-text); }
.gap-count { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.gap-count .icon { width: 12px; height: 12px; }
.count-pending { font-size: var(--fs-xs); font-weight: 500; color: var(--accent-text); }
.count-ready { font-size: var(--fs-xs); font-weight: 500; color: var(--ok-text); }
.icon-ok { color: var(--high-solid); width: 15px; height: 15px; }
.nav-shortcuts {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%; margin-top: var(--sp-6); padding: 8px var(--sp-3);
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-3);
  font: 400 var(--fs-xs)/1.4 var(--font); cursor: pointer;
}
.nav-shortcuts:hover { color: var(--text); background: var(--surface-3); }
.nav-shortcuts kbd { margin-left: auto; }

/* ---------------------------------------------------------------- panels */

.review-center { min-width: 0; container-type: inline-size; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-6) var(--sp-8) var(--sp-8); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.panel-head h2 { font: 400 26px/1.2 var(--display); letter-spacing: -0.01em; }
.panel-sub { margin-top: 6px; color: var(--text-2); font-size: var(--fs-sm); max-width: 72ch; }
.panel-count { font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; }

/* which panel shows: the overview by default; a link target (#…) wins — no JS needed */
.review-center > .tab-panel { display: none; }
.review-center > #overview { display: block; }
.review-center:has(> .tab-panel:not(#overview):target, > .tab-panel:not(#overview) :target) > #overview { display: none; }
.review-center > .tab-panel:target, .review-center > .tab-panel:has(:target) { display: block; }
.section-panel { display: none; }
.section-panel.is-active { display: block; }
#findings:has(.section-panel:target, .section-panel :target) .section-panel.is-active:not(:target):not(:has(:target)) { display: none; }
.section-panel:target, .section-panel:has(:target) { display: block; }
.tab-panel:target, .tab-panel:has(:target), .section-panel:target { animation: panel-in .22s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }

/* the findings filters: with JavaScript only (without it every row shows); the choice is set on
   #findings, so it holds from section to section */
.finding-filters { display: none; flex-wrap: wrap; gap: 6px; margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); }
.js .finding-filters { display: flex; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 500 var(--fs-xs)/1.5 var(--font); cursor: pointer; }
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filter-chip .filter-count { font-family: var(--mono); font-weight: 400; opacity: .8; }
#findings[data-filter="todo"] .finding-row:not(.review-proposed),
#findings[data-filter="conflict"] .finding-row:not(.in-conflict),
#findings[data-filter="weak"] .finding-row:not(.is-weak),
#findings[data-filter="gaps"] .finding-row,
#findings[data-filter]:not([data-filter="gaps"]) .gap-row,
#findings[data-filter]:not([data-filter="conflict"]) .conflict-banner { display: none; }
.filter-empty { display: none; padding: var(--sp-4); color: var(--text-2); font-size: var(--fs-sm); }
#findings[data-filter="todo"] .section-panel:not(:has(.finding-row.review-proposed)) .filter-empty,
#findings[data-filter="conflict"] .section-panel:not(:has(.finding-row.in-conflict)) .filter-empty,
#findings[data-filter="weak"] .section-panel:not(:has(.finding-row.is-weak)) .filter-empty,
#findings[data-filter="gaps"] .section-panel:not(:has(.gap-row)) .filter-empty { display: block; }

.section-bar { height: 3px; border-radius: 2px; background: var(--surface-3); margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); overflow: hidden; }
.section-bar span { display: block; height: 100%; background: var(--text-2); border-radius: inherit; transition: width .4s var(--ease); }

.conflict-banner {
  display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); border-radius: var(--r-md);
  background: var(--danger-bg); color: var(--text);
}
.conflict-banner > .icon { color: var(--danger-text); margin-top: 2px; }
.conflict-title { font-weight: 600; color: var(--danger-text); }
.conflict-banner p { font-size: var(--fs-sm); }
.conflict-links { margin-top: 4px; }
.conflict-links a { font-weight: 600; }

/* ---------------------------------------------------------------- finding rows */

.rows { display: flex; flex-direction: column; gap: 0; }
.finding-row, .gap-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3) var(--sp-5); padding: var(--sp-4) var(--sp-4);
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease), opacity .15s;
  scroll-margin-top: calc(var(--topbar-h) + var(--dossier-h) + var(--sp-6));
}
.finding-row { display: flex; flex-direction: column; gap: var(--sp-3); cursor: pointer; }
.finding-row:focus-visible { outline-offset: -2px; border-radius: var(--r-lg); }
.row-top, .row-bottom { display: flex; gap: var(--sp-2) var(--sp-4); justify-content: space-between; }
.row-top { align-items: flex-start; }
.row-bottom { align-items: center; }
.row-top > .row-main { flex: 1; }
.row-top > .row-state { flex: none; padding-top: 1px; }
.row-bottom > .row-provenance { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.row-bottom > .row-actions { flex: none; margin-left: auto; }
.row-error { margin: 0; }
.finding-row:hover { background: var(--surface-2); }
.finding-row.is-selected {
  position: relative; z-index: 1; margin: 4px calc(-1 * var(--sp-2)); padding-left: var(--sp-6); padding-right: var(--sp-6);
  border-radius: var(--r-lg); border-bottom-color: transparent; background: var(--surface-3); box-shadow: var(--lift);
}
.finding-row.is-selected .row-field { color: var(--accent-text); }
.finding-row:target { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 30% { background: var(--accent-soft); } 100% { background: transparent; } }
.finding-row.review-rejected .row-field { color: var(--text-3); }
.finding-row.review-rejected .row-value { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent); color: var(--text-3); }
.finding-row.verification-failed:not(.review-rejected) { background: color-mix(in srgb, var(--danger-bg) 60%, transparent); }
/* optimistic: the analyst's choice shows at once, the server answer replaces the row */
.finding-row.pending-accept { opacity: .75; }
.finding-row.pending-reject { opacity: .6; }
.finding-row.pending-accept .btn-accept, .finding-row.pending-reject .btn-reject { pointer-events: none; }
.row-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-field { font-size: var(--fs-xs); color: var(--text-3); }
.row-value { font-size: 15px; color: var(--text); font-weight: 500; overflow-wrap: anywhere; white-space: pre-line; }
.row-was { font-size: var(--fs-xs); color: var(--text-3); }
.row-warning { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--danger-text); font-weight: 600; }
.sources { list-style: none; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sources:empty { display: none; }
.source { display: flex; align-items: center; gap: 2px var(--sp-3); flex-wrap: wrap; font-size: var(--fs-xs); }
.source-chip {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; max-width: 100%;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.source-chip { align-items: center; }
.source-chip .tag { font-size: var(--fs-2xs); padding: 0 7px; }
.source-chip:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.source-name { overflow-wrap: anywhere; }
.source-type { font-weight: 400; color: var(--text-3); white-space: nowrap; }
.source-links { display: inline-flex; gap: 2px var(--sp-3); flex-wrap: wrap; }
.source-links a { color: var(--text-3); font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.source-links a:hover { color: var(--accent-text); text-decoration: underline; }
.source-links .icon { width: 12px; height: 12px; }
/* the confidence: three bars and its word; the reason is in the evidence panel (and the tooltip) */
.confidence { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-2); }
.conf-bars { display: inline-flex; gap: 2px; }
.conf-bars i { width: 4px; height: 10px; border-radius: 1px; background: var(--border-strong); }
.confidence-high .conf-bars i, .confidence-medium .conf-bars i:nth-child(-n+2), .confidence-low .conf-bars i:first-child { background: var(--text-2); }
.confidence-high .conf-bars i { background: var(--high-solid); }
.conf-verified, .conf-pending { color: var(--text-3); }
.review-status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.status-accepted { color: var(--ok-text); } .status-accepted .status-dot { background: var(--high-solid); }
.status-edited { color: var(--text); } .status-edited .status-dot { background: var(--text-2); }
.status-rejected { color: var(--text-3); } .status-rejected .status-dot { background: var(--low-solid); }
.status-proposed { color: var(--text-2); } .status-proposed .status-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--med-solid); }
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.finding-actions { display: flex; gap: 6px; align-items: center; position: relative; }
.default-submit { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.finding-row.is-selected .btn-accept:not(.is-on) { --btn-bg: var(--primary-bg); --btn-fg: var(--primary-fg); --btn-border: var(--primary-bg); }
/* with a pointer, the review buttons show on the row in hand (selected, hovered or focused), so a
   section reads as a list of facts; a decided row keeps its decision visible */
@media (hover: hover) {
  .finding-row:not(.is-selected):not(:hover):not(:focus-within) .finding-actions > :not(.is-on) { opacity: 0; }
  .finding-actions > * { transition: opacity .12s var(--ease); }
}
.btn-accept:hover, .btn-accept.is-on { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.btn-reject:hover, .btn-reject.is-on { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }

/* gap rows: what was not checked, on a quieter step */
.gap-row { align-items: center; color: var(--text-2); }
.gap-reason { display: flex; gap: 6px; align-items: flex-start; color: var(--text-2); font-size: var(--fs-sm); }
.gap-reason .icon { margin-top: 2px; color: var(--text-3); }
.gap-tag { font-size: var(--fs-xs); color: var(--text-3); padding: 1px 8px; border-radius: var(--r-sm); background: var(--surface-3); }

/* ---------------------------------------------------------------- the evidence drawer */

.drawer { position: sticky; top: var(--stick); max-height: calc(100vh - var(--stick) - var(--sp-4)); min-width: 0; }
.drawer-inner { display: flex; flex-direction: column; max-height: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-md); overflow: hidden; }
.drawer-bar { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-5); border-bottom: 1px solid var(--border); }
.drawer-title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.drawer-body { overflow: auto; padding: var(--sp-4) var(--sp-5); }
.drawer-body:empty { display: none; }
.drawer-body > .drawer-content { animation: drawer-in .22s var(--ease); }
@keyframes drawer-in { from { opacity: 0; transform: translateX(10px); } }
.drawer-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); padding: var(--sp-10) var(--sp-6); color: var(--text-2); }
.drawer-empty .icon-xl { color: var(--text-3); }
.drawer-body:not(:empty) ~ .drawer-empty { display: none; }
.drawer:has(.drawer-body:empty) [data-drawer-close] { visibility: hidden; }
.drawer-skeleton { display: none; padding: var(--sp-4); flex-direction: column; gap: var(--sp-3); }
.drawer.is-loading .drawer-skeleton { display: flex; }
.drawer.is-loading .drawer-body, .drawer.is-loading .drawer-empty { display: none; }
.drawer-head { margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.drawer-head h2 { font: 400 22px/1.2 var(--display); }
.drawer-head h2:focus { outline: none; }
/* why the finding has its confidence, and whether its quote was found: under the value */
.drawer-why { margin-bottom: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--surface-2); font-size: var(--fs-sm); color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.drawer-why .quote-label { margin: 0; }
.drawer-verified { display: flex; align-items: flex-start; gap: 6px; color: var(--text-2); }
.drawer-verified .icon { width: 14px; height: 14px; margin-top: 3px; flex: none; }
.drawer-verified.verification-verified .icon { color: var(--high-solid); }
.drawer-verified.verification-failed { color: var(--danger-text); }
.drawer-why + .evidence-card { border-top: 0; margin-top: 0; padding-top: 0; }
/* DD History, inside the checks panel */
.subpanel { margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 1px solid var(--border); scroll-margin-top: calc(var(--topbar-h) + var(--dossier-h) + var(--sp-6)); }
.subpanel > h3 { font: 400 var(--fs-xl)/1.2 var(--display); }
.subpanel > .panel-sub { margin-bottom: var(--sp-4); }
.section-about { color: var(--text); }
.drawer-value { margin-top: 4px; color: var(--text); font-weight: 500; overflow-wrap: anywhere; white-space: pre-line; font-size: var(--fs-lg); }
.evidence-card { border-top: 1px solid var(--border); padding-top: var(--sp-4); margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.drawer-head + .evidence-card { border-top: 0; margin-top: 0; padding-top: 0; }
.evidence-figure { margin: 0; border-radius: var(--r-lg); border: 1px solid var(--border); overflow: hidden; background: var(--paper); box-shadow: var(--shadow-sm); }
.zoom-toggle { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.evidence-shot { display: block; width: 100%; max-height: 420px; object-fit: cover; object-position: top center; }
.evidence-figure.is-zoomed .zoom-toggle { cursor: zoom-out; max-height: 72vh; overflow: auto; }
.evidence-figure.is-zoomed .evidence-shot { width: auto; max-width: none; max-height: none; object-fit: contain; }
.highlight-callout {
  position: absolute; left: 8px; bottom: 8px; display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px 3px 6px;
  border-radius: var(--r-sm); background: rgba(22, 21, 19, .86); color: #efebe5; font-size: 11px; font-weight: 500;
}
.hl-swatch { width: 14px; height: 10px; border-radius: 2px 4px 3px 5px; background: var(--hl); }
.zoom-hint { position: absolute; right: 8px; bottom: 8px; display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: var(--r-sm); background: rgba(22, 21, 19, .86); color: #efebe5; font-size: 11px; font-weight: 500; }
.evidence-figure figcaption { padding: 6px var(--sp-3); font: 400 var(--fs-xs)/1.5 var(--font); color: var(--text-3); background: var(--surface); border-top: 1px solid var(--border); }
.evidence-figure.is-page .evidence-shot { max-height: none; object-fit: contain; }
.evidence-pdf, .evidence-noshot { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface-2); color: var(--text-2); }
.pdf-icon { width: 36px; height: 36px; color: var(--danger-text); flex: none; }
.pdf-title { font-weight: 600; color: var(--text); }
.pdf-page { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; margin-top: 2px; }
.minimal-note { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 500; color: var(--warn-text); background: var(--warn-bg); padding: 6px var(--sp-3); border-radius: var(--r-md); }
.quote-label { font-size: var(--fs-xs); color: var(--text-3); }
/* the quote as it sits on the source page: a sheet of paper with the highlighter stroke on the exact words */
.evidence-quote {
  margin: -4px 0 0; padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg);
  background: var(--paper); color: var(--paper-text); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere;
  box-shadow: var(--shadow-md);
}
/* the signature: a highlighter stroke, a little uneven at its ends, wherever a source is quoted */
.hl {
  background: var(--hl); color: inherit; padding: 0.06em 0.2em; margin: 0 -0.08em;
  border-radius: 0.18em 0.42em 0.24em 0.5em / 0.36em 0.2em 0.44em 0.26em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.evidence-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); margin: 0; padding: var(--sp-1) 0; }
.evidence-meta > div:first-child, .evidence-meta > .meta-wide { grid-column: 1 / -1; }
.evidence-meta dd { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.evidence-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- possible matches: subject ⇄ list entry */

.match-card { padding: var(--sp-6); margin-bottom: var(--sp-4); background: var(--surface-2); border-color: transparent; }
.match-card.decision-true_match { background: color-mix(in srgb, var(--danger-bg) 70%, var(--surface)); }
.match-card.decision-false_positive { background: var(--surface-2); }
.match-head { display: flex; justify-content: space-between; gap: var(--sp-4); align-items: flex-start; margin-bottom: var(--sp-4); }
.match-head h3 { overflow-wrap: anywhere; font: 400 22px/1.2 var(--display); }
.match-list { display: flex; align-items: center; gap: 6px; }
.match-list .icon { width: 13px; height: 13px; }
.tilde { color: var(--text-3); font-weight: 400; margin: 0 6px; }
.match-source { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-3); }
.match-score { display: flex; align-items: center; gap: var(--sp-3); flex: none; padding: 6px 12px 6px 6px; border-radius: var(--r-xl); background: var(--surface); }
.score-ring {
  --p: var(--w, 0%);
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-weight: 600; font-size: var(--fs-lg); color: var(--text);
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--accent) var(--p), var(--surface-3) 0);
}
.score-caption { display: flex; flex-direction: column; font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; line-height: 1.3; }
.score-of { font-size: var(--fs-2xs); color: var(--text-3); font-weight: 400; }
.compare { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.compare-split { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.compare th, .compare td { padding: 9px var(--sp-3); text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare tr:last-child > * { border-bottom: 0; }
.compare thead th { background: var(--surface-3); font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); }
.compare thead th:first-child { width: 118px; }
.compare thead .cmp-mid { width: 108px; }
.cmp-side-label { display: inline-flex; align-items: center; gap: 6px; }
.cmp-side-label .icon { color: var(--text-3); }
.cmp-side-label .mono { color: var(--text-3); font-weight: 400; }
.cmp-label { color: var(--text-3); font-size: var(--fs-xs) !important; font-weight: 500 !important; }
.compare td { overflow-wrap: anywhere; color: var(--text); }
.compare { background: var(--surface); }
.match-entry { background: var(--surface-2); }
.cmp-verdict { text-align: center !important; white-space: nowrap; vertical-align: middle !important; }
.cmp-mark { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 500; }
.cmp-mark .icon { width: 13px; height: 13px; }
.cmp-none { width: 22px; height: 1px; padding: 0; border-radius: 0; background: var(--border-strong); vertical-align: middle; }
.cmp-agree .cmp-mark { background: var(--ok-bg); color: var(--ok-text); }
.cmp-conflict .cmp-mark { background: var(--danger-bg); color: var(--danger-text); }
.match-facts { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--text-3); }
.match-facts a { display: inline-flex; gap: 4px; align-items: center; font-weight: 500; }
.match-facts .icon { width: 12px; height: 12px; }
.triage-callout {
  display: flex; gap: var(--sp-3); margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-2);
}
.triage-callout > .icon { color: var(--text-3); margin-top: 2px; }
.callout-label { font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); margin-bottom: 2px; }
.match-decision { margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--surface-3); font-size: var(--fs-sm); }
.match-decision.decided-true_match { background: var(--danger-bg); color: var(--danger-text); }
.match-decision.decided-false_positive { background: var(--ok-bg); color: var(--ok-text); }
.match-decision span { color: var(--text-2); }
.match-decision-form { margin-top: var(--sp-4); }
.decision-buttons { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
.decision-buttons .hint { margin: 0 0 0 var(--sp-2); }
.decision-meaning { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }
.decision-meaning strong { color: var(--text-2); font-weight: 600; }
.compare-intro { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-sm); color: var(--text-2); }
/* a decided match folds its comparison (and the form to change it) under its decision */
.match-more { margin-top: var(--sp-3); }
.match-more > summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.match-more > summary:hover { color: var(--text); }
.match-card .triage-callout { background: var(--surface); }
.match-card .triage-callout p:not(.callout-label) { color: var(--text); font-size: var(--fs-md); }

/* what was screened: every name, clear or close to an entry */
.screen-summary { margin-bottom: var(--sp-6); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); background: var(--surface-2); }
.screen-summary-head { font-size: var(--fs-sm); color: var(--text-2); }
.screen-summary-head strong { color: var(--text); }
.screen-summary-head a { margin-left: var(--sp-3); font-weight: 500; }
.screened-names { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-3); }
.screened { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-2); }
.screened .icon { width: 12px; height: 12px; color: var(--high-solid); }
.screened.is-hit { border-color: var(--warn-border); background: var(--warn-bg); color: var(--text); }
.screened.is-hit .icon { color: var(--accent-text); }
.match-group-title { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-6) 0 var(--sp-3); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.screen-summary + .match-group-title, .checks-progress + .match-group-title { margin-top: 0; }

/* ---------------------------------------------------------------- tasks */

.task-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.task-item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-5) var(--sp-2); border-bottom: 1px solid var(--border); }
.task-item:last-child { border-bottom: 0; }
.task-item.task-done, .task-item.task-unavailable { color: var(--text-2); }
.task-check { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 2px; border-radius: var(--r-sm); border: 2px solid var(--input-border); color: var(--surface); }
.task-done .task-check { background: var(--high-solid); border-color: var(--high-solid); color: var(--ink-on-solid); }
.task-unavailable .task-check { background: var(--surface-3); color: var(--text-3); }
.task-check .icon { width: 14px; height: 14px; }
.task-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.task-head { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: flex-start; }
.task-head h3 { font-size: var(--fs-md); }
.task-done .task-head h3 { color: var(--text-2); }
.task-portal { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }
.task-why { color: var(--text-2); font-size: var(--fs-sm); }
.task-note, .task-upload { font-size: var(--fs-sm); color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.task-form { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-2); }
/* an open check's three steps: search, upload, mark */
.task-steps { list-style: none; display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2.4fr) minmax(170px, 1.2fr); gap: var(--sp-4); align-items: start; }
.task-step { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.task-step .hint { margin-top: 0; }
.task-step textarea { width: 100%; }
.task-step-title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; }
.task-step-n { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-strong); font: 500 11px/1 var(--mono); color: var(--text-2); flex: none; }
.task-steps .open-portal { align-self: flex-start; }
.task-redo > summary { cursor: pointer; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.task-redo > summary:hover { color: var(--text); }
.task-waiting { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-sm); color: var(--text-3); }
.task-waiting .icon { width: 14px; height: 14px; margin-top: 3px; flex: none; }
.checks-progress { margin-bottom: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-2); }
.checks-progress p { font-size: var(--fs-sm); color: var(--text-2); }
.checks-progress strong { color: var(--text); }
.checks-bar { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.checks-bar span { display: block; height: 100%; background: var(--high-solid); border-radius: inherit; }
.history-questions { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.history-questions li { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-sm); }
.history-answer { flex-basis: 100%; padding-left: 28px; color: var(--text); font-weight: 500; }
.task-actions { display: flex; gap: var(--sp-2); }
.dropzone { flex: 1; min-width: 0; position: relative; border: 1.5px dashed var(--input-border); border-radius: var(--r-lg); background: var(--surface-2); padding: var(--sp-3); transition: border-color .15s, background-color .15s; }
.dropzone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-file { border-style: solid; }
.dropzone-label { display: flex; gap: var(--sp-2); align-items: center; margin: 0; font-weight: 400; color: var(--text-2); cursor: pointer; }
.dropzone-label .icon { color: var(--text-3); width: 18px; height: 18px; }
.dropzone-label strong { color: var(--text); font-weight: 600; }
.dropzone input[type=file] { margin-top: var(--sp-2); }
.js .dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; width: 100%; }
.js .dropzone input[type=file]:focus-visible + .dropzone-preview, .js .dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.dropzone-preview { position: relative; z-index: 1; margin-top: var(--sp-2); display: flex; gap: var(--sp-3); align-items: center; font-size: var(--fs-sm); }
.dropzone-preview img { width: 72px; height: 48px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }
.dropzone-preview p { display: flex; align-items: center; gap: 6px; color: var(--text); }
.extracted { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--surface-2); }
.extracted-title { font-size: var(--fs-xs); font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.extracted ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.extracted li { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); }
.extracted a { color: var(--text); text-decoration: none; }
.extracted a:hover { text-decoration: underline; }
.extracted .row-field { margin-right: 6px; }

/* ---------------------------------------------------------------- DD history */

.history-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--sp-6); align-items: start; }
.history-form label { display: flex; gap: var(--sp-2); align-items: baseline; }
.q-num { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 500; }
.hint-card { padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface-2); display: flex; flex-direction: column; gap: var(--sp-3); }
.hint-card h3 { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); }
.hint-card ul { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.previous-run { display: flex; flex-direction: column; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--surface); text-decoration: none; }
.previous-run:hover { background: var(--surface-3); }
.previous-name { font-weight: 600; color: var(--text); font-size: var(--fs-sm); }
.previous-meta { font-size: var(--fs-xs); color: var(--text-3); }

/* ---------------------------------------------------------------- red flags */

.red-flag-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); }
.red-flag { display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); background: var(--danger-bg); }
.red-flag > .icon { color: var(--danger-text); margin-top: 2px; }
.red-flag-area { font-weight: 500; color: var(--danger-text); }
.red-flag p:not(.red-flag-area) { color: var(--text); font-size: var(--fs-sm); }
.red-flag-indicator { background: var(--warn-bg); }
.red-flag-indicator > .icon, .red-flag-indicator .red-flag-area { color: var(--warn-text); }
.red-flag > div { min-width: 0; flex: 1; }
.red-flag-findings { margin-top: var(--sp-2); font-size: var(--fs-sm); }
.red-flag-findings summary { cursor: pointer; color: var(--text-2); font-weight: 500; }
.red-flag-findings summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
.red-flag-findings ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.red-flag-findings li { color: var(--text); overflow-wrap: anywhere; }
.red-flag-source { margin-left: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }

/* ---------------------------------------------------------------- sign-off */

.checklist { list-style: none; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.checklist li { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-4); border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.check-icon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: var(--r-sm); font: 600 12px/1 var(--font); }
.check-icon.is-done { background: var(--high-bg); color: var(--high-text); }
.check-icon.is-done .icon { width: 14px; height: 14px; }
.check-icon.is-blocked { background: var(--warn-bg); color: var(--warn-text); }
.check-text { flex: 1; min-width: 0; }
.signoff-check .check-text { color: var(--text-2); }
.signoff-blocker { background: var(--surface-2); }
.signoff-blocker .check-text { font-weight: 500; }
.go-there { flex: none; font-weight: 500; font-size: var(--fs-sm); }
.ready-line { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); color: var(--ok-text); font-weight: 500; }
.signoff-steps { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--sp-5); }
.signoff-step { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface-2); }
.signoff-step input { max-width: 320px; }
.step-title { display: flex; align-items: center; gap: var(--sp-2); font-weight: 500; }
.step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text); font-size: var(--fs-xs); font-weight: 600; }
.signed-card { display: flex; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6); border-radius: var(--r-lg); background: var(--ok-bg); }
.signed-card > .icon { color: var(--ok-text); }
.signed-title { font: 400 22px/1.2 var(--display); color: var(--ok-text); }
.downloads { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.signed-card .hint { color: var(--text-2); }
.rescreen-form { margin-top: var(--sp-3); display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }

/* ---------------------------------------------------------------- live research */

.status-region { display: flex; flex-direction: column; gap: 0; margin-bottom: var(--sp-5); }
.progress-card { padding: var(--sp-5) var(--sp-6); overflow: hidden; position: relative; }

.progress-top { display: flex; justify-content: space-between; gap: var(--sp-6); align-items: flex-start; flex-wrap: wrap; }
.progress-title { display: flex; align-items: center; gap: var(--sp-2); font: 400 28px/1.2 var(--display); letter-spacing: -0.01em; }
.progress-headline { margin-top: 6px; color: var(--text-2); max-width: 70ch; }
.counters { display: grid; grid-template-columns: repeat(4, minmax(96px, auto)); gap: var(--sp-2); margin: 0; }
.counter { padding: var(--sp-1) var(--sp-3); }
.counter dt { font-size: var(--fs-xs); color: var(--text-3); }
.counter dd { margin: 0; font-size: 28px; font-weight: 500; line-height: 1.2; color: var(--text); }

/* the stage rail: nodes light up as the run passes them */
.timeline { list-style: none; display: grid; grid-template-columns: repeat(8, 1fr); margin: var(--sp-6) 0 var(--sp-2); position: relative; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); text-align: center; }
.stage::before { /* the connector to the previous stage */
  content: ""; position: absolute; top: 10px; right: 50%; width: 100%; height: 2px; background: var(--border-strong); z-index: 0;
}
.stage:first-child::before { display: none; }
.stage.is-done::before, .stage.is-current::before, .stage.is-waiting::before, .stage.is-failed::before, .stage.is-stalled::before { background: var(--accent); }
.stage-dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); transition: box-shadow .3s var(--ease), background-color .3s var(--ease); }
.stage.is-done { color: var(--text-2); }
.stage.is-done .stage-dot { background: var(--accent); border-color: var(--accent); }
.stage.is-done .stage-dot::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.stage.is-current { color: var(--text); font-weight: 500; }
.stage.is-current .stage-dot { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.stage.is-current .stage-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.stage.is-waiting, .stage.is-stalled { color: var(--warn-text); font-weight: 500; }
.stage.is-waiting .stage-dot, .stage.is-stalled .stage-dot { border-color: var(--accent); background: var(--warn-bg); }
.stage.is-failed { color: var(--danger-text); font-weight: 500; }
.stage.is-failed .stage-dot { border-color: var(--danger); background: var(--danger-bg); }
.progress-card.is-paused .progress-title { color: var(--warn-text); }

/* agent lanes: who is working */
.agent-lanes { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-2); margin-top: var(--sp-5); }
.lane {
  display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: var(--sp-2); align-items: center;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-lg); border: 1px solid transparent; background: var(--surface-2); color: var(--text-3);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.lane-icon { grid-row: span 2; width: 28px; height: 28px; padding: 6px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-3); }
.lane-name { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); line-height: 1.25; }
.lane-state { font-size: var(--fs-xs); line-height: 1.3; }
.lane.has-run .lane-icon { background: var(--surface-3); color: var(--text); }
.lane.has-run .lane-name { color: var(--text); }
.lane.has-warning .lane-icon { background: var(--warn-bg); color: var(--warn-text); }
.lane.is-active { border-color: var(--accent-soft-2); background: var(--surface-3); }
.lane.is-active .lane-icon { background: var(--accent); color: var(--on-accent); }
.lane.is-active .lane-name { color: var(--text); }
.lane.is-active .lane-state { color: var(--accent-text); font-weight: 500; }

/* the activity feed as a timeline */
.activity-feed { list-style: none; margin-top: var(--sp-5); border-top: 1px solid var(--border); max-height: 380px; overflow: auto; padding-top: var(--sp-2); position: relative; }
.activity-item { position: relative; display: grid; grid-template-columns: 28px 1fr auto; gap: 2px var(--sp-3); align-items: center; padding: 7px 0; }
.activity-item:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 28px; bottom: -8px; width: 1px; background: var(--border-strong); }
.actor-icon { position: relative; z-index: 1; width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); border: 2px solid var(--surface); }
.actor-redflags .actor-icon, .kind-warning .actor-icon { background: var(--danger-bg); color: var(--danger-text); }
.activity-msg { color: var(--text); overflow-wrap: anywhere; font-size: var(--fs-sm); }
.kind-result .activity-msg { font-weight: 500; }
.activity-meta { display: flex; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.activity-item.is-new { animation: feed-in .5s var(--ease); }
@keyframes feed-in { from { background: var(--accent-soft); } to { background: transparent; } }
.progress-card.is-live .activity-item:first-child .actor-icon { background: var(--accent-soft); color: var(--accent-text); }

/* skeletons */
.sk { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-line { height: 12px; width: 100%; }
.sk-line.short { width: 60%; }
.sk-dot { width: 28px; height: 28px; border-radius: 50%; }
.sk-img { height: 200px; }
.skeleton-row { grid-template-columns: 28px 1fr; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* while research runs: findings so far, tasks */
.while-running { display: flex; flex-direction: column; gap: var(--sp-3); }
.while-running > details > summary { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); cursor: pointer; list-style: none; }
.while-running > details > summary::-webkit-details-marker { display: none; }
.while-running > details > summary::before { content: ""; width: 7px; height: 7px; border: solid var(--text-3); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; }
.while-running > details[open] > summary::before { transform: rotate(45deg); }
.while-running .hint { margin: 0 0 0 auto; }
.so-far-title { font-weight: 500; }
.so-far-body, .tasks-while-running .task-list { padding: 0 var(--sp-5) var(--sp-5); }
.so-far-section h3 { font-size: var(--fs-sm); margin: var(--sp-3) 0 var(--sp-2); color: var(--text-2); }
.so-far-section ul { list-style: none; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface-2); }
.so-far-section li { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: 6px var(--sp-3); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.so-far-section li:last-child { border-bottom: 0; }
.so-far-value { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- responsive (workspace) */

/* wide screens: until a finding is selected the drawer is a slim hint, not a full column */
@media (min-width: 1280px) {
  .workspace { transition: grid-template-columns .2s var(--ease); }
  .workspace:has(#findings:target, #findings :target):has(.drawer-body:empty) { grid-template-columns: var(--nav-w) minmax(0, 1fr) 220px; }
  .drawer:has(.drawer-body:empty) .drawer-empty { padding: var(--sp-6) var(--sp-4); font-size: var(--fs-sm); }
  .drawer:has(.drawer-body:empty) .drawer-empty .icon-xl { width: 24px; height: 24px; }
  .drawer:has(.drawer-body:empty) .drawer-empty .muted { display: none; } /* the nav has the shortcuts */
}
@media (min-width: 1280px) and (max-width: 1499px) { .workspace { --drawer-w: 400px; } }

/* laptops: the drawer becomes a slide-over */
@media (max-width: 1279px) {
  .workspace, .workspace:has(#findings:target, #findings :target) { grid-template-columns: 216px minmax(0, 1fr); }
  .workspace > .drawer, .workspace:has(#findings:target, #findings :target) > .drawer { display: block; }
  .drawer {
    position: fixed; top: var(--topbar-h); right: 0; bottom: 0; z-index: 50; width: min(var(--drawer-w), 92vw); max-height: none;
    transform: translateX(105%); transition: transform .24s var(--ease); visibility: hidden;
  }
  .drawer .drawer-inner { height: 100%; max-height: none; border-radius: 0; border-top: 0; border-right: 0; box-shadow: var(--shadow-lg); }
  body.drawer-open .drawer { transform: none; visibility: visible; }
  body.drawer-open::after { content: ""; position: fixed; inset: var(--topbar-h) 0 0 0; background: var(--overlay); z-index: 45; animation: fade .2s; }
  .drawer-empty { display: none !important; }
  .section-nav { padding-left: var(--sp-1); padding-right: var(--sp-1); }
}
@keyframes fade { from { opacity: 0; } }
@container (max-width: 760px) {
  .compare thead th:first-child { width: 88px; }
  .compare thead .cmp-mid { width: 100px; }
  .cmp-side-label { flex-wrap: wrap; row-gap: 0; }
}
@container (max-width: 680px) {
  .row-top, .row-bottom { flex-wrap: wrap; }
  .row-top > .row-state { order: -1; flex-basis: 100%; }
  .row-bottom > .row-actions { margin-left: 0; }
  .history-layout, .signoff-steps, .task-steps { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  .workspace, .workspace:has(#findings:target, #findings :target) { grid-template-columns: 1fr; }
  .section-nav { position: static; max-height: none; display: flex; gap: var(--sp-2); overflow-x: auto; padding: var(--sp-2); }
  .section-nav .nav-heading, .section-nav .nav-title, .nav-shortcuts { display: none; }
  .nav-groups { display: flex; gap: 2px; }
  .nav-list { flex-direction: row; }
  .nav-section { white-space: nowrap; background: var(--surface); }
  .nav-label { overflow-wrap: normal; }
  .timeline { grid-template-columns: repeat(4, 1fr); row-gap: var(--sp-4); }
  .stage:nth-child(5)::before { display: none; }
  .counters { grid-template-columns: repeat(2, 1fr); width: 100%; }
}
