/* MailGuard design system.
   Fonts are self-hosted (public/fonts, SIL Open Font License) so no page makes a third-party request. */
@font-face { font-family:"Inter"; font-style:normal; font-weight:100 900; font-display:swap; src:url("../fonts/inter-latin-wght.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-style:normal; font-weight:100 800; font-display:swap; src:url("../fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg:#f4f5fa; --surface:#ffffff; --surface-2:#f8f9fc; --surface-3:#eef0f6;
  --card:var(--surface);
  --line:#e3e6ef; --line-strong:#cfd5e2;
  --text:#0f172a; --muted:#5a6479; --faint:#8a93a8;
  --accent:#4f46e5; --accent-2:#7c3aed; --accent-strong:#4338ca; --accent-soft:#eef0ff; --accent-ring:rgba(79,70,229,.28);
  --grad:linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%);
  --pass:#15803d; --fail:#c2261d; --warn:#b45309; --unknown:#7c3aed; --info:#475569;
  --pass-soft:#e9f8ef; --fail-soft:#fdeeed; --warn-soft:#fff5e5; --unknown-soft:#f4efff; --info-soft:#eff2f7;
  --hit:#ffe08a; --hit-text:#1d2330;
  --hit-signed:#d1fadf; --hit-signed-text:#065f46; --hit-oversigned:#cffafe; --hit-oversigned-text:#155e75; --hit-unsigned:#fee4e2; --hit-unsigned-text:#912018;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow:0 1px 2px rgba(16,24,40,.04), 0 4px 16px -4px rgba(16,24,40,.08);
  --shadow-lg:0 12px 40px -12px rgba(30,27,75,.22);
  --radius:14px; --radius-sm:9px;
  --topbar-h:60px;
  --font:"Inter",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
@media (prefers-color-scheme: dark) { :root {
  color-scheme: dark;
  --bg:#0a0d16; --surface:#121726; --surface-2:#161c2d; --surface-3:#1d2438;
  --line:#242c42; --line-strong:#323c57;
  --text:#e8ebf4; --muted:#9ba4ba; --faint:#6f7890;
  --accent:#8b8cff; --accent-2:#b18cff; --accent-strong:#a5a6ff; --accent-soft:rgba(139,140,255,.12); --accent-ring:rgba(139,140,255,.35);
  --grad:linear-gradient(135deg,#6366f1 0%,#8b5cf6 100%);
  --pass:#4ade80; --fail:#ff7b6e; --warn:#f2b84b; --unknown:#b99cff; --info:#a3adc2;
  --pass-soft:rgba(74,222,128,.1); --fail-soft:rgba(255,123,110,.1); --warn-soft:rgba(242,184,75,.1); --unknown-soft:rgba(185,156,255,.1); --info-soft:rgba(163,173,194,.08);
  --hit:#7a5b12; --hit-text:#fff8e0;
  --hit-signed:#0f4c2a; --hit-signed-text:#d1fadf; --hit-oversigned:#134e5e; --hit-oversigned-text:#cffafe; --hit-unsigned:#5f1d18; --hit-unsigned-text:#fee4e2;
  --shadow-sm:0 1px 2px rgba(0,0,0,.3);
  --shadow:0 1px 2px rgba(0,0,0,.3), 0 6px 20px -6px rgba(0,0,0,.45);
  --shadow-lg:0 16px 48px -12px rgba(0,0,0,.6);
} }

/* ---------- Base ---------- */
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior:auto; } *, *::before, *::after { transition:none !important; animation:none !important; } }
body { margin:0; font:14.5px/1.55 var(--font); font-feature-settings:"cv11","ss01"; background:var(--bg); color:var(--text); -webkit-font-smoothing:antialiased; min-height:100vh; display:flex; flex-direction:column; }
body::before { content:""; position:fixed; inset:0 0 auto 0; height:420px; z-index:-1; pointer-events:none;
  background:radial-gradient(60% 100% at 15% 0%, rgba(99,102,241,.10), transparent 70%), radial-gradient(50% 90% at 90% 0%, rgba(139,92,246,.08), transparent 70%); }
a { color:var(--accent); text-decoration:none; } a:hover { text-decoration:underline; text-underline-offset:3px; }
h1, h2, h3 { line-height:1.2; letter-spacing:-.02em; margin:0 0 .5em; }
h1 { font-size:28px; font-weight:750; }
h2 { font-size:19px; font-weight:700; margin-top:1.6em; }
h3 { font-size:15.5px; font-weight:650; }
p { margin:.4em 0 .8em; }
code, pre, kbd { font-family:var(--mono); }
code { font-size:12.5px; word-break:break-all; background:var(--surface-3); padding:1px 5px; border-radius:5px; }
pre { overflow:auto; background:var(--surface-2); border:1px solid var(--line); padding:12px; border-radius:var(--radius-sm); font-size:12px; line-height:1.55; max-height:360px; }
pre code { background:none; padding:0; }
hr { border:0; border-top:1px solid var(--line); margin:16px 0; }
[id] { scroll-margin-top:calc(var(--topbar-h) + 64px); }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
::selection { background:var(--accent-ring); }

