/* ==========================================================================
   EdgeAudit — design tokens and components.

   Theme: Linear (from the popular-web-designs catalog). Chosen because the
   palette is almost entirely achromatic with a single chromatic accent
   (indigo #7170ff) reserved for interactive elements. On a status-driven
   security UI that is essential: red, amber and green must mean something and
   must not compete with the brand colour.

   Rules carried over from the Linear template:
     * elevation is background luminance, never a drop shadow on dark
     * borders are semi-transparent white, never solid grey
     * primary text is #f7f8f8, never pure white
     * the brand accent appears only on interactive/CTA elements
   ========================================================================== */

:root {
  /* --- Surfaces: luminance stacking, never pure black --- */
  --bg: #08090a;
  --bg-panel: #0f1011;
  --bg-surface: #191a1b;
  --bg-hover: #23252a;

  /* --- Text: four tiers; --text-muted is the lightest used for body copy --- */
  --text: #f7f8f8;
  --text-secondary: #d0d6e0;
  --text-muted: #8a8f98;
  --text-faint: #62666d;

  /* --- Brand: the only chromatic chrome colour --- */
  --accent: #7170ff;
  --accent-hover: #828fff;
  --brand: #5e6ad2;
  --accent-soft: rgba(113, 112, 255, 0.12);

  /* --- Borders: semi-transparent white --- */
  --border: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-strong: #2a2b2e;

  /* --- Semantic status. ALWAYS paired with a text label (WCAG 1.4.1) --- */
  --critical: #f85149;
  --critical-soft: rgba(248, 81, 73, 0.12);
  --warn: #d29922;
  --warn-soft: rgba(210, 153, 34, 0.12);
  --pass: #3fb950;
  --pass-soft: rgba(63, 185, 80, 0.12);
  --info: #8a8f98;
  --info-soft: rgba(138, 143, 152, 0.12);

  /* --- Type --- */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* --- Radii --- */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 9999px;

  /* --- Focus ring --- */
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.011em;
  font-feature-settings: "cv01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 590;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 19px; line-height: 1.3; }
h3 { font-size: 16px; line-height: 1.35; }

p { margin: 0 0 12px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

code, pre, .mono {
  font-family: var(--mono);
  font-size: 0.86em;
  font-feature-settings: normal;
}

pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  overflow-x: auto;
  color: var(--text-secondary);
}

hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 20px 0; }

/* Visible focus ring on every interactive element. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-sm);
}

/* Skip link for keyboard users. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--text);
  font-weight: 510;
}
.skip-link:focus { left: 16px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}
.sidebar__brand img { width: 26px; height: 26px; flex: 0 0 26px; }
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar__brand-name { font-size: 15px; font-weight: 590; color: var(--text); }
.sidebar__brand-tag {
  font-size: 9.5px; font-weight: 510; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.07em;
}

.nav-group {
  font-size: 10px;
  font-weight: 590;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 14px 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 510;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-link svg { width: 15px; height: 15px; flex: 0 0 15px; opacity: 0.9; }
.nav-link__badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 590;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--critical-soft);
  color: var(--critical);
  border: 1px solid rgba(248, 81, 73, 0.3);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11.5px;
  color: var(--text-faint);
}
.sidebar__user { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sidebar__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 590; flex: 0 0 26px;
}
.sidebar__user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sidebar__user-name {
  color: var(--text-secondary); font-size: 12.5px; font-weight: 510;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar__user-role { font-size: 10.5px; color: var(--text-faint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.topbar__heading { font-size: 18px; font-weight: 590; letter-spacing: -0.02em; }
.topbar__sub { font-size: 12.5px; color: var(--text-muted); }
.topbar__actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.content { padding: 24px 28px 56px; max-width: 1500px; width: 100%; }

/* Mobile: collapse the sidebar into a top strip. */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 4px; padding: 10px 12px;
  }
  .sidebar__brand { border: 0; margin: 0; padding: 0 10px 0 4px; }
  .sidebar__brand-tag { display: none; }
  .nav-group { display: none; }
  .nav-link { padding: 6px 9px; font-size: 12.5px; }
  .sidebar__footer {
    margin: 0 0 0 auto; padding: 0; border: 0;
    display: flex; align-items: center; gap: 8px;
  }
  .sidebar__user { margin: 0; }
  .sidebar__user-meta { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 44px; }
}

/* --------------------------------------------------------------------------
   Cards / panels
   -------------------------------------------------------------------------- */
