/* POC Vault UI — design tokens + components. Mobile-first, no framework. */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 14px; --radius-pill: 999px;
  --text-xs: .75rem; --text-sm: .8125rem; --text-base: .9375rem; --text-lg: 1.0625rem; --text-xl: 1.25rem; --text-2xl: 1.5rem; --text-3xl: 1.875rem;
  --ease: cubic-bezier(.2,.7,.3,1); --dur: 160ms;
  --header-h: 56px; --tabbar-h: 60px; --content-max: 1280px;

  /* dark (default) */
  --bg: #0b0d12;
  --bg-elev: #0f1219;
  --surface: #141821;
  --surface-2: #1a1f2a;
  --surface-hover: #1e2430;
  --border: #283040;
  --border-strong: #3a4456;
  --text: #e8ebf1;
  --text-muted: #a5aebd;
  --text-subtle: #98a2b3; /* >= 4.5:1 on every dark surface incl. tinted (crit/med) rows */
  --accent: #7cb0ff;
  --accent-hover: #a3c7ff;
  --accent-bg: #2563eb;
  --accent-bg-hover: #1d4ed8;
  --on-accent: #ffffff;
  --focus: #ffb454;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);

  --crit-fg: #ffb4b4; --crit-bg: rgba(239,68,68,.18); --crit-bd: rgba(239,68,68,.45); --crit-solid: #ef4444;
  --high-fg: #ffc89a; --high-bg: rgba(249,115,22,.18); --high-bd: rgba(249,115,22,.45); --high-solid: #f97316;
  --med-fg:  #fde68a; --med-bg:  rgba(234,179,8,.16);  --med-bd:  rgba(234,179,8,.42);  --med-solid: #eab308;
  --low-fg:  #a7f3c5; --low-bg:  rgba(34,197,94,.15);  --low-bd:  rgba(34,197,94,.4);   --low-solid: #22c55e;
  --info-fg: #b9d4ff; --info-bg: rgba(59,130,246,.16); --info-bd: rgba(59,130,246,.42);
  --neutral-fg: #c9d0db; --neutral-bg: rgba(148,163,184,.14); --neutral-bd: rgba(148,163,184,.32);
  --kev-fg: #ffffff; --kev-bg: #b91c1c;
  --teal-fg: #99f6e4; --teal-bg: rgba(20,184,166,.16); --teal-bd: rgba(20,184,166,.42); --teal-solid: #14b8a6;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --surface-hover: #f6f8fb;
  --border: #d3d8e0;
  --border-strong: #b4bcc8;
  --text: #111827;
  --text-muted: #4b5563;
  --text-subtle: #5b6472;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-bg: #1d4ed8;
  --accent-bg-hover: #1e40af;
  --on-accent: #ffffff;
  --focus: #c2410c;
  --shadow: 0 1px 3px rgba(16,24,40,.10), 0 10px 28px -14px rgba(16,24,40,.28);

  --crit-fg: #991b1b; --crit-bg: #fee2e2; --crit-bd: #fca5a5;
  --high-fg: #9a3412; --high-bg: #ffedd5; --high-bd: #fdba74;
  --med-fg:  #854d0e; --med-bg:  #fef3c7; --med-bd:  #fcd34d;
  --low-fg:  #166534; --low-bg:  #dcfce7; --low-bd:  #86efac;
  --info-fg: #1e40af; --info-bg: #dbeafe; --info-bd: #93c5fd;
  --neutral-fg: #374151; --neutral-bg: #eef0f3; --neutral-bd: #d1d5db;
  --kev-fg: #ffffff; --kev-bg: #b91c1c;
  --teal-fg: #115e59; --teal-bg: #ccfbf1; --teal-bd: #5eead4; --teal-solid: #0d9488;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 var(--text-base)/1.55 var(--font-sans); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
@media (min-width: 768px) { body { padding-bottom: 0; } }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: var(--text-2xl); font-weight: 700; }
h2 { font-size: var(--text-lg); font-weight: 650; }
h3 { font-size: var(--text-base); font-weight: 650; }
p { margin: 0; }
a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
code, pre, kbd, .mono { font-family: var(--font-mono); font-size: .875em; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); font-size: var(--text-sm); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; word-break: break-word; }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- skip link */
.skip-link { position: absolute; left: var(--space-3); top: -100px; z-index: 100; display: inline-flex; align-items: center; min-height: 44px; background: var(--accent-bg); color: var(--on-accent); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: var(--space-3); color: var(--on-accent); }

/* ---------------------------------------------------------------- header / nav */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner { max-width: var(--content-max); margin: 0 auto; height: 100%; display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-4); }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text); font-weight: 750; font-size: var(--text-lg); text-decoration: none; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; }
.brand-mark .icon { width: 18px; height: 18px; }
.brand small { font-weight: 500; color: var(--text-subtle); font-size: var(--text-xs); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 0 6px; }

.nav { display: none; }
.nav a, .tabbar a { text-decoration: none; color: var(--text-muted); font-weight: 550; }
@media (min-width: 768px) {
  .nav { display: flex; gap: var(--space-1); margin-left: var(--space-4); }
  .nav a { display: inline-flex; align-items: center; gap: var(--space-2); padding: 6px 12px; border-radius: var(--radius-sm); font-size: var(--text-sm); }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
}
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: var(--text-xs); min-height: 44px; }
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
@media (min-width: 768px) { .tabbar { display: none; } }

/* ---------------------------------------------------------------- layout */
.main { max-width: var(--content-max); margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-7); }
@media (min-width: 768px) { .main { padding: var(--space-6) var(--space-5) var(--space-7); } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-5); }
.page-head .lede { color: var(--text-muted); margin-top: var(--space-1); }
.grid { display: grid; gap: var(--space-4); }
.grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 639px) { .grid-kpi > .kpi-wide { grid-column: span 2; } }
/* 7 cards: phones 2-up (KEV full width, Suspicious + Malicious paired below it); tablets 3-up (KEV last, full row);
   desktop 4-up (KEV spans 2 beside Suspicious + Malicious) — no orphan gaps at any width */
@media (min-width: 640px) { .grid-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) and (max-width: 1099px) { .grid-kpi > .kpi-kev { order: 1; grid-column: span 3; } }
@media (min-width: 1100px) { .grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-kpi > .kpi-kev { grid-column: span 2; } }
.grid-2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.grid-main-aside { grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .grid-main-aside { grid-template-columns: minmax(0, 1fr) 360px; } }
.section-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.section-head a { font-size: var(--text-sm); margin-left: auto; }

/* ---------------------------------------------------------------- card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow); min-width: 0; }
@media (min-width: 768px) { .card { padding: var(--space-5); } }
.card-flush { padding: 0; overflow: hidden; }
.card-title { font-size: var(--text-sm); font-weight: 650; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--space-3); }

.kpi { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--border-strong); background: var(--surface-hover); color: inherit; }
.kpi-label { font-size: var(--text-sm); color: var(--text-muted); display: flex; gap: var(--space-2); align-items: center; }
.kpi-value { font-size: var(--text-3xl); font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-foot { font-size: var(--text-xs); color: var(--text-subtle); }
.kpi-accent .kpi-value { color: var(--crit-fg); }
/* safety KPIs: calm/neutral at 0, tinted only when something is flagged (colour is never the only cue: label + icon + foot) */
a.kpi { min-height: 44px; }
.kpi-risk .kpi-label .icon { color: var(--text-subtle); }
.kpi-risk:not(.is-hot) .kpi-value { color: var(--text-muted); }
.kpi-sus.is-hot { border-color: var(--med-bd); box-shadow: inset 3px 0 0 var(--med-solid), var(--shadow); }
.kpi-sus.is-hot .kpi-value, .kpi-sus.is-hot .kpi-label .icon { color: var(--med-fg); }
.kpi-mal.is-hot { border-color: var(--crit-bd); background: var(--crit-bg); box-shadow: inset 3px 0 0 var(--crit-solid), var(--shadow); }
.kpi-mal.is-hot .kpi-value, .kpi-mal.is-hot .kpi-label .icon, .kpi-mal.is-hot .kpi-label { color: var(--crit-fg); }
.kpi-mal.is-hot .kpi-foot { color: var(--crit-fg); font-weight: 600; }
.kpi-sus.is-hot:hover { border-color: var(--med-fg); }
.kpi-mal.is-hot:hover { border-color: var(--crit-fg); background: var(--crit-bg); }
:root[data-theme="light"] .kpi-sus.is-hot { --med-solid: #ca8a04; }
:root[data-theme="light"] .kpi-mal.is-hot { --crit-solid: #dc2626; }
a.kpi:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-lg); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg); font: 600 var(--text-sm)/1.2 var(--font-sans);
  text-decoration: none; cursor: pointer; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn-primary { --btn-bg: var(--accent-bg); --btn-fg: var(--on-accent); --btn-bd: transparent; }
