/* ==========================================================================
   Intelligent Security Advisor — design system
   Hand-written CSS, no framework. Tokens → base → layout → components → pages.
   Identity: a survey instrument. Quiet spruce surfaces, one cobalt signal colour,
   and a segmented score gauge as the single bold element.
   ========================================================================== */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-wdth.woff2") format("woff2-variations"),
       url("../fonts/instrument-sans-latin-wdth.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------- Tokens --------------------------------------------------------- */
:root {
  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale (1.2 minor third), fluid at the top end */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.4rem, 1.1rem + 1vw, 1.75rem);
  --fs-2xl: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --fs-hero: clamp(2.25rem, 1.2rem + 4.4vw, 4.25rem);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
  --content-max: 1320px;
  --gutter: clamp(16px, 3vw, 32px);

  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Light theme */
  --bg: #edf1f2;
  --surface: #ffffff;
  --surface-2: #f4f7f7;
  --surface-3: #e7edee;
  --ink: #10242b;
  --ink-2: #2e444b;
  --muted: #5b6f76;
  --line: #d4dee0;
  --line-strong: #b9c7ca;
  --accent: #2f55e4;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecfe;
  --focus: #2f55e4;

  --sev-critical: #c92a45;
  --sev-high: #d85a22;
  --sev-medium: #b88207;
  --sev-low: #2f7fae;
  --sev-info: #6b7d83;
  --ok: #17885b;
  --band-excellent: #17885b;
  --band-good: #4f9a3a;
  --band-moderate: #b88207;
  --band-high: #d85a22;
  --band-critical: #c92a45;
  --band-none: #9aabb0;

  --sev-critical-bg: #fbe9ec;
  --sev-high-bg: #fcede5;
  --sev-medium-bg: #faf1dc;
  --sev-low-bg: #e5f1f8;
  --sev-info-bg: #edf1f2;
  --ok-bg: #e2f3ea;

  --shadow-pop: 0 12px 32px rgba(16, 36, 43, .16), 0 2px 6px rgba(16, 36, 43, .08);
  --code-bg: #f0f4f5;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1519; --surface: #121f25; --surface-2: #17272e; --surface-3: #1d3038;
    --ink: #e3edef; --ink-2: #c3d2d6; --muted: #8ca2a9; --line: #233840; --line-strong: #31505a;
    --accent: #7d9bff; --accent-ink: #0c1519; --accent-soft: #1b2a52; --focus: #9fb6ff;
    --sev-critical: #ff6b81; --sev-high: #ff9159; --sev-medium: #f0c04f; --sev-low: #6cbcec; --sev-info: #93a6ac; --ok: #4fd39b;
    --band-excellent: #4fd39b; --band-good: #93d46a; --band-moderate: #f0c04f; --band-high: #ff9159; --band-critical: #ff6b81; --band-none: #4b6168;
    --sev-critical-bg: #3a1720; --sev-high-bg: #3a2216; --sev-medium-bg: #352b12; --sev-low-bg: #142d3c; --sev-info-bg: #1c2b31; --ok-bg: #133126;
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
    --code-bg: #0e1a1f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1519; --surface: #121f25; --surface-2: #17272e; --surface-3: #1d3038;
  --ink: #e3edef; --ink-2: #c3d2d6; --muted: #8ca2a9; --line: #233840; --line-strong: #31505a;
  --accent: #7d9bff; --accent-ink: #0c1519; --accent-soft: #1b2a52; --focus: #9fb6ff;
  --sev-critical: #ff6b81; --sev-high: #ff9159; --sev-medium: #f0c04f; --sev-low: #6cbcec; --sev-info: #93a6ac; --ok: #4fd39b;
  --band-excellent: #4fd39b; --band-good: #93d46a; --band-moderate: #f0c04f; --band-high: #ff9159; --band-critical: #ff6b81; --band-none: #4b6168;
  --sev-critical-bg: #3a1720; --sev-high-bg: #3a2216; --sev-medium-bg: #352b12; --sev-low-bg: #142d3c; --sev-info-bg: #1c2b31; --ok-bg: #133126;
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
  --code-bg: #0e1a1f;
  color-scheme: dark;
}

