:root {
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --radius: 12px; --radius-sm: 8px;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2c2c2a;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,.10);
  --accent: #3987e5; --accent-ink: #fff; --accent-wash: rgba(57,135,229,.14);
  --good-ink: #3ecf3e; --critical-ink: #f07a7a; --warning-ink: #fab219; --serious-ink: #ec835a;
  --seq: 57,135,229;
}
[data-theme="light"] {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --surface-2: #f3f2ef; --surface-3: #e9e8e3;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #6d6b66;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,.10);
  --accent: #2a78d6; --accent-ink: #fff; --accent-wash: rgba(42,120,214,.10);
  --good-ink: #006300; --critical-ink: #b02a2a; --warning-ink: #8a5f00; --serious-ink: #a8481f;
  --seq: 42,120,214;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--sans); }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 620; }
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); } .ink2 { color: var(--ink-2); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nums { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.wrap-any { overflow-wrap: anywhere; }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 56px;
  background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand svg { width: 22px; height: 22px; }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-size: 14px; }
.topbar nav a:hover { background: var(--surface-2); color: var(--ink); }
.topbar nav a.active { background: var(--surface-2); color: var(--ink); font-weight: 560; }
main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

/* Components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } main { padding: 20px 14px 60px; } .topbar { padding: 0 14px; gap: 8px; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 14px; font-weight: 520; text-decoration: none; color: var(--ink); white-space: nowrap; transition: background .12s; }
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger:hover { color: var(--critical-ink); }
.btn.lg { padding: 11px 22px; font-size: 15px; }
.icon-btn { padding: 7px 9px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=password], input[type=url], input[type=search], textarea, select {
  width: 100%; padding: 9px 11px; background: var(--page); border: 1px solid var(--border); border-radius: var(--radius-sm); }
[data-theme="light"] input[type=text], [data-theme="light"] input[type=password], [data-theme="light"] input[type=url], [data-theme="light"] input[type=search], [data-theme="light"] textarea, [data-theme="light"] select { background: #fff; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 84px; }
textarea.code, input.code { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.error-box { padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--critical) 13%, transparent); border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent); font-size: 14px; }
.info-box { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 13.5px; color: var(--ink-2); }
.warn-box { padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warning) 12%, transparent); border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); font-size: 13.5px; }
.import { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.import > summary { cursor: pointer; font-size: 13.5px; font-weight: 560; color: var(--ink-2); }
.ok-box { padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--good) 12%, transparent); border: 1px solid color-mix(in srgb, var(--good) 40%, transparent); font-size: 13.5px; }
.tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 540; white-space: nowrap; }
.tag.link { text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* Status: an icon and a label, never color alone */
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 580; white-space: nowrap; }
.status .ic { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; line-height: 1; font-weight: 800; color: #fff; }
.st-compromised .ic { background: var(--critical); } .st-compromised { color: var(--critical-ink); }
.st-partial .ic { background: var(--warning); color: #0b0b0b; } .st-partial { color: var(--warning-ink); }
.st-blocked .ic { background: var(--good); } .st-blocked { color: var(--good-ink); }
.st-inconclusive .ic, .st-error .ic { background: var(--muted); } .st-inconclusive, .st-error { color: var(--ink-2); }
.sev { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); text-transform: capitalize; }
.sev::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--muted); }
.sev-critical::before { background: var(--critical); } .sev-high::before { background: var(--serious); } .sev-medium::before { background: var(--warning); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(800px 420px at 50% -10%, var(--accent-wash), transparent), var(--page); }
.login-card { width: min(390px, 100%); }
.login-mark { width: 44px; height: 44px; margin-bottom: 16px; }

/* Stat tiles */
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 18px; min-width: 0; }
.tile .k { font-size: 12.5px; color: var(--muted); margin-bottom: 3px; }
.tile .v { font-size: 25px; line-height: 1.2; font-weight: 620; letter-spacing: -.02em; }
.tile .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; font-weight: 560; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--axis); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.score-chip { display: inline-flex; align-items: baseline; gap: 5px; font-weight: 620; font-variant-numeric: tabular-nums; }

/* Wizard */
.goal-input { font-size: 16px; padding: 13px 15px; min-height: 74px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; background: transparent; cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.chip:hover { background: var(--surface-2); color: var(--ink); }
.seg { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.seg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .seg, .seg2, .seg4 { grid-template-columns: 1fr; } }
.option { display: block; text-align: left; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; cursor: pointer; }
.option:hover { background: var(--surface-2); }
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.option:disabled { opacity: .5; cursor: not-allowed; }
.option b { display: block; font-weight: 600; font-size: 14px; }
.option span { font-size: 12.5px; color: var(--muted); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.check { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.check:hover { background: var(--surface-2); }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 650; }

/* Live */
.stepper { display: flex; gap: 6px; flex-wrap: wrap; }
.phase { display: flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); }
.phase.done { color: var(--ink-2); } .phase.done::before { content: "✓"; color: var(--good-ink); font-weight: 800; }
.phase.now { color: var(--ink); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.phase.now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.track { position: relative; height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); width: 0; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.feed { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; }
.feed-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--grid); font-size: 13.5px; animation: slide .22s ease-out; }
.feed-row:last-child { border-bottom: 0; }
@keyframes slide { from { opacity: 0; transform: translateY(-5px); } }