/* ---------- App shell ---------- */
.topbar { position:sticky; top:0; z-index:40; height:var(--topbar-h); display:flex; align-items:center; gap:16px; padding:0 max(16px, calc((100vw - 1280px) / 2 + 16px));
  background:color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter:saturate(180%) blur(14px); -webkit-backdrop-filter:saturate(180%) blur(14px); border-bottom:1px solid var(--line); }
.brand { display:inline-flex; align-items:center; gap:10px; font-weight:750; font-size:16px; letter-spacing:-.02em; color:var(--text); text-decoration:none !important; margin-right:8px; }
.brand-mark { width:30px; height:30px; border-radius:9px; display:grid; place-items:center; background:var(--grad); color:#fff; box-shadow:0 4px 14px -4px rgba(99,102,241,.6); }
.brand-mark svg { width:18px; height:18px; }
.topbar nav { display:flex; gap:4px; align-items:center; flex:1; min-width:0; }
.nav-link { display:inline-flex; align-items:center; gap:7px; padding:7px 12px; border-radius:9px; color:var(--muted); font-weight:550; text-decoration:none !important; transition:background .15s, color .15s; white-space:nowrap; }
.nav-link svg { width:16px; height:16px; opacity:.8; }
.nav-link:hover { background:var(--surface-3); color:var(--text); }
.nav-link.active { color:var(--accent-strong); background:var(--accent-soft); }
.nav-end { margin-left:auto; display:flex; align-items:center; gap:8px; }
.nav-user { display:inline-flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; }
.avatar { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:12.5px; color:var(--accent-strong); background:var(--accent-soft); border:1px solid var(--line); }
main { width:100%; max-width:1280px; margin:0 auto; padding:28px 16px 64px; flex:1; }
.page-narrow { max-width:760px; margin:0 auto; }
.site-foot { text-align:center; color:var(--faint); font-size:12.5px; padding:20px 16px 28px; }
@media (max-width:860px) {
  .topbar { height:auto; flex-wrap:wrap; padding-top:10px; padding-bottom:10px; gap:8px; }
  .topbar nav { order:3; flex-basis:100%; overflow-x:auto; scrollbar-width:none; }
  .nav-user span.nav-name { display:none; }
  .nav-link .label-long { display:none; }
}

/* ---------- Page heads ---------- */
.page-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; margin:0 0 20px; }
.page-head h1 { margin:0; }
.page-head .lede { margin:6px 0 0; color:var(--muted); max-width:64ch; }
.eyebrow { text-transform:uppercase; letter-spacing:.08em; font-size:11px; font-weight:700; color:var(--faint); margin:0 0 4px; }
.crumbs { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--faint); margin-bottom:6px; }
.crumbs a { color:var(--muted); }

/* ---------- Cards ---------- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:20px; margin:14px 0; box-shadow:var(--shadow); }
.card > h2:first-child, .card > h1:first-child, .card-head h2 { margin-top:0; }
.card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }
.card-head p { margin:2px 0 0; }
.card-icon { width:38px; height:38px; flex:none; border-radius:11px; display:grid; place-items:center; color:var(--accent-strong); background:var(--accent-soft); }
.card-icon svg { width:20px; height:20px; }
.card-title { display:flex; gap:12px; align-items:flex-start; }
.card-title h2 { margin:0; }
.narrow { max-width:420px; margin:40px auto; }
.row { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.grid-2 { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:18px; align-items:start; }
.grid-2 > .card { margin:0; }
@media (max-width:900px) { .grid-2 { grid-template-columns:1fr; } }
.stack > * + * { margin-top:14px; }

/* ---------- Buttons ---------- */
button, .button { display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:8px 15px; min-height:36px; border:1px solid transparent; border-radius:10px;
  background:var(--grad); color:#fff; font:inherit; font-weight:600; font-size:14px; line-height:1.2; cursor:pointer; text-decoration:none !important; white-space:nowrap;
  box-shadow:0 1px 2px rgba(16,24,40,.08), inset 0 1px 0 rgba(255,255,255,.18); transition:transform .12s, box-shadow .15s, background .15s, border-color .15s, color .15s, filter .15s; }
button:hover, .button:hover { filter:brightness(1.07); box-shadow:0 6px 18px -6px rgba(79,70,229,.55); }
button:active, .button:active { transform:translateY(1px); }
button:disabled, button[disabled] { opacity:.55; cursor:not-allowed; filter:none; box-shadow:none; transform:none; }
button svg, .button svg { width:16px; height:16px; flex:none; }
button.secondary, .button.secondary { background:var(--surface); color:var(--text); border-color:var(--line-strong); box-shadow:var(--shadow-sm); }
button.secondary:hover, .button.secondary:hover { background:var(--surface-2); border-color:var(--accent); color:var(--accent-strong); filter:none; box-shadow:0 0 0 3px var(--accent-soft); }
button.ghost, .button.ghost { background:transparent; color:var(--muted); border-color:transparent; box-shadow:none; }
button.ghost:hover, .button.ghost:hover { background:var(--surface-3); color:var(--text); filter:none; box-shadow:none; }
button.small, .button.small { padding:4px 10px; min-height:28px; font-size:12.5px; border-radius:8px; gap:5px; }
button.small svg, .button.small svg { width:14px; height:14px; }
button.danger, .button.danger { background:var(--surface); color:var(--fail); border-color:color-mix(in srgb, var(--fail) 45%, transparent); box-shadow:none; }
button.danger:hover { background:var(--fail-soft); filter:none; box-shadow:0 0 0 3px var(--fail-soft); }
button.link { background:none; color:var(--accent); padding:0; min-height:0; border:0; box-shadow:none; font-weight:550; }
button.link:hover { text-decoration:underline; text-underline-offset:3px; filter:none; box-shadow:none; }
button.quiet-danger { background:none; border:0; padding:0; min-height:0; color:var(--fail); cursor:pointer; font:inherit; box-shadow:none; }
form.inline { display:inline; }
.actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.header-side { display:flex; flex-direction:column; align-items:flex-end; gap:4px; }