.btn-primary:hover { background: var(--accent-bg-hover); border-color: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-danger { --btn-fg: var(--crit-fg); --btn-bd: var(--crit-bd); --btn-bg: var(--crit-bg); }
.btn-danger:hover { background: var(--crit-bg); border-color: var(--crit-fg); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-icon { min-width: 40px; padding: 8px; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.theme-toggle { margin-left: auto; }
.theme-toggle .when-light, :root[data-theme="light"] .theme-toggle .when-dark { display: none; }
:root[data-theme="light"] .theme-toggle .when-light { display: inline; }

/* ---------------------------------------------------------------- badges / chips */
.badge {
  --b-fg: var(--neutral-fg); --b-bg: var(--neutral-bg); --b-bd: var(--neutral-bd);
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; min-height: 22px;
  border-radius: var(--radius-pill); border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg);
  font-size: var(--text-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; text-decoration: none; font-variant-numeric: tabular-nums;
}
a.badge:hover { color: var(--b-fg); border-color: var(--b-fg); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.sev-CRITICAL { --b-fg: var(--crit-fg); --b-bg: var(--crit-bg); --b-bd: var(--crit-bd); }
.sev-HIGH { --b-fg: var(--high-fg); --b-bg: var(--high-bg); --b-bd: var(--high-bd); }
.sev-MEDIUM { --b-fg: var(--med-fg); --b-bg: var(--med-bg); --b-bd: var(--med-bd); }
.sev-LOW { --b-fg: var(--low-fg); --b-bg: var(--low-bg); --b-bd: var(--low-bd); }
.badge-kev { --b-fg: var(--kev-fg); --b-bg: var(--kev-bg); --b-bd: var(--kev-bg); letter-spacing: .04em; }
.st-mirrored { --b-fg: var(--low-fg); --b-bg: var(--low-bg); --b-bd: var(--low-bd); }
.st-pending { --b-fg: var(--info-fg); --b-bg: var(--info-bg); --b-bd: var(--info-bd); }
.st-flagged_suspicious, .st-error { --b-fg: var(--crit-fg); --b-bg: var(--crit-bg); --b-bd: var(--crit-bd); }
.st-flagged { --b-fg: var(--crit-fg); --b-bg: var(--crit-bg); --b-bd: var(--crit-bd); }
.st-duplicate, .st-skipped_empty, .st-skipped_large, .st-rejected_empty { --b-fg: var(--neutral-fg); --b-bg: var(--neutral-bg); --b-bd: var(--neutral-bd); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label, legend { font-size: var(--text-sm); font-weight: 600; color: var(--text); }
.hint { font-size: var(--text-xs); color: var(--text-subtle); }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--text); font: inherit; font-size: 16px; /* 16px avoids iOS zoom */
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@media (min-width: 768px) { .input, .select, .textarea { font-size: var(--text-sm); } }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 160px; resize: vertical; font-family: var(--font-mono); font-size: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent-bg); margin: 0; }
.toggle-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle-chips label { position: relative; }
.toggle-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle-chips span { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); font-size: var(--text-xs); font-weight: 650; color: var(--text-muted); background: var(--bg-elev); cursor: pointer; }
.toggle-chips input:checked + span { color: var(--b-fg, var(--text)); background: var(--b-bg, var(--surface-2)); border-color: var(--b-fg, var(--accent)); }
.toggle-chips input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.toggle-chips input:checked + span::before { content: "✓"; }

.search-bar { position: relative; display: flex; gap: var(--space-2); }
.search-bar .input { padding-left: 40px; min-height: 46px; border-radius: var(--radius-lg); font-size: 16px; }
.search-bar > .icon { position: absolute; left: 13px; top: 15px; color: var(--text-subtle); pointer-events: none; }
.search-bar .btn { min-height: 46px; border-radius: var(--radius-lg); }

/* ---------------------------------------------------------------- search layout */
.search-layout { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1024px) { .search-layout { grid-template-columns: 300px minmax(0, 1fr); gap: var(--space-5); } }
.filters { padding: 0; }
.filters > summary { list-style: none; display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); cursor: pointer; font-weight: 650; min-height: 48px; border-radius: var(--radius-lg); }
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary .chev { margin-left: auto; transition: transform var(--dur) var(--ease); }
.filters[open] > summary .chev { transform: rotate(180deg); }
.filters[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.filters-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.filters-actions { display: flex; gap: var(--space-2); }
.filters-actions .btn { flex: 1; }
@media (min-width: 1024px) {
  .filters > summary { cursor: default; pointer-events: none; }
  .filters > summary .chev { display: none; }
}
.count-pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--accent-bg); color: var(--on-accent); font-size: 11px; font-weight: 700; }

.results-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); min-height: 32px; }
.results-head .total { font-weight: 650; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.progress { position: relative; height: 2px; overflow: hidden; border-radius: 2px; margin-bottom: var(--space-3); visibility: hidden; }
.is-loading .progress { visibility: visible; }
.progress::before { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: slide 1s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.is-loading .result-list { opacity: .55; transition: opacity var(--dur); }

/* ---------------------------------------------------------------- result cards */
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.poc-card { position: relative; display: grid; gap: var(--space-2); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.poc-card:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.poc-card:focus-within { border-color: var(--accent); }
.poc-card .top { display: flex; align-items: flex-start; gap: var(--space-3); }
.poc-card .title { font-size: var(--text-base); font-weight: 650; line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.poc-card .title a { color: var(--text); text-decoration: none; }
.poc-card .title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* whole card clickable */
.poc-card .title a:hover { color: var(--accent); }
.poc-card .title a:focus-visible { outline: none; }
.poc-card .title a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.poc-card .owner { color: var(--text-muted); font-weight: 500; }
.poc-card .status { margin-left: auto; flex: none; }
.poc-card .desc { color: var(--text-muted); font-size: var(--text-sm); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.poc-card .chip-list, .poc-card .actions { position: relative; z-index: 1; } /* above the stretched link */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-4); color: var(--text-subtle); font-size: var(--text-xs); }
.meta span { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.meta .icon { width: 14px; height: 14px; }
.poc-card .foot { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.poc-card .actions { margin-left: auto; display: flex; gap: var(--space-2); }

.meter { --v: 0; position: relative; display: inline-block; width: 54px; height: 6px; border-radius: 3px; background: var(--neutral-bg); overflow: hidden; vertical-align: middle; }
.meter::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--accent); border-radius: inherit; }
.meter.lg { width: 100%; height: 8px; }
.meter.sev-CRITICAL::after { background: var(--crit-solid, var(--crit-fg)); }
.meter.sev-HIGH::after { background: var(--high-solid, var(--high-fg)); }
.meter.sev-MEDIUM::after { background: var(--med-solid, var(--med-fg)); }
.meter.sev-LOW::after { background: var(--low-solid, var(--low-fg)); }
:root[data-theme="light"] .meter.sev-CRITICAL::after { background: #dc2626; }
:root[data-theme="light"] .meter.sev-HIGH::after { background: #ea580c; }
:root[data-theme="light"] .meter.sev-MEDIUM::after { background: #ca8a04; }
:root[data-theme="light"] .meter.sev-LOW::after { background: #16a34a; }

/* ---------------------------------------------------------------- bars (dashboard) */
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.bars li { display: grid; grid-template-columns: 96px minmax(0, 1fr) 44px; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.bars a { color: var(--text); text-decoration: none; }
.bars a:hover { color: var(--accent); }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------------------------------------------------------------- lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border); min-width: 0; }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 var(--space-4) var(--space-5); font-size: var(--text-sm); }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: 2px; width: 1px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--text-subtle); font-size: var(--text-xs); }
.timeline .kind { font-weight: 650; }
/* repeated identical events collapsed (UI only): "×N" pill, neutral tokens (AA in both themes) */
.timeline .ev-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
.timeline .ev-line > a { min-width: 0; }
.ev-n { display: inline-flex; align-items: center; padding: 0 7px; border-radius: var(--radius-pill); font-size: var(--text-xs);
  font-weight: 700; line-height: 1.6; font-variant-numeric: tabular-nums; color: var(--info-fg); background: var(--info-bg);
  border: 1px solid var(--info-bd); }

/* ---------------------------------------------------------------- detail */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--text-sm); color: var(--text-subtle); margin-bottom: var(--space-3); }
.breadcrumb a { color: var(--text-muted); }
.detail-title { font-size: var(--text-2xl); overflow-wrap: anywhere; }
@media (min-width: 768px) { .detail-title { font-size: var(--text-3xl); } }
.detail-title .owner { color: var(--text-muted); font-weight: 500; }
.action-bar { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 479px) { .action-bar .btn { flex: 1 1 calc(50% - var(--space-2)); } .action-bar .btn-primary { flex-basis: 100%; } }
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; }
.facts > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--space-3); padding: 10px 0; border-top: 1px solid var(--border); font-size: var(--text-sm); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (min-width: 768px) { .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.metric { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.metric .label { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.metric .value { font-size: var(--text-xl); font-weight: 750; font-variant-numeric: tabular-nums; }
.cve-block { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); background: var(--surface-2); display: flex; flex-direction: column; gap: var(--space-3); }
.cve-block .head { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.cve-block .head a { font-weight: 700; font-family: var(--font-mono); font-size: var(--text-base); }
.code-block { position: relative; }
.code-block pre, pre.readme { position: relative; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); font-size: 13px; line-height: 1.6; max-height: 480px; overflow: auto; color: var(--text); }
.copy-row { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); }
.copy-row code { position: relative; flex: 1; min-width: 0; padding: 9px 12px; overflow-x: auto; white-space: nowrap; font-size: 12.5px; }
.copy-row .btn { border-radius: 0; border-width: 0 0 0 1px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- callouts / states */
.callout { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius); border: 1px solid var(--b-bd, var(--border)); background: var(--b-bg, var(--surface-2)); color: var(--b-fg, var(--text)); font-size: var(--text-sm); }
.callout .icon { margin-top: 2px; }
.callout strong { font-weight: 700; }
.callout-danger { --b-fg: var(--crit-fg); --b-bg: var(--crit-bg); --b-bd: var(--crit-bd); }
.callout-warn { --b-fg: var(--med-fg); --b-bg: var(--med-bg); --b-bd: var(--med-bd); }
.callout-info { --b-fg: var(--info-fg); --b-bg: var(--info-bg); --b-bd: var(--info-bd); }
.callout-ok { --b-fg: var(--low-fg); --b-bg: var(--low-bg); --b-bd: var(--low-bd); }
.empty { text-align: center; padding: var(--space-7) var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.empty .empty-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); }
.empty .empty-icon .icon { width: 24px; height: 24px; }
.empty p { color: var(--text-muted); max-width: 46ch; }
.empty .row { justify-content: center; margin-top: var(--space-2); }
.error-page { max-width: 560px; margin: var(--space-7) auto; text-align: center; display: flex; flex-direction: column; gap: var(--space-4); align-items: center; }
.error-code { font-size: 4.5rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; background: linear-gradient(135deg, var(--accent), #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skeleton { display: block; height: 96px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border: 1px solid var(--border); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-5); flex-wrap: wrap; }
.pagination .current { font-size: var(--text-sm); color: var(--text-muted); padding: 0 var(--space-2); }

/* ---------------------------------------------------------------- table (cve page, history) */
.table-wrap { position: relative; overflow-x: auto; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--text-muted); font-weight: 600; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; }

.site-footer { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-4) var(--space-6); color: var(--text-subtle); font-size: var(--text-xs); display: flex; gap: var(--space-3); flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }

