/* =====================================================================
   Sentinel design system - AI Browser Security
   Dark-first, light theme via [data-theme="light"]. No external assets.
   ===================================================================== */
:root, [data-theme="dark"] {
  --bg: #0a0d12;
  --bg-2: #0d1117;
  --surface: #11161d;
  --surface-2: #161c25;
  --surface-3: #1c2330;
  --hover: #1a212c;
  --border: #222a36;
  --border-2: #2d3746;
  --text: #e7ecf3;
  --text-2: #a9b3c1;
  --text-3: #808b9b;
  --accent: #2dd4bf;
  --accent-2: #5eead4;
  --accent-ink: #032420;
  --accent-soft: rgba(45, 212, 191, .12);
  --accent-line: rgba(45, 212, 191, .35);
  --ai: #a78bfa;
  --ai-soft: rgba(167, 139, 250, .12);
  --ok: #3fb950;
  --ok-soft: rgba(63, 185, 80, .12);
  --low: #a3c55a;
  --low-soft: rgba(163, 197, 90, .12);
  --warn: #e3b341;
  --warn-soft: rgba(227, 179, 65, .13);
  --high: #f0883e;
  --high-soft: rgba(240, 136, 62, .13);
  --crit: #f85149;
  --crit-soft: rgba(248, 81, 73, .13);
  --neutral: #8b949e;
  --neutral-soft: rgba(139, 148, 158, .14);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .45), 0 0 0 1px var(--border);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-2: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceff3;
  --hover: #f1f3f6;
  --border: #e2e6ec;
  --border-2: #d3d9e1;
  --text: #0f141b;
  --text-2: #444e5c;
  --text-3: #5f6977;
  --accent: #0d9488;
  --accent-2: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: rgba(13, 148, 136, .09);
  --accent-line: rgba(13, 148, 136, .35);
  --ai: #7c3aed;
  --ai-soft: rgba(124, 58, 237, .08);
  --ok: #1a7f37;
  --ok-soft: rgba(26, 127, 55, .09);
  --low: #4d7c0f;
  --low-soft: rgba(77, 124, 15, .09);
  --warn: #9a6700;
  --warn-soft: rgba(154, 103, 0, .1);
  --high: #bc4c00;
  --high-soft: rgba(188, 76, 0, .09);
  --crit: #cf222e;
  --crit-soft: rgba(207, 34, 46, .08);
  --neutral: #5f6977;
  --neutral-soft: rgba(95, 105, 119, .1);
  --shadow-pop: 0 12px 40px rgba(16, 24, 40, .14), 0 0 0 1px var(--border);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  color-scheme: light;
}

:root {
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --sidebar: 236px; --sidebar-min: 60px; --topbar: 52px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: var(--accent-soft); }
code, .mono { font-family: var(--mono); font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 14px; height: 14px; }
svg.i.lg { width: 20px; height: 20px; }
[hidden] { display: none !important; }