/* Dropdown menus built on <details> */
details.menu { position:relative; display:inline-block; }
details.menu > summary { list-style:none; }
details.menu > summary::-webkit-details-marker { display:none; }
details.menu > summary.button { color:var(--text); }
details.menu[open] > summary.button { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.menu-list { position:absolute; right:0; top:calc(100% + 6px); z-index:30; min-width:220px; padding:6px; margin:0; list-style:none; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow-lg); animation:pop .14s ease-out; }
.menu-list a, .menu-list button { display:flex; width:100%; align-items:center; gap:10px; justify-content:flex-start; padding:8px 10px; min-height:0; border-radius:8px; background:none; border:0; box-shadow:none; color:var(--text); font-weight:500; font-size:13.5px; text-decoration:none !important; }
.menu-list a:hover, .menu-list button:hover { background:var(--surface-3); filter:none; box-shadow:none; }
.menu-list svg { width:16px; height:16px; color:var(--muted); }
.menu-list .menu-hint { display:block; font-size:12px; color:var(--faint); font-weight:400; }
.menu-list .danger-item, .menu-list .danger-item svg { color:var(--fail); }
.menu-list hr { margin:6px 4px; }
.menu-list form { margin:0; }
@keyframes pop { from { opacity:0; transform:translateY(-4px) scale(.98); } to { opacity:1; transform:none; } }

/* ---------- Forms ---------- */
label { display:block; margin:14px 0 6px; font-weight:600; font-size:13.5px; }
input, textarea, select { display:block; width:100%; margin-top:6px; padding:9px 12px; font:inherit; font-size:14px; font-weight:400; color:inherit; background:var(--surface); border:1px solid var(--line-strong); border-radius:10px; transition:border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color:var(--faint); }
input:hover, textarea:hover, select:hover { border-color:color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
input:focus, textarea:focus, select:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-ring); }
input[type="checkbox"], input[type="radio"] { width:auto; display:inline-block; margin:0; accent-color:var(--accent); box-shadow:none; }
input[type="checkbox"] { width:17px; height:17px; flex:none; }
label.check, label.checkbox { display:flex; gap:10px; align-items:center; font-weight:500; }
label.check input, label.checkbox input { width:17px; display:inline-block; margin:0; }
.field-hint, label + p.muted, label + .muted { font-size:13px; margin:-2px 0 8px; }
fieldset { border:1px solid var(--line); border-radius:12px; margin:16px 0; padding:4px 16px 14px; } legend { font-weight:650; padding:0 6px; }
.form-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:18px; }

/* Switch-style checkbox */
label.switch { display:flex; align-items:flex-start; gap:12px; cursor:pointer; font-weight:550; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); transition:border-color .15s, background .15s; }
label.switch:hover { border-color:var(--line-strong); }
label.switch input { appearance:none; -webkit-appearance:none; position:relative; width:36px; height:20px; flex:none; margin-top:1px; border-radius:999px; background:var(--line-strong); border:0; cursor:pointer; transition:background .18s; }
label.switch input::after { content:""; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .18s; }
label.switch input:checked { background:var(--accent); }
label.switch input:checked::after { transform:translateX(16px); }
label.switch input:focus-visible { box-shadow:0 0 0 4px var(--accent-ring); }
label.switch .switch-text small { display:block; font-weight:400; color:var(--muted); font-size:12.5px; margin-top:2px; }

/* Collapsible "more options" */
details.disclosure { border:1px solid var(--line); border-radius:12px; margin:16px 0; background:var(--surface-2); }
details.disclosure > summary { list-style:none; display:flex; align-items:center; gap:10px; padding:12px 14px; cursor:pointer; color:var(--text); font-weight:600; font-size:14px; }
details.disclosure > summary::-webkit-details-marker { display:none; }
details.disclosure > summary::before { content:""; width:8px; height:8px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(-45deg); transition:transform .15s; margin:0 4px 0 2px; }
details.disclosure[open] > summary::before { transform:rotate(45deg); }
details.disclosure > summary .muted { font-weight:400; font-size:13px; }
details.disclosure > .disclosure-body { padding:0 16px 16px; }

/* Drop zone around the native file input */
.dropzone { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:6px; margin:6px 0 4px; padding:30px 20px; border:2px dashed var(--line-strong); border-radius:16px; background:var(--surface-2); cursor:pointer; font-weight:500; transition:border-color .15s, background .15s, transform .15s; }
.dropzone:hover, .dropzone.dragging { border-color:var(--accent); background:var(--accent-soft); }
.dropzone.dragging { transform:scale(1.01); }
.dropzone.has-file { border-style:solid; border-color:color-mix(in srgb, var(--pass) 55%, transparent); background:var(--pass-soft); }
.dropzone input[type="file"] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; margin:0; }
.dropzone-icon { width:46px; height:46px; border-radius:14px; display:grid; place-items:center; background:var(--surface); color:var(--accent); box-shadow:var(--shadow); margin-bottom:4px; }
.dropzone-icon svg { width:24px; height:24px; }
.dropzone-title { font-size:15px; font-weight:650; color:var(--text); }
.dropzone-title u { color:var(--accent); text-decoration:none; }
.dropzone-sub { font-size:12.5px; color:var(--muted); font-weight:400; }
.dropzone-file { font-family:var(--mono); font-size:13px; color:var(--pass); font-weight:600; word-break:break-all; }

