/* ============================================================
   TrackSonar Admin — "Mission Control"
   Everything is scoped under body (dark, always); the rest
   of the site never sees these rules even though the sheet loads
   globally. Fonts are self-hosted under /static/fonts/.
   ============================================================ */

@font-face {
  font-family: "InterVar";
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens + Pico rebinding ---------- */
body {
  --bg: #0a0c10;
  --surface: #11141b;
  --inset: #171b24;
  --border: #1e2430;
  --border-strong: #2a3242;
  --text: #e7eaf0;
  --muted: #8b93a5;
  --faint: #707a90;
  --accent: #58a6ff;
  --accent-hi: #79b8ff;
  --accent-dim: rgba(88, 166, 255, 0.14);
  --ok: #3fb950;
  --warn: #d29922;
  --danger: #f85149;
  --panel-gap: 1.25rem;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "InterVar", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;

  color-scheme: dark;

  /* Pico v2 variable rebinds — recolors form controls we don't touch directly */
  --pico-background-color: var(--bg);
  --pico-color: var(--text);
  --pico-muted-color: var(--muted);
  --pico-muted-border-color: var(--border);
  --pico-primary: var(--accent);
  --pico-primary-background: var(--accent);
  --pico-primary-border: var(--accent);
  --pico-primary-hover: var(--accent-hi);
  --pico-primary-hover-background: var(--accent-hi);
  --pico-card-background-color: var(--surface);
  --pico-card-border-color: var(--border);
  --pico-form-element-background-color: #0d1017;
  --pico-form-element-active-background-color: #0d1017; /* focused inputs went light without this */
  --pico-form-element-border-color: var(--border-strong);
  --pico-form-element-active-border-color: var(--accent);
  --pico-form-element-focus-color: var(--accent-dim);
  --pico-form-element-color: var(--text);
  --pico-form-element-placeholder-color: var(--faint);
  --pico-code-background-color: var(--inset);
  --pico-code-color: #a8b3c7;
  --pico-mark-background-color: rgba(210, 153, 34, 0.16);
  --pico-mark-color: #e3b341;
  --pico-table-border-color: var(--border);
  --pico-table-row-stripped-background-color: transparent;
  --pico-border-radius: 6px;
  --pico-switch-background-color: var(--border-strong);
  --pico-switch-checked-background-color: var(--accent);
  --pico-switch-color: #e7eaf0;
  --pico-icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");

  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1100px 380px at 50% -120px, rgba(88, 166, 255, 0.06), transparent 65%),
    var(--bg);
  min-height: 100vh;
  display: flex;               /* pin the footer to the viewport bottom */
  flex-direction: column;
  overflow-x: clip; /* nav's full-bleed hairline uses 100vw; clip (not hidden) keeps position:sticky alive */
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

body ::selection { background: rgba(88, 166, 255, 0.3); }

/* Pico's heading color vars are still light-theme; force the text token */
body h1, body h2, body h3, body h4, body h5, body h6 { color: var(--text); }
body hgroup > p { color: var(--muted); }

body a { color: var(--accent); text-decoration: none; }
body a:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }

body code {
  font-family: var(--mono);
  font-size: 0.78em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

body mark {
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-family: var(--mono);
}

/* ---------- top nav (base.html, restyled in scope only) ---------- */
body > nav.container {
  max-width: 1320px;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  position: relative;
}
body > nav.container::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100vw;
  height: 1px;
  background: var(--border);
}
body > nav a { color: var(--muted); font-size: 0.85rem; font-weight: 400; }
body > nav a:hover { color: var(--text); text-decoration: none; }
body > nav strong a { color: var(--text); font-weight: 600; }
body.admin > nav a[href="/admin"] { color: var(--text); }
body > nav button { /* the Sign out pseudo-link; !important beats its inline style */
  background: none !important; border: 0 !important; padding: 0 !important;
  color: var(--muted) !important; font-size: 0.85rem !important;
}
body > nav button:hover { color: var(--text) !important; }

/* ---------- layout shell: rail + main ---------- */
main.container {
  max-width: 1320px;
  width: 100%;
  flex: 1;                     /* footer-pinning: main absorbs the void */
}
body.admin main.container {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 2.25rem;
  align-items: start;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}