.card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}
.card--flush { padding: 0; overflow: hidden; }
.card__header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.card__title { font-size: 14px; font-weight: 590; }
.card__body { padding: 16px 18px; }
.card__hint { font-size: 12px; color: var(--text-muted); }

.grid { display: grid; gap: 16px; }
.grid--metrics { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 1080px) { .grid--sidebar { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* --------------------------------------------------------------------------
   Metric card
   -------------------------------------------------------------------------- */
.metric {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
}
.metric::before {
  content: "";
  position: absolute; inset: 0 auto 0 0; width: 2px;
  background: var(--accent);
  opacity: 0.85;
}
.metric--critical::before { background: var(--critical); }
.metric--warn::before { background: var(--warn); }
.metric--pass::before { background: var(--pass); }
.metric--neutral::before { background: var(--info); }

.metric__label {
  font-size: 10.5px; font-weight: 590; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-faint);
}
.metric__value {
  font-size: 27px; font-weight: 590; line-height: 1.1;
  letter-spacing: -0.03em; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.metric__value--critical { color: var(--critical); }
.metric__value--warn { color: var(--warn); }
.metric__value--pass { color: var(--pass); }
.metric__value--accent { color: var(--accent); }
.metric__foot { font-size: 11.5px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.015);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 620px;
}
table.data caption {
  caption-side: top; text-align: left;
  padding: 12px 16px; font-size: 13px; font-weight: 590;
  color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle);
}
table.data th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 590;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }
table.data td.mono, table.data td .mono { font-family: var(--mono); font-size: 12.5px; }
table.data .num { font-variant-numeric: tabular-nums; text-align: right; }

/* Drift row colour-coding: new open = red, closed = amber, unchanged = neutral. */
tr.drift-new td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
tr.drift-closed td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.drift-neutral td:first-child { box-shadow: inset 3px 0 0 var(--info); }
tr.drift-new { background: rgba(248, 81, 73, 0.045); }
tr.drift-closed { background: rgba(210, 153, 34, 0.04); }
tr.is-accepted td { opacity: 0.62; }