/* ---------- Text helpers & alerts ---------- */
.muted { color:var(--muted); } .faint { color:var(--faint); } .error { color:var(--fail); font-weight:500; } .small-text { font-size:13px; }
.limit { color:var(--warn); margin:6px 0; font-size:13.5px; padding-left:10px; border-left:2px solid color-mix(in srgb, var(--warn) 50%, transparent); }
.flash { display:flex; gap:10px; align-items:flex-start; padding:12px 16px; border-radius:12px; border:1px solid var(--line); background:var(--surface); box-shadow:var(--shadow-sm); margin:0 0 16px; }
.flash::before { content:""; flex:none; width:8px; height:8px; margin-top:7px; border-radius:50%; background:var(--info); }
.flash.ok { border-color:color-mix(in srgb, var(--pass) 35%, transparent); background:var(--pass-soft); } .flash.ok::before { background:var(--pass); }
.flash.bad { border-color:color-mix(in srgb, var(--fail) 35%, transparent); background:var(--fail-soft); } .flash.bad::before { background:var(--fail); }
.flash code { background:var(--surface); }
.callout { padding:12px 14px; border-radius:12px; background:var(--accent-soft); border:1px solid color-mix(in srgb, var(--accent) 22%, transparent); font-size:13.5px; }
.callout.neutral { background:var(--surface-2); border-color:var(--line); }

/* ---------- Tables ---------- */
table { width:100%; border-collapse:separate; border-spacing:0; background:var(--surface); font-size:13.5px; }
th, td { text-align:left; padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--faint); background:var(--surface-2); }
tr:last-child > td { border-bottom:0; }
.table-wrap { border:1px solid var(--line); border-radius:var(--radius); overflow:auto; box-shadow:var(--shadow); background:var(--surface); margin:14px 0; }
.table-wrap table { margin:0; }
.card table, details table { border:1px solid var(--line); border-radius:10px; overflow:hidden; }
tr[data-href] { cursor:pointer; transition:background .12s; }
tr[data-href]:hover > td { background:var(--surface-2); }
td .file-name { font-weight:600; color:var(--text); }
tr[data-href]:hover .file-name { color:var(--accent); }

/* Pagination (Laravel's default markup) */
nav[role="navigation"] { margin:16px 0; font-size:13px; }
nav[role="navigation"] svg { width:16px; height:16px; }

/* ---------- Badges ---------- */
.badge { display:inline-flex; align-items:center; gap:5px; padding:2px 9px; border-radius:999px; font-size:12px; font-weight:600; line-height:18px; white-space:nowrap; margin:1px 2px;
  border:1px solid color-mix(in srgb, currentColor 28%, transparent); background:color-mix(in srgb, currentColor 10%, transparent); }
.badge.dot::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.s-pass, .run-completed { color:var(--pass); } .s-fail, .s-error, .run-failed { color:var(--fail); } .s-warning { color:var(--warn); }
.s-evidence_unavailable, .s-lookup_unavailable { color:var(--unknown); border-style:dashed; } .s-info, .s-not_applicable, .run-queued, .run-running { color:var(--info); }
.run-running::before, .run-queued::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; animation:pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity:.3; } }
.l-proposed { color:var(--info); } .l-simulated { color:var(--unknown); } .l-observed, .l-confirmed { color:var(--pass); }
.risk-low { color:var(--info); } .risk-medium { color:var(--warn); } .risk-high { color:var(--fail); }
.cause-verified { color:var(--pass); } .cause-likely { color:var(--warn); } .cause-possible { color:var(--unknown); border-style:dashed; }
.e-resolved { color:var(--pass); } .e-partly_resolved { color:var(--warn); } .e-not_resolved { color:var(--fail); } .e-not_measured { color:var(--info); border-style:dashed; }
.o-met, .o-followed { color:var(--pass); } .o-not_met { color:var(--fail); } .o-unknown { color:var(--unknown); border-style:dashed; } .o-not_followed { color:var(--warn); } .o-not_needed, .o-not_visible { color:var(--info); }
.counts { display:flex; flex-wrap:wrap; gap:4px; margin:8px 0; }
.provider-headlines { list-style:none; padding:0; margin:12px 0 4px; } .provider-headlines li { margin:2px 0; }

/* Segmented status bar */
.statusbar { display:flex; height:8px; border-radius:999px; overflow:hidden; background:var(--surface-3); gap:2px; }
.statusbar span { display:block; min-width:4px; }
.statusbar .seg-fail, .statusbar .seg-error { background:var(--fail); } .statusbar .seg-warning { background:var(--warn); }
.statusbar .seg-evidence_unavailable, .statusbar .seg-lookup_unavailable { background:repeating-linear-gradient(45deg, var(--unknown) 0 3px, color-mix(in srgb, var(--unknown) 45%, transparent) 3px 6px); }
.statusbar .seg-pass { background:var(--pass); } .statusbar .seg-info, .statusbar .seg-not_applicable { background:var(--line-strong); }
.mini-results { display:flex; flex-direction:column; gap:6px; min-width:180px; }
.mini-results .statusbar { height:6px; max-width:220px; }

