/* ============================================================
   VibeMetricsAI — Local dashboard stylesheet
   Light, high-contrast, dependency-free design system.

   Token policy: the `--color-*` / `--space-*` / `--text-*` /
   `--radius-*` / `--shadow-*` names below are canonical. The short
   legacy names (--bg, --surface, --ink, --ok, …) remain as aliases so
   every rule in this file keeps resolving identically.
   ============================================================ */

:root {
  /* ---------- Color (canonical) ---------- */
  --color-background: #f2f5f9;
  --color-surface: #ffffff;
  --color-surface-subtle: #eef1f6;
  --color-ink: #101720;
  --color-ink-secondary: #37424f;
  --color-ink-muted: #5b6877;
  --color-line: #dce2ea;
  --color-line-strong: #c4cddb;
  --color-accent: #2350c9;
  --color-accent-hover: #1c43ab;
  --color-accent-ink: #ffffff;
  --color-accent-soft: #e8eefe;
  --color-success: #147a43;
  --color-success-soft: #e3f5ea;
  --color-warning: #98560a;
  --color-warning-soft: #fdf0da;
  --color-danger: #bb3724;
  --color-danger-soft: #fbeae7;
  --color-info: #3b62c4;
  --color-info-soft: #e8eefb;

  /* ---------- Typography ---------- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  --text-xs: 11.5px;
  --text-sm: 12.5px;
  --text-md: 13.5px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --leading-tight: 1.2;

  /* ---------- Spacing ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* ---------- Radii ---------- */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* ---------- Elevation ---------- */
  --shadow: 0 1px 2px rgba(16, 23, 32, 0.05), 0 4px 14px rgba(16, 23, 32, 0.05);
  --shadow-md: 0 2px 6px rgba(16, 23, 32, 0.07), 0 10px 26px rgba(16, 23, 32, 0.07);
  --shadow-focus: 0 0 0 3px rgba(35, 80, 201, 0.22);

  /* ---------- Layout ---------- */
  --container: 1120px;

  /* ---------- Legacy aliases (existing rules) ---------- */
  --bg: var(--color-background);
  --surface: var(--color-surface);
  --surface-2: var(--color-surface-subtle);
  --ink: var(--color-ink);
  --ink-2: var(--color-ink-secondary);
  --muted: var(--color-ink-muted);
  --line: var(--color-line);
  --line-strong: var(--color-line-strong);
  --accent: var(--color-accent);
  --accent-ink: var(--color-accent-ink);
  --accent-soft: var(--color-accent-soft);
  --ok: var(--color-success);
  --ok-soft: var(--color-success-soft);
  --warn: var(--color-warning);
  --warn-soft: var(--color-warning-soft);
  --danger: var(--color-danger);
  --danger-soft: var(--color-danger-soft);
  --info: var(--color-info);
  --info-soft: var(--color-info-soft);
  --font: var(--font-sans);
  --mono: var(--font-mono);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--color-accent-soft); color: var(--color-ink); }

a { color: var(--color-accent); text-underline-offset: 2px; }

h1, h2, h3, h4 { letter-spacing: -0.015em; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-line);
  border-radius: 5px;
  padding: 0.05em 0.4em;
  word-break: break-all;
}

.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.fine-print { font-size: 0.8em; }
.mute { color: var(--muted); }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--color-line);
  box-shadow: 0 1px 0 rgba(16, 23, 32, 0.03);
}

.site-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-ink);
  min-width: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--color-accent), #6d3ee0);
  box-shadow: 0 2px 6px rgba(35, 80, 201, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
}
/* The mark renders a "V" glyph without adding text to the DOM. */
.brand-mark::after {
  content: "V";
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.brand-name {
  display: block;
  font-weight: 750;
  font-size: 16.5px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.brand-tag {
  display: block;
  font-weight: 500;
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--color-ink-muted);
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: var(--color-ink-secondary);
  text-decoration: none;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  font-weight: 550;
  font-size: 14px;
  transition: background 120ms ease, color 120ms ease;
}

.nav-link:hover { background: var(--color-surface-subtle); color: var(--color-ink); }

.nav-link--active {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.nav-cta { margin-left: 6px; }

.nav-sep {
  width: 1px;
  height: 26px;
  background: var(--color-line);
  margin: 0 8px;
  flex: 0 0 auto;
}

/* ---------- Account chip ---------- */
.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 240px;
  padding: 5px 11px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  color: var(--color-ink-secondary);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-account::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  flex: 0 0 auto;
}

/* ---------- Mobile menu toggle ---------- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--color-accent); }
.nav-toggle-bars {
  display: grid;
  gap: 4px;
  width: 17px;
}
.nav-toggle-bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--color-ink-secondary);
  transition: transform 140ms ease, opacity 140ms ease;
}
.site-header[data-menu-open="true"] .nav-toggle-bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.site-header[data-menu-open="true"] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.site-header[data-menu-open="true"] .nav-toggle-bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.brand-text { display: grid; min-width: 0; }

/* ---------- Layout ---------- */
.page-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 24px 8px;
}

.page-head {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0 0 5px;
  font-size: var(--text-2xl);
  font-weight: 750;
  line-height: var(--leading-tight);
  letter-spacing: -0.022em;
}

.page-sub { margin: 0; max-width: 72ch; font-size: 14px; }

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.crumbs { margin: 0 0 12px; font-size: 12.5px; color: var(--color-ink-muted); }

.site-footer {
  max-width: var(--container);
  margin: 44px auto 0;
  padding: 24px 24px 44px;
  border-top: 1px solid var(--color-line);
  font-size: 12.5px;
  color: var(--color-ink-muted);
}
.site-footer p { margin: 0; max-width: 92ch; }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.card--muted { background: var(--color-surface-subtle); box-shadow: none; }
.card--panel { padding: 0 22px 18px; }

.card-title {
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--color-ink);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 12px;
}

.panel-head .card-title { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) { transform: translateY(1px); }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn--primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  box-shadow: 0 1px 2px rgba(35, 80, 201, 0.28);
}
.btn--primary:hover:not(:disabled) { background: var(--color-accent-hover); box-shadow: 0 2px 8px rgba(35, 80, 201, 0.32); }

.btn--ghost { background: var(--color-surface); color: var(--color-ink-secondary); border-color: var(--color-line-strong); }
.btn--ghost:hover:not(:disabled) { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-soft); }

.btn--danger { background: var(--color-danger); color: #fff; box-shadow: 0 1px 2px rgba(187, 55, 36, 0.28); }
.btn--danger:hover:not(:disabled) { background: #9e2c1c; }

.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--lg { padding: 12px 22px; font-size: 15px; }

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
/* Soft top accent keeps the grid lively without implying any metric. */
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), rgba(109, 62, 224, 0.55));
  opacity: 0.9;
}