body .admin-main { min-width: 0; }

body .admin-rail {
  position: sticky;
  top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body .rail-title {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0.4rem 0.75rem 0.5rem;
}
body .admin-rail a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.75rem;
  border-radius: 6px;
  font-size: 0.86rem;
  color: var(--muted);
  text-decoration: none;
}
body .admin-rail a:hover {
  color: var(--text);
  background: var(--inset);
  text-decoration: none;
}
body .admin-rail a.active {
  color: var(--text);
  background: var(--accent-dim);
  box-shadow: inset 2px 0 0 var(--accent);
}
body .admin-rail svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}
body .admin-rail a.active svg { color: var(--accent); }

/* ---------- page head ---------- */
body .page-head { margin-bottom: 1.4rem; }
body .page-head h2 {
  font-size: 1.3rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 0.15rem;
  color: var(--text);
}
body .page-head .sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}
body .page-head .crumb {
  margin: 0 0 0.3rem;
  font-size: 0.76rem;
}
body .page-head .crumb a { color: var(--muted); }
body .page-head .crumb a:hover { color: var(--text); }
body .tracknum {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}

body h4.sect {
  margin: 1.9rem 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ---------- KPI strip ---------- */
body .kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;                    /* 1px gaps over border color = hairline grid */
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
body .kpi { background: var(--surface); padding: 0.95rem 1.15rem; }
body .kpi .v {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
body .kpi .v .u { font-size: 0.85rem; color: var(--muted); }
body .kpi .v .fail { font-size: 0.95rem; color: var(--danger); }
body .kpi .v.alert { color: var(--danger); }
body .kpi .l {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;         /* one line everywhere or the strip's rhythm breaks */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- panels (cards → flat bordered surfaces) ---------- */
body .panel,
body article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: none;
  padding: 0;
  margin: 0 0 var(--panel-gap);
}
body .panel.pad, body article.pad { padding: 1.1rem 1.25rem; }
body .tbl-scroll { overflow: auto; max-height: 78vh; } /* vertical cap makes sticky thead real */
body .panel > p, body .panel .empty { margin: 0; }
body .empty {
  padding: 2.25rem 1rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.85rem;
}
body .panel > .empty {
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  margin: 0.9rem;
  padding: 1.6rem 1rem;
}

/* ---------- tables ---------- */
body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.84rem;
}
body thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
body tbody tr { background: transparent; }
body tbody td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  vertical-align: middle;
}
body tbody tr:last-child td { border-bottom: 0; }
body tbody tr:hover td { background: var(--inset); }
body td small, body th small { color: var(--muted); font-size: 0.74rem; }
body table button { padding: 0.14rem 0.5rem; font-size: 0.72rem; }
body table button.contrast { border-color: transparent; } /* red text only until hover */
#logrows td:first-child { min-width: 5.5rem; } /* "59m ago"→"1h ago" must not reflow the live tail */

/* numeric / metric cells: mono + tabular */
body .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
}
body td.num { white-space: nowrap; } /* "0 ok" / "1 ms" never wrap; the ratio track breaks below on its own */
body .dim { color: var(--faint); }
body .bad { color: var(--danger); }
body .ok-mark { color: var(--ok); }

/* long-error truncation (title attr holds full text) */
body .err-cell {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--muted);
}
body span.err-cell { display: inline-block; vertical-align: bottom; }
body td.err-cell[title]:not([title=""]) { color: var(--danger); }

/* neutral truncation (err-cell without the danger coloring) */
body .trunc {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body .dot.still { animation: none; } /* catalog: capability, not live health */

/* ---------- status: glowing dots + tinted badges ---------- */
body .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.55rem;
  vertical-align: 1px;
}
body .dot.ok { background: var(--ok); animation: ts-pulse-ok 2.4s ease-out infinite; }
body .dot.err { background: var(--danger); animation: ts-pulse-err 1.1s ease-out infinite; }
body .dot.warn { background: var(--warn); }
body .dot.off { background: transparent; border: 1px solid #3d4757; } /* hollow ring = intentionally off */
body td.row-off strong { color: var(--muted); font-weight: 500; }

body .live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 0.5rem;
  vertical-align: 2px;
  animation: ts-pulse-ok 2s ease-out infinite;
}