/* ---------- Empty states ---------- */
.empty { text-align:center; padding:48px 20px; border:1px dashed var(--line-strong); border-radius:var(--radius); background:var(--surface); }
.empty-icon { width:56px; height:56px; margin:0 auto 14px; border-radius:16px; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent); }
.empty-icon svg { width:28px; height:28px; }
.empty h2 { margin:0 0 6px; font-size:18px; }
.empty p { color:var(--muted); max-width:46ch; margin:0 auto 16px; }

/* ---------- Toolbar / filters ---------- */
.filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:0 0 14px; padding:10px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow-sm); }
.filters input, .filters select { width:auto; min-width:11rem; flex:1; margin:0; }
.filters input[type="search"], .filters input[name="q"] { flex:2; padding-left:36px; background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center / 17px; }
.filters button, .filters .button { margin:0; }

/* ---------- Results list (checks) ---------- */
.results { list-style:none; padding:0; margin:0; }
.result { display:grid; grid-template-columns:150px minmax(0,1fr); gap:14px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 14px; margin:8px 0; transition:border-color .15s, box-shadow .15s; }
.result:hover { border-color:var(--line-strong); }
.result p { margin:0 0 4px; } .result .badge { justify-self:start; align-self:start; }
.result-actions { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:4px; }
.result.active { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
@media (max-width:600px) { .result { grid-template-columns:1fr; gap:6px; } }
details summary { cursor:pointer; color:var(--muted); font-size:13px; }
details summary:hover { color:var(--text); }
.result details summary code, .evidence-summary code { font-size:11.5px; }

/* ---------- Report: header ---------- */
.report-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.report-head h1 { margin:0; word-break:break-all; font-size:26px; }
.report-sub { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin:8px 0 0; color:var(--muted); font-size:13.5px; }
.report-sub > span { display:inline-flex; align-items:center; gap:6px; }
.report-sub svg { width:15px; height:15px; color:var(--faint); }
.report-sub b { color:var(--text); font-weight:600; }

/* ---------- Report: verdict hero ---------- */
.verdict-card { display:grid; grid-template-columns:minmax(260px, 1.1fr) repeat(3, minmax(0, 1fr)); gap:0; padding:0; overflow:hidden; position:relative; }
.verdict-card::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; background:var(--tone, var(--grad)); }
.verdict-main { display:flex; gap:16px; align-items:flex-start; padding:22px; background:linear-gradient(135deg, color-mix(in srgb, var(--tone-c, var(--accent)) 8%, transparent), transparent 70%); border-right:1px solid var(--line); }
.verdict-icon { width:48px; height:48px; flex:none; border-radius:14px; display:grid; place-items:center; color:#fff; background:var(--tone, var(--grad)); box-shadow:0 8px 20px -8px var(--tone-c, var(--accent)); }
.verdict-icon svg { width:26px; height:26px; }
.verdict-title { font-size:24px; font-weight:780; letter-spacing:-.025em; margin:0; }
.verdict-main p { margin:6px 0 0; color:var(--muted); font-size:13.5px; }
.verdict-main .counts { margin:10px 0 0; }
.tone-fail { --tone:linear-gradient(135deg,#ef4444,#c2261d); --tone-c:#dc2626; }
.tone-pass { --tone:linear-gradient(135deg,#22c55e,#15803d); --tone-c:#16a34a; }
.tone-warn { --tone:linear-gradient(135deg,#f59e0b,#b45309); --tone-c:#d97706; }
.stat { padding:20px 22px; border-right:1px solid var(--line); display:flex; flex-direction:column; gap:6px; min-width:0; }
.stat:last-child { border-right:0; }
.stat-label { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--faint); display:flex; align-items:center; gap:6px; }
.stat-value { font-size:24px; font-weight:750; letter-spacing:-.02em; line-height:1.1; }
.stat-value small { font-size:14px; font-weight:550; color:var(--faint); }
.stat-note { font-size:12.5px; color:var(--muted); }
.stat .statusbar { margin-top:4px; }
.stat .counts { margin:4px 0 0; }
.stat .counts .badge { font-size:11.5px; padding:1px 7px; }
.meter { position:relative; height:8px; border-radius:999px; background:var(--surface-3); overflow:visible; margin-top:6px; }
.meter > span { position:absolute; inset:0 auto 0 0; border-radius:999px; background:var(--pass); }
.meter.s-warning > span { background:var(--warn); } .meter.s-fail > span { background:var(--fail); }
.meter > i { position:absolute; top:-4px; bottom:-4px; width:2px; border-radius:2px; background:var(--text); opacity:.55; }
.meter-scale { display:flex; justify-content:space-between; font-size:11px; color:var(--faint); }
@media (max-width:1060px) { .verdict-card { grid-template-columns:1fr 1fr; } .verdict-main { grid-column:1 / -1; border-right:0; border-bottom:1px solid var(--line); } .stat:nth-child(3) { border-right:0; } .stat:last-child { grid-column:1 / -1; border-top:1px solid var(--line); } }
@media (max-width:560px) { .verdict-card { grid-template-columns:1fr; } .stat { border-right:0; border-top:1px solid var(--line); } }

/* ---------- Report: jump bar ---------- */
.jumpbar { position:sticky; top:var(--topbar-h); z-index:25; display:flex; align-items:center; gap:4px; margin:16px 0 4px; padding:6px; overflow-x:auto; scrollbar-width:none;
  background:color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow-sm); }
.jumpbar::-webkit-scrollbar { display:none; }
.jumpbar a { display:inline-flex; align-items:center; gap:7px; padding:6px 12px; border-radius:8px; color:var(--muted); font-weight:550; font-size:13.5px; white-space:nowrap; text-decoration:none !important; transition:background .15s, color .15s; }
.jumpbar a:hover { background:var(--surface-3); color:var(--text); }
.jumpbar a.active { background:var(--accent-soft); color:var(--accent-strong); }
.jumpbar .count { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; border-radius:999px; font-size:11.5px; font-weight:700; background:var(--surface-3); color:var(--muted); }
.jumpbar a.active .count { background:var(--accent); color:#fff; }
.jumpbar .count.bad { background:var(--fail-soft); color:var(--fail); }
.jumpbar .spacer { flex:1; }
@media (max-width:860px) { .jumpbar { top:0; position:relative; } }

/* ---------- Report: sections ---------- */
.section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap; margin:28px 0 10px; }
.section-head h2 { margin:0; font-size:20px; }
.section-head p { margin:4px 0 0; color:var(--muted); font-size:13.5px; max-width:70ch; }
.runinfo { display:flex; flex-wrap:wrap; gap:6px 18px; font-size:13.5px; color:var(--muted); }
.runinfo span { display:inline-flex; gap:6px; }
.about-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:12px 20px; margin:10px 0 14px; }
.about-grid div { display:flex; flex-direction:column; gap:2px; font-size:13.5px; min-width:0; }
.about-grid dt { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--faint); }
.about-grid dd { margin:0; word-break:break-word; }

/* Proof ladder: proposed -> simulated -> observed -> confirmed */
.ladder { display:flex; align-items:center; flex-wrap:wrap; gap:4px; margin:0; padding:0; list-style:none; font-size:12.5px; }
.ladder li { display:inline-flex; align-items:center; gap:4px; color:var(--muted); cursor:help; }
.ladder li + li::before { content:"→"; color:var(--faint); margin:0 4px 0 2px; }
.ladder .badge { margin:0; }
.proof { display:inline-flex; align-items:center; gap:3px; }
.proof i { width:14px; height:4px; border-radius:2px; background:var(--line-strong); }
.proof i.on { background:currentColor; }

/* ---------- Report: fixes ---------- */
.fixes { list-style:none; padding:0; margin:0; }
.fix-group { display:flex; align-items:baseline; gap:6px; margin:22px 0 2px; }
.fix-group-critical { color:var(--fail); } .fix-group-high { color:var(--warn); } .fix-group-proven { color:var(--pass); } .fix-group-investigate { color:var(--unknown); }
.fix-group .muted { font-weight:500; }
.fix-group-note { margin:0 0 10px; font-size:13.5px; }
.fix p.fix-reason { margin:8px 0 0; font-size:13.5px; }
.score-sources h3 { margin:0 0 10px; }
.score-sources td.points { font-variant-numeric:tabular-nums; white-space:nowrap; text-align:right; font-weight:600; }
.score-sources td a { text-decoration:none; } .score-sources td code { word-break:normal; }
.score-sources p { margin:10px 0 0; font-size:13px; }
@media (max-width:600px) { .score-sources th, .score-sources td { padding:8px; } }
.comparison h3 { margin:0 0 6px; }
.comparison > p { margin:6px 0; font-size:13.5px; }
.comparison .comparison-score { font-size:14.5px; }
.comparison-group { margin-top:10px; }
.comparison-group > summary { font-weight:600; font-size:14px; cursor:pointer; }
.comparison-group .results { margin-top:6px; }
.comparison .transition { display:inline-flex; align-items:center; gap:4px; flex-wrap:wrap; color:var(--muted); }
.comparison .transition { align-self:start; } .comparison .transition .badge { margin:0; align-self:center; }
.comparison .result { grid-template-columns:250px minmax(0,1fr); }
@media (max-width:600px) { .comparison .result { grid-template-columns:1fr; } }
.fix { position:relative; padding:16px 18px 16px 20px; overflow:hidden; transition:border-color .15s, box-shadow .15s; }
.fix::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--info); opacity:.7; }
.fix.risk-high::before { background:var(--fail); } .fix.risk-medium::before { background:var(--warn); } .fix.risk-low::before { background:var(--info); }
.fix.risk-high, .fix.risk-medium, .fix.risk-low { color:inherit; }
.fix:has(input[type="checkbox"]:checked) { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft), var(--shadow); }
.fix-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px 16px; flex-wrap:wrap; }
.fix-head label.check { margin:0; align-items:flex-start; gap:12px; font-size:15px; cursor:pointer; flex:1; min-width:240px; }
.fix-head label.check input { margin-top:2px; }
.fix-head label.check strong { font-weight:650; line-height:1.4; }
.fix-meta { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.fix ol { margin:8px 0; padding-left:22px; } .fix ol li { margin:3px 0; } .fix p { margin:6px 0; }
.fix-note { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin:10px 0 0; font-size:13.5px; }
.fix details { margin-top:10px; }
.fix details > summary { display:inline-flex; align-items:center; gap:6px; font-size:13px; font-weight:600; color:var(--accent); list-style:none; }
.fix details > summary::-webkit-details-marker { display:none; }
.fix details > summary::before { content:""; width:6px; height:6px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); transition:transform .15s; }
.fix details[open] > summary::before { transform:rotate(45deg); }
.fix-detail { margin-top:10px; padding:12px 14px; border-radius:10px; background:var(--surface-2); border:1px solid var(--line); }
.dns { margin:10px 0; } .dns pre { margin:6px 0; white-space:pre-wrap; word-break:break-all; }
.simulate-bar { position:sticky; bottom:12px; z-index:15; display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:14px 0 6px; padding:12px 14px; border-radius:14px;
  background:color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border:1px solid var(--line); box-shadow:var(--shadow-lg); }