/* ---------------- app shell ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; transition: grid-template-columns .2s var(--ease); }
.app.collapsed { grid-template-columns: var(--sidebar-min) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  background: var(--bg-2); border-right: 1px solid var(--border); padding: 12px 10px; overflow: hidden; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #0e7490); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.brand-mark svg { width: 17px; height: 17px; }
.brand-name { font-weight: 650; letter-spacing: -.01em; line-height: 1.15; white-space: nowrap; }
.brand-name small { display: block; font-weight: 500; font-size: 11px; color: var(--text-3); letter-spacing: .02em; }
.nav-group { margin-top: 10px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  padding: 4px 10px 6px; white-space: nowrap; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--text-2); text-decoration: none !important; white-space: nowrap; font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.collapsed .brand-name, .collapsed .nav-label, .collapsed .nav-item span, .collapsed .nav-item .count { display: none; }
.collapsed .nav-item { justify-content: center; padding: 9px; }
.collapsed .nav-group { margin-top: 6px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-3); font-size: 13px; }
.crumbs a, .crumbs span { color: var(--text-3); white-space: nowrap; }
.crumbs a:hover { color: var(--text); }
.crumbs .cur { color: var(--text); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; min-width: 240px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text-3); cursor: pointer;
}
.search-trigger:hover { border-color: var(--border-2); color: var(--text-2); }
.search-trigger kbd { margin-left: auto; }
kbd { font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 4px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text-2); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neutral); }
.status-pill.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status-pill.bad .dot { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); }
.content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px 24px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.mobile-only { display: none !important; }

/* ---------------- typography ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); max-width: 70ch; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------- controls ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  font-weight: 550; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--hover); border-color: var(--border-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--crit); }
.btn.danger:hover { background: var(--crit-soft); border-color: var(--crit); }
.btn.danger.solid { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14px; border-radius: var(--r); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; gap: 5px; }
.btn.icon { width: 32px; padding: 0; }
.btn.icon.sm { width: 26px; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.input, .select {
  height: 32px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text); min-width: 0;
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: grid; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > svg { position: absolute; left: 9px; color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-left: 30px; width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 2px; gap: 2px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-2); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar .grow { flex: 1; min-width: 180px; }

/* ---------------- panels ---------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 0; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 400; }
.panel-body { padding: 14px 16px 16px; }
.panel-body.flush { padding: 8px 0 4px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--border);
  border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.stat { padding: 14px 16px; border-right: 1px solid var(--border); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .k { font-size: 12px; color: var(--text-3); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 12px; color: var(--text-3); }

/* ---------------- badges & severity ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px;
  font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--text-2); }
.badge svg { width: 12px; height: 12px; }
.badge.outline { background: transparent; border: 1px solid var(--border-2); }
.tone-ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.tone-low { --tone: var(--low); --tone-soft: var(--low-soft); }
.tone-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.tone-high { --tone: var(--high); --tone-soft: var(--high-soft); }
.tone-crit { --tone: var(--crit); --tone-soft: var(--crit-soft); }
.tone-neutral { --tone: var(--neutral); --tone-soft: var(--neutral-soft); }
.tone-accent { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.tone-ai { --tone: var(--ai); --tone-soft: var(--ai-soft); }
.badge[class*="tone-"] { background: var(--tone-soft); color: var(--tone); }
.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--tone, var(--text-2));
  text-transform: capitalize; white-space: nowrap; }
.sev svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.score { font-weight: 650; font-variant-numeric: tabular-nums; }
.chip-score { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 22px; padding: 0 6px;
  border-radius: 6px; font: 650 12.5px/1 var(--font); font-variant-numeric: tabular-nums; background: var(--tone-soft, var(--neutral-soft));
  color: var(--tone, var(--text)); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { position: sticky; top: 0; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); white-space: nowrap; }
table.t th button.sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
table.t th button.sort:focus-visible { box-shadow: var(--focus); border-radius: 4px; }
table.t th[aria-sort] { color: var(--text); }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr:hover { background: var(--hover); }
table.t tr.clickable { cursor: pointer; }
table.t tr.selected { background: var(--accent-soft) !important; }
table.t td.actions { width: 1%; white-space: nowrap; text-align: right; }
table.t td.check, table.t th.check { width: 1%; padding-right: 0; }
.url-cell { font-family: var(--mono); font-size: 12.5px; max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell .host { color: var(--text); }
.url-cell .path { color: var(--text-3); }

/* key-value */
dl.kv { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; gap: 0; margin: 0; }
dl.kv dt, dl.kv dd { padding: 7px 0; border-bottom: 1px solid var(--border); margin: 0; min-width: 0; }
dl.kv dt { color: var(--text-3); font-size: 12.5px; padding-right: 16px; }
dl.kv dd { font-size: 13px; word-break: break-word; }
dl.kv > :nth-last-child(-n+2) { border-bottom: 0; }

/* code / evidence */
.code { position: relative; font: 12px/1.55 var(--mono); background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 10px 40px 10px 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  color: var(--text-2); max-height: 260px; }
.code .copy { position: absolute; top: 6px; right: 6px; }

/* ---------------- tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; height: 38px; padding: 0 12px; border: 0; background: none; color: var(--text-2); font-weight: 550;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px;
  border-radius: 2px; background: var(--accent); }
.tab .count { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.tabpanel { animation: fade-in .18s var(--ease); }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } }

/* ---------------- findings (expandable) ---------------- */
.findings { display: grid; }
.finding { border-bottom: 1px solid var(--border); }
.finding:last-child { border-bottom: 0; }
.finding > button.f-head { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 98px 1fr auto;
  gap: 12px; align-items: center; padding: 11px 16px; cursor: pointer; }