/* meter widths (CSP-safe: no inline styles) */
.v-0{--w:0%}.v-5{--w:5%}.v-10{--w:10%}.v-15{--w:15%}.v-20{--w:20%}.v-25{--w:25%}.v-30{--w:30%}.v-35{--w:35%}.v-40{--w:40%}.v-45{--w:45%}.v-50{--w:50%}.v-55{--w:55%}.v-60{--w:60%}.v-65{--w:65%}.v-70{--w:70%}.v-75{--w:75%}.v-80{--w:80%}.v-85{--w:85%}.v-90{--w:90%}.v-95{--w:95%}.v-100{--w:100%}
.mt-3{margin-top:var(--space-3)}.mt-5{margin-top:var(--space-5)}.mb-4{margin-bottom:var(--space-4)}.justify-end{justify-content:flex-end}.stack-xs{display:flex;flex-direction:column;gap:4px}.pre-wrap{white-space:pre-wrap}
.field .label{font-size:var(--text-sm);font-weight:600}

/* ---------------------------------------------------------------- user menu */
.is-bare { padding-bottom: 0; }
.theme-toggle { margin-left: auto; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; gap: var(--space-2); padding: 4px 8px 4px 4px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu .chev { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.user-menu[open] .chev { transform: rotate(180deg); }
.user-name { display: none; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 640px) { .user-name { display: inline; } }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 750; font-size: var(--text-sm); color: #fff; background: linear-gradient(135deg, #2563eb, #7c3aed); flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: var(--text-lg); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 60; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--space-2); display: flex; flex-direction: column; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--border); margin-bottom: var(--space-2); }
.menu a, .menu button { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 40px; padding: 8px var(--space-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font: 500 var(--text-sm)/1.2 var(--font-sans); background: none; border: 0; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); color: var(--text); }
.menu form { margin: 0; border-top: 1px solid var(--border); margin-top: var(--space-2); padding-top: var(--space-2); }
.role-admin { --b-fg: #e9d5ff; --b-bg: rgba(147,51,234,.2); --b-bd: rgba(168,85,247,.5); }
:root[data-theme="light"] .role-admin { --b-fg: #6b21a8; --b-bg: #f3e8ff; --b-bd: #d8b4fe; }

/* ---------------------------------------------------------------- auth pages */
.auth-wrap { min-height: calc(100vh - var(--header-h) - 140px); display: grid; place-items: center; padding: var(--space-5) 0; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: var(--space-5); }
@media (min-width: 768px) { .auth-card .card { padding: var(--space-6); } }
.auth-card h1 { font-size: var(--text-2xl); }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); margin-bottom: var(--space-5); }
.auth-head .brand-mark { width: 48px; height: 48px; border-radius: 12px; }
.auth-head .brand-mark .icon { width: 26px; height: 26px; }
.btn-block { width: 100%; min-height: 44px; }
.pw-field { position: relative; }
.pw-field .input { padding-right: 48px; }
.pw-field .reveal { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 36px; min-width: 40px; }
.pw-meter { height: 4px; border-radius: 2px; background: var(--neutral-bg); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--crit-solid, #ef4444); transition: width var(--dur) var(--ease), background var(--dur); }
.pw-meter[data-score="2"] span { width: 50%; background: var(--med-solid, #eab308); }
.pw-meter[data-score="3"] span { width: 75%; background: var(--low-solid, #22c55e); }
.pw-meter[data-score="4"] span { width: 100%; background: var(--low-solid, #22c55e); }
.pw-meter[data-score="1"] span { width: 25%; }
.secret-box { display: flex; align-items: stretch; border: 1px dashed var(--med-bd); border-radius: var(--radius); background: var(--med-bg); overflow: hidden; }
.secret-box code { position: relative; flex: 1; min-width: 0; padding: 12px 14px; font-size: 1.05rem; letter-spacing: .04em; color: var(--text); overflow-x: auto; white-space: nowrap; }
.secret-box .btn { border-radius: 0; border-width: 0 0 0 1px; }

/* ---------------------------------------------------------------- user admin */
.user-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.user-table th, .user-table td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.user-table th { color: var(--text-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.user-table tbody tr:hover td { background: var(--surface-hover); }
.user-cell { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.user-cell a { font-weight: 650; color: var(--text); text-decoration: none; }
.user-cell a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 767px) {
  .user-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .user-table, .user-table tbody, .user-table tr, .user-table td { display: block; width: 100%; }
  .user-table tr { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-3); padding: var(--space-3); background: var(--surface); }
  .user-table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: var(--space-3); }
  .user-table td::before { content: attr(data-label); color: var(--text-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
  .user-table td.user-main::before { content: none; }
  .user-table td.user-main { padding-bottom: var(--space-2); }
  .user-table .card-flush { background: none; border: 0; box-shadow: none; }
}
.danger-zone { border-color: var(--crit-bd); }
.danger-zone .card-title { color: var(--crit-fg); }
.inline-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; }
.inline-form .field { flex: 1 1 180px; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.radio-cards label { position: relative; display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; background: var(--bg-elev); }
.radio-cards input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio-cards strong { font-size: var(--text-sm); }
.radio-cards span { font-size: var(--text-xs); color: var(--text-muted); }
.radio-cards label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--info-bg); }
.radio-cards label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.max-w-form { max-width: 640px; }
.center{text-align:center}

/* ---------------------------------------------------------------- safety scan (risk badges, remarks, warning) */
/* risk colours: clean=green, low=teal, suspicious=amber, malicious=red, unknown=neutral — always with icon + text */
.risk-clean { --b-fg: var(--low-fg); --b-bg: var(--low-bg); --b-bd: var(--low-bd); --r-solid: var(--low-solid, #22c55e); }
.risk-low { --b-fg: var(--teal-fg); --b-bg: var(--teal-bg); --b-bd: var(--teal-bd); --r-solid: var(--teal-solid); }
.risk-suspicious { --b-fg: var(--med-fg); --b-bg: var(--med-bg); --b-bd: var(--med-bd); --r-solid: var(--med-solid, #eab308); }
.risk-malicious { --b-fg: var(--crit-fg); --b-bg: var(--crit-bg); --b-bd: var(--crit-bd); --r-solid: var(--crit-solid, #ef4444); }
.risk-unknown { --b-fg: var(--neutral-fg); --b-bg: var(--neutral-bg); --b-bd: var(--neutral-bd); --r-solid: #94a3b8; }
:root[data-theme="light"] .risk-clean { --r-solid: #16a34a; }
:root[data-theme="light"] .risk-suspicious { --r-solid: #ca8a04; }
:root[data-theme="light"] .risk-malicious { --r-solid: #dc2626; }
:root[data-theme="light"] .risk-unknown { --r-solid: #6b7280; }
.badge.risk .icon { width: 13px; height: 13px; vertical-align: -2px; }
.badge.risk-malicious { font-weight: 700; }
.badge.lg { min-height: 28px; padding: 2px 12px; font-size: var(--text-sm); }
.badge.lg .icon { width: 15px; height: 15px; }
.risk-link { text-decoration: none; border-radius: var(--radius-pill); }
.meter.risk-clean::after, .meter.risk-low::after, .meter.risk-suspicious::after, .meter.risk-malicious::after, .meter.risk-unknown::after { background: var(--r-solid); }
.bars li .badge.risk { justify-self: start; }
.safety-widget .bars li { grid-template-columns: 112px minmax(0, 1fr) 44px; }
.safety-flagged { margin-top: var(--space-4); font-size: var(--text-sm); font-weight: 600; }
.safety-flagged a { display: inline-flex; align-items: center; gap: 6px; color: var(--med-fg); }
.grid-3 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* card summary line */
.safety-line { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-xs); color: var(--text-muted); }
.safety-line .badge { flex: none; }
.safety-sum { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poc-card:has(.risk-malicious) { border-left: 3px solid var(--crit-bd); }
.poc-card:has(.safety-line .risk-suspicious) { border-left: 3px solid var(--med-bd); }
.btn-warn-dl { --btn-fg: var(--med-fg); --btn-bd: var(--med-bd); --btn-bg: var(--med-bg); }
.btn-warn-dl:hover { background: var(--med-bg); border-color: var(--med-fg); }

/* detail panel */
.safety-panel { border-top: 3px solid var(--r-solid, var(--border)); }
.safety-panel .section-head .badge { margin-left: auto; }
.safety-panel > p.muted { margin-bottom: var(--space-3); font-size: var(--text-sm); }
.safety-facts { margin-bottom: var(--space-4); }
@media (min-width: 640px) {
  .safety-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
  .safety-facts > div { grid-template-columns: 1fr; gap: 2px; border-top: 0; padding: 0; }
  .safety-facts dt { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; }
}
.safety-empty { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); font-size: var(--text-sm); }
.safety-empty .icon { margin-top: 3px; color: var(--text-muted); }
.remarks-title { font-size: var(--text-sm); margin-bottom: var(--space-2); display: flex; flex-wrap: wrap; gap: 4px var(--space-2); align-items: baseline; }
.remarks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.remark { padding: var(--space-3); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; background: var(--bg-elev); }
.remark:first-child { border-top: 0; }
.remark-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-2); }
.remark-loc { font-size: var(--text-xs); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px 6px; }
.remark-code { font-size: var(--text-xs); color: var(--text-subtle); }
.remark-reason { font-size: var(--text-sm); color: var(--text-muted); white-space: pre-wrap; }
.rsev { text-transform: none; }
.rsev-critical, .rsev-high { --b-fg: var(--crit-fg); --b-bg: var(--crit-bg); --b-bd: var(--crit-bd); }
.rsev-medium, .rsev-med, .rsev-warning, .rsev-warn { --b-fg: var(--med-fg); --b-bg: var(--med-bg); --b-bd: var(--med-bd); }
.rsev-low { --b-fg: var(--teal-fg); --b-bg: var(--teal-bg); --b-bd: var(--teal-bd); }
.rsev-info { --b-fg: var(--info-fg); --b-bg: var(--info-bg); --b-bd: var(--info-bd); }
/* code evidence (indicator chip + excerpt). Long lines scroll inside the block, never the page. */
.remark.has-evidence { gap: var(--space-2); }
.evidence { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; max-width: 100%; }
.ind-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-2); margin: 0; font-size: var(--text-sm); }
.ind-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 650; color: var(--crit-fg); background: var(--crit-bg); border: 1px solid var(--crit-bd); }
.ind-chip .icon { width: 13px; height: 13px; flex: none; }
.ind-chip.ind-info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-bd); } /* heuristic note: not a threat colour */
.ind-reason { color: var(--text-muted); min-width: 0; }
.code-ev { margin: 0; min-width: 0; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.code-ev-cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px var(--space-3); padding: 6px var(--space-3); border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: var(--text-xs); color: var(--text); }
.code-ev-link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 600; }
.code-ev-link .icon { width: 13px; height: 13px; }
/* position:relative makes the scroller the containing block of absolutely positioned descendants (.sr-only):
   otherwise they escape the overflow clip and widen the page, and phones zoom the whole layout out. */
.code-scroll { position: relative; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; max-width: 100%; }
.code-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.code-lines { margin: 0; padding: var(--space-2) 0; font-size: 12.5px; line-height: 1.6; white-space: pre; background: transparent; border: 0; color: var(--text); width: max-content; min-width: 100%; }
.code-lines code { font-size: inherit; display: block; }
.code-lines .cl { position: relative; display: block; padding: 0 var(--space-3) 0 0; border-left: 3px solid transparent; }
.code-lines .ln { display: inline-block; box-sizing: content-box; min-width: 4ch; padding: 0 var(--space-3) 0 var(--space-2); margin-right: var(--space-2); text-align: right; color: var(--text-subtle); border-right: 1px solid var(--border); user-select: none; }
.code-lines.ln5 .ln { min-width: 5ch; } /* 10k+ line files keep one column width */
.code-lines .cl.hit { background: var(--crit-bg); border-left-color: var(--crit-solid, #dc2626); }
.code-lines .cl.hit .ln { color: var(--crit-fg); font-weight: 700; }
.code-lines .cl.hit .tx { color: var(--text); font-weight: 600; }
:root[data-theme="light"] .code-lines .cl.hit { border-left-color: #dc2626; }
.dl-note { display: flex; align-items: center; gap: 6px; margin-top: calc(-1 * var(--space-2)); }

/* download warning (page + modal) */
.dl-warn-page { max-width: 760px; border-top: 3px solid var(--r-solid, var(--crit-bd)); }
.dl-warn-head { display: flex; gap: var(--space-3); align-items: flex-start; }
.dl-warn-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd); }
.dl-warn-icon .icon { width: 22px; height: 22px; }
.dl-warn-title { font-size: var(--text-xl); }
.dl-warn-title:focus { outline: none; }
.dl-warn-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 479px) { .dl-warn-actions .btn { flex: 1 1 100%; } }
.modal { width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px -16px rgba(0,0,0,.6); overflow: auto; }
.modal::backdrop { background: rgba(5,8,14,.72); backdrop-filter: blur(3px); }
.modal .dl-warn { padding: var(--space-5); }
.modal-x { position: absolute; top: 10px; right: 10px; min-height: 40px; min-width: 40px; padding: 0; }
@media (max-width: 639px) { .modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; } }

/* ---------------------------------------------------------------- syntax highlighting (Pygments, server-side)
   codeview emits <span class="hl-X"> only; colours are AA (>= 4.5:1) on the code background and on flagged lines. */
.hl-k { color: #ff9ac8; } .hl-s { color: #a8e48a; } .hl-c { color: #9aa4b5; font-style: italic; } .hl-m { color: #f8c37f; }
.hl-f { color: #8ccaff; } .hl-b { color: #cbb4ff; } .hl-d { color: #ffd88a; } .hl-v { color: #e8ebf1; } .hl-o { color: #c2cad6; }
:root[data-theme="light"] .hl-k { color: #a1145f; } :root[data-theme="light"] .hl-s { color: #1d6a10; } :root[data-theme="light"] .hl-c { color: #555e6c; }
:root[data-theme="light"] .hl-m { color: #8a4300; } :root[data-theme="light"] .hl-f { color: #0b55a0; } :root[data-theme="light"] .hl-b { color: #5f2fc2; }
:root[data-theme="light"] .hl-d { color: #6f4f00; } :root[data-theme="light"] .hl-v { color: #111827; } :root[data-theme="light"] .hl-o { color: #374151; }

/* evidence actions + review */
.code-ev-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border); background: var(--surface); }
.code-ev[aria-busy="true"] [data-ev-body] { opacity: .6; }
.btn-danger-soft { --btn-fg: var(--crit-fg); --btn-bd: var(--crit-bd); }
.btn-danger-soft:hover { background: var(--crit-bg); }
.input-sm { min-height: 32px; padding: 4px 10px; }
.review-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding-top: var(--space-2); border-top: 1px dashed var(--border); }
.review-note-field { flex: 1 1 200px; min-width: 0; display: flex; }
.review-note-field .input { width: 100%; }
.review-btns { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* "Review…" disclosure: note + verdict buttons only after a deliberate click */
.review-more { flex: 1 1 auto; min-width: 0; }
.review-more > summary { list-style: none; }
.review-more > summary::-webkit-details-marker { display: none; }
.review-more[open] > summary { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.review-panel { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
@media (max-width: 767px) {
  .review-form .btn, .review-more > summary { min-height: 44px; padding-inline: 14px; font-size: var(--text-sm); }
  .review-panel { flex-direction: column; align-items: stretch; gap: var(--space-3); }
  .review-note-field { flex: none; } .review-note-field .input { min-height: 44px; }
  .review-btns { flex-direction: column; gap: var(--space-3); } .review-btns .btn { width: 100%; }
}
.review-state { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); font-size: var(--text-sm); margin: 0; }
.review-note { color: var(--text-muted); font-size: var(--text-sm); font-style: italic; min-width: 0; }
.badge.rv-false_positive { --b-fg: var(--teal-fg); --b-bg: var(--teal-bg); --b-bd: var(--teal-bd); }
.badge.rv-confirmed { --b-fg: var(--crit-fg); --b-bg: var(--crit-bg); --b-bd: var(--crit-bd); }
.badge.risk.is-reviewed .rv-tag { font-weight: 500; opacity: .85; }
.verdict-scanner { opacity: .85; }
.badge.reviewed-badge { --b-fg: var(--info-fg); --b-bg: var(--info-bg); --b-bd: var(--info-bd); }
.reviewed-note { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-sm); color: var(--info-fg); background: var(--info-bg); border: 1px solid var(--info-bd); border-radius: var(--radius); padding: var(--space-2) var(--space-3); margin: var(--space-2) 0 0; }
.reviewed-note .icon { flex: none; margin-top: 3px; }
/* false positives: dimmed via colour (not opacity, so text keeps AA contrast) and evidence collapsed */
.remark.is-fp, .finding.is-fp { background: var(--surface-2); border-left: 3px solid var(--teal-bd); }
.remark.is-fp .remark-reason, .finding.is-fp .remark-reason, .finding.is-fp .finding-poc { color: var(--text-subtle); }
.remark.is-fp .remark-reason { text-decoration: line-through; text-decoration-color: var(--border-strong); }
.remark.is-confirmed, .finding.is-confirmed { border-left: 3px solid var(--crit-solid, #dc2626); }
.fp-details summary { cursor: pointer; font-size: var(--text-sm); font-weight: 600; min-height: 32px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; padding-top: 6px; }
.fp-details[open] summary { margin-bottom: var(--space-2); }

/* file viewer */
.viewer-title { font-size: var(--text-xl); line-height: 1.3; }
.viewer-meta { font-size: var(--text-sm); }
.viewer-actions { gap: var(--space-2) var(--space-3); }
/* Sticky finding bar: ONE slim row (counter, severity + kind/indicator chip with ellipsis, prev/next, Details) so it
   hides as little code as possible. The full finding is a drawer (.fn-detail) inside the bar, shown only when
   expanded. --fn-h = the bar's measured height (app.js; CSS fallback below) and drives the highlighted line's
   scroll-margin, so the target + ~3 lines of context are never under it. :root[data-fn-collapsed] is set before first
   paint by theme.js (default collapsed on phones). */
:root { --fn-h: 148px; --fn-ctx: calc(3 * 1.6 * 12.5px); }
:root[data-fn-collapsed] { --fn-h: 54px; }
.findings-nav { position: sticky; top: var(--header-h); z-index: 20; min-width: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.fn-bar { display: flex; align-items: center; gap: var(--space-2); min-width: 0; min-height: 50px; padding: 4px var(--space-2) 4px var(--space-3); }
.fn-count { flex: none; margin: 0; font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fn-count-short, .fn-count-extra { display: none; }
.fn-sum { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--text-muted); }
.fn-sum .badge { flex: none; }
.fn-sum-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-xs); }
.fn-sum-ind { color: var(--text); }
.fn-btns { flex: none; display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.fn-btn, .fn-toggle { min-height: 40px; }
.fn-btns [aria-disabled="true"] { color: var(--text-subtle); cursor: not-allowed; }
.fn-toggle { gap: 4px; }
.fn-toggle .icon { transition: transform .15s ease; }
.fn-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.fn-detail { position: relative; display: flex; flex-direction: column; gap: 6px; max-height: 45vh; overflow: auto; padding: var(--space-2) var(--space-3) var(--space-3); border-top: 1px solid var(--border); }
.fn-detail .remark-reason { margin: 0; font-size: var(--text-sm); }
.fn-detail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); font-size: var(--text-xs); }
.fn-detail .review-form { padding-top: 6px; }

.kbd-hint { display: none; flex: none; margin: 0; font-size: var(--text-xs); }
@media (min-width: 1200px) { .kbd-hint { display: block; } }
.kbd-hint kbd { padding: 0 4px; border: 1px solid var(--border-strong); border-radius: 4px; background: var(--surface-2); }
:root[data-fn-collapsed] .fn-detail { display: none; }
@media (max-width: 767px) {
  :root { --fn-h: 190px; }
  :root[data-fn-collapsed] { --fn-h: 54px; }
  .fn-bar { gap: 6px; padding: 3px 4px 3px var(--space-2); min-height: 52px; }
  .fn-count-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fn-count-short { display: inline; }
  .fn-sum-txt, .fn-sum-rv { display: none; } /* phone bar: counter · severity · prev/next · Details */
  .fn-btn { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .fn-btn-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fn-toggle { min-height: 44px; padding: 0 10px; }
  .fn-detail { max-height: 50vh; }
  .kbd-hint { display: none; }
}
@media (min-width: 400px) and (max-width: 767px) { .fn-sum-txt { display: block; } }
@media (min-width: 1024px) { .fn-count-extra { display: inline; } }
/* desktop drawer: reason (max 2 lines) on top, then location/indicator on the left and review actions on the right */
@media (min-width: 768px) {
  .fn-detail { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px var(--space-4); }
  .fn-detail .remark-reason { grid-column: 1 / -1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .fn-detail .review-form, .fn-detail .review-state { padding-top: 0; border-top: 0; justify-content: flex-end; }
}
:root[data-fn-collapsed] .fn-detail { display: none; }
/* long code lines: visible hint + right-edge fade while clipped (app.js sets .is-clipped/.at-end), optional wrapping */
.code-ev-tools { display: inline-flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.scroll-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); }
.viewer-code { position: relative; }
.viewer-code.is-clipped:not(.at-end)::after { content: ""; position: absolute; top: 33px; right: 0; bottom: 0; width: 28px; pointer-events: none; background: linear-gradient(to right, transparent, var(--bg)); }
.wrap-toggle[aria-pressed="true"] { --btn-bg: var(--surface); --btn-bd: var(--border-strong); color: var(--text); }
:root[data-code-wrap] .viewer-code .code-lines { white-space: pre-wrap; width: auto; }
:root[data-code-wrap] .viewer-code .code-lines .cl { display: grid; grid-template-columns: auto minmax(0, 1fr); }
:root[data-code-wrap] .viewer-code .code-lines .tx { overflow-wrap: anywhere; min-width: 0; }
.fn-list summary { cursor: pointer; font-size: var(--text-sm); font-weight: 600; min-height: 32px; }
.fn-list ol { margin: var(--space-2) 0 0; padding-left: var(--space-5); font-size: var(--text-sm); display: flex; flex-direction: column; gap: 4px; }
.fn-list a[aria-current="true"] { font-weight: 700; }
.code-lines a.ln { text-decoration: none; }
.code-lines a.ln:hover { color: var(--text); }
.code-lines .cl:target { background: var(--info-bg); box-shadow: inset 0 0 0 1px var(--info-bd); }
.code-lines .cl.hit:target { background: var(--crit-bg); box-shadow: inset 0 0 0 2px var(--focus); }
/* html already has scroll-padding-top = header + 12px; add the sticky bar's height and ~3 lines of context */
.viewer .code-lines .cl { scroll-margin-top: calc(var(--fn-h) + var(--fn-ctx)); }

/* findings page */
.findings-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-4); }
.findings-filters .ff-q, .findings-filters .ff-risk { grid-column: 1 / -1; }
.findings-filters .ff-actions { align-self: end; }
.findings-filters .ff-actions .btn { flex: 1; }
@media (min-width: 768px) { .findings-filters { grid-template-columns: minmax(0, 2fr) auto repeat(2, minmax(0, 1fr)) auto; align-items: end; padding: var(--space-4); }
  .findings-filters .ff-q, .findings-filters .ff-risk { grid-column: auto; } .findings-filters .ff-actions .btn { flex: none; } }
.findings-filters fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ff-actions { display: flex; gap: var(--space-2); }
.review-chips .badge { text-decoration: none; min-height: 32px; }
.review-chips .badge.is-on { --b-fg: var(--on-accent); --b-bg: var(--accent-bg); --b-bd: var(--accent-bg); }
.review-chips .badge.is-on .subtle { color: inherit; }
.finding-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.finding { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); min-width: 0; }
.finding-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.finding-poc { font-weight: 650; text-decoration: none; min-width: 0; }
.finding-poc .owner { color: var(--text-subtle); font-weight: 500; }
.finding .remark-reason { margin: 0; }
.finding-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--text-sm); }
.pager { display: flex; align-items: center; justify-content: center; gap: var(--space-3); margin-top: var(--space-4); }

/* ---------------------------------------------------------------- README card (rendered Markdown) */
.readme-head { flex-wrap: wrap; row-gap: var(--space-2); }
.readme-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-2); margin-left: auto; min-width: 0; }
.readme-badges .badge { white-space: normal; }
.readme-pending { display: inline-flex; align-items: center; gap: 4px; }
.readme-pending .icon { width: 14px; height: 14px; }
.badge-tr { --b-fg: var(--info-fg); --b-bg: var(--info-bg); --b-bd: var(--info-bd); }
.badge-stale { --b-fg: var(--med-fg); --b-bg: var(--med-bg); --b-bd: var(--med-bd); }
.readme-tools { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.seg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; min-width: 44px; padding: 4px 14px; border-radius: calc(var(--radius) - 3px); color: var(--text-muted); font-size: var(--text-sm); font-weight: 600; text-decoration: none; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.seg-btn:hover { color: var(--text); background: var(--surface-hover); }
.seg-btn[aria-current="true"] { color: var(--text); background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong), 0 1px 2px rgba(0,0,0,.18); }
.seg-btn:focus-visible { outline-offset: 0; }
@media (max-width: 767px) {
  .readme-badges { margin-left: 0; width: 100%; }
  .readme-tools { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-2); }
  .seg { display: flex; min-width: 0; }
  .seg-btn { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 4px 6px; }
}
.readme-foot { margin: var(--space-4) 0 0; }
.readme-card pre.readme { max-height: 70vh; }

.md { min-width: 0; font-size: var(--text-base); line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.6em 0 .6em; line-height: 1.3; font-weight: 700; scroll-margin-top: calc(var(--header-h) + 16px); }
.md h1 { font-size: var(--text-2xl); padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.md h2 { font-size: var(--text-xl); padding-bottom: .25em; border-bottom: 1px solid var(--border); }
.md h3 { font-size: var(--text-lg); }
.md h4, .md h5, .md h6 { font-size: var(--text-base); }
.md h6 { color: var(--text-muted); }
.md p, .md ul, .md ol, .md dl, .md blockquote, .md pre, .md .md-table, .md details { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.6em; }
.md li + li { margin-top: .25em; }
.md li > ul, .md li > ol { margin: .25em 0 0; }
.md ul.contains-task-list { list-style: none; padding-left: .4em; }
.md .task-list-item-checkbox { margin: 0 .5em 0 0; vertical-align: -2px; width: 16px; height: 16px; accent-color: var(--accent-bg); }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.md a:hover { color: var(--accent-hover); }
.md strong { font-weight: 700; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }
.md blockquote { padding: .25em 1em; border-left: 4px solid var(--border-strong); color: var(--text-muted); }
.md blockquote > :last-child { margin-bottom: 0; }
.md code, .md kbd, .md samp { font-size: .875em; }
.md :not(pre) > code { padding: .15em .4em; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.md kbd { padding: .1em .4em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); }
.md pre { position: relative; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; max-width: 100%; padding: var(--space-3) var(--space-4); background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; line-height: 1.6; white-space: pre; overflow-wrap: normal; }
.md pre code { font-size: inherit; background: none; border: 0; padding: 0; white-space: inherit; }
.md pre:focus-visible, .md .md-table:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.md .md-table { position: relative; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); }
.md table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: var(--text-sm); overflow-wrap: normal; }
.md th, .md td { padding: 8px 12px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; vertical-align: top; max-width: 40ch; overflow-wrap: anywhere; }
.md th:last-child, .md td:last-child { border-right: 0; }
.md tbody tr:last-child td { border-bottom: 0; }
.md th { background: var(--surface-2); font-weight: 700; }
.md tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.md .al-center { text-align: center; } .md .al-right { text-align: right; }
.md details { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); }
.md summary { cursor: pointer; font-weight: 600; min-height: 32px; display: list-item; }
.md .md-img { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 10px; margin: 2px 0; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted); font-size: var(--text-sm); line-height: 1.5; text-decoration: none; vertical-align: middle; }
.md a.md-img { color: var(--accent); }
.md a.md-img:hover { border-color: var(--accent); }
.md a .md-img { color: inherit; }
.md .md-img > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.md .md-img-icon { font-size: .9em; opacity: .8; }
.md mark { background: var(--med-bg); color: var(--text); padding: 0 .15em; border-radius: 3px; }
.md sup, .md sub { line-height: 0; }

/* ================================================================ UX polish (tap targets, notices, filters, hub)
   Phones get >= 44px targets; inline links/chips grow their hit area with padding or ::after, not their look. */
.meta, .kpi-foot, .timeline .when, .hint, .code-ev-cap { font-size: max(var(--text-xs), 12.5px); }
@media (max-width: 767px), (pointer: coarse) { /* phones + any touch screen (tablets too) */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 44px; padding-inline: 12px; font-size: var(--text-sm); }
  .btn-icon, .theme-toggle { min-width: 44px; min-height: 44px; }
  .user-menu > summary { min-height: 44px; padding-inline: 6px; }
  .menu a, .menu button { min-height: 44px; }
  .check { min-height: 44px; }
  .toggle-chips span { min-height: 44px; padding-inline: 14px; }
  .toggle-chips, .chip-list, .active-filters, .tags { gap: 10px 8px; }
  a.badge { position: relative; min-height: 32px; padding-inline: 10px; }
  a.badge::after { content: ""; position: absolute; inset: -8px -3px; } /* >= 44px tall hit area (32px chip + 2x8px) */
  .poc-card .chip-list a.badge::after { inset: -8px -3px; }
  .finding-poc, .list a.title, .timeline a, .breadcrumb a, .facts dd a, .section-head a, .bars a, .safety-flagged a, .site-footer a,
  .risk-link, .poc-notice a, a.remark-loc, .brand, .form-tips a, .cve-block .head > a { display: inline-block; padding-block: 13px; margin-block: -13px; }
  .bars a, .risk-link, .safety-flagged a, .brand { display: inline-flex; align-items: center; }
  .input, .select { min-height: 44px; }
  .poc-card .title a { padding-block: 10px; margin-block: -10px; display: inline-block; }
  .code-ev-link { min-height: 44px; }
}
/* card-wide stretched link stays the main target; chips/actions sit above it */
.poc-card .title a::after { inset: 0; }

/* result cards: id beside the status (never alone on a line), muted "No description" */
.poc-card .status { display: inline-flex; align-items: center; gap: var(--space-2); }
.poc-id { color: var(--text-subtle); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.no-desc { color: var(--text-subtle); font-style: italic; }
.poc-card .desc.no-desc { -webkit-line-clamp: 1; line-clamp: 1; }

/* ---------------------------------------------------------------- PoC detail */
.bc-back { width: 14px; height: 14px; margin-right: 2px; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 2px; }
@media (max-width: 767px) { .breadcrumb .bc-tail { display: none; } }
@media (min-width: 768px) { .breadcrumb .bc-back { display: none; } }
.detail-title { overflow-wrap: break-word; word-break: normal; hyphens: manual; }
.poc-notice a { color: inherit; font-weight: 700; }
.isolation-note { display: flex; align-items: flex-start; gap: 6px; margin-top: calc(-1 * var(--space-2)); }
.isolation-note .icon { margin-top: 3px; flex: none; }
.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-2); }
.link-row a { font-weight: 600; white-space: nowrap; }
.link-row .btn-icon { min-width: 32px; min-height: 32px; padding: 4px; }
@media (max-width: 767px) { .link-row .btn-icon { min-width: 44px; min-height: 44px; } }

/* ---------------------------------------------------------------- dashboard */
.dash-body { display: flex; flex-direction: column; gap: var(--space-5); }
@media (max-width: 767px) { .dash-main { order: -1; } } /* phones: Recently added before the charts */
.grid-kpi > .kpi { height: 100%; }
.kpi-foot { margin-top: auto; }
.grid-3 > .card { height: 100%; }
.bars li.is-zero .val, .bars li.is-zero a { color: var(--text-subtle); }
.bars li.is-zero .badge { --b-fg: var(--text-subtle); --b-bg: transparent; --b-bd: var(--border); }
@media (max-width: 639px) {
  .kpi-kev { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: var(--space-3); }
  .kpi-kev .kpi-label { flex: 1 1 auto; }
  .kpi-kev .kpi-value { order: 2; }
  .kpi-kev .kpi-foot { flex-basis: 100%; order: 3; margin-top: 0; }
}

/* ---------------------------------------------------------------- filters (search sidebar + findings) */
@media (min-width: 1024px) {
  .search-layout > .filters { position: sticky; top: calc(var(--header-h) + var(--space-4)); max-height: calc(100vh - var(--header-h) - var(--space-6)); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .search-layout > .filters > summary { position: sticky; top: 0; z-index: 1; background: var(--surface); }
}
.fgroup { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); }
.fgroup > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-2); min-height: 44px; padding: var(--space-2) var(--space-3); cursor: pointer; font-size: var(--text-sm); font-weight: 650; }
.fgroup > summary::-webkit-details-marker { display: none; }
.fgroup > summary .subtle { font-weight: 500; font-size: var(--text-xs); }
.fgroup > summary .chev { margin-left: auto; transition: transform var(--dur) var(--ease); }
.fgroup[open] > summary .chev { transform: rotate(180deg); }
.fgroup-body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-3); border-top: 1px solid var(--border); }
.results-col { min-width: 0; position: relative; }
.results-loading { position: sticky; top: calc(var(--header-h) + 8px); z-index: 5; display: flex; align-items: center; gap: var(--space-2); width: max-content; max-width: 100%; margin: 0 0 var(--space-2) auto; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: var(--text-sm); color: var(--text); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.findings-filter-panel { padding: 0; }
.findings-filter-panel .findings-filters { padding: var(--space-3) var(--space-4) var(--space-4); }
.findings-filter-panel[open] > summary { border-bottom: 1px solid var(--border); }
@media (min-width: 1024px) { .findings-filter-panel > summary { display: none; } .findings-filter-panel .findings-filters { padding: var(--space-4); } }
.review-chips { gap: 8px; }

/* ---------------------------------------------------------------- undo toast */
.toast { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); display: flex; align-items: center; gap: var(--space-2) var(--space-3); width: max-content; max-width: calc(100vw - 24px); padding: 8px 8px 8px 14px; border-radius: var(--radius-lg); background: var(--text); color: var(--bg); box-shadow: 0 12px 32px -8px rgba(0,0,0,.5); font-size: var(--text-sm); font-weight: 600; }
@media (min-width: 768px) { .toast { bottom: 24px; } }
.toast > .icon { color: var(--bg); flex: none; }
.toast-form { margin: 0; }
.toast .btn { --btn-bg: transparent; --btn-fg: var(--bg); --btn-bd: color-mix(in srgb, var(--bg) 40%, transparent); }
.toast .btn:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }
.toast .toast-x { --btn-bd: transparent; }
.toast :focus-visible { outline-color: var(--focus); }