.simulate-bar .muted { font-size:12.5px; flex:1; min-width:200px; }
.simulate-count { display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 6px; border-radius:999px; background:rgba(255,255,255,.25); font-size:12px; font-weight:700; }

/* Simulation step inside a fix */
.step { margin:12px 0 0; padding:14px; border-radius:12px; background:var(--surface-2); border:1px solid var(--line); }
.card.step { box-shadow:none; }
.step h3 { margin:0 0 8px; font-size:15px; }
.step-head { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; margin-bottom:6px; }
.step-kicker { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--faint); }
.step-effects { margin:0; display:flex; flex-direction:column; gap:4px; }
.step-effects .badge { margin-left:0; }
.score-line { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; margin:8px 0; font-size:13.5px; }
.score-line .score-nums { font-weight:650; font-variant-numeric:tabular-nums; }
.delta { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px; font-size:12px; font-weight:700; font-variant-numeric:tabular-nums; background:var(--info-soft); color:var(--info); }
.delta.good { background:var(--pass-soft); color:var(--pass); } .delta.bad { background:var(--fail-soft); color:var(--fail); }
.excluded { font-size:12px; color:var(--faint); margin:-2px 0 8px; }
.step-files { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:8px 0; }
.step-files .muted { font-size:12.5px; }
.step table { font-size:13px; margin-top:8px; }
.step td, .step th { padding:7px 10px; }
.chg { font-weight:600; }
.chg-improved, .chg-added { color:var(--pass); } .chg-regressed, .chg-worse, .chg-removed { color:var(--fail); } .chg-unknown, .chg-not-comparable { color:var(--faint); font-weight:500; }
.arrow { color:var(--faint); margin:0 4px; }