.finding > button.f-head:hover { background: var(--hover); }
.finding > button.f-head:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.f-title { font-weight: 550; min-width: 0; }
.f-title .meta { display: block; font-weight: 400; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.f-chev { color: var(--text-3); transition: transform .18s var(--ease); }
.finding.open .f-chev { transform: rotate(90deg); }
.f-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s var(--ease); }
.finding.open .f-body { grid-template-rows: 1fr; }
.f-body > div { overflow: hidden; }
.f-inner { padding: 0 16px 14px 126px; display: grid; gap: 10px; }
.f-fix { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: var(--r); background: var(--accent-soft);
  border: 1px solid var(--accent-line); font-size: 13px; }
.f-fix svg { color: var(--accent); margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------- verdict hero ---------------- */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; min-width: 0; gap: 24px; align-items: center; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--tone, var(--neutral)); }
.gauge { position: relative; width: 104px; height: 104px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(135deg); }
.gauge .track { stroke: var(--surface-3); }
.gauge .val { stroke: var(--tone, var(--neutral)); transition: stroke-dashoffset .8s var(--ease); }
.gauge .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .num b { font-size: 28px; font-weight: 700; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.gauge .num span { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; }
.hero h1 { margin: 2px 0 2px; font-size: 21px; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.hero .final { min-width: 0; font-family: var(--mono); font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.hero .final > span { min-width: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-actions { display: flex; gap: 8px; align-self: start; flex-wrap: wrap; justify-content: flex-end; }
.signals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden; }
.signal { padding: 14px 16px; border-right: 1px solid var(--border); display: grid; gap: 4px; align-content: start; min-width: 0; }
.signal:last-child { border-right: 0; }
.signal .k { font-size: 12px; color: var(--text-3); font-weight: 550; }
.signal .v { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.signal .d { font-size: 12.5px; color: var(--text-2); }
.meter { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.meter > span { display: block; height: 100%; background: var(--tone, var(--accent)); border-radius: 2px; transition: width .7s var(--ease); }
.summary { padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); display: grid; gap: 10px; }
.summary .ai-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ai); }
.summary p { margin: 0; font-size: 14px; line-height: 1.6; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r);
  background: var(--tone-soft, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--tone, var(--border)) 35%, transparent);
  font-weight: 550; font-size: 13.5px; }
.callout svg { color: var(--tone, var(--text-2)); margin-top: 2px; }

/* ---------------- scanner ---------------- */
.scanbox { padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--border); background:
  radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 55%), var(--surface); display: grid; gap: 14px; }
.scanbox h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.scanbox p { margin: 0; color: var(--text-2); }
.scan-input { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 6px 0 14px; border-radius: var(--r);
  border: 1px solid var(--border-2); background: var(--bg-2); transition: border-color .12s, box-shadow .12s; }
.scan-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.scan-input.invalid { border-color: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); }
.scan-input > svg { color: var(--text-3); }
.scan-input input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; padding: 0 8px;
  font: 14.5px var(--mono); color: var(--text); }
.scan-input input::placeholder { color: var(--text-3); font-family: var(--font); }
.scan-input .btn.primary { height: 36px; }
.scan-msg { min-height: 18px; font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.scan-msg.error { color: var(--crit); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px;
  border-radius: var(--r-sm); color: var(--text-3); transition: background .2s, color .2s; }
.steps li .st { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-2); display: grid; place-items: center; }
.steps li .st svg { width: 11px; height: 11px; stroke-width: 3; }
.steps li.active { color: var(--text); background: var(--surface-2); }
.steps li.active .st { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps li.done { color: var(--text-2); }
.steps li.done .st { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps li .t { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.steps li .detail { font-size: 12px; color: var(--text-3); }

/* ---------------- charts ---------------- */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 112px 1fr 64px; align-items: center; gap: 12px; font-size: 13px; }
.bar-row .lbl { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.bar-track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--tone, var(--accent)); width: 0; transition: width .7s var(--ease); }
.bar-row .n { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.stack > span { background: var(--tone); transition: flex-grow .6s var(--ease); min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.columns { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.columns .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; position: relative; cursor: default; }
.columns .col span { display: block; border-radius: 3px 3px 0 0; background: var(--accent); min-height: 0; transition: height .6s var(--ease); }
.columns .col span.thr { background: var(--crit); border-radius: 3px 3px 0 0; }
.columns .col:hover span { filter: brightness(1.15); }
.col-axis { display: flex; gap: 4px; font-size: 10.5px; color: var(--text-3); margin-top: 6px; }
.col-axis span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.tip { position: fixed; z-index: 90; pointer-events: none; padding: 7px 9px; border-radius: var(--r-sm); background: var(--surface-3);
  box-shadow: var(--shadow-pop); font-size: 12px; color: var(--text); white-space: nowrap; }

/* ---------------- list rows ---------------- */
.rows { display: grid; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 16px;
  border-bottom: 1px solid var(--border); text-decoration: none !important; color: inherit; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--hover); }
.row .main { min-width: 0; }
.row .main .ttl { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .main .sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- timeline ---------------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; display: grid; gap: 14px; border-left: 1px solid var(--border); }
.timeline li { position: relative; padding-left: 18px; display: grid; grid-template-columns: 104px 1fr; gap: 12px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--tone, var(--neutral)); }
.timeline .date { color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------- empty, skeleton ---------------- */
.empty { display: grid; justify-items: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--text-2); }
.empty .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2);
  color: var(--text-3); border: 1px solid var(--border); }