/* ---------- Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { margin: 0 0 var(--space-3); line-height: 1.2; font-weight: 640; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h4 { font-size: var(--fs-base); }
p { margin: 0 0 var(--space-3); }
small, .small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-6) 0; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.86em; }
code { background: var(--code-bg); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); word-break: break-word; }
pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4); overflow-x: auto; line-height: 1.55; margin: 0 0 var(--space-4); white-space: pre; tab-size: 4;
}
pre code { background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.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;
}
.skip-link { position: absolute; left: var(--space-4); top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); }
.skip-link:focus { top: var(--space-3); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 0.9em; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); }
.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 32px; height: 32px; }

/* ---------- App shell ------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; transition: grid-template-columns .2s var(--ease); }
.shell.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-5);
  height: var(--topbar-h); text-decoration: none; color: var(--ink); flex: none; border-bottom: 1px solid var(--line);
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 680; font-size: 1.0625rem; letter-spacing: -0.015em; line-height: 1.1; }
.brand-name small { display: block; font-weight: 450; color: var(--muted); font-size: 0.72rem; letter-spacing: 0; }
.nav { padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.nav-group { margin-top: var(--space-4); padding: 0 var(--space-3) var(--space-1); font-size: var(--fs-xs); color: var(--muted); font-weight: 560; }
.nav a {
  display: flex; align-items: center; gap: var(--space-3); padding: 9px var(--space-3); min-height: 40px;
  border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; position: relative;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .badge { margin-left: auto; }
.sidebar-foot { padding: var(--space-3) var(--space-5) var(--space-5); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }
.is-collapsed .nav a span, .is-collapsed .nav-group, .is-collapsed .brand-name, .is-collapsed .sidebar-foot, .is-collapsed .nav .badge { display: none; }
.is-collapsed .nav a { justify-content: center; }
.is-collapsed .brand { justify-content: center; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { font-weight: 600; font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); }
.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--space-6) var(--gutter) var(--space-16); flex: 1 1 auto; }
.footer { padding: var(--space-5) var(--gutter); color: var(--muted); font-size: var(--fs-xs); border-top: 1px solid var(--line); display: flex; gap: var(--space-4); flex-wrap: wrap; justify-content: space-between; }

.scrim { display: none; }
@media (max-width: 1023px) {
  .shell, .shell.is-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s var(--ease); box-shadow: var(--shadow-pop); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(6, 14, 18, .45); z-index: 35; }
  .is-collapsed .nav a span, .is-collapsed .nav-group, .is-collapsed .brand-name, .is-collapsed .sidebar-foot, .is-collapsed .nav .badge { display: revert; }
  .is-collapsed .nav a { justify-content: flex-start; }
  .is-collapsed .brand { justify-content: flex-start; padding: 0 var(--space-5); }
  .collapse-toggle { display: none !important; }
}
@media (min-width: 1024px) { .menu-toggle { display: none !important; } }

/* ---------- Page header ---------------------------------------------------- */
.page-head { display: flex; gap: var(--space-4); align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--space-6); }
.page-head h1 { margin: 0; font-size: var(--fs-2xl); font-weight: 650; font-stretch: 92%; letter-spacing: -0.02em; }
.page-head p { margin: var(--space-2) 0 0; color: var(--muted); max-width: 70ch; }
.breadcrumb { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--space-2); display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb span[aria-hidden] { opacity: .5; }

