:root {
  color-scheme: light;
  --page: #f9f9f7; --surface-1: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,0.10); --wash: rgba(11,11,11,0.05);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --ly: #898781; --up: #006300; --down: #d03b3b; --warn: #fab219;
  --ramp-1: #86b6ef; --ramp-2: #5598e7; --ramp-3: #2a78d6; --ramp-4: #184f95;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface-1: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10); --wash: rgba(255,255,255,0.06);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #0ca30c; --series-7: #9085e9; --series-8: #e66767;
    --ly: #898781; --up: #0ca30c; --down: #e66767;
    --ramp-1: #184f95; --ramp-2: #256abf; --ramp-3: #3987e5; --ramp-4: #86b6ef;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 14px; margin: 0; font-weight: 600; }
.sub, .note { color: var(--ink-2); margin: 2px 0 0; font-size: 13px; }
.note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.top { position: sticky; top: 0; z-index: 5; background: var(--page); border-bottom: 1px solid var(--border); padding: 14px 20px 10px; }
.top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fresh { font-size: 12px; color: var(--ink-2); text-align: right; }
.fresh b { font-weight: 600; color: var(--ink); }
.fresh .stale { color: var(--ink); background: color-mix(in srgb, var(--warn) 30%, transparent); padding: 2px 6px; border-radius: 4px; }
.tabs { display: flex; gap: 4px; margin-top: 12px; }
.tabs button { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--ink-2); padding: 6px 12px; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--series-1); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 10px; }
.chips, .days, .seg { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button, .days button, .seg button, .locs button {
  font: inherit; font-size: 12.5px; background: var(--surface-1); color: var(--ink-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.days button { border-radius: 6px; padding: 3px 6px; min-width: 34px; line-height: 1.2; text-align: center; }
.days button small { display: block; font-size: 10px; color: var(--muted); }
.days button .tag { color: var(--series-2); font-weight: 700; }
.chips button:hover, .days button:hover:not(:disabled), .seg button:hover, .locs button:hover { background: var(--wash); }
button[aria-pressed="true"] { background: var(--ink) !important; color: var(--page) !important; border-color: var(--ink) !important; }
button[aria-pressed="true"] small, button[aria-pressed="true"] .tag { color: inherit !important; }
.days button:disabled { opacity: 0.4; cursor: default; }
.seg { margin-left: auto; }
.locs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
main { padding: 16px 20px 8px; max-width: 1500px; margin: 0 auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi, .card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.kpi .label { color: var(--ink-2); font-size: 12.5px; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.kpi .delta { font-size: 12.5px; margin-top: 2px; color: var(--ink-2); }
.up { color: var(--up); font-weight: 600; } .down { color: var(--down); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.card { grid-column: span 12; min-width: 0; }
.c6 { grid-column: span 6; } .c4 { grid-column: span 4; } .c8 { grid-column: span 8; }
@media (max-width: 1000px) { .c6, .c4, .c8 { grid-column: span 12; } .seg { margin-left: 0; } }
.card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card header span { color: var(--muted); font-size: 12px; }
.plot { position: relative; height: 280px; } .plot.tall { height: 340px; } .plot.short { height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.line { height: 2px; vertical-align: 3px; border-radius: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
th { color: var(--ink-2); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: 0; } tr.total td { font-weight: 650; border-top: 1px solid var(--axis); }
.scroll { overflow-x: auto; }
td .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.empty { color: var(--muted); padding: 28px 0; text-align: center; font-size: 13px; }
.loading { color: var(--muted); }
.funnel { display: grid; gap: 10px; }
.funnel .row { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; }
.funnel .bar { height: 26px; background: var(--wash); border-radius: 4px; overflow: hidden; }
.funnel .bar i { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.funnel .n { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.funnel .step { grid-column: 2 / 4; font-size: 12px; color: var(--ink-2); margin-top: -6px; }
.segbar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 4px 0 2px; }
.segbar i { display: block; height: 100%; min-width: 2px; }
.heat { display: grid; gap: 2px; font-size: 11px; color: var(--muted); align-items: center; }
.heat .cell { height: 18px; border-radius: 3px; background: var(--wash); }
.heat .cell:hover { outline: 2px solid var(--ink); }
.heat .hd { text-align: center; } .heat .rl { white-space: nowrap; padding-right: 6px; color: var(--ink-2); }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--page); padding: 6px 9px; border-radius: 6px; font-size: 12px; max-width: 260px; }
.foot { max-width: 1500px; margin: 0 auto; padding: 8px 20px 32px; color: var(--muted); font-size: 12px; }
.foot p { margin: 4px 0; }