.empty h3 { margin: 4px 0 0; font-size: 14px; color: var(--text); font-weight: 600; }
.empty p { margin: 0; max-width: 46ch; font-size: 13px; color: var(--text-3); }
.sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 6px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
  animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------------- overlays ---------------- */
.menu { position: absolute; z-index: 60; min-width: 200px; padding: 4px; border-radius: var(--r); background: var(--surface);
  box-shadow: var(--shadow-pop); animation: pop .12s var(--ease); }
.menu button, .menu a { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px;
  border-radius: 5px; font-size: 13px; color: var(--text); cursor: pointer; }
.menu button:hover, .menu a:hover, .menu button:focus-visible, .menu a:focus-visible { background: var(--hover); }
.menu .sep { height: 1px; background: var(--border); margin: 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
dialog.dlg { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface);
  color: var(--text); box-shadow: var(--shadow-pop); }
dialog.dlg::backdrop { background: rgba(4, 7, 12, .6); backdrop-filter: blur(3px); }
dialog.dlg[open] { animation: pop .15s var(--ease); }
.dlg-body { padding: 20px 20px 4px; }
.dlg-body h3 { margin: 0 0 6px; font-size: 16px; display: flex; gap: 10px; align-items: center; }
.dlg-body p { margin: 0; color: var(--text-2); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; }
.palette { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
.palette::backdrop { background: rgba(4, 7, 12, .55); backdrop-filter: blur(3px); }
.palette[open] { animation: pop .14s var(--ease); }
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.palette .p-input input { flex: 1; height: 50px; border: 0; background: transparent; outline: none; font-size: 15px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
.palette .p-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.palette li.opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.palette li.opt .hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.palette li.opt[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.palette li.opt[aria-selected="true"] svg { color: var(--accent); }
.palette .p-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 10px 12px; border-radius: var(--r);
  background: var(--surface-3); box-shadow: var(--shadow-pop); font-size: 13px; animation: toast-in .2s var(--ease); }
.toast svg { color: var(--tone, var(--accent)); }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.scrim { display: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal:nth-child(2) { border-right: 0; }
  .signal:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; transform: translateX(-100%); transition: transform .22s var(--ease);
    box-shadow: var(--shadow-pop); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(4, 7, 12, .5); }
  .collapsed .brand-name, .collapsed .nav-label, .collapsed .nav-item span { display: initial; }
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  .search-trigger { min-width: 0; }
  .search-trigger .lbl, .search-trigger kbd { display: none; }
  .content { padding: 16px 16px 48px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 14px; }
  .hero > * { max-width: 100%; }
  .hero-actions { justify-content: flex-start; }
  .f-inner { padding-left: 16px; }
  .finding > button.f-head { grid-template-columns: 1fr auto; }
  .finding > button.f-head .sev { grid-column: 1 / -1; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { padding-bottom: 0; border-bottom: 0; }
  .bar-row { grid-template-columns: 92px 1fr 52px; }
  .stat { border-bottom: 1px solid var(--border); }
  .hide-sm { display: none !important; }
}
@media (max-width: 520px) {
  .signals { grid-template-columns: 1fr; }
  .signal { border-right: 0; border-bottom: 1px solid var(--border); }
  .crumbs > :not(.cur) { display: none; }
  .scan-input { height: auto; flex-wrap: wrap; padding: 6px; }
  .scan-input input { height: 40px; flex: 1 1 0; min-width: 0; }
  .scan-input .btn.primary { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .hero-actions, .tabs, .toasts, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; }
  .tabpanel[hidden] { display: block !important; }
}