/* ---------------------------------------------------------------- confirm (dialog + no-JS page) */
.confirm-dialog .dl-warn { display: flex; flex-direction: column; gap: var(--space-3); }
.confirm-card { max-width: 640px; border-top: 3px solid var(--crit-bd); }
.confirm-actions { gap: var(--space-2); }

/* ---------------------------------------------------------------- account hub (dropdown + /account page) */
.menu { min-width: 260px; }
.menu-head { justify-content: flex-start; gap: var(--space-3); }
.menu-who { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.menu-label { margin: var(--space-2) var(--space-3) 2px; font-size: var(--text-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle); }
.menu-sep { height: 1px; background: var(--border); margin: var(--space-2) 0; }
.menu a[aria-current="page"] { background: var(--surface-2); font-weight: 650; }
.menu-theme .when-light, :root[data-theme="light"] .menu-theme .when-dark { display: none; }
:root[data-theme="light"] .menu-theme .when-light { display: inline-flex; }
.menu .menu-signout { border-top: 0; margin-top: 0; padding-top: 0; }
.menu .menu-signout button { color: var(--crit-fg); font-weight: 600; }
.menu .menu-signout button:hover { background: var(--crit-bg); color: var(--crit-fg); }
.menu-like { display: flex; flex-direction: column; padding: var(--space-3); max-width: 520px; }
.menu-like a, .menu-like button { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 48px; padding: 10px var(--space-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font: 500 var(--text-base)/1.2 var(--font-sans); background: none; border: 0; cursor: pointer; text-align: left; }
.menu-like a:hover, .menu-like button:hover { background: var(--surface-2); color: var(--text); }
.menu-like form { margin: 0; }
.menu-like .menu-signout button { color: var(--crit-fg); font-weight: 600; }
.menu-like .menu-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--border); margin-bottom: var(--space-2); }