/* --------------------------------------------------------------------------
   Badges / pills — always carry a word, never colour alone
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 590;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; flex: 0 0 5px;
}
.badge--plain::before { display: none; }

.badge-critical, .sev-critical, .st-fail {
  color: var(--critical); background: var(--critical-soft);
  border-color: rgba(248, 81, 73, 0.32);
}
.badge-warn, .sev-warn, .st-warn {
  color: var(--warn); background: var(--warn-soft);
  border-color: rgba(210, 153, 34, 0.32);
}
.badge-pass, .st-pass {
  color: var(--pass); background: var(--pass-soft);
  border-color: rgba(63, 185, 80, 0.32);
}
.badge-info, .sev-info, .st-info {
  color: var(--text-muted); background: var(--info-soft);
  border-color: var(--border);
}
.badge-accent { color: var(--accent); background: var(--accent-soft); border-color: rgba(113,112,255,.3); }

.drift-new { color: var(--critical); }
.drift-closed { color: var(--warn); }
.drift-neutral { color: var(--text-muted); }

.port-open { color: var(--text); font-weight: 510; }
.port-critical { color: var(--critical); font-weight: 590; }
.port-closed { color: var(--warn); }
.port-filtered { color: var(--text-faint); }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 510;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 510;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); text-decoration: none; }
.btn:active { background: rgba(255, 255, 255, 0.08); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 510;
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn--danger {
  background: transparent; border-color: rgba(248, 81, 73, 0.42); color: var(--critical);
}
.btn--danger:hover { background: var(--critical-soft); color: var(--critical); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn--sm { padding: 4px 10px; font-size: 12px; }
.btn--block { width: 100%; }
.btn svg { width: 14px; height: 14px; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field__label {
  font-size: 12px; font-weight: 510; color: var(--text-secondary);
}
.field__hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.field__error { font-size: 11.5px; color: var(--critical); }
.field__required { color: var(--critical); }

input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="search"], input[type="date"],
input[type="url"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color 0.12s ease, background 0.12s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, 0.14); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--critical); }
textarea { min-height: 84px; resize: vertical; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238a8f98' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1.5;
}
.checkbox input[type="checkbox"] {
  width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px;
  accent-color: var(--brand); cursor: pointer;
}
.checkbox__text { display: flex; flex-direction: column; gap: 2px; }

.form-actions {
  display: flex; gap: 9px; align-items: center;
  padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px 6px;
  margin: 0 0 18px;
}
legend {
  padding: 0 8px;
  font-size: 12px; font-weight: 590;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   Notices / alerts
   -------------------------------------------------------------------------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.notice__icon { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px; }
.notice--critical {
  border-color: rgba(248, 81, 73, 0.36); background: var(--critical-soft); color: #ffb4ae;
}
.notice--warn { border-color: rgba(210, 153, 34, 0.36); background: var(--warn-soft); color: #e8c46a; }
.notice--pass { border-color: rgba(63, 185, 80, 0.36); background: var(--pass-soft); color: #7ee08a; }
.notice--info { border-color: rgba(113, 112, 255, 0.3); background: var(--accent-soft); color: #b9b8ff; }
.notice a { color: inherit; text-decoration: underline; }

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 44px 24px; text-align: center;
}
.empty__icon { width: 34px; height: 34px; color: var(--text-faint); opacity: 0.7; }
.empty__title { font-size: 14.5px; font-weight: 590; color: var(--text-secondary); }
.empty__text { font-size: 13px; color: var(--text-muted); max-width: 460px; line-height: 1.55; }

/* --------------------------------------------------------------------------
   Auth screens
   -------------------------------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 480px at 50% -12%, rgba(94, 106, 210, 0.15), transparent 68%),
    var(--bg);
}
.auth__card {
  width: 100%;
  max-width: 404px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 30px 30px 26px;
}
.auth__brand {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 22px; justify-content: center;
}
.auth__brand img { width: 40px; height: 40px; }
.auth__title { font-size: 19px; font-weight: 590; text-align: center; letter-spacing: -0.02em; }
.auth__sub {
  font-size: 13px; color: var(--text-muted); text-align: center;
  margin: 5px 0 22px; line-height: 1.5;
}
.auth__foot {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle);
  font-size: 11.5px; color: var(--text-faint); text-align: center; line-height: 1.55;
}
.auth__wide { max-width: 620px; }

.qr-panel {
  background: #fff;
  border-radius: var(--r-md);
  padding: 12px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  width: 208px;
}
.qr-panel svg { width: 184px; height: 184px; display: block; }

.secret-box {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.09em;
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  text-align: center;
  color: var(--text);
  word-break: break-all;
  user-select: all;
}

.code-input {
  font-family: var(--mono) !important;
  font-size: 21px !important;
  letter-spacing: 0.36em !important;
  text-align: center;
  padding: 11px !important;
}

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.recovery-codes code {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.06em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  text-align: center;
  color: var(--text);
  user-select: all;
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 13px; }
.kv dt { color: var(--text-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.kv dd { margin: 0; color: var(--text-secondary); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline__item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.timeline__item:last-child { border-bottom: 0; }
.timeline__when { color: var(--text-faint); font-size: 11.5px; font-family: var(--mono); }
.timeline__what { color: var(--text-secondary); line-height: 1.5; }

.spark { display: block; width: 100%; height: 46px; overflow: visible; }
.spark rect { transition: opacity 0.12s ease; }
.spark rect:hover { opacity: 0.78; }

.filters {
  display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.015);
}
.filters .field { margin: 0; min-width: 132px; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 14px; }

.diff-inline {
  font-family: var(--mono); font-size: 12px;
  display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.diff-inline .was { color: var(--text-faint); text-decoration: line-through; }
.diff-inline .now { color: var(--critical); }
.diff-inline .arrow { color: var(--text-faint); }

.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-critical { color: var(--critical); }
.text-warn { color: var(--warn); }
.text-pass { color: var(--pass); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }

details.disclosure {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.015);
  padding: 0;
  margin-bottom: 12px;
}
details.disclosure > summary {
  cursor: pointer; padding: 11px 14px; font-size: 13px;
  font-weight: 510; color: var(--text-secondary); list-style: none;
  display: flex; align-items: center; gap: 8px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before {
  content: "▸"; color: var(--text-faint); font-size: 11px; transition: transform .12s ease;
}
details.disclosure[open] > summary::before { transform: rotate(90deg); }
details.disclosure > .disclosure__body { padding: 0 14px 14px; }

/* --------------------------------------------------------------------------
   Accessibility & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .sidebar, .topbar, .filters, .btn, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .table-wrap, .metric { border-color: #ccc; background: #fff; }
  table.data th { background: #f2f2f2; color: #000; }
  table.data td { color: #000; }
  .content { padding: 0; }
  a { color: #000; text-decoration: underline; }
}