@keyframes ts-pulse-ok {
  0% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}
@keyframes ts-pulse-err {
  0% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(248, 81, 73, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); }
}

/* Tinted status pill: admin templates pass style="--s:{{badge .Status}}"
   (a CSS var, not an inline background), so badge() stays the single color
   source while the light-theme user pages keep their solid pills. */
body .status-badge {
  --s: #8b93a5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.16rem 0.6rem;
  border-radius: 99px;
  background: rgba(139, 147, 165, 0.14);            /* fallback */
  background: color-mix(in srgb, var(--s) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--s) 32%, transparent);
  color: #cdd3de;                                    /* fallback */
  color: color-mix(in srgb, var(--s) 72%, #fff);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
body .status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--s);
  flex: none;
}

/* ---------- inline latency bar ---------- */
body .msbar {
  display: inline-block;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--inset);
  overflow: hidden;
  margin-right: 0.5rem;
  vertical-align: 2px;
}
body .msbar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: calc(min(var(--ms, 0) / 2000 * 100%, 100%)); /* 2s pegs the bar */
}

/* ---------- ok/fail ratio meter (flex-grow fed with raw counts) ---------- */
body .ratio {
  display: flex;
  height: 3px;
  max-width: 130px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--inset);
  margin-top: 0.35rem;
}
body .ratio i { background: var(--ok); }
body .ratio b { background: var(--danger); }

/* ---------- segmented error-budget meter (breaker column) ---------- */
body .budget {
  display: inline-flex;
  gap: 2px;
  margin-right: 0.5rem;
  vertical-align: 1px;
}
body .budget i {
  width: 10px;
  height: 5px;
  border-radius: 1px;
  background: transparent;
  border: 1px solid #39445a;
}
body .budget i.hit { background: var(--danger); border-color: var(--danger); }

/* ---------- forms / inputs / buttons ---------- */
body input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
body select {
  height: 2.25rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
  font-family: var(--sans);
}
body select { padding-right: 2rem; }
/* Pico decorates [type=search] with a left magnifier icon, but our tighter
   input padding leaves no room for it so it overlaps the placeholder text.
   The ops theme has no input icons — drop it. Selector matches Pico's own
   `input:not(...)[type=search]` specificity (0,2,x) so background-image:none
   actually wins the cascade; padding is already reset by the general input rule. */
body input:not([type="checkbox"])[type="search"] {
  background-image: none;
  padding-inline-start: 0.65rem;
}
body input[type="search"]::-webkit-search-decoration,
body input[type="search"]::-webkit-search-results-button { display: none; }
body input[readonly] {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--inset);
  cursor: copy;
}
body label { font-size: 0.78rem; color: var(--muted); }

body button, body [type="submit"] {
  width: auto;
  padding: 0.45rem 0.95rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #0a0c10;
  margin-bottom: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
body button:hover, body [type="submit"]:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  color: #0a0c10;
}
body button.secondary, body button.outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--muted);
}
body button.secondary:hover, body button.outline:hover {
  background: var(--inset);
  border-color: #3b465c;
  color: var(--text);
}
body button.contrast, body button.outline.contrast {
  background: transparent;
  border-color: rgba(248, 81, 73, 0.4);
  color: var(--danger);
}
body button.contrast:hover, body button.outline.contrast:hover {
  background: rgba(248, 81, 73, 0.12);
  border-color: var(--danger);
  color: var(--danger);
}

/* grouped controls: split Pico's fused groups into separated pills */
body fieldset[role="group"] {
  display: flex;
  gap: 0.5rem;
  border: 0;
  padding: 0;
  margin: 0 0 0.5rem;
  background: none;
  box-shadow: none;
}
body fieldset[role="group"] > input,
body fieldset[role="group"] > select,
body fieldset[role="group"] > button {
  border-radius: 6px !important;
  margin-bottom: 0;
}
body fieldset[role="group"] > input { flex: 1 1 auto; }
body fieldset[role="group"] > button { white-space: nowrap; }
body div[role="group"] {
  display: flex;
  gap: 0.4rem;
  width: auto;
  margin: 0;
  align-items: center;
}
body div[role="group"] > form { margin: 0; width: auto; }
body div[role="group"].actions { width: 100%; }
body div[role="group"].actions > form:last-child { margin-left: auto; } /* danger quarantined hard right */
body .filterbar { margin-bottom: 1rem; }
body .filterbar select, body .filterbar input { max-width: 15rem; }