/* ---------- Report: check layers ---------- */
.layer { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:0 16px 6px; margin:10px 0; box-shadow:var(--shadow-sm); transition:box-shadow .15s; }
.layer[open] { box-shadow:var(--shadow); }
.layer > summary { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:14px 0; color:var(--text); font-size:15.5px; font-weight:650; cursor:pointer; list-style:none; }
.layer > summary::-webkit-details-marker { display:none; }
.layer > summary > span:first-child { display:inline-flex; align-items:center; gap:10px; }
.layer > summary > span:first-child::before { content:""; width:7px; height:7px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted); transform:rotate(-45deg); transition:transform .15s; margin:0 2px; }
.layer[open] > summary > span:first-child::before { transform:rotate(45deg); }
.layer[open] > summary { border-bottom:1px solid var(--line); margin-bottom:8px; }
.layer-counts { display:flex; flex-wrap:wrap; gap:4px; font-weight:600; }
.other-results { margin:6px 0 10px; }
.other-results > summary { padding:6px 0; font-weight:600; }
.sender-rules td .muted { font-size:13px; margin-left:4px; }

/* ---------- Report: checks beside the source ---------- */
.check-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,440px); gap:20px; align-items:start; }
.check-source { align-self:stretch; }
.source-pane { position:sticky; top:calc(var(--topbar-h) + 64px); max-height:calc(100vh - var(--topbar-h) - 80px); display:flex; flex-direction:column; gap:10px; margin:14px 0; padding:14px; overflow:hidden; }
.source-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.source-title { display:flex; align-items:center; gap:8px; margin:0; font-size:14.5px; font-weight:700; }
.source-title svg { width:17px; height:17px; color:var(--accent); }
.seg { display:inline-flex; gap:2px; padding:3px; border-radius:10px; background:var(--surface-3); border:1px solid var(--line); max-width:100%; }
.seg button { background:transparent; color:var(--muted); border:0; box-shadow:none; min-height:26px; padding:3px 10px; font-size:12.5px; font-weight:600; border-radius:7px; }
.seg button:hover { color:var(--text); background:color-mix(in srgb, var(--surface) 60%, transparent); filter:none; box-shadow:none; }
.seg button.active { background:var(--surface); color:var(--text); box-shadow:var(--shadow-sm); }
.source-views { display:flex; flex-wrap:wrap; gap:2px; max-width:100%; min-width:0; }
.source-views button { white-space:normal; text-align:left; line-height:1.3; height:auto; max-width:100%; }
.source-views button.active { background:var(--accent); color:#fff; }
.source-modes { display:inline-flex; }
.source-bar { display:flex; align-items:flex-start; gap:10px; margin:0; padding:9px 11px; border-radius:10px; background:var(--accent-soft); border:1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.source-caption { margin:0; font-size:13px; font-weight:550; flex:1; min-width:0; }
.source-nav { display:flex; align-items:center; gap:4px; font-size:12px; flex:none; }
.source-nav button { min-height:24px; padding:2px 8px; }
.source-nav[hidden], .source-mail[hidden] { display:none; }
.source-view { display:flex; flex-direction:column; flex:1; min-height:0; }
.source-view[hidden] { display:none; }
.source-note { margin:0; font-size:13px; }
.source-mail { position:relative; flex:1; overflow:auto; max-height:calc(100vh - 300px); margin:0; white-space:pre-wrap; word-break:break-word; font-size:11.5px; line-height:1.6; }
.source-mail mark { background:transparent; color:inherit; padding:0; cursor:pointer; }
.source-mail mark:hover { text-decoration:underline dotted var(--muted); }
.source-mail mark.hit { background:var(--hit); color:var(--hit-text); border-radius:3px; text-decoration:none; box-shadow:0 0 0 1px color-mix(in srgb, var(--hit) 70%, transparent); }
.source-mail mark.hit.hit-signed { background:var(--hit-signed); color:var(--hit-signed-text); }
.source-mail mark.hit.hit-oversigned { background:var(--hit-oversigned); color:var(--hit-oversigned-text); }
.source-mail mark.hit.hit-unsigned { background:var(--hit-unsigned); color:var(--hit-unsigned-text); }
.source-mail mark.hit.current { outline:2px solid var(--accent); outline-offset:1px; }
.source-mail details.source-fold { display:block; margin:4px 0; }
.source-mail details.source-fold summary { cursor:pointer; color:var(--muted); font-weight:600; }
.source-key { display:flex; flex-wrap:wrap; gap:4px 12px; list-style:none; margin:0; padding:8px 2px 0; border-top:1px solid var(--line); font-size:11.5px; color:var(--muted); }
.source-key li { display:flex; align-items:center; gap:5px; }
.source-key .swatch { width:12px; height:12px; border-radius:3px; display:inline-block; box-shadow:inset 0 0 0 1px rgba(29,35,48,.25); }
@media (prefers-color-scheme: dark) { .source-key .swatch { box-shadow:inset 0 0 0 1px rgba(230,233,239,.35); } }
.source-key .swatch.hit { background:var(--hit); }
.source-key .swatch.hit-signed { background:var(--hit-signed); }
.source-key .swatch.hit-oversigned { background:var(--hit-oversigned); }
.source-key .swatch.hit-unsigned { background:var(--hit-unsigned); }
.source-jump { display:inline-flex; align-items:center; gap:5px; font-size:12.5px; margin:2px 0 4px; }
.source-jump svg { width:14px; height:14px; }
.source-jump[aria-pressed="true"] { color:var(--accent-strong); text-decoration:underline; text-underline-offset:3px; }
@media (max-width:900px) {
  .check-layout { grid-template-columns:1fr; padding-bottom:44vh; }
  .source-pane { position:fixed; bottom:0; left:0; right:0; top:auto; max-height:42vh; margin:0; border-radius:16px 16px 0 0; z-index:35; box-shadow:0 -8px 30px rgba(0,0,0,.18); }
  .source-mail { max-height:calc(42vh - 150px); }
  .simulate-bar { bottom:calc(42vh + 10px); }
}

/* ---------- Settings ---------- */
.settings-section { display:grid; grid-template-columns:minmax(200px, 300px) minmax(0, 1fr); gap:24px; }
.settings-section > header h2 { margin:0 0 6px; font-size:16.5px; }
.settings-section > header p { color:var(--muted); font-size:13.5px; margin:0; }
.settings-section form > label:first-child { margin-top:0; }
@media (max-width:820px) { .settings-section { grid-template-columns:1fr; gap:8px; } }
.card.danger-zone { border-color:color-mix(in srgb, var(--fail) 35%, var(--line)); }
.card.danger-zone h2 { color:var(--fail); }

/* ---------- Auth ---------- */
.auth-wrap { min-height:calc(100vh - var(--topbar-h) - 140px); display:grid; place-items:center; }
.auth-card { width:100%; max-width:420px; margin:24px auto; padding:30px; }
.auth-card .brand-mark { width:44px; height:44px; border-radius:13px; margin-bottom:16px; }
.auth-card .brand-mark svg { width:24px; height:24px; }
.auth-card h1 { font-size:24px; margin-bottom:4px; }
.auth-card form button[type="submit"], .auth-card form > button { width:100%; margin-top:18px; min-height:42px; }

/* ---------- Monitor list cards ---------- */
.monitor-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; margin:14px 0; }
.monitor-card { display:flex; flex-direction:column; gap:10px; margin:0; text-decoration:none !important; color:inherit; transition:border-color .15s, transform .15s, box-shadow .15s; }
.monitor-card:hover { border-color:var(--accent); transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.monitor-card h3 { margin:0; font-size:16px; word-break:break-all; display:flex; align-items:center; gap:8px; }
.monitor-card .meta { display:flex; justify-content:space-between; gap:8px; font-size:12.5px; color:var(--muted); }
.monitor-card .counts { margin:0; }
