:root {
  color-scheme: light;
  --surface-0: #f6f6f4;
  --surface-1: #fcfcfb;
  --border: #e3e2de;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #77766f;
  --series-1: #2a78d6;
  --good: #0a7a34;
  --good-bg: #e3f4e8;
  --warn: #8a5a00;
  --warn-bg: #fdf0d5;
  --neutral-bg: #ecebe7;
  --accent: #0b0b0b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #111110;
    --surface-1: #1a1a19;
    --border: #2f2e2b;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #9a998f;
    --series-1: #3987e5;
    --good: #5ccf85;
    --good-bg: #13301e;
    --warn: #f0c060;
    --warn-bg: #3a2d10;
    --neutral-bg: #2a2a27;
    --accent: #f0efec;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #111110; --surface-1: #1a1a19; --border: #2f2e2b; --text-primary: #f0efec; --text-secondary: #c3c2b7;
  --text-muted: #9a998f; --series-1: #3987e5; --good: #5ccf85; --good-bg: #13301e; --warn: #f0c060; --warn-bg: #3a2d10;
  --neutral-bg: #2a2a27; --accent: #f0efec;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-0); color: var(--text-primary); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.viz-root { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 22px; margin: 0; letter-spacing: .2px; }
h2 { font-size: 15px; margin: 0; }
.muted { color: var(--text-secondary); margin: 2px 0 0; }
.small { font-size: 13px; }
.top { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-1); }
.seg button { border: 0; background: transparent; color: var(--text-secondary); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; min-height: 36px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent); color: var(--surface-1); }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.card-head { margin-bottom: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.kpi .label { color: var(--text-secondary); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--text-muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--text-muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.step td:first-child { padding-left: 24px; color: var(--text-secondary); }
tr.source td { font-weight: 600; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 1px; }
.badge.draft { background: var(--neutral-bg); color: var(--text-secondary); }
.badge.live, .badge.approved { background: var(--good-bg); color: var(--good); }
.badge.test { background: var(--warn-bg); color: var(--warn); }
.chart { position: relative; }
.chart svg { display: block; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .axis text { fill: var(--text-muted); font-size: 11px; }
.chart .bar { fill: var(--series-1); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.hover { opacity: .8; }
.empty { color: var(--text-secondary); padding: 24px 0; text-align: center; }
.tooltip { position: fixed; pointer-events: none; background: var(--text-primary); color: var(--surface-1); font-size: 12.5px; padding: 6px 9px; border-radius: 6px; z-index: 10; white-space: nowrap; }
.notes { margin: 0 0 12px; padding-left: 18px; color: var(--text-secondary); font-size: 13px; }
.login { max-width: 420px; }
.login form { display: flex; gap: 8px; margin-top: 12px; }
.login input { flex: 1; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-0); color: var(--text-primary); font: inherit; }
.login button { padding: 9px 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--surface-1); font: inherit; font-weight: 600; cursor: pointer; }
.error { color: #c0392b; }
.prot { display: flex; gap: 24px; flex-wrap: wrap; }
.prot div { min-width: 110px; }
.prot strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
tr.source td .muted, tr.step td .muted { font-weight: 400; }
#sources { min-width: 860px; }
#sources td:first-child { min-width: 200px; }
#queue { min-width: 460px; }
.grid2 > *, .card, .kpis > * { min-width: 0; }