/* Score hero */
.hero { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); gap: 32px; align-items: center; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; gap: 16px; } }
.score-num { font-size: 76px; line-height: 1; font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.score-num small { font-size: 22px; font-weight: 520; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.score-track { position: relative; height: 16px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.score-track > i { display: block; height: 100%; width: 0; border-radius: 8px; transition: width 1.1s cubic-bezier(.2,.7,.2,1); }
.score-track > b { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.score-bands { position: relative; height: 18px; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.score-bands span { position: absolute; transform: translateX(-50%); }
.verdict { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); border-left-width: 4px; background: var(--surface-2); }
.verdict.exploited { border-left-color: var(--critical); } .verdict.partially_exploited { border-left-color: var(--warning); }
.verdict.not_demonstrated { border-left-color: var(--good); } .verdict.not_tested { border-left-color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--axis); margin: 22px 0; overflow-x: auto; }
.tabs button { padding: 9px 14px; border: 0; background: none; cursor: pointer; color: var(--ink-2); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 580; border-bottom-color: var(--accent); }

.eval-num { font-size: 36px; line-height: 1.1; font-weight: 680; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.eval-num small { font-size: 15px; font-weight: 520; letter-spacing: 0; color: var(--muted); margin-left: 3px; }
.score-track.thin { height: 8px; }

.plan.current { box-shadow: inset 0 0 0 1px var(--accent); }

/* Foldable cards */
.folds { margin-top: 16px; align-items: start; }
.fold { padding: 0; }
.fold > summary { display: flex; align-items: center; gap: 10px; padding: 14px 20px; cursor: pointer; list-style: none; border-radius: var(--radius); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; color: var(--muted); font-size: 12px; transition: transform .12s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary:hover { background: var(--surface-2); }
.fold > summary span { margin-left: auto; }
.fold > :not(summary) { margin: 0 20px 20px; }

/* Marks */
.stackbar { display: flex; gap: 2px; height: 14px; }
.stackbar > i { display: block; min-width: 3px; transition: filter .1s; }
.stackbar > i:first-child { border-radius: 4px 0 0 4px; } .stackbar > i:last-child { border-radius: 0 4px 4px 0; } .stackbar > i:only-child { border-radius: 4px; }
.stackbar > i:hover { filter: brightness(1.2); }
.c-compromised { background: var(--critical); } .c-partial { background: var(--warning); } .c-blocked { background: var(--good); } .c-inconclusive { background: var(--muted); } .c-error { background: var(--axis); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 32%) minmax(0, 1fr) 84px; gap: 12px; align-items: center; padding: 6px 0; font-size: 13.5px; }
.bar-track { height: 12px; }
.hbar { height: 12px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.heat { display: grid; grid-template-columns: 90px repeat(5, minmax(0, 1fr)); gap: 3px; font-size: 13px; }
.heat .h { font-size: 12px; color: var(--muted); padding: 4px 6px; text-align: center; }
.heat .rh { font-size: 12.5px; color: var(--ink-2); padding: 8px 4px; text-transform: capitalize; }
.heat .cell { display: grid; place-items: center; min-height: 38px; border-radius: 5px; font-variant-numeric: tabular-nums; font-weight: 560; }
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.fw { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.fw.off { background: transparent; border-style: solid; opacity: .75; }
.fw-score { font-size: 20px; font-weight: 640; font-variant-numeric: tabular-nums; }
details.dtable { margin-top: 12px; font-size: 13px; }
details.dtable summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
details.dtable[open] summary { margin-bottom: 8px; }
.chart { width: 100%; min-height: 40px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 11.5px var(--sans); fill: var(--muted); }
.tooltip { position: fixed; z-index: 50; pointer-events: none; max-width: 320px; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; line-height: 1.4;
  background: var(--ink); color: var(--page); box-shadow: 0 6px 22px rgba(0,0,0,.35); }

/* Findings */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }
.finding { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.finding + .finding { margin-top: 8px; }
.finding > summary { display: grid; grid-template-columns: 112px minmax(0, 1fr) 80px auto; gap: 12px; align-items: center; padding: 11px 14px; cursor: pointer; list-style: none; }
.finding > summary::-webkit-details-marker { display: none; }
.finding > summary:hover { background: var(--surface-2); border-radius: var(--radius-sm); }
.finding[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.finding-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 640px) { .finding > summary { grid-template-columns: 1fr auto; } .finding > summary .hide-sm { display: none; } .feed-row { grid-template-columns: 1fr auto; } .feed-row .hide-sm { display: none; } .bar-row { grid-template-columns: 1fr 56px; } .bar-row .bar-track { grid-row: 2; grid-column: 1 / -1; } }
.msg { padding: 10px 12px; border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 340px; overflow-y: auto; }
.msg.attack { background: color-mix(in srgb, var(--serious) 10%, transparent); border: 1px solid color-mix(in srgb, var(--serious) 28%, transparent); }
.msg.reply { background: var(--surface-2); border: 1px solid var(--border); }
.msg.call { background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); }
.msg-label { font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.evidence { padding: 8px 12px; border-left: 3px solid var(--critical); background: var(--surface-2); font-size: 13.5px; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 56px 20px; }
.empty svg { width: 42px; height: 42px; margin-bottom: 12px; }
ol.plain, ul.plain { margin: 0; padding: 0; list-style: none; }
.plan-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.plan-item:last-child { border-bottom: 0; }
.prio { display: inline-grid; place-items: center; height: 22px; border-radius: 5px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); }
.prio.P0 { background: var(--critical); color: #fff; } .prio.P1 { background: var(--serious); color: #0b0b0b; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
@media print { .topbar, .tabs, .no-print { display: none !important; } body { background: #fff; } }
