:root {
  --ink: #12140f;
  --ink-2: #171a14;
  --paper: #e8e6df;
  --muted: #9a978c;
  --line: #2a2d26;
  --accent: #4cc38a;
  --bad: #e5484d;
  --warn: #e8a13a;
  --err: #c08484;
  --mono: "Consolas", "SF Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
[hidden] { display: none !important; }
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important; clip-path: inset(50%) !important;
  overflow: hidden !important; width: 1px !important; height: 1px !important;
  margin: -1px !important; padding: 0 !important; border: 0 !important;
  white-space: nowrap !important;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
input[aria-invalid="true"] { border-color: var(--bad); }
.skip-link {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus-visible {
  position: fixed; top: 8px; left: 8px; z-index: 300;
  width: auto; height: auto; overflow: visible; clip-path: none;
  background: var(--ink-2); color: var(--paper);
  border: 1px solid var(--accent); border-radius: 4px; padding: 8px 12px;
}
body {
  margin: 0; background: var(--ink); color: var(--paper);
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
}
a { color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.spacer { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 28px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.brand span { color: var(--accent); margin-left: 6px; }
nav a { color: var(--muted); text-decoration: none; margin-right: 18px; padding-bottom: 2px; }
nav a.on { color: var(--paper); border-bottom: 2px solid var(--accent); }
.env { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
.panel {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 20px 22px; margin-bottom: 18px;
}
h1 { font-size: 20px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 18px 0 10px; }
.panel > h2:first-child, .report-head h2 { margin-top: 0; }
.sub, .meta { color: var(--muted); margin: 0 0 14px; }
.error { color: var(--bad); }
.empty { color: var(--muted); padding: 8px; }
.account h2 { margin-top: 0; }
.account-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.account-row label { color: var(--muted); font-size: 13px; }
.account-row input { flex: 1; min-width: 200px; max-width: 420px; }
.account-row input[type="checkbox"] { flex: none; min-width: 0; }
.account-key-value {
  word-break: break-all; border: 1px solid var(--line); border-radius: 4px;
  padding: 10px; background: var(--ink);
}

.drop {
  display: block; border: 1px dashed #3a3e33; border-radius: 6px;
  padding: 22px; text-align: center; color: var(--muted); cursor: pointer;
}
.drop.over { border-color: var(--accent); color: var(--paper); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.hashline { color: var(--muted); font-size: 12px; word-break: break-all; margin: 8px 0 0; }
.known {
  margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 4px; font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap;
}
.controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; margin-top: 14px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.controls label.check { flex-direction: row; align-items: center; gap: 7px; max-width: 340px; }
select, button, input[type="text"], input[type="password"] { font: inherit; }
select, input[type="text"], input[type="password"] {
  background: var(--ink); color: var(--paper); border: 1px solid var(--line);
  border-radius: 4px; padding: 7px 8px;
}
button, .btnlink {
  background: var(--ink); color: var(--paper); border: 1px solid var(--line);
  border-radius: 4px; padding: 7px 12px; cursor: pointer; text-decoration: none;
  display: inline-block; font-size: 14px;
}
button#submit { background: var(--accent); border-color: var(--accent); color: #0c100c; font-weight: 600; }
button:disabled { opacity: .45; cursor: default; }
progress.progress {
  appearance: none; width: 100%; height: 6px; margin-top: 12px;
  border: 0; border-radius: 3px; background: #23261f; color: var(--accent);
  accent-color: var(--accent); display: block;
}
progress.progress::-webkit-progress-bar { background: #23261f; border-radius: 3px; }
progress.progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress.progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.upload-status { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.file-chip {
  display: inline-flex; gap: 10px; align-items: center; margin: 10px 0 0;
  border: 1px solid var(--accent); border-radius: 999px; padding: 4px 6px 4px 12px;
  font-size: 13px; max-width: 100%;
}
.file-chip .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { padding: 2px 9px; font-size: 12px; border-radius: 999px; }
.engines-head { display: flex; gap: 10px; align-items: center; margin: 16px 0 8px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.engines-head button { padding: 2px 8px; font-size: 12px; }
.evidence-note { margin-left: auto; }
.engine-picker { display: flex; flex-direction: column; gap: 8px; }
.tier-group {
  border: 1px solid var(--line); border-radius: 6px; margin: 0;
  padding: 8px 10px 10px; min-width: 0;
}
.tier-group legend {
  color: var(--muted); font-size: 12px; padding: 0 4px;
  font-family: var(--mono);
}
.tier-engines { display: flex; flex-wrap: wrap; gap: 6px; }
.engine-picker label {
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px;
  font-size: 13px; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; min-block-size: 36px;
}
.engine-picker label.sel { color: var(--paper); border-color: var(--accent); }
.engine-picker label.off { opacity: .45; cursor: not-allowed; }
.engine-picker label:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.engine-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; clip-path: inset(50%); }
.engine-picker .tag { font-size: 11px; color: var(--warn); margin-left: 6px; }
.engine-picker .price { font-family: var(--mono); color: var(--muted); margin-left: 6px; font-size: 12px; }
.engine-summary { display: flex; flex-direction: column; gap: 8px; }
.engine-group {
  border: 1px solid var(--line); border-radius: 6px; margin: 0;
  padding: 8px 10px 10px; min-width: 0;
}
.engine-group-title {
  color: var(--muted); font-size: 12px; margin: 0 0 8px;
  font-family: var(--mono);
}
.engine-chip {
  border: 1px solid var(--accent); border-radius: 4px; padding: 6px 9px;
  font-size: 13px; color: var(--paper);
  display: inline-flex; align-items: center; min-block-size: 36px;
}
.engine-chip.off { border-color: var(--line); color: var(--muted); opacity: .55; }
.engine-summary .tag { font-size: 11px; color: var(--warn); margin-left: 6px; }
.quote { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 4px; }
.quote h2 { margin-top: 8px; }
.quote-lines {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 14px;
  font-size: 13px; margin: 8px 0; max-width: 560px;
}
.quote-lines dt { color: var(--muted); }
.quote-lines dd { margin: 0; text-align: right; }
.quote-lines .total { font-weight: 700; color: var(--paper); border-top: 1px solid var(--line); padding-top: 4px; }
.quote-lines dd.total { text-align: right; }
dialog {
  background: var(--ink-2); color: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; padding: 20px 22px; max-width: min(92vw, 440px);
}
dialog h2 { margin-top: 0; }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(0 0 0 / .55); overflow: hidden; overscroll-behavior: contain; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.lookup { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.lookup label { color: var(--muted); font-size: 13px; }
.lookup input { flex: 1; min-width: 240px; }

.report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meta-grid {
  display: grid; grid-template-columns: 130px 1fr 130px 1fr; gap: 4px 14px;
  font-size: 12.5px; margin: 12px 0; word-break: break-all;
}
.meta-grid dt { color: var(--muted); }
.meta-grid dd { margin: 0; }
.summary { font-size: 14px; margin: 10px 0; }
.summary.sticky {
  position: sticky; top: 0; background: var(--ink-2); padding: 8px 0;
  border-bottom: 1px solid var(--line); z-index: 2;
}
.matrix-head, .row {
  display: grid; grid-template-columns: 1.15fr .95fr 1.5fr .55fr .5fr;
  gap: 12px; align-items: center;
}
.fleet-head, .frow {
  display: grid; grid-template-columns: 1.2fr .45fr 1fr 1.2fr .8fr .55fr;
  gap: 12px; align-items: center;
}
.matrix-head, .fleet-head {
  color: var(--muted); font-size: 12px; padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.row, .frow { min-height: 36px; padding: 3px 8px; border-bottom: 1px solid #22251f; }
.row .det { overflow-wrap: anywhere; }
.row .detail { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.row .bar { height: 3px; background: #23261f; margin-top: 3px; }
.row .bar i { display: block; height: 100%; width: 100%; background: var(--muted); transform-origin: left; scale: 0 1; }
.row details.sig { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.row details.sig pre {
  white-space: pre-wrap; word-break: break-all; margin: 4px 0 8px;
  font-family: var(--mono); font-size: 11.5px;
}
.chip {
  font-family: var(--mono); font-size: 11.5px; white-space: nowrap;
  border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px;
  justify-self: start;
}
.st-detected_on_write, .st-detected_at_runtime, .st-detected { color: var(--bad); }
.st-clean { color: var(--accent); }
.st-inconclusive, .st-timeout, .st-maintenance { color: var(--warn); }
.st-error, .st-offline { color: var(--err); }
.st-running { color: var(--paper); }
.st-queued, .st-planned { color: var(--muted); }
.st-cancelled { color: var(--muted); }
.row .billingline, .frow .billingline { display: block; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.st-done { color: var(--paper); }
.st-online { color: var(--accent); }
.ev-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
.ev-thumbs img {
  width: 54px; height: 34px; object-fit: cover; border: 1px solid var(--line);
  border-radius: 3px; display: block;
}
.evidence-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.evidence-strip figure { margin: 0; }
.evidence-strip img {
  width: 220px; max-width: 100%; border: 1px solid var(--line); border-radius: 4px;
  display: block;
}
.evidence-strip figcaption { color: var(--muted); font-size: 12px; margin-top: 3px; }
.recent a {
  color: var(--paper); text-decoration: none; display: grid;
  grid-template-columns: 1fr auto auto; gap: 14px; padding: 8px;
  border-bottom: 1px solid #22251f; align-items: center;
}
.recent a:hover { background: #1b1e17; }
.recent .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer { max-width: 1080px; margin: 0 auto; padding: 0 20px 28px; color: var(--muted); font-size: 13px; }

/* Live scan timeline: stages derive only from server scan/engine state. */
.scan-timeline-wrap { margin: 14px 0 6px; }
.scan-timeline {
  list-style: none; display: flex; gap: 6px; flex-wrap: wrap;
  margin: 0; padding: 0;
}
.scan-timeline li {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px 3px 8px;
  font-size: 12.5px; color: var(--muted); font-family: var(--mono);
}
.scan-timeline .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  border: 1px solid currentColor; background: transparent;
}
.scan-timeline li.done { color: var(--accent); }
.scan-timeline li.done .dot { background: var(--accent); }
.scan-timeline li.current { color: var(--paper); border-color: var(--accent); }
.scan-timeline li.current .dot { background: var(--paper); }
.scan-timeline li.failed { color: var(--bad); border-color: var(--bad); }
.stage-detail { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; min-height: 1.3em; }
.row .statecell { display: inline-flex; align-items: center; gap: 8px; }
.row .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  border: 1px solid var(--muted); background: transparent;
}
.row .dot.st-clean, .row .dot.st-done { background: var(--accent); border-color: var(--accent); }
.row .dot.st-detected_on_write, .row .dot.st-detected_at_runtime { background: var(--bad); border-color: var(--bad); }
.row .dot.st-running { background: var(--paper); border-color: var(--paper); }
.row .dot.st-inconclusive, .row .dot.st-timeout { background: var(--warn); border-color: var(--warn); }
.row .dot.st-error { background: var(--err); border-color: var(--err); }
.quote-lines dd.total.stale { opacity: .5; }
.skel-row {
  display: grid; grid-template-columns: 1.15fr .95fr 1.5fr .55fr .5fr; gap: 12px;
  align-items: center; min-height: 36px; padding: 3px 8px; border-bottom: 1px solid #22251f;
}
.skel { display: block; height: 11px; border-radius: 3px; background: #262922; }
button#submit[aria-busy="true"] { opacity: .75; }

/* Motion: compositor-only, ease-out, gated behind no-preference so
   reduced-motion users get instant state changes by default. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out 140ms ease-out both; }
  ::view-transition-new(root) { animation: vt-in 180ms ease-out both; }
  button, .btnlink, select, input[type="text"], input[type="password"] {
    transition: border-color 140ms ease-out, color 140ms ease-out, opacity 140ms ease-out, scale 140ms ease-out;
  }
  button:not(:disabled):active, .btnlink:active { scale: 0.97; transition-duration: 0ms; }
  .drop { transition: border-color 150ms ease-out, color 150ms ease-out, background 150ms ease-out; }
  .drop.over { background: #1b2018; }
  .engine-picker label { transition: border-color 140ms ease-out, color 140ms ease-out, opacity 140ms ease-out; }
  .chip, .row .dot, .scan-timeline li, .scan-timeline .dot {
    transition: color 180ms ease-out, border-color 180ms ease-out, background 180ms ease-out, opacity 180ms ease-out;
  }
  .row .bar i { transition: scale 400ms ease-out; }
  .quote-lines dd.total { transition: opacity 160ms ease-out; }
  .quote-lines dd.total.flash { animation: quote-flash 450ms ease-out; }
  .enter { animation: enter-in 190ms ease-out both; animation-delay: var(--stagger, 0ms); }
  .row.just-terminal { animation: settle-in 260ms ease-out; }
  .row .dot.st-running, .scan-timeline li.current .dot { animation: dot-pulse 1600ms ease-in-out infinite; }
  .skel { animation: skel-pulse 1400ms ease-in-out infinite; }
  dialog {
    opacity: 1; scale: 1;
    transition: opacity 160ms ease-out, scale 160ms ease-out, overlay 160ms ease-out allow-discrete, display 160ms ease-out allow-discrete;
  }
  dialog:not([open]) { opacity: 0; scale: 0.95; transition-duration: 128ms; }
  @starting-style { dialog[open] { opacity: 0; scale: 0.95; } }
  dialog::backdrop { transition: opacity 160ms ease-out, overlay 160ms ease-out allow-discrete, display 160ms ease-out allow-discrete; }
  @starting-style { dialog[open]::backdrop { opacity: 0; } }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@keyframes enter-in { from { opacity: 0; translate: 0 4px; } }
@keyframes settle-in { from { opacity: .35; translate: 0 3px; } }
@keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes skel-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes quote-flash { 0% { opacity: .3; } 100% { opacity: 1; } }
@media (max-width: 860px) {
  .meta-grid { grid-template-columns: 110px 1fr; }
  .fleet-head, .frow { grid-template-columns: 1fr auto; }
  .fleet-head span:nth-child(2), .fleet-head span:nth-child(3), .fleet-head span:nth-child(4),
  .frow > :nth-child(2), .frow > :nth-child(3), .frow > :nth-child(4) { display: none; }
}
@media (max-width: 720px) {
  .quote-lines { max-width: none; }
  .evidence-note { margin-left: 0; }
  .account-row input { min-width: 0; max-width: none; }
  .matrix-head, .row { grid-template-columns: 1fr auto; }
  .matrix-head span:nth-child(3), .matrix-head span:nth-child(4),
  .matrix-head span:nth-child(5),
  .row .evcell, .row .barwrap { display: none; }
  .row .det { grid-column: 1 / -1; display: block; white-space: normal; }
  header { gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  .enter, .row.just-terminal { animation: none !important; }
}

.policy-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  color: var(--paper, #e9ecf1);
  font-size: 13px;
  line-height: 1.5;
}
.policy-banner strong { color: var(--warn); }
.terms-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