/* ---------------------------------------------------------------- change password + add PoC */
.pw-field .input { padding-right: 56px; }
.pw-field .reveal { right: 2px; min-height: 44px; min-width: 48px; }
.pw-match.is-ok { color: var(--low-fg); font-weight: 600; }
.pw-match.is-bad { color: var(--med-fg); }
:root[data-theme="light"] .pw-match.is-bad { color: #854d0e; }
.form-tips { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--text-sm); color: var(--text-muted); }
.form-tips-title { display: flex; align-items: center; gap: 6px; font-weight: 650; color: var(--text); margin-bottom: 4px; }
.form-tips ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.btn.is-busy { cursor: progress; opacity: .85; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
.btn.is-busy .icon { display: none; }
@media (max-width: 767px) { .site-footer { flex-direction: column; gap: 2px; } .site-footer > [aria-hidden="true"] { display: none; } }

/* ================================================================ auto-analysis (PoC detail "Analysis" card)
   Confidence and state badges reuse the semantic tokens (AA in both themes); actions are >= 44px on phones. */
.analysis-panel .section-head { flex-wrap: wrap; }
.an-head-badges { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.badge.needs-review { --b-fg: var(--med-fg); --b-bg: var(--med-bg); --b-bd: var(--med-bd); }
.badge.needs-review .icon { width: 13px; height: 13px; }
.badge.conf-high { --b-fg: var(--low-fg); --b-bg: var(--low-bg); --b-bd: var(--low-bd); }
.badge.conf-medium { --b-fg: var(--med-fg); --b-bg: var(--med-bg); --b-bd: var(--med-bd); }
.badge.conf-low { --b-fg: var(--neutral-fg); --b-bg: var(--neutral-bg); --b-bd: var(--neutral-bd); }
.an-st-queued, .an-st-running { --b-fg: var(--info-fg); --b-bg: var(--info-bg); --b-bd: var(--info-bd); }
.an-st-done { --b-fg: var(--neutral-fg); --b-bg: var(--neutral-bg); --b-bd: var(--neutral-bd); }
.an-st-error { --b-fg: var(--crit-fg); --b-bg: var(--crit-bg); --b-bd: var(--crit-bd); }
.an-state-pending { --b-fg: var(--info-fg); --b-bg: var(--info-bg); --b-bd: var(--info-bd); }
.an-state-auto_applied { --b-fg: var(--teal-fg); --b-bg: var(--teal-bg); --b-bd: var(--teal-bd); }
.an-state-accepted { --b-fg: var(--low-fg); --b-bg: var(--low-bg); --b-bd: var(--low-bd); }
.an-state-rejected, .an-state-matched { --b-fg: var(--neutral-fg); --b-bg: var(--neutral-bg); --b-bd: var(--neutral-bd); }
.an-empty { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.an-empty > .icon { flex: none; margin-top: 3px; color: var(--info-fg); }
.an-rerun-note { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--space-3); }
.an-cve { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.an-cve-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--space-3); }
.an-cve-label { font-size: var(--text-sm); color: var(--text-muted); font-weight: 600; }
.an-cve-id { font-size: var(--text-lg); font-weight: 700; }
.an-evidence > summary, .an-sources > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; font-size: var(--text-sm); font-weight: 600; color: var(--accent); list-style: none; }
.an-evidence > summary::-webkit-details-marker, .an-sources > summary::-webkit-details-marker, .an-edit > summary::-webkit-details-marker { display: none; }
.an-evidence > summary .chev, .an-sources > summary .chev { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform var(--dur) var(--ease); }
.an-evidence[open] > summary .chev, .an-sources[open] > summary .chev { transform: none; }
.an-evidence > summary:focus-visible, .an-sources > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.an-cands { margin: var(--space-2) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); }
.an-cands > li { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.an-cands > li.is-chosen { border-left: 3px solid var(--low-bd); }
.an-cand-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); font-weight: 650; }
.an-cands ul { margin: 4px 0 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 2px; }
.an-where { font-weight: 600; }
.an-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .an-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } .an-list .an-pending, .an-list #an-description { grid-column: 1 / -1; } }
.an-item { display: flex; flex-direction: column; gap: 4px; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.an-item.an-pending { border-color: var(--info-bd); box-shadow: inset 3px 0 0 var(--info-bd); }
.an-item:target { outline: 3px solid var(--focus); outline-offset: 2px; }
.an-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); }
.an-label { font-size: var(--text-sm); font-weight: 650; color: var(--text-muted); }
.an-badges { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.an-value { font-size: var(--text-base); font-weight: 600; color: var(--text); }
.an-rejected .an-value { color: var(--text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.an-meta, .an-current { margin: 0; font-size: max(var(--text-xs), 12.5px); color: var(--text-subtle); overflow-wrap: anywhere; }
.an-current { color: var(--text-muted); }
.an-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); margin: var(--space-1) 0 0; padding-top: var(--space-2); border-top: 1px dashed var(--border); }
.an-edit { display: block; flex: 0 1 auto; min-width: 0; }
.an-edit[open] { flex: 1 1 100%; }
.an-edit > summary { list-style: none; }
.an-edit[open] > summary { background: var(--surface); border-color: var(--border-strong); }
.an-edit-panel { margin-top: var(--space-2); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.an-edit-panel .input, .an-edit-panel .textarea { flex: 1 1 240px; min-width: 0; }
.an-foot { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.an-foot p { margin: 0; }
.an-sources .facts { margin-top: var(--space-2); }
.an-foot-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.an-foot-actions form { margin: 0; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
/* analysis v2: auto-applied values (marked `auto`, with Undo) and outside evidence */
.badge.auto-chip { --b-fg: var(--teal-fg); --b-bg: var(--teal-bg); --b-bd: var(--teal-bd); font-size: var(--text-xs); padding-block: 0; text-transform: lowercase; letter-spacing: .02em; }
.an-item.an-auto_applied { box-shadow: inset 3px 0 0 var(--teal-bd); }
.an-auto-note { margin: 0; font-size: max(var(--text-xs), 12.5px); overflow-wrap: anywhere; }
.an-ext-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); }
.an-ext-list > li { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.an-ext-list p { margin: 4px 0 0; }
.an-ext { margin-top: var(--space-3); }
.row-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 767px) {
  .an-actions .btn, .an-edit > summary { min-height: 44px; padding-inline: 14px; font-size: var(--text-sm); }
  .an-actions > .btn, .an-edit { flex: 1 1 calc(33% - var(--space-2)); }
  .an-edit > summary { width: 100%; }
  .an-edit[open] { flex-basis: 100%; }
  .an-edit-panel { flex-direction: column; align-items: stretch; }
  .an-edit-panel .input, .an-edit-panel .textarea { flex: none; min-height: 44px; }
  .an-edit-panel .btn { width: 100%; }
  .an-evidence > summary, .an-sources > summary { min-height: 44px; }
  .an-actions > .btn[value="undo"] { flex: 0 1 auto; min-width: 44px; }
  .an-cve-id { display: inline-block; padding-block: 9px; margin-block: -9px; }
  .an-foot-actions .btn { width: 100%; }
  .an-foot-actions form { flex: 1 1 100%; }
  .an-badges { margin-left: 0; }
}

/* flagged / suspicious mirrors: warn next to the Gitea link and the clone command (no confirmation step there) */
.btn-warn-link { --b-fg: var(--crit-fg); color: var(--crit-fg); border-color: var(--crit-bd); background: var(--crit-bg); }
.btn-warn-link:hover { border-color: var(--crit-fg); }
.mirror-warn { display: flex; gap: var(--space-2); align-items: flex-start; margin: 0; color: var(--crit-fg); font-size: var(--text-sm); line-height: 1.45; }
.mirror-warn .icon { flex: none; margin-top: 2px; }
.mirror-warn code { color: inherit; }
.mirror-warn-sm { font-size: var(--text-xs); }

/* ================================================================ mobile UX v2 (audit items) */
.h1-count { color: var(--text-subtle); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (hover: none) and (pointer: coarse) { .kbd-hint { display: none; } } /* no "/" shortcut without a keyboard */
@media (max-width: 639px) { .field-row { grid-template-columns: minmax(0, 1fr); } } /* Add: Found by / Notes stacked */

/* bottom nav: active tab = accent + top bar + bold label (not colour alone) */
.tabbar a { position: relative; }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tabbar a[aria-current="page"] span { font-weight: 750; }
/* labels must never clip: one line, cells may shrink, slightly smaller text on very narrow phones (targets stay >=44px) */
.tabbar a { min-width: 0; }
.tabbar a span { white-space: nowrap; }
@media (max-width: 340px) { .tabbar a { font-size: 11px; letter-spacing: -.01em; } }
@media (forced-colors: active) { .tabbar a[aria-current="page"]::before { background: CanvasText; } }

/* dashboard: compact on phones */
@media (max-width: 639px) {
  .page-head:has(.dash-lede) { margin-bottom: var(--space-3); }
  .dash-lede { display: none; }
  .grid-kpi { gap: var(--space-2); margin-top: var(--space-3); }
  .grid-kpi > .kpi { padding: 10px 12px; gap: 0; }
  .grid-kpi .kpi-value { font-size: var(--text-2xl); line-height: 1.2; }
  .grid-kpi .kpi-kev { padding-block: 8px; }
}
@media (max-width: 767px) {
  .dash-recent > li:nth-child(n+4) { display: none; }    /* 3 recent cards + "View all" */
  .dash-activity > li:nth-child(n+5) { display: none; }
}
/* charts: collapsible (closed by default on phones via app.js; open without JS) */
.dash-chart > details > summary { list-style: none; cursor: pointer; min-height: 44px; margin-bottom: 0; border-radius: var(--radius-sm); }
.dash-chart > details > summary::-webkit-details-marker { display: none; }
.dash-chart > details[open] > summary { margin-bottom: var(--space-3); }
.dash-chart > details > summary .chev { margin-left: auto; flex: none; color: var(--text-subtle); transition: transform var(--dur) var(--ease); }
.dash-chart > details[open] > summary .chev { transform: rotate(180deg); }
.dash-chart > details > summary .subtle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-chart > details > summary:hover h2 { color: var(--accent); }
@media (max-width: 767px) { .dash-chart { padding-block: var(--space-2); } .grid-3 > .card.dash-chart { height: auto; } .dash-stats { gap: var(--space-2); } }

/* malicious PoC: download demoted below the safety panel */
.dl-after-scan { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border: 1px dashed var(--crit-bd); border-radius: var(--radius-lg); }
.dl-after-scan p { display: flex; align-items: flex-start; gap: 6px; flex: 1 1 260px; margin: 0; }
.dl-after-scan p .icon { flex: none; margin-top: 3px; color: var(--crit-fg); }
.btn-dl-jump { color: var(--text-muted); }

/* result cards: Zip sits on the meta row instead of wrapping onto its own line */
.poc-card .foot { flex-wrap: nowrap; align-items: flex-end; }
.poc-card .foot .meta { flex: 1 1 auto; min-width: 0; }
.poc-card .foot .actions { flex: none; }

/* ================================================================ PoC detail: compact header + tabs (README first) */
.poc-head { gap: var(--space-2); }
.poc-head .breadcrumb { margin-bottom: 0; }
.poc-head .detail-title { font-size: var(--text-xl); line-height: 1.3; }
@media (min-width: 768px) { .poc-head .detail-title { font-size: var(--text-2xl); } }
@media (max-width: 767px) {
  .poc-head .detail-title { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .poc-desc { display: none; } /* shown in Info → Repository */
}
.poc-desc { margin: 0; }
.poc-head .callout, .poc-head .isolation-note { margin: 0; }
.poc-danger { border-width: 2px; }
.poc-warn-strip { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 6px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--med-fg); background: var(--med-bg); border: 1px solid var(--med-bd); font-size: var(--text-sm); }
.poc-warn-strip:hover { border-color: var(--med-fg); color: var(--med-fg); }
.poc-warn-strip > span { flex: 1; min-width: 0; }
.poc-warn-strip .icon { flex: none; }
.poc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.poc-actions .btn { min-height: 44px; justify-content: center; padding-inline: 8px; }
@media (min-width: 768px) { .poc-actions { display: flex; flex-wrap: wrap; } .poc-actions .btn { padding-inline: 16px; } }

.poc-tabs { position: sticky; top: var(--header-h); z-index: 30; margin: var(--space-4) calc(-1 * var(--space-4)) 0; padding: 4px var(--space-4) 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .poc-tabs { margin-inline: calc(-1 * var(--space-5)); padding-inline: var(--space-5); } }
.poc-tabs.is-mal { border-bottom: 2px solid var(--crit-solid, #ef4444); }
.poc-tablist { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; max-width: 760px; }
.poc-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px;
  border-radius: var(--radius) var(--radius) 0 0; color: var(--text-muted); text-decoration: none; font-size: 12px; font-weight: 650; }
.poc-tab:hover { color: var(--text); background: var(--surface-hover); }
.poc-tab .tab-ic { position: relative; display: inline-flex; }
.poc-tab .tab-ic .icon { width: 20px; height: 20px; }
.poc-tab .tab-l { white-space: nowrap; }
.poc-tab[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.poc-tab[aria-selected="true"] .tab-l { font-weight: 800; }
.poc-tab:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.poc-tab.tone-warn .tab-ic .icon { color: var(--med-fg); }
.poc-tab.tone-crit, .poc-tab.tone-crit .tab-ic .icon { color: var(--crit-fg); }
.tab-n { position: absolute; top: -6px; left: calc(100% - 6px); display: inline-flex; align-items: center; gap: 3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--neutral-bg); color: var(--neutral-fg); border: 1px solid var(--neutral-bd); }
.tab-n.n-warn { background: var(--med-bg); color: var(--med-fg); border-color: var(--med-bd); }
.tab-n.n-crit { background: #dc2626; color: #fff; border-color: transparent; } /* white on #dc2626 = 4.8:1 */
:root[data-theme="light"] .tab-n.n-crit { background: #b91c1c; }
.tab-n.n-kev { background: var(--kev-bg); color: var(--kev-fg); border-color: transparent; }
.tab-kev { font-size: 9px; letter-spacing: .02em; }
@media (min-width: 768px) {
  .poc-tab { flex-direction: row; gap: 8px; min-height: 48px; font-size: var(--text-sm); }
  .tab-n { position: static; }
}
@media (forced-colors: active) { .poc-tab[aria-selected="true"] { outline: 2px solid CanvasText; outline-offset: -2px; } }

.poc-panels { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-4); }
.poc-panel { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.poc-panel[hidden] { display: none; }
.poc-panel:focus { outline: none; }
/* no JS: panels stacked under small headings so the order reads README → Safety → … */
.poc-info { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.poc-info-main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
@media (min-width: 1024px) { .poc-info { grid-template-columns: minmax(0, 1fr) 380px; } }
html:has(.poc-tabs) { scroll-padding-top: calc(var(--header-h) + 64px); }
.poc-detail .md :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: calc(var(--header-h) + 72px); }

/* README contents */
.readme-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.readme-main { min-width: 0; }
.readme-toc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.readme-toc > summary { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 12px; cursor: pointer; list-style: none; font-weight: 650; font-size: var(--text-sm); }
.readme-toc > summary::-webkit-details-marker { display: none; }
.readme-toc > summary .chev { margin-left: auto; color: var(--text-subtle); transition: transform var(--dur) var(--ease); }
.readme-toc[open] > summary .chev { transform: rotate(180deg); }
.readme-toc > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--radius); }
.toc-list { list-style: none; margin: 0; padding: 0 6px 6px; display: flex; flex-direction: column; font-size: var(--text-sm); }
.toc-list li { min-width: 0; }
.toc-list li + li { border-top: 1px solid var(--border); }
/* each entry is a full-width block >= 44px tall (touch standard); nesting is shown by indent + a guide line */
.toc-list a { display: flex; align-items: center; min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; line-height: 1.35; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .toc-list a:hover { color: var(--text); background: var(--surface-hover); } } /* no sticky hover after a tap */
.toc-list a:active { background: var(--surface-hover); color: var(--accent); }
.toc-list a:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.toc-list .toc-d1 > a { padding-left: 24px; }
.toc-list .toc-d2 > a { padding-left: 38px; font-size: var(--text-xs); }
.toc-list .toc-d1 > a, .toc-list .toc-d2 > a { position: relative; }
.toc-list .toc-d1 > a::before, .toc-list .toc-d2 > a::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 12px; border-left: 2px solid var(--border); }
.toc-list .toc-d2 > a::before { left: 26px; }
/* desktop with a mouse: compact sidebar rhythm (no 44px rows, no dividers) */
@media (min-width: 1100px) and (pointer: fine) {
  .readme-body > .readme-toc .toc-list li + li { border-top: 0; }
  .readme-body > .readme-toc .toc-list a { min-height: 0; padding-block: 5px; }
}
@media (min-width: 1100px) {
  .readme-body:has(> .readme-toc:not([hidden])) { grid-template-columns: minmax(0, 1fr) 240px; }
  .readme-body > .readme-toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 64px); max-height: calc(100vh - var(--header-h) - 88px); overflow-y: auto; }
  .readme-body > .readme-main { grid-column: 1; grid-row: 1; }
  .readme-card .md { max-width: 880px; }
}
/* with tabs the README card heading repeats the tab label: keep it for screen readers only */
.has-tabs .readme-card > .readme-head > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.has-tabs .readme-card > .readme-head:not(:has(.badge, .readme-pending)) { display: none; }