/* ---------- Panels ---------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: var(--fs-md); }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.panel-body { padding: var(--space-5); }
.panel-body.flush { padding: 0; }
.panel-foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.panel.sunken { background: var(--surface-2); }

.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); }
.grid-side-main { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); }
@media (max-width: 1199px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .grid-main-side, .grid-side-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* KPI strip: one panel, divided by hairlines (not a row of identical cards) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.kpis-8 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .kpis-8 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .kpis-8 { grid-template-columns: repeat(8, 1fr); } .kpis-8 .kpi { padding-inline: var(--space-4); } }
.kpi { padding: var(--space-4) var(--space-5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; min-width: 0; }
.kpi-label { font-size: var(--fs-sm); color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi-value { font-size: 1.75rem; font-weight: 620; font-stretch: 80%; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; letter-spacing: -0.02em; }
.kpi-value small { font-size: var(--fs-sm); font-weight: 450; color: var(--muted); font-stretch: 100%; letter-spacing: 0; }
.kpi-note { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.kpi a { color: inherit; text-decoration: none; }
.kpi a:hover .kpi-value { color: var(--accent); }

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface); --btn-ink: var(--ink); --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--btn-bg); color: var(--btn-ink); border: 1px solid var(--btn-line);
  font: inherit; font-weight: 560; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { --btn-bg: var(--accent); --btn-ink: var(--accent-ink); --btn-line: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-danger { --btn-bg: var(--surface); --btn-ink: var(--sev-critical); --btn-line: color-mix(in srgb, var(--sev-critical) 45%, var(--line)); }
.btn-danger:hover { background: var(--sev-critical-bg); }
.btn-ghost { --btn-bg: transparent; --btn-line: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 32px; padding: 5px 12px; font-size: var(--fs-sm); }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: var(--fs-md); }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--sev-critical); border: 2px solid var(--bg); }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading { pointer-events: none; opacity: .85; }

/* ---------- Badges, pills, severity ---------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.neutral::before { display: none; }
.sev-critical { color: var(--sev-critical); background: var(--sev-critical-bg); }
.sev-high { color: var(--sev-high); background: var(--sev-high-bg); }
.sev-medium { color: var(--sev-medium); background: var(--sev-medium-bg); }
.sev-low { color: var(--sev-low); background: var(--sev-low-bg); }
.sev-info { color: var(--sev-info); background: var(--sev-info-bg); }
.st-ok, .st-verified, .st-completed, .st-resolved, .st-connected, .st-active, .st-pass { color: var(--ok); background: var(--ok-bg); }
.st-running, .st-starting, .st-queued, .st-pending, .st-in_progress, .st-ready_for_verification { color: var(--accent); background: var(--accent-soft); }
.st-failed, .st-rejected, .st-auth_error, .st-suspended, .st-fail, .st-timeout { color: var(--sev-critical); background: var(--sev-critical-bg); }
.st-partial, .st-expired, .st-rate_limited, .st-unavailable, .st-warn, .st-inconclusive { color: var(--sev-medium); background: var(--sev-medium-bg); }
.st-cancelled, .st-unverified, .st-not_configured, .st-disconnected, .st-accepted_risk, .st-false_positive, .st-not_applicable, .st-skipped, .st-info, .st-waiting { color: var(--sev-info); background: var(--sev-info-bg); }
.st-running::before, .st-starting::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.sev-bar { display: inline-block; width: 4px; height: 1.2em; border-radius: 2px; vertical-align: middle; background: currentColor; }

/* ---------- Forms ----------------------------------------------------------- */
.form { display: grid; gap: var(--space-5); }
.form-row { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field-label { font-weight: 560; font-size: var(--fs-sm); color: var(--ink); }
.field .hint { font-size: var(--fs-xs); color: var(--muted); margin: 0; }
.field-error { color: var(--sev-critical); font-size: var(--fs-sm); margin: 0; display: flex; gap: 6px; align-items: flex-start; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--sev-critical); }
.select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.input-mono { font-family: var(--font-mono); font-size: 0.9rem; }
.check { display: flex; gap: var(--space-3); align-items: flex-start; cursor: pointer; line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check-card { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s; }
.check-card:hover { border-color: var(--line-strong); }
.check-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-card:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.check-card input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check-card strong { display: block; font-weight: 600; }
.check-card span { color: var(--muted); font-size: var(--fs-sm); }
.choice-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.form-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; margin-bottom: var(--space-3); padding: 0; }
.password-field { position: relative; }
.password-field .input { padding-right: 46px; }
.password-field .icon-btn { position: absolute; right: 2px; top: 1px; }