/* config grids on the carriers page */
body .cfg-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.7rem;
  margin: 0.85rem 0 0.35rem;
}
body .cfg-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 0;
}
body .cfg-grid input { margin-bottom: 0; }

/* ---------- carriers: failover chain rail ---------- */
body .carrier-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
body .carrier-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}
body .carrier-head > .dim { font-size: 0.74rem; } /* hint tier, not a co-title */
body .cfg-grid [role="switch"] { margin-top: 0.45rem; } /* center against sibling inputs */
body .carrier-panel { position: relative; }
body .carrier-panel.chained { margin-left: 2.1rem; }
body .carrier-panel.chained::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  transform: translateX(-50%);
  top: calc(-1 * var(--panel-gap));  /* bridge the gap to the previous panel */
  bottom: calc(-1 * var(--panel-gap));
  width: 2px;
  background: #333e52;
}
body .carrier-panel.chained.first::before { top: calc(1.1rem + 12px); }
body .carrier-panel.chained.last::before { bottom: auto; height: calc(1.1rem + 12px); }
body .carrier-panel.chained.first.last::before { display: none; }
body .chain-node {
  position: absolute;
  left: -1.35rem;
  top: 1.1rem;                 /* centers on the panel's header row */
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0d1420;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* ---------- banners (repoll feedback, push-test result) ---------- */
body .banner {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--text);
  margin: 0.9rem 0;
  overflow-wrap: anywhere;      /* long callback URLs / error bodies */
}
body .banner.ok { border-left-color: var(--ok); }
body .banner.err { border-left-color: var(--danger); }

/* ---------- events timeline ---------- */
body .timeline { list-style: none; padding: 0; margin: 0 0 0 0.4rem; }
body .timeline li { list-style: none; } /* Pico sets list-style on li, not ul */
body .timeline li {
  position: relative;
  border-left: 1px solid var(--border-strong);
  padding: 0 0 1.25rem 1.6rem;
  margin: 0;
  font-size: 0.86rem;
}
body .timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.3rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--muted);
}
body .timeline li:first-child::before {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.6);
}
body .timeline li:last-child { border-left-color: transparent; padding-bottom: 0.25rem; }
body .timeline li small { color: var(--muted); }

/* ---------- diagnostics strip (tracking detail) ---------- */
body .diag {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}
body .diag b { color: var(--text); font-weight: 500; }

/* ---------- pager ---------- */
body .pager {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-family: var(--mono);
}

/* ---------- htmx indicator ---------- */
body .htmx-indicator { opacity: 0; transition: opacity 0.2s; font-size: 0.8rem; color: var(--muted); }
body .htmx-indicator.htmx-request,
body .htmx-request .htmx-indicator { opacity: 1; }

/* ---------- footer ---------- */
body > footer.container {
  max-width: 1320px;
  color: var(--faint);
  font-size: 0.78rem;
}
body > footer a { color: var(--muted); }

/* ---------- focus states ---------- */
body :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
body input:focus, body select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ---------- responsive (≤900px) ---------- */
@media (max-width: 900px) {
  body.admin main.container { grid-template-columns: 1fr; gap: 1.25rem; padding-top: 1rem; }
  body .admin-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.25rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
  }
  body .rail-title { display: none; }
  body .admin-rail a { white-space: nowrap; }
  body .admin-rail a.active { box-shadow: inset 0 -2px 0 var(--accent); background: transparent; }
  body .kpis { grid-template-columns: repeat(2, 1fr); }
  body .kpi:last-child { grid-column: span 2; }
  body .cfg-grid { grid-template-columns: repeat(2, 1fr) !important; }
  body .carrier-panel.chained { margin-left: 1.4rem; }
  body fieldset[role="group"] { flex-wrap: wrap; }
  body .filterbar select, body .filterbar input { max-width: none; min-width: 9rem; flex: 1; }
  body .err-cell { max-width: 180px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after {
    animation: none !important;
    transition: none !important;
  }
}