.stat-label { margin: 0 0 6px; font-size: var(--text-sm); color: var(--color-ink-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-value { margin: 0; font-size: 30px; font-weight: 780; line-height: 1.05; letter-spacing: -0.025em; }
.stat-sub { margin: 6px 0 0; font-size: var(--text-sm); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* Coverage: plain-language note when some checks could not be executed. */
.coverage-note {
  margin: 8px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-info);
  border-radius: var(--radius-sm);
  background: var(--color-info-soft);
  color: var(--color-ink-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}

.data-table thead th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
  color: var(--color-ink-muted);
  border-bottom: 1px solid var(--color-line-strong);
  white-space: nowrap;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table tbody tr:hover { background: #f7f9fc; }

.target-cell { max-width: 320px; }
.job-id { font-weight: 600; color: var(--ink); }
.link { text-decoration: none; font-weight: 500; }

.table-actions { white-space: nowrap; }

@media (max-width: 720px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td, .data-table th { display: block; width: 100%; }
  .data-table tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 10px; }
  .data-table td, .data-table th { border: 0; padding: 4px 0; }
  .data-table td[data-label]::before {
    content: attr(data-label);
    display: inline-block;
    width: 88px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }
  .data-table th[scope="row"] { font-weight: 600; }
}

/* ---------- Badges / pills / tags ---------- */
.badge, .pill, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge { padding: 5px 10px; border: 1px solid transparent; }

.badge--queued, .tag--blocked { background: var(--info-soft); color: var(--ink-2); border-color: var(--line-strong); }
.badge--running { background: var(--accent-soft); color: var(--accent); }
.badge--completed { background: var(--ok-soft); color: var(--ok); }
.badge--failed { background: var(--danger-soft); color: var(--danger); }
.badge--cancelled { background: var(--surface-2); color: var(--muted); }
.badge--timed_out { background: var(--warn-soft); color: var(--warn); }

.pill { padding: 4px 9px; border: 1px solid var(--line-strong); color: var(--ink-2); }

.pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
}
.pill--critical { border-color: #b93b2c; color: #992e21; background: #fdf0ee; }
.pill--critical .pill-dot { background: #c23b27; }
.pill--high { border-color: #d69a2d; color: #8a5a00; background: #fdf4e2; }
.pill--high .pill-dot { background: #d97706; }
.pill--medium { border-color: #d9b13c; color: #7c5b00; background: #fcf7e3; }
.pill--medium .pill-dot { background: #b58900; }
.pill--low { border-color: #5f8fdc; color: #1e4a9e; background: #edf3fd; }
.pill--low .pill-dot { background: #2563eb; }
.pill--info { border-color: var(--line-strong); color: var(--muted); background: var(--surface); }

.tag { padding: 3px 8px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

.tag--new { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag--resolved { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag--not_tested, .tag--not_testable { background: var(--surface-2); color: var(--muted); }
.tag--not_comparable { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag--changed { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag--unchanged { background: var(--surface-2); color: var(--muted); }
.tag--passed, .tag--completed { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag--failed { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag--warning, .tag--inconclusive { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag--blocked, .tag--queued, .tag--running { background: var(--info-soft); color: var(--ink-2); border-color: var(--line); }
.tag--good { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag--degraded { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag--critical { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag--unknown { background: var(--surface-2); color: var(--muted); }
.tag--success { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag--unavailable, .tag--timeout, .tag--rate_limited, .tag--provider_error,
.tag--malformed_response { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag--invalid_target, .tag--skipped { background: var(--surface-2); color: var(--muted); border-color: transparent; }
.tag--agrees, .tag--supports { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag--conflicts { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag--no_comparison, .tag--native_only, .tag--external_only { background: var(--surface-2); color: var(--muted); border-color: transparent; }

/* ---------- Score ---------- */
.score-block { text-align: center; }

.score-label { margin: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.score-value {
  margin: 8px 0 0;
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}

.score-max { font-size: 20px; color: var(--muted); font-weight: 600; }
.score-note { margin: 8px 0 0; font-size: 12.5px; }

/* ---------- Severity ---------- */
.severity-row { display: flex; gap: 10px; flex-wrap: wrap; }
.severity-count { display: inline-flex; }

/* ---------- Coverage ---------- */
.coverage-bar {
  height: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0 8px;
}

.coverage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #4f7ce8);
  border-radius: 999px;
}

.coverage-caption { margin: 0 0 14px; font-size: 12.5px; }

/* ---------- Phases ---------- */
.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.phase-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.phase-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.phase-reason { font-size: 12px; color: var(--warn); margin: 6px 0 0; word-break: break-word; }

/* ---------- Scope ---------- */
.module-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.module-list { margin: 4px 0 0; padding-left: 18px; }
.module-list li { margin: 3px 0; }

/* ---------- States ---------- */
.state {
  text-align: center;
  padding: 46px 24px;
  background: var(--color-surface);
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-lg);
}

.state-title { margin: 0 0 6px; font-size: 16.5px; font-weight: 680; }
.state-note { margin: 0 auto; max-width: 54ch; font-size: 14px; }
.state-action { margin: 16px 0 0; }

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 14px;
  border: 3px solid var(--color-line);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--sm { width: 14px; height: 14px; margin: 0; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Alerts ---------- */
.alert {
  border: 1px solid;
  border-radius: var(--radius);
  padding: 13px 15px;
  margin: 0 0 16px;
  font-size: 14px;
}

.alert-title { margin: 0 0 4px; font-weight: 700; }

.alert--error { background: var(--color-danger-soft); border-color: #e5b3ab; color: #7c2417; }
.alert--warn { background: var(--color-warning-soft); border-color: #e9cf9e; }
.alert--info { background: var(--color-info-soft); border-color: var(--color-line-strong); }
.alert--ok { background: var(--color-success-soft); border-color: #b7dfc6; }

.error-code { margin: 6px 0 0; font-size: 12.5px; }
.error-code code { background: transparent; border: 0; padding: 0; }

/* ---------- Forms ---------- */
.form-card { margin-bottom: 18px; }

fieldset.field { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }

.field-label,
.form-label {
  display: block;
  font-weight: 600;
  margin: 0 0 6px;
  font-size: 13.5px;
  color: var(--color-ink);
}

.required-mark { color: var(--color-danger); }

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
select,
textarea {
  font: inherit;
  font-size: 14px;
  color: var(--color-ink);
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  width: 100%;
  max-width: 560px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea { resize: vertical; min-height: 72px; line-height: 1.5; }

input::placeholder, textarea::placeholder { color: #8b97a5; }

input:focus, select:focus, textarea:focus {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-focus);
  outline: none;
}

/* Gate policy form uses .form-control on selects/inputs. */
.form-control { max-width: 100%; }

.form-check-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 7px 0;
}
.form-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--color-accent);
  flex: 0 0 auto;
  cursor: pointer;
}

input[disabled], select[disabled], textarea[disabled] {
  background: var(--color-surface-subtle);
  color: var(--color-ink-muted);
  cursor: not-allowed;
}

/* Findings filter bar — responsive grid that stacks on small screens. */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}
.filter-bar input,
.filter-bar select {
  width: 100%;
}
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
@media (max-width: 480px) {
  .filter-bar { grid-template-columns: 1fr; }
  .filter-actions { flex-wrap: wrap; }
  .filter-actions .btn { flex: 1; }
}

/* Phase 33 public website: independent from the authenticated app shell. */
.public-home { color: #152337; }
.public-nav, .public-footer, .public-home > section { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.public-nav { height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #e3e9ef; }
.public-nav-toggle { display: none; }
.public-nav nav, .public-footer > div, .public-auth-links { display: flex; align-items: center; gap: clamp(16px, 2.5vw, 34px); }
.public-nav a, .public-footer a { color: #526174; text-decoration: none; font-size: 13px; font-weight: 600; transition: color .18s ease; }
.public-nav a:hover, .public-footer a:hover { color: #1f55ad; }
.public-nav .public-signup { padding: 10px 14px; border: 1px solid #cbd8e7; border-radius: 7px; color: #234f8f; }
.public-brand { display: inline-flex; align-items: center; gap: 10px; color: #14243a !important; text-decoration: none; font-weight: 750; letter-spacing: -.035em; white-space: nowrap; }
.public-logo { width: 30px; height: 30px; display: inline-grid; place-items: center; color: #fff; background: #2156ad; border-radius: 9px; font-size: 16px; font-weight: 800; box-shadow: 0 4px 10px #2156ad30; }
.button { min-height: 44px; padding: 0 18px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 8px; color: #fff; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease; }
.button-primary { color: #fff !important; background: #2256ad; box-shadow: 0 3px 8px #2256ad28; }
.button-primary:hover { background: #173f86; box-shadow: 0 5px 13px #2256ad36; }
.button-outline { color: #1e4d94; border-color: #bbcade; background: #fff; }
.button-outline:hover { border-color: #2256ad; background: #f5f8fc; }
.button:focus-visible, .public-nav a:focus-visible, .public-footer a:focus-visible, .faq-list summary:focus-visible { outline: 3px solid #74a7ea; outline-offset: 3px; }
.hero-section { min-height: 548px; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(360px, .96fr); align-items: center; gap: 56px; padding-block: 72px 76px; }
.hero-copy { max-width: 580px; }
.eyebrow { margin: 0 0 16px; color: #2155a2; font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%; background: #2d9b78; box-shadow: 0 0 0 3px #2d9b781c; }
.hero-copy h1 { max-width: 600px; margin: 0; color: #14243a; font-size: clamp(42px, 5.1vw, 66px); font-weight: 750; letter-spacing: -.058em; line-height: 1.04; }
.hero-copy h1 span { color: #2256ad; }
.hero-lede { max-width: 510px; margin: 22px 0 26px; color: #536477; font-size: 16px; line-height: 1.7; }
.scan-entry { padding: 17px; border: 1px solid #dfe6ee; border-radius: 12px; background: #fff; box-shadow: 0 12px 32px #2037530d; }
.scan-entry label { display: block; margin: 0 0 9px 2px; color: #24364b; font-size: 12px; font-weight: 700; }
.scan-entry-row { display: flex; gap: 9px; align-items: center; }
.scan-entry-row input { min-width: 0; flex: 1; height: 46px; padding: 0 12px 0 35px; border: 1px solid #ccd7e2; border-radius: 7px; color: #192b40; background: #fff; font: inherit; font-size: 14px; outline: none; }
.scan-entry-row input:focus { border-color: #2868bf; box-shadow: 0 0 0 3px #2868bf22; }
.scan-entry-row input[aria-invalid="true"] { border-color: #b33b34; }
.url-icon { position: absolute; margin-left: 13px; color: #70839a; font-size: 15px; pointer-events: none; }
.scan-entry-row .button { min-height: 46px; white-space: nowrap; }
.scan-entry-row .button:disabled { cursor: progress; opacity: .68; }
.scan-help { margin: 10px 2px 0; color: #617185; font-size: 11px; line-height: 1.5; }
.form-message { min-height: 0; margin: 0; color: #a32e29; font-size: 12px; }
.form-message:not(:empty) { margin: 9px 2px 0; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 19px; color: #576a7d; font-size: 11px; font-weight: 650; }
.hero-trust span::before { content: "✓"; margin-right: 6px; color: #2b8c6b; font-weight: 800; }
.hero-visual { position: relative; display: grid; place-items: center; min-width: 0; }
.report-window { position: relative; z-index: 1; width: min(100%, 450px); overflow: hidden; border: 1px solid #dce5ed; border-radius: 13px; background: #fff; box-shadow: 0 24px 60px #17355318, 0 4px 12px #1735530c; }
.window-top { height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-bottom: 1px solid #e9eef3; color: #77869a; font-size: 9px; }
.window-dots { display: flex; gap: 4px; }.window-dots i { width: 6px; height: 6px; border-radius: 50%; background: #cbd5df; }.window-dots i:first-child { background: #e3a67d; }.window-lock { color: #3b8d78; font-size: 15px; }
.report-target { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; }
.target-monogram { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #edf3fb; color: #285a9e; font-size: 13px; font-weight: 800; }
.report-target > div { min-width: 0; flex: 1; }.report-target strong, .report-target small { display: block; overflow-wrap: anywhere; }.report-target strong { color: #26394f; font: 650 12px var(--font-mono); }.report-target small { margin-top: 5px; color: #78879a; font-size: 9px; }
.report-state { padding: 5px 8px; border-radius: 99px; color: #657489; background: #f1f4f7; font-size: 9px; font-weight: 750; }
.report-rule { height: 1px; background: #e9eef3; }
.report-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 17px 18px; }.report-summary small, .report-summary strong { display: block; }.report-summary small { margin-bottom: 5px; color: #7a899a; font-size: 9px; }.report-summary strong { color: #293d53; font-size: 12px; }
.sample-finding { margin: 0 15px; padding: 15px; border: 1px solid #e4eaf0; border-radius: 9px; background: #fcfdfe; }.sample-finding-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }.severity-tag { padding: 4px 7px; border-radius: 4px; font-size: 9px; font-weight: 750; }.severity-observation { color: #76530d; background: #faf1da; }.sample-id { color: #8391a0; font: 9px var(--font-mono); }.sample-finding > strong { display: block; color: #293d53; font-size: 12px; }.sample-finding p { margin: 6px 0 11px; color: #6a7a8b; font-size: 10px; line-height: 1.55; }.evidence-line { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid #e7edf2; border-radius: 5px; color: #5f7185; background: #f7f9fb; }.evidence-line span { color: #368f79; }.evidence-line code { min-width: 0; overflow-wrap: anywhere; font-size: 9px; }
.sample-foot { padding: 15px 18px 17px; color: #64758a; font-size: 9px; }.mini-check { margin-right: 5px; color: #248463; font-weight: 800; }
.hero-ornament { position: absolute; right: -32px; bottom: -36px; width: 160px; stroke: #7cb6ad; stroke-width: 1; fill: none; opacity: .38; }
.scope-band { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 18px; align-items: start; margin-block: 4px 80px !important; padding: 23px 25px; border: 1px solid #d7e5e8; border-radius: 10px; background: #f1f8f7; }
.scope-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #267861; background: #dff1eb; font-size: 20px; }.scope-band h2 { margin: 0 0 7px; color: #20384a; font-size: 15px; }.scope-band p { max-width: 790px; margin: 0; color: #596e7b; font-size: 12px; line-height: 1.65; }.scope-band > a { align-self: center; color: #22644f; font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.content-section, .how-section, .faq-section { padding-block: 70px; border-top: 1px solid #e7edf1; }
.section-heading { max-width: 700px; margin-bottom: 30px; }.section-heading h2, .evidence-copy h2, .account-band h2 { margin: 0; color: #172a40; font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -.045em; line-height: 1.12; }.section-heading > p:last-child { max-width: 650px; margin: 13px 0 0; color: #607185; font-size: 14px; line-height: 1.7; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }.check-card { min-height: 196px; padding: 20px; border: 1px solid #e0e7ed; border-radius: 9px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }.check-card:hover { border-color: #b4cadf; box-shadow: 0 8px 20px #1e3b570c; }.check-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 19px; border-radius: 8px; font-size: 18px; font-weight: 700; }.icon-blue { color: #2256ad; background: #eaf1fb; }.icon-teal { color: #207c69; background: #e8f5f1; }.icon-violet { color: #6552a7; background: #f0edfa; }.icon-amber { color: #916415; background: #fbf4e4; }.check-card h3 { margin: 0; color: #263b51; font-size: 13px; }.check-card p { min-height: 56px; margin: 8px 0 14px; color: #68798b; font-size: 11px; line-height: 1.6; }.mode-label { display: inline-block; padding: 5px 7px; border-radius: 4px; color: #36659f; background: #edf3fa; font-size: 9px; font-weight: 700; }.mode-verified { color: #765717; background: #faf3e3; }
.how-section { background: #f7f9fb; }.steps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }.steps-grid article { padding: 12px 0 9px; border-top: 1px solid #cad5df; }.step-number { color: #2b68b6; font: 700 11px var(--font-mono); }.steps-grid h3 { margin: 22px 0 8px; color: #263c52; font-size: 15px; }.steps-grid p { max-width: 310px; margin: 0; color: #647589; font-size: 12px; line-height: 1.7; }
.evidence-section { display: grid; grid-template-columns: 1fr .85fr; align-items: center; gap: 80px; padding-block: 85px !important; }.evidence-copy > p:not(.eyebrow) { max-width: 560px; color: #607185; font-size: 13px; line-height: 1.75; }.evidence-visual { display: grid; gap: 12px; }.evidence-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #e0e7ee; border-radius: 8px; background: #fff; box-shadow: 0 6px 16px #17355308; }.evidence-card-offset { margin-left: 28px; }.evidence-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 8px; color: #245aa6; background: #eaf1fb; font: 700 13px var(--font-mono); }.evidence-mark-teal { color: #267b67; background: #e8f5f1; }.evidence-mark-violet { color: #6651a8; background: #f1eef9; }.evidence-card div { flex: 1; }.evidence-card strong, .evidence-card small { display: block; }.evidence-card strong { color: #293d53; font-size: 11px; }.evidence-card small { margin-top: 4px; color: #77889a; font-size: 10px; }.evidence-card b { color: #8594a3; font: 10px var(--font-mono); }
.account-band { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 28px 30px; border: 1px solid #dfe7ed; border-radius: 10px; background: linear-gradient(105deg, #f4f8fc, #f5faf8); }.account-band .eyebrow { margin-bottom: 9px; }.account-band h2 { font-size: 24px; }.account-band p:not(.eyebrow) { max-width: 660px; margin: 9px 0 0; color: #627386; font-size: 12px; line-height: 1.65; }.account-band .button { flex: 0 0 auto; }
.faq-section { padding-bottom: 88px; }.faq-list { max-width: 850px; border-top: 1px solid #dfe6ec; }.faq-list details { border-bottom: 1px solid #dfe6ec; }.faq-list summary { position: relative; padding: 19px 36px 19px 0; color: #263a50; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }.faq-list summary::-webkit-details-marker { display: none; }.faq-list summary::after { content: "+"; position: absolute; right: 5px; top: 15px; color: #476483; font-size: 19px; font-weight: 400; }.faq-list details[open] summary::after { content: "−"; }.faq-list details p { max-width: 760px; margin: -3px 0 18px; color: #627386; font-size: 12px; line-height: 1.7; }
.public-footer { min-height: 105px; display: flex; align-items: center; justify-content: space-between; gap: 26px; border-top: 1px solid #e4eaf0; }.public-footer p { max-width: 410px; color: #6b7b8d; font-size: 10px; line-height: 1.6; }.public-footer > div { gap: 18px; }.public-footer > div a { font-size: 10px; }
.guest-page { width: min(940px, calc(100% - 40px)); margin: 42px auto 80px; }.guest-page h1 { color: #172a40; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }.guest-status { padding: 18px; border: 1px solid #dde6ed; border-radius: 9px; background: #fff; }.guest-status[aria-busy="true"] { border-color: #c8d7e7; }.guest-findings { display: grid; gap: 12px; }.guest-finding { padding: 18px; border: 1px solid #dfe6ed; border-radius: 9px; background: #fff; overflow-wrap: anywhere; }.guest-finding h3 { margin: 10px 0 6px; color: #243a50; font-size: 15px; }.guest-finding p { color: #5e7184; font-size: 12px; line-height: 1.65; }.guest-evidence { margin-top: 10px; padding: 11px; border-radius: 6px; background: #f4f7f9; color: #526679; font: 11px/1.6 var(--font-mono); overflow-wrap: anywhere; }.guest-cta { margin-top: 22px; padding: 18px; border-radius: 9px; background: #f0f6f7; color: #314c5c; }.guest-cta p { margin: 5px 0 12px; font-size: 12px; line-height: 1.65; }
@media (max-width: 980px) { .hero-section { gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(330px, .9fr); }.public-nav nav { gap: 16px; }.public-nav nav a { font-size: 11px; }.check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.check-card { min-height: 170px; }.check-card p { min-height: auto; } }
@media (max-width: 700px) { .public-nav, .public-footer, .public-home > section { width: min(100% - 32px, 560px); }.public-nav { position: relative; height: 68px; gap: 10px; }.public-nav-toggle { display: inline-flex; min-height: 38px; align-items: center; padding: 0 11px; border: 1px solid #d7e0e8; border-radius: 7px; color: #344a60; background: white; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }.public-nav nav { display: none; }.public-nav[data-menu-open="true"] nav { position: absolute; z-index: 5; top: 58px; left: 0; right: 0; display: grid; gap: 0; padding: 8px 14px; border: 1px solid #dce5ed; border-radius: 8px; background: #fff; box-shadow: 0 12px 28px #17355318; }.public-nav[data-menu-open="true"] nav a { padding: 12px 0; font-size: 12px; }.public-auth-links { gap: 8px; margin-left: auto; }.public-nav .public-auth-links a { font-size: 11px; }.public-nav .public-signup { padding: 8px 9px; }.nav-scan { display: none; }.hero-section { display: flex; flex-direction: column; align-items: stretch; gap: 38px; padding-block: 55px 60px; }.hero-copy h1 { font-size: clamp(42px, 12vw, 58px); }.hero-lede { font-size: 14px; }.scan-entry { padding: 13px; }.scan-entry-row { align-items: stretch; flex-direction: column; }.scan-entry-row input { flex: none; width: 100%; box-sizing: border-box; }.scan-entry-row .button { width: 100%; box-sizing: border-box; }.url-icon { margin-top: 15px; }.hero-trust { gap: 10px 16px; }.hero-visual { min-height: 330px; }.report-window { width: 100%; }.hero-ornament { right: -12px; }.scope-band { grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 17px; margin-bottom: 56px !important; }.scope-band > a { grid-column: 2; }.content-section, .how-section, .faq-section { padding-block: 54px; }.check-grid { grid-template-columns: 1fr; }.check-card { min-height: 0; }.steps-grid { grid-template-columns: 1fr; gap: 14px; }.steps-grid article { padding: 17px 0; }.steps-grid h3 { margin: 10px 0 6px; }.evidence-section { grid-template-columns: 1fr; gap: 24px; padding-block: 58px !important; }.account-band { align-items: flex-start; flex-direction: column; padding: 22px; }.public-footer { align-items: flex-start; flex-direction: column; padding-block: 22px; gap: 12px; }.public-footer p { margin: 0; }.public-footer > div { flex-wrap: wrap; }.faq-section { padding-bottom: 62px; } }
@media (prefers-reduced-motion: reduce) { .public-nav a, .public-footer a, .button, .check-card { transition: none; } }
.guest-verify { margin-top: 24px; padding: 20px; border: 1px solid #d9e6e5; border-radius: 9px; background: #f6faf9; }.guest-verify h2 { margin: 0 0 8px; color: #20384a; font-size: 18px; }.guest-verify > p:not(.eyebrow), .guest-proof p { color: #5e7181; font-size: 12px; line-height: 1.65; }.guest-verify form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }.guest-verify label { width: 100%; color: #34495b; font-size: 11px; font-weight: 700; }.guest-verify select { min-height: 42px; min-width: 190px; padding: 0 10px; border: 1px solid #cbd8df; border-radius: 6px; background: #fff; color: #293e52; font: inherit; font-size: 12px; }.guest-proof { margin-top: 14px; padding: 14px; border: 1px solid #dce6e8; border-radius: 7px; background: #fff; }.guest-proof code { overflow-wrap: anywhere; color: #294d68; }

.field-error { margin: 6px 0 0; color: var(--danger); font-size: 13px; font-weight: 500; }
.field-warn { margin: 8px 0 0; color: var(--warn); font-size: 13px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 18px; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; max-width: 520px; }

.check {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
  margin-bottom: 12px;
  cursor: pointer;
}

.check input { width: 16px; height: 16px; accent-color: var(--accent); margin-right: 8px; }
.check span { font-weight: 500; }
.check-help { margin: 2px 0 0; font-size: 12.5px; max-width: 64ch; }

.checks-column { margin-top: 6px; }

.error-summary {
  background: var(--danger-soft);
  border: 1px solid #e5b3ab;
  color: #7c2417;
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 34px;
  font-size: 13.5px;
}

.form-actions { display: flex; gap: 12px; margin-top: 4px; }

/* ---------- Progress ---------- */
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-indicator { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.progress-phases { display: grid; gap: 8px; margin: 14px 0 4px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.progress-phase { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; }
.phase-label { font-weight: 600; }

/* ---------- Job header ---------- */
.job-header-card .card-title { margin: 0 0 8px; }

.job-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin: 12px 0 0;
}

.job-facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.job-facts dd { margin: 2px 0 0; font-size: 14px; word-break: break-word; }

/* ---------- Tabs ---------- */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-line-strong);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-link {
  padding: 9px 15px;
  text-decoration: none;
  color: var(--color-ink-secondary);
  font-weight: 550;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 7px 7px 0 0;
  transition: color 120ms ease, background 120ms ease;
}

.tab-link:hover { color: var(--color-accent); background: var(--color-accent-soft); }

.tab-link--active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  font-weight: 650;
}
.tab-link--active:hover { background: transparent; }

/* ---------- Findings ---------- */
.finding-list { display: grid; gap: 14px; }

.finding-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.finding-title { margin: 0; font-size: 17px; letter-spacing: -0.01em; }
.finding-dedup { margin: 4px 0 0; font-size: 12px; }
.finding-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.finding-description { margin: 0 0 12px; color: var(--ink-2); }

.finding-details {
  display: grid;
  gap: 6px 18px;
  margin: 0 0 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.finding-details dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.finding-details dd { margin: 2px 0 0; font-size: 13.5px; }
.finding-details dd code { background: transparent; border: 0; padding: 0; }

.finding-remediation {
  background: var(--ok-soft);
  border: 1px solid #b7dfc6;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13.5px;
}

.finding-remediation strong { color: var(--ok); }

.fix-prompt { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.fix-prompt-panel { display: grid; gap: 10px; margin-top: 12px; }
.fix-prompt-panel h3, .fix-prompt-panel p { margin: 0; }
.fix-prompt-preview { width: 100%; min-height: 280px; max-height: 65vh; resize: vertical; overflow: auto; white-space: pre-wrap; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.fix-prompt-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.rule-id { margin-right: 4px; }

/* ---------- Evidence ---------- */
.evidence-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }

.evidence-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.evidence-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 6px; }
.evidence-top time { font-size: 12px; }
.evidence-summary { margin: 0; font-size: 14px; }

.evidence-details-wrap { margin-top: 8px; font-size: 13px; }
.evidence-details-wrap summary { cursor: pointer; color: var(--accent); font-weight: 500; }

.evidence-details {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  max-height: 320px;
  overflow-y: auto;
}

.evidence-details code { background: transparent; border: 0; padding: 0; }

/* ---------- Comparison ---------- */
.verdict {
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 18px;
}

.verdict-title { margin: 0; font-size: 18px; font-weight: 750; }

.banner--regression { background: var(--danger-soft); border-color: #e5b3ab; color: #7c2417; }
.banner--ok { background: var(--ok-soft); border-color: #b7dfc6; color: #0f6b38; }
.banner--muted { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }

.verdict-reasons { margin-top: 8px; }
.reason-list { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; }

.delta-up { color: var(--ok); font-weight: 600; }
.delta-down { color: var(--danger); font-weight: 600; }
.delta-flat { color: var(--muted); }
.dir-note { font-size: 12px; }
.unchanged-line { margin: 0 0 10px; }

/* ---------- Misc ---------- */
.noscript-note { max-width: 1080px; margin: 20px auto 0; padding: 12px 20px; color: var(--warn); }
.flex-wrap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.summary-row { margin-bottom: 14px; font-size: 13.5px; }

/* ---------- Auth / account ---------- */
.auth-page {
  min-height: 100vh;
  max-width: 440px;
  margin: 0 auto;
  padding: 7vh 20px 60px;
  display: grid;
  gap: 14px;
  align-content: start;
}

/* Decorative product line above the auth card — no markup change needed. */
.auth-page::before {
  content: "VibeMetricsAI · Security & Readiness Platform";
  display: block;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
  padding-top: 8px;
}

.auth-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px 26px 28px;
}
.auth-card .card-title { font-size: 21px; margin-bottom: 6px; }
.auth-card .page-sub { font-size: 13.5px; margin-bottom: 18px; }
.auth-card .form-actions { margin-top: 20px; }
.auth-card .form-actions .btn { width: 100%; }
.auth-card .field-label { font-size: 13.5px; }
.auth-card input[type="email"],
.auth-card input[type="password"] { max-width: 100%; font-size: 15px; padding: 11px 12px; }

.card--error { border-color: #e5b3ab; background: var(--color-danger-soft); color: #7c2417; margin-bottom: 14px; }

.auth-switch { margin: 16px 0 0; font-size: 13.5px; text-align: center; }

.form-sublabel { font-size: 12.5px; color: var(--color-ink-muted); margin: -6px 0 0; }

.inline-rename { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-rename input { flex: 1 1 200px; max-width: 280px; }

/* ---------- Visually hidden (aria-live / decorative glyphs) ---------- */
/* Used by the scan-detail live region. It must exist in the DOM (so assistive
   tech can announce it) but must never occupy layout. */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Status chips ---------- */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-chip--queued,
.status-chip--pending { color: var(--muted); }
.status-chip--running { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }
.status-chip--completed { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-soft); }
.status-chip--failed,
.status-chip--timed_out { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-soft); }
.status-chip--cancelled,
.status-chip--expired,
.status-chip--skipped { color: var(--muted); background: var(--surface-2); }
.status-chip--pass { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-soft); }
.status-chip--fail { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-soft); }

/* ---------- Quality gate result ---------- */
.gate-result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.gate-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 8px 0 0; }
.gate-facts > div { display: flex; gap: 6px; align-items: baseline; }
.gate-facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.gate-facts dd { margin: 0; font-size: 13px; }
.gate-facts code { font-size: 12.5px; }
.gate-summary { margin: 12px 0 6px; font-size: 13px; }
.gate-policy-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; font-size: 12px; color: var(--muted); }
.badge--policy { background: var(--surface-2); color: var(--ink-2); border-color: var(--line-strong); font-size: 11.5px; }
.gate-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gate-rule {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
}
.gate-rule-glyph {
  flex: 0 0 18px; width: 18px; height: 18px; line-height: 18px;
  text-align: center; border-radius: 999px; font-size: 12px; font-weight: 700; margin-top: 1px;
}
.gate-rule--pass .gate-rule-glyph { background: var(--ok-soft); color: var(--ok); }
.gate-rule--fail .gate-rule-glyph { background: var(--danger-soft); color: var(--danger); }
.gate-rule--not-evaluated .gate-rule-glyph { background: var(--surface-2); color: var(--muted); }
.gate-rule-main { min-width: 0; flex: 1; }
.gate-rule-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.gate-rule-name { margin: 0; font-size: 13.5px; }
.gate-rule-verdict { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.gate-rule--pass .gate-rule-verdict { color: var(--ok); }
.gate-rule--fail .gate-rule-verdict { color: var(--danger); }
.gate-rule--not-evaluated .gate-rule-verdict { color: var(--muted); }
.gate-rule-detail { margin: 0 0 2px; font-size: 13px; }
.gate-rule-facts { margin: 0; font-size: 12px; color: var(--muted); }
.gate-rule-facts code { font-size: 11.5px; }

/* Small inverted-margin helper so a result card can sit below the form. */
.mt-4 { margin-top: 20px; }
@media (max-width: 479px) {
  .gate-result-head { flex-direction: column; }
  .gate-facts { gap: 6px 14px; }
  .gate-rule-head { flex-direction: column; align-items: flex-start; gap: 0; }
}

/* Small inline spinner, sized for chip use. */
.spinner--sm {
  width: 11px;
  height: 11px;
  border-width: 2px;
}

/* ---------- Card head rows ---------- */
.card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.card-head-row .card-title { margin: 0; }

/* ---------- Scan summary / progress facts ---------- */
.scan-target { margin: 4px 0 0; font-size: 14px; word-break: break-word; }

.scan-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 16px;
  margin: 14px 0 0;
}
.scan-facts--stack { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.scan-facts dt {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.scan-facts dd { margin: 3px 0 0; font-size: 14px; word-break: break-word; }
.scan-facts dd:empty::before { content: "\2014"; color: var(--muted); }

.scan-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.scan-progress-head .card-title { margin: 0; }

/* ---------- Module pipeline ---------- */
/* Colour is NEVER the only signal: every row carries a glyph AND a text state
   label, so the pipeline reads correctly in greyscale and for colour-blind users. */
.module-pipeline {
  list-style: none;
  margin: 16px 0 4px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.module-row {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.module-row--pending { background: var(--surface-2); border-style: dashed; border-left-style: solid; }
.module-row--completed { border-left-color: var(--ok); }
.module-row--running { border-left-color: var(--accent); background: var(--accent-soft); }
.module-row--blocked { border-left-color: var(--warn); background: var(--warn-soft); }
.module-row--not_configured,
.module-row--skipped { border-left-color: var(--line-strong); background: var(--surface-2); }
.module-row--failed { border-left-color: var(--danger); background: var(--danger-soft); }

.module-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
}
.module-row--completed .module-glyph { color: var(--ok); border-color: var(--ok); }
.module-row--running .module-glyph { color: var(--accent); border-color: var(--accent); }
.module-row--blocked .module-glyph { color: var(--warn); border-color: var(--warn); }
.module-row--failed .module-glyph { color: var(--danger); border-color: var(--danger); }

.module-main { min-width: 0; }
.module-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.module-name { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }

.module-state-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.module-row--completed .module-state-label { color: var(--ok); }
.module-row--running .module-state-label { color: var(--accent); }
.module-row--blocked .module-state-label { color: var(--warn); }
.module-row--failed .module-state-label { color: var(--danger); }

.module-detail { margin: 5px 0 0; font-size: 13px; color: var(--ink-2); word-break: break-word; }
.module-elapsed { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Per-check detail (finished modules only) ---------- */
.check-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 4px;
}
.check-item {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 8px;
  align-items: baseline;
  font-size: 12.5px;
}
.check-glyph { font-weight: 700; color: var(--muted); }
.check-item--passed .check-glyph { color: var(--ok); }
.check-item--failed .check-glyph { color: var(--danger); }
.check-item--warning .check-glyph { color: var(--warn); }
.check-name { min-width: 0; word-break: break-word; }
.check-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.check-item--passed .check-status { color: var(--ok); }
.check-item--failed .check-status { color: var(--danger); }
.check-item--warning .check-status { color: var(--warn); }

/* ---------- Findings preview rows ---------- */
.finding-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.finding-row:last-child { border-bottom: 0; }
.finding-row .finding-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  word-break: break-word;
}
.pill-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}

/* ---------- Scan card wrappers ---------- */
.scan-summary-card,
.scan-progress-card,
.scan-modules-card { scroll-margin-top: 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .page-wrap { padding: 20px 14px 8px; }
  .page-title { font-size: 22px; }
  .card { padding: 15px 15px; }

  .scan-facts,
  .scan-facts--stack,
  .job-facts { grid-template-columns: 1fr 1fr; gap: 10px; }

  .module-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 11px 12px;
  }
  .module-head { gap: 6px; }
  .check-item { grid-template-columns: 16px 1fr; }
  .check-status { grid-column: 2; }

  .finding-row { flex-wrap: wrap; }
}

@media (max-width: 460px) {
  .scan-facts,
  .scan-facts--stack,
  .job-facts { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; }
}

/* Pointer-coarse / keyboard users get a thicker, offset focus ring. */
@media (pointer: coarse) {
  :focus-visible { outline-width: 4px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 1.6s; }
  *, *::before, *::after { transition: none !important; }
}
/* ---------- Live scan status (scan detail) ---------- */
.scan-live-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.status-chip--live {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.status-chip--live .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* Only the ACTIVE module animates; completed/waiting rows stay still. */
.module-row--running .module-glyph {
  animation: live-pulse 1.8s ease-in-out infinite;
}

/* ---------- Inner subsections of the scan progress card ---------- */
.card--subtle {
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 13px 15px;
  margin: 16px 0 0;
}
.card-title--sm {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 8px;
}

/* ---------- "What VibeMetricsAI checks" disclosures ---------- */
/* Native <details>/<summary>: keyboard accessible and screen-reader friendly
   without scripting. Descriptions are explanatory only — no item carries a
   status the backend did not report. */
.wc-grid { display: grid; gap: 8px; }
.wc-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.wc-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
}
.wc-summary:hover { background: var(--accent-soft); }
.wc-hint { font-size: 12px; font-weight: 500; white-space: nowrap; }
.wc-body { padding: 0 12px 11px; }
.wc-body p { margin: 0 0 6px; font-size: 13px; }
.wc-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink-2);
  display: grid;
  gap: 3px;
}
.wc-list li::marker { color: var(--muted); }

/* ---------- Disabled-for-this-scan list ---------- */
.disabled-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  font-size: 13px;
}
.disabled-list li { color: var(--ink-2); }
.disabled-list strong { font-weight: 600; }

/* ---------- Scan detail: motion & small screens ---------- */
@media (max-width: 460px) {
  .scan-live-wrap {
    width: 100%;
    justify-content: space-between;
  }
  .wc-summary { flex-wrap: wrap; }
  .wc-hint { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .status-chip--live .pulse,
  .module-row--running .module-glyph { animation: none; }
}

/* ============================================================
   Phase 24 — remaining component vocabulary + responsive shell
   ============================================================ */

/* ---------- Page structure ---------- */
.auth-shell { min-height: 100vh; }

.page-body { min-width: 0; }

/* ---------- Scan detail job header ---------- */
.job-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.job-table { font-variant-numeric: tabular-nums; }

/* ---------- Findings summary chips ---------- */
.summary-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 14px;
  font-size: 13px;
}
.summary-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-ink-secondary);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.chip-label { font-weight: 650; color: var(--color-ink-muted); }

button.chip { cursor: pointer; transition: border-color 120ms ease, color 120ms ease, background 120ms ease; }
button.chip:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-soft); }
button.chip[aria-pressed="true"] { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-accent); }

/* ---------- Comparison ---------- */
.comparison > * + * { margin-top: 14px; }
.comparison .card,
.comparison .verdict { margin-bottom: 0; }

.baseline-line { margin: 0; font-size: 13.5px; }

.changed-field {
  display: inline-block;
  padding: 1px 7px;
  margin: 1px 3px 1px 0;
  border-radius: 5px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 11.5px;
  font-weight: 600;
  word-break: break-word;
}

.loc-note { margin-top: 3px; font-size: 12.5px; }

.sections { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.filters .field { margin: 0; min-width: 0; }
.filters label {
  display: block;
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 650;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filters select,
.filters input { max-width: 100%; }
.filters p[data-filter-summary] { grid-column: 1 / -1; margin: 0; font-size: 13px; }

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: 13px;
}

/* ---------- Finding cards ---------- */
.finding-head-left { flex: 1 1 300px; min-width: 0; }
.finding-id-line { margin-bottom: 4px; }
.finding-id { color: var(--color-ink); font-weight: 600; }
a.link:hover .finding-id { color: var(--color-accent); }
.finding-cell-title { font-weight: 550; color: var(--color-ink); }

.finding-evidence,
.finding-note {
  border-top: 1px dashed var(--color-line);
  margin-top: 14px;
  padding-top: 12px;
  font-size: 14px;
}
.finding-evidence > strong,
.finding-note > strong {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-muted);
}
.finding-note-text { margin: 0; color: var(--color-ink-secondary); }
.finding-link { font-weight: 550; }

/* ---------- Triage form ---------- */
.triage-form {
  display: grid;
  gap: 12px;
  max-width: 640px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--color-line);
}
.triage-form > label {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--color-ink);
  margin-bottom: 5px;
}
.triage-form textarea { max-width: 100%; }
.triage-status-row { max-width: 300px; }
.triage-status-row select { max-width: 100%; }
.triage-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.triage-notice { font-size: 13px; }

/* ---------- Rule reference ---------- */
.rule-reference { padding-top: 18px; }
.rule-reference > .card-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-line);
}
.rule-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.rule-title { margin: 4px 0 6px; font-size: 15.5px; font-weight: 680; }
.rule-description { margin: 0 0 14px; color: var(--color-ink-secondary); font-size: 14px; }

/* ---------- Result view cards ---------- */
.severity-card .card-title {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-muted);
}
.coverage-table { font-variant-numeric: tabular-nums; }
.coverage-table td[data-label] { white-space: nowrap; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0 2px;
}
.pagination-label { font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- Gate / form vocabulary ---------- */
.form-group { margin-bottom: 14px; }
.form-group > label {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--color-ink);
  margin-bottom: 6px;
}
.form-group.form-check { margin-bottom: 4px; }

.form-hint {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.45;
}

.form-fieldset {
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  padding: 12px 16px 8px;
  margin: 0 0 16px;
  min-width: 0;
}
.form-legend {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-muted);
  padding: 0 8px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 20px;
}
.form-error {
  margin-top: 10px;
  color: var(--color-danger);
  font-size: 13.5px;
  font-weight: 600;
}
.form-error:empty { display: none; }

.field-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-ink-muted);
  max-width: 64ch;
}

/* ---------- Small layout utilities ---------- */
.d-flex { display: flex; gap: 10px; flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

/* ---------- Scan progress: minor helpers ---------- */
.wc-title { flex: 1 1 auto; min-width: 0; }
.status-chip-text { font-weight: 700; }

/* ---------- Findings extras ---------- */
.finding-card { scroll-margin-top: 80px; }
.findings-table th[scope="row"] { white-space: nowrap; }
.triage-note { margin-top: 3px; font-size: 12.5px; line-height: 1.45; word-break: break-word; }

/* ============================================================
   Phase 24 — responsive shell / mobile navigation
   ============================================================ */
@media (max-width: 860px) {
  .site-header-inner {
    min-height: 56px;
    padding: 0 16px;
    position: relative;
  }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: -16px;
    right: -16px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow-md);
  }
  .site-header[data-menu-open="true"] .site-nav { display: flex; }

  .nav-link {
    padding: 12px 12px;
    font-size: 15px;
    border-radius: var(--radius-sm);
  }
  .nav-link:hover { background: var(--color-surface-subtle); }
  .nav-link--active { background: var(--color-accent-soft); }

  .nav-cta { margin: 8px 0 4px; }
  .nav-cta .btn { width: 100%; }

  .nav-sep {
    width: auto;
    height: 1px;
    margin: 8px 0;
    background: var(--color-line);
  }

  .nav-account {
    max-width: none;
    justify-content: flex-start;
    margin-top: 6px;
    overflow: visible;
    white-space: normal;
    word-break: break-all;
  }

  .site-nav .btn--ghost { width: 100%; }
}

@media (max-width: 600px) {
  .brand-tag { display: none; }
}

@media (max-width: 480px) {
  .site-header-inner { padding: 0 12px; }
  .site-nav { left: -12px; right: -12px; padding: 10px 12px 14px; }

  .page-wrap { padding: 20px 12px 8px; }
  .page-title { font-size: 22px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 24px; }
  .card { padding: 16px 14px; }
  .card--panel { padding: 0 14px 14px; }

  .auth-page { padding: 4vh 14px 40px; }
  .auth-card { padding: 20px 18px 22px; }

  .summary-chips { gap: 6px 12px; }
  .filters { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .pagination { justify-content: center; }
  .state { padding: 34px 16px; }
  .score-value { font-size: 44px; }
}


/* ---------- Policy pages & footer links ---------- */
.policy-card {
  max-width: 880px;
  margin: 0 auto 32px;
  line-height: 1.65;
}
.policy-card h2 {
  font-size: 18px;
  margin-top: 28px;
  margin-bottom: 12px;
  color: var(--color-ink);
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 6px;
}
.policy-card h3 {
  font-size: 15px;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--color-ink-secondary);
}
.policy-card p, .policy-card ul {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--color-ink-secondary);
  margin-bottom: 14px;
}
.policy-card ul {
  padding-left: 24px;
}
.policy-card li {
  margin-bottom: 8px;
}
.policy-card .callout-box {
  background: var(--color-surface-subtle);
  border-left: 4px solid var(--color-accent);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 18px 0;
  font-size: 13.5px;
}
.policy-card .callout-box--warning {
  border-left-color: var(--color-warning);
  background: var(--color-warning-soft);
}
.site-footer-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-weight: 550;
  font-size: 13px;
}
.site-footer-links a {
  color: var(--color-ink-secondary);
  text-decoration: none;
}
.site-footer-links a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}
.footer-sep {
  color: var(--color-line-strong);
}

/* ---------- Admin Panel & Reports Styles ---------- */
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}

.stat-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 6px;
}

.stat-card .stat-desc {
  font-size: 12.5px;
  color: var(--muted);
}

/* Status & Category Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

.badge--status-new {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge--status-in_review {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge--status-resolved {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.badge--category {
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--line);
}

/* Admin Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--ink);
  background: var(--surface-subtle);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-subtle);
}

.text-danger {
  color: #dc2626;
}