/* ---------- Alerts, flash, toasts ------------------------------------------ */
.alert { 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(--line); background: var(--surface); margin-bottom: var(--space-4); }
.alert .icon { margin-top: 2px; }
.alert p:last-child { margin-bottom: 0; }
.alert-success { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: var(--ok-bg); }
.alert-success .icon { color: var(--ok); }
.alert-error { border-color: color-mix(in srgb, var(--sev-critical) 40%, var(--line)); background: var(--sev-critical-bg); }
.alert-error .icon { color: var(--sev-critical); }
.alert-info { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
.alert-info .icon { color: var(--accent); }
.alert-warn { border-color: color-mix(in srgb, var(--sev-medium) 45%, var(--line)); background: var(--sev-medium-bg); }
.alert-warn .icon { color: var(--sev-medium); }
.toasts { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: 90; display: grid; gap: var(--space-2); width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: var(--space-3) var(--space-4); border-radius: var(--radius); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); animation: toast-in .25s var(--ease); }
.toast.is-error { background: var(--sev-critical); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Tables ------------------------------------------------------------ */
.table-tools { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.table-tools .input, .table-tools .select { min-height: 36px; padding-top: 6px; padding-bottom: 6px; width: auto; max-width: 100%; min-width: 0; }
@media (max-width: 599px) { .table-tools .select { flex: 1 1 140px; } .table-tools .search { max-width: none; flex-basis: 100%; } }
.table-tools .search { position: relative; flex: 1 1 220px; max-width: 360px; }
.table-tools .search .input { width: 100%; padding-left: 36px; }
.table-tools .search .icon { position: absolute; left: 11px; top: 9px; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 580; color: var(--muted); padding: 10px var(--space-4); border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.table td { padding: 12px var(--space-4); border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: var(--space-5); }
.table th:last-child, .table td:last-child { padding-right: var(--space-5); }
.table a.row-link { color: var(--ink); font-weight: 560; text-decoration: none; }
.table a.row-link:hover { color: var(--accent); text-decoration: underline; }
.table .sub { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.table .actions { text-align: right; white-space: nowrap; }
.empty { text-align: center; padding: var(--space-12) var(--space-5); color: var(--muted); }
.empty .icon-xl { color: var(--line-strong); margin-bottom: var(--space-3); }
.empty h3 { color: var(--ink); }
.empty p { max-width: 46ch; margin: 0 auto var(--space-4); }
.pagination { display: flex; gap: var(--space-2); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }

/* Card-list fallback on phones: tables with .table-cards stack into labelled rows */
@media (max-width: 767px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { border: 0; padding: 3px 0 !important; display: flex; gap: var(--space-3); justify-content: space-between; text-align: right; }
  .table-cards td::before { content: attr(data-label); color: var(--muted); font-weight: 500; text-align: left; flex: none; }
  .table-cards td.primary { display: block; text-align: left; padding-bottom: 6px !important; }
  .table-cards td.primary::before { display: none; }
  .table-cards td.actions { justify-content: flex-end; padding-top: 8px !important; }
  .table-cards td.actions::before { display: none; }
  .table-cards tbody tr:hover td { background: none; }
}

/* ---------- Key/value lists -------------------------------------------------- */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 8px var(--space-5); margin: 0; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 479px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: var(--space-2); } }

/* ---------- Tabs ---------------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--space-5); }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px var(--space-4); border: 0; background: none; color: var(--muted); font: inherit; font-weight: 560; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab .badge { margin-left: 6px; }
[role="tabpanel"][hidden] { display: none; }

/* ---------- Dropdown & popover --------------------------------------------- */
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; max-width: min(360px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: var(--space-2); z-index: 60; display: none; }
.menu.is-open .menu-panel { display: block; animation: toast-in .15s var(--ease); }
.menu-panel a, .menu-panel button.menu-item { display: flex; gap: var(--space-3); align-items: center; width: 100%; padding: 9px var(--space-3); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-panel a:hover, .menu-panel button.menu-item:hover { background: var(--surface-2); }
.menu-head { padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--line); margin-bottom: var(--space-2); }
.menu-head strong { display: block; }
.menu-head span { color: var(--muted); font-size: var(--fs-sm); word-break: break-all; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif { display: block; padding: 10px var(--space-3); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-size: var(--fs-sm); }
.notif:hover { background: var(--surface-2); }
.notif.unread { font-weight: 600; }
.notif small { display: block; color: var(--muted); font-weight: 400; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 650; font-size: var(--fs-sm); flex: none; }

/* ---------- Dialog ---------------------------------------------------------- */
dialog.modal { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }
dialog.modal::backdrop { background: rgba(6, 14, 18, .5); }
dialog.modal[open] { animation: toast-in .18s var(--ease); }
.modal-head { padding: var(--space-5) var(--space-5) 0; }
.modal-body { padding: var(--space-4) var(--space-5); }
.modal-foot { padding: var(--space-4) var(--space-5); display: flex; gap: var(--space-3); justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* ---------- Spinner & skeleton -------------------------------------------- */
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius-sm); min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Score instrument (the signature element) ----------------------- */
.instrument { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: var(--space-6); align-items: center; }
@media (max-width: 599px) { .instrument { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } }
.gauge { position: relative; width: 100%; max-width: 260px; aspect-ratio: 1; }
.gauge svg { width: 100%; height: 100%; display: block; overflow: visible; }
.gauge .track { stroke: var(--surface-3); }
.gauge .seg { transition: stroke-dashoffset 1.1s var(--ease); }
.gauge .cov-track { stroke: var(--line); }
.gauge .cov { stroke: var(--ink-2); }
.gauge-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.gauge-score { font-size: clamp(3rem, 2rem + 4vw, 4.4rem); font-weight: 620; font-stretch: 75%; line-height: .95; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.gauge-score.is-none { font-size: 1.6rem; font-stretch: 90%; letter-spacing: -0.01em; }
.gauge-band { font-weight: 600; font-size: var(--fs-sm); margin-top: 4px; }
.gauge-cov { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.band-excellent { color: var(--band-excellent); } .band-good { color: var(--band-good); } .band-moderate { color: var(--band-moderate); }
.band-high { color: var(--band-high); } .band-critical { color: var(--band-critical); } .band-none { color: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: var(--fs-sm); }
.legend li:last-child { border-bottom: 0; }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; }
.legend .w { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.legend .s { font-weight: 640; font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.legend .na { color: var(--muted); font-weight: 450; }
.mini-gauge { width: 44px; height: 44px; flex: none; }
.score-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 28px; padding: 0 8px; border-radius: var(--radius-sm); font-weight: 650; font-stretch: 85%; font-variant-numeric: tabular-nums; border: 1px solid currentColor; font-size: var(--fs-sm); }

/* ---------- Charts ---------------------------------------------------------- */
.chart { position: relative; width: 100%; min-height: 200px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font-sans); }
.chart .series-line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { fill: var(--accent); opacity: .08; }
.chart .point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .bar { fill: var(--accent); }
.chart .bar.alt { fill: var(--ok); }
.chart .bar-bg { fill: var(--surface-2); }
.chart .band-zone { opacity: .06; }
.chart-empty { display: grid; place-items: center; min-height: 200px; color: var(--muted); font-size: var(--fs-sm); text-align: center; padding: var(--space-5); border: 1px dashed var(--line); border-radius: var(--radius); }
.chart-legend { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--muted); margin-top: var(--space-3); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: var(--fs-xs); padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s; z-index: 5; }
.chart-tip.is-on { opacity: 1; }
.hbars { display: grid; gap: var(--space-3); }
.hbar { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 3ch; gap: var(--space-3); align-items: center; font-size: var(--fs-sm); }
.hbar meter, .meter { width: 100%; height: 10px; border-radius: 5px; border: 0; background: var(--surface-3); appearance: none; -webkit-appearance: none; display: block; }
meter::-webkit-meter-bar { background: var(--surface-3); border: 0; border-radius: 5px; height: 10px; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value { background: var(--accent); border-radius: 5px; }
meter::-moz-meter-bar { background: var(--accent); border-radius: 5px; }
meter.sev-critical::-webkit-meter-optimum-value, meter.sev-critical::-webkit-meter-suboptimum-value, meter.sev-critical::-webkit-meter-even-less-good-value { background: var(--sev-critical); }
meter.sev-critical::-moz-meter-bar { background: var(--sev-critical); }
meter.sev-high::-webkit-meter-optimum-value, meter.sev-high::-webkit-meter-suboptimum-value, meter.sev-high::-webkit-meter-even-less-good-value { background: var(--sev-high); }
meter.sev-high::-moz-meter-bar { background: var(--sev-high); }
meter.sev-medium::-webkit-meter-optimum-value, meter.sev-medium::-webkit-meter-suboptimum-value, meter.sev-medium::-webkit-meter-even-less-good-value { background: var(--sev-medium); }
meter.sev-medium::-moz-meter-bar { background: var(--sev-medium); }
meter.sev-low::-webkit-meter-optimum-value, meter.sev-low::-webkit-meter-suboptimum-value, meter.sev-low::-webkit-meter-even-less-good-value { background: var(--sev-low); }
meter.sev-low::-moz-meter-bar { background: var(--sev-low); }
meter.ok::-webkit-meter-optimum-value, meter.ok::-webkit-meter-suboptimum-value, meter.ok::-webkit-meter-even-less-good-value { background: var(--ok); }
meter.ok::-moz-meter-bar { background: var(--ok); }
meter.sev-critical, meter.sev-high, meter.sev-medium, meter.sev-low, meter.ok { background: var(--surface-3); color: inherit; }
progress.progress { width: 100%; height: 8px; border-radius: 4px; border: 0; background: var(--surface-3); appearance: none; -webkit-appearance: none; overflow: hidden; display: block; }
progress.progress::-webkit-progress-bar { background: var(--surface-3); }
progress.progress::-webkit-progress-value { background: var(--accent); transition: width .5s var(--ease); }
progress.progress::-moz-progress-bar { background: var(--accent); }

/* Severity strip: stacked distribution bar drawn with SVG */
.sev-strip { display: block; width: 100%; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.sev-counts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-3); font-size: var(--fs-sm); }
.sev-counts span { display: inline-flex; gap: 6px; align-items: baseline; }
.sev-counts b { font-variant-numeric: tabular-nums; font-weight: 650; }
.fill-critical { fill: var(--sev-critical); } .fill-high { fill: var(--sev-high); } .fill-medium { fill: var(--sev-medium); }
.fill-low { fill: var(--sev-low); } .fill-info { fill: var(--sev-info); } .fill-ok { fill: var(--ok); } .fill-accent { fill: var(--accent); }
.stroke-excellent { stroke: var(--band-excellent); } .stroke-good { stroke: var(--band-good); } .stroke-moderate { stroke: var(--band-moderate); }
.stroke-high { stroke: var(--band-high); } .stroke-critical { stroke: var(--band-critical); } .stroke-none { stroke: var(--band-none); }
.bg-excellent { background: var(--band-excellent); } .bg-good { background: var(--band-good); } .bg-moderate { background: var(--band-moderate); }
.bg-high { background: var(--band-high); } .bg-critical { background: var(--band-critical); } .bg-none { background: var(--band-none); }

/* Posture comparison heat table */
.heat td.cell { text-align: center; font-weight: 640; font-variant-numeric: tabular-nums; }
.heat .h-excellent { color: var(--band-excellent); } .heat .h-good { color: var(--band-good); } .heat .h-moderate { color: var(--band-moderate); }
.heat .h-high { color: var(--band-high); } .heat .h-critical { color: var(--band-critical); } .heat .h-none { color: var(--muted); font-weight: 400; }

/* ---------- Timeline / activity -------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 var(--space-4) var(--space-6); font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: -4px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li.is-auto::after { border-color: var(--accent); }
.timeline .when { color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Module list (scan progress & results) -------------------------- */
.modules { list-style: none; margin: 0; padding: 0; }
.module { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.module:last-child { border-bottom: 0; }
.module-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.module.is-running .module-icon { background: var(--accent-soft); color: var(--accent); }
.module.is-done .module-icon { background: var(--ok-bg); color: var(--ok); }
.module.is-failed .module-icon { background: var(--sev-critical-bg); color: var(--sev-critical); }
.module-name { font-weight: 580; }
.module-sub { color: var(--muted); font-size: var(--fs-xs); }

/* Checks list */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: var(--space-3); padding: 10px var(--space-5); border-bottom: 1px solid var(--line); font-size: var(--fs-sm); align-items: start; }
.checks li:last-child { border-bottom: 0; }
.checks .mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.checks .mark .icon { width: 13px; height: 13px; stroke-width: 2.5; }
.checks .pass .mark { background: var(--ok-bg); color: var(--ok); }
.checks .fail .mark, .checks .warn .mark { background: var(--sev-high-bg); color: var(--sev-high); }
.checks .info .mark, .checks .not_applicable .mark { background: var(--sev-info-bg); color: var(--sev-info); }
.checks .inconclusive .mark { background: var(--sev-medium-bg); color: var(--sev-medium); }
.checks .detail { color: var(--muted); margin-top: 2px; }

/* ---------- Finding detail ---------------------------------------------------- */
.finding-head { display: grid; grid-template-columns: 6px minmax(0, 1fr); gap: var(--space-4); }
.finding-head .rail { border-radius: 3px; background: var(--sev-info); }
.finding-head .rail.critical { background: var(--sev-critical); } .finding-head .rail.high { background: var(--sev-high); }
.finding-head .rail.medium { background: var(--sev-medium); } .finding-head .rail.low { background: var(--sev-low); }
.guidance h3 { font-size: var(--fs-base); margin-top: var(--space-5); }
.guidance h3:first-child { margin-top: 0; }
.plain { font-size: var(--fs-md); line-height: 1.55; color: var(--ink); max-width: 68ch; }
.ai-card { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: linear-gradient(var(--surface), var(--surface)) padding-box; border-radius: var(--radius-lg); }
.ai-card .panel-head { background: var(--accent-soft); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.ai-meta { font-size: var(--fs-xs); color: var(--muted); }
.ai-body ol, .ai-body ul { padding-left: 1.2em; margin: 0 0 var(--space-4); }
.ai-body li { margin-bottom: 6px; }
.prio { font-weight: 650; text-transform: none; }

/* ---------- Kanban tracker ------------------------------------------------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: var(--space-4); overflow-x: auto; padding-bottom: var(--space-3); scroll-snap-type: x proximity; }
.lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 200px; scroll-snap-align: start; max-height: 75vh; }
.lane-head { padding: var(--space-3) var(--space-4); display: flex; justify-content: space-between; align-items: center; font-weight: 600; border-bottom: 1px solid var(--line); }
.lane-body { padding: var(--space-3); display: grid; gap: var(--space-2); overflow-y: auto; align-content: start; }
.ticket { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--sev-info); border-radius: var(--radius-sm); padding: var(--space-3); text-decoration: none; color: var(--ink); font-size: var(--fs-sm); }
.ticket:hover { border-color: var(--line-strong); }
.ticket.critical { border-left-color: var(--sev-critical); } .ticket.high { border-left-color: var(--sev-high); }
.ticket.medium { border-left-color: var(--sev-medium); } .ticket.low { border-left-color: var(--sev-low); }
.ticket strong { display: block; font-weight: 580; margin-bottom: 4px; }
.ticket .sub { color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 767px) { .board { grid-auto-columns: 84%; } }

/* ---------- Advisor chat ---------------------------------------------------- */
.chat { display: flex; flex-direction: column; gap: var(--space-4); }
.msg { max-width: 820px; }
.msg-q { align-self: flex-end; background: var(--accent); color: var(--accent-ink); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg); max-width: min(560px, 90%); white-space: pre-wrap; }
.msg-a { align-self: flex-start; width: 100%; }
.chat-input { display: flex; gap: var(--space-3); align-items: flex-end; position: sticky; bottom: 0; background: var(--bg); padding: var(--space-3) 0; }
.chat-input .textarea { min-height: 52px; max-height: 200px; }
.suggestions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.suggestion { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-pill); padding: 6px 14px; font: inherit; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.suggestion:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Verification steps -------------------------------------------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-4); }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-3); }
.steps > li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-weight: 650; font-size: var(--fs-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.copy-field { display: flex; gap: var(--space-2); align-items: stretch; min-width: 0; }
.copy-field code { flex: 1 1 auto; display: block; padding: 9px 12px; overflow-x: auto; white-space: nowrap; min-width: 0; font-size: 0.85rem; }

/* ---------- Auth & public pages ------------------------------------------- */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-side { background: var(--ink); color: var(--bg); padding: var(--space-12) clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side .brand { border: 0; padding: 0; color: inherit; height: auto; }
.auth-side .brand-name small { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.auth-side blockquote { margin: 0; font-size: var(--fs-xl); line-height: 1.35; max-width: 26ch; font-weight: 520; font-stretch: 90%; letter-spacing: -0.01em; }
.auth-side .quiet { color: color-mix(in srgb, var(--bg) 62%, transparent); font-size: var(--fs-sm); max-width: 44ch; }
.auth-side .contours { position: absolute; right: -120px; bottom: -120px; width: 520px; height: 520px; opacity: .16; pointer-events: none; }
.auth-main { display: grid; place-items: center; padding: var(--space-10) var(--gutter); }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: var(--fs-2xl); font-stretch: 90%; letter-spacing: -0.02em; margin-bottom: var(--space-2); }
.auth-card .lead { color: var(--muted); margin-bottom: var(--space-6); }
.auth-alt { margin-top: var(--space-6); font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 899px) { .auth-wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; } .auth-main { place-items: start center; padding-top: var(--space-8); } .auth-side { padding: var(--space-6) var(--gutter); } .auth-side blockquote, .auth-side .quiet, .auth-side .contours { display: none; } }

.pub-nav { display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--gutter); height: 68px; max-width: var(--content-max); margin: 0 auto; }
.pub-nav .brand { border: 0; padding: 0; }
.pub-nav nav { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; }
.pub-nav nav a:not(.btn) { color: var(--ink-2); text-decoration: none; padding: 8px 10px; font-weight: 500; }
.pub-nav nav a:not(.btn):hover { color: var(--ink); }
@media (max-width: 599px) { .pub-nav nav .hide-sm { display: none; } }
.pub-nav nav a { white-space: nowrap; }
@media (max-width: 479px) {
  .pub-nav { gap: var(--space-2); }
  .pub-nav .brand-name small { display: none; }
  .pub-nav nav { gap: 2px; }
  .pub-nav nav a:not(.btn) { padding: 8px 6px; }
}
.hero { max-width: var(--content-max); margin: 0 auto; padding: var(--space-12) var(--gutter) var(--space-16); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: var(--space-10); align-items: center; }
.hero h1 { font-size: var(--fs-hero); line-height: .98; font-weight: 640; font-stretch: 78%; letter-spacing: -0.035em; margin-bottom: var(--space-5); max-width: 14ch; }
.hero p.lead { font-size: var(--fs-md); color: var(--ink-2); max-width: 52ch; margin-bottom: var(--space-6); }
.hero-proof { margin-top: var(--space-6); font-size: var(--fs-sm); color: var(--muted); display: flex; gap: var(--space-5); flex-wrap: wrap; }
.hero-proof span { display: inline-flex; gap: 6px; align-items: center; }
.hero-instrument { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); position: relative; }
.hero-instrument .caption { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--space-4); border-top: 1px dashed var(--line); padding-top: var(--space-3); }
@media (max-width: 899px) { .hero { grid-template-columns: minmax(0, 1fr); padding-top: var(--space-6); } }
.section { max-width: var(--content-max); margin: 0 auto; padding: var(--space-12) var(--gutter); border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-8); margin-bottom: var(--space-8); }
.section-head h2 { font-size: var(--fs-2xl); font-stretch: 85%; letter-spacing: -0.025em; line-height: 1.05; margin: 0; }
.section-head p { color: var(--ink-2); margin: 0; max-width: 60ch; }
@media (max-width: 767px) { .section-head { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); } }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.checklist > div { padding: var(--space-5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.checklist h3 { font-size: var(--fs-base); display: flex; gap: var(--space-2); align-items: center; }
.checklist p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.flow { list-style: none; counter-reset: f; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); }
.flow li { counter-increment: f; border-top: 2px solid var(--ink); padding-top: var(--space-4); }
.flow li::before { content: counter(f); font-weight: 650; font-stretch: 80%; font-size: var(--fs-xl); display: block; margin-bottom: var(--space-2); font-variant-numeric: tabular-nums; }
.flow h3 { font-size: var(--fs-base); }
.flow p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
@media (max-width: 899px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 479px) { .flow { grid-template-columns: minmax(0, 1fr); } }
.pub-footer { max-width: var(--content-max); margin: 0 auto; padding: var(--space-8) var(--gutter); color: var(--muted); font-size: var(--fs-sm); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* Help */
.doc { max-width: 76ch; }
.doc h2 { margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.doc h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.doc li { margin-bottom: 6px; }
.toc { position: sticky; top: calc(var(--topbar-h) + 16px); font-size: var(--fs-sm); }
.toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }

/* ---------- Research participant ------------------------------------------ */
.study { max-width: 760px; margin: 0 auto; padding: var(--space-8) var(--gutter) var(--space-16); }
.likert { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.likert label { display: grid; place-items: center; gap: 4px; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.likert label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.likert input { accent-color: var(--accent); }

/* ---------- Motion preferences --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Utility visibility */
@media (max-width: 767px) { .hide-sm { display: none !important; } }
@media (min-width: 768px) { .show-sm { display: none !important; } }

/* Additions */
.brand-mark { color: var(--accent); }
.notif-empty { padding: 8px 12px; margin: 0; }
@media (min-width: 1024px) { .pre-collapsed .shell { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); } }
.span-all { grid-column: 1 / -1; }

/* ---------- Developers page ----------------------------------------------- */
.dev-grid { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .dev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .dev-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dev-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6) var(--space-5) var(--space-5); display: flex; flex-direction: column; min-width: 0; }
/* The photo sits inside a dotted ring, the same mark the score gauge uses for coverage. */
.dev-photo { width: 128px; height: 128px; border-radius: 50%; padding: 7px; border: 2px dotted var(--line-strong, var(--muted)); margin-bottom: var(--space-5); }
.dev-photo img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--surface-3); }
.dev-name { font-size: var(--fs-lg, 1.25rem); margin: 0; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dev-title { margin: 4px 0 var(--space-5); color: var(--muted); font-size: var(--fs-sm); }
.dev-ids { margin: auto 0 0; padding-top: var(--space-3); border-top: 1px solid var(--line); display: grid; gap: var(--space-2); }
.dev-ids div { display: flex; justify-content: space-between; gap: var(--space-3); align-items: baseline; }
.dev-ids dt { color: var(--muted); font-size: var(--fs-sm); }
.dev-ids dd { margin: 0; font-family: var(--font-mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.footer-links { display: inline-flex; gap: var(--space-4); }
