:root {
  color-scheme: light;
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #f0efeb; --line: #e2e0da;
  --text: #191919; --text-2: #666666; --accent: #b3262d;
  --good: #0b7a28; --bad: #c62828; --grid: #ececec; --ghost: #d4d2cc;
  --series-1: #257de0; --series-2: #f47230; --series-3: #00b894; --series-4: #f2a600;
  --series-5: #ee7fac; --series-6: #008a17; --series-7: #6a4ce2; --series-8: #ec4647;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121212; --surface: #191919; --surface-2: #222222; --line: #333333;
    --text: #efefef; --text-2: #9c9c9c; --accent: #e5575d;
    --good: #3fbf5f; --bad: #f06a6a; --grid: #2a2a2a; --ghost: #3d3d3d;
    --series-1: #338ced; --series-2: #e76624; --series-3: #00a888; --series-4: #d28e05;
    --series-5: #e24d8b; --series-6: #0aac23; --series-7: #9887ef; --series-8: #eb6263;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.muted { color: var(--text-2); }
button, select, input { font: inherit; color: inherit; }
select, input[type=password] { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
button { cursor: pointer; }

/* Gate */
.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 20%, #1f4d2b, #0c1f12); }
.gate-box { background: var(--surface); width: min(360px, 100%); padding: 28px; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 10px; }
.gate-box h1 { margin: 0; font-size: 24px; }
.gate-box p { margin: 0 0 8px; }
.gate-icon { font-size: 40px; }
.gate-box input[type=password] { padding: 10px; font-size: 16px; }
.gate-box button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px; font-weight: 600; }
.check { font-size: 13px; display: flex; gap: 6px; align-items: center; color: var(--text-2); }
.gate-msg { color: var(--bad); min-height: 1.2em; font-size: 14px; }

/* Layout */
.top { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-size: 17px; }
.pickers { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); }
.pickers select { color: var(--text); }
.icon-btn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link-btn { background: none; border: 0; color: var(--text-2); text-decoration: underline; font-size: 13px; }
.tabs { display: flex; gap: 4px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; color: var(--text-2); white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
.foot { text-align: center; font-size: 12px; padding: 20px; }
.foot a { color: var(--text-2); }
h2 { font-size: 18px; margin: 4px 0 4px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.sub { margin: 0 0 16px; color: var(--text-2); font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid .card { margin: 0; }

/* Tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile .lab { font-size: 12px; color: var(--text-2); }
.tile .val { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .d { font-size: 13px; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--text-2); position: sticky; top: 0; background: var(--surface); }
th.sortable { cursor: pointer; user-select: none; }
th.sorted::after { content: " ▾"; }
th.sorted.asc::after { content: " ▴"; }
td.l, th.l { text-align: left; }
td.wrap { white-space: normal; }
tr:hover td { background: var(--surface-2); }
tr.grp th { background: var(--surface-2); color: var(--text); text-align: center; border-bottom: 0; }
.name { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline dotted var(--text-2); text-underline-offset: 3px; text-align: left; }
.name:hover { text-decoration-color: var(--text); }
.dt { font-size: 12px; margin-left: 6px; }
.up { color: var(--good); } .down { color: var(--bad); } .same { color: var(--text-2); }
.chip { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); margin: 1px 2px; }
.neu { font-size: 11px; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 5px; margin-left: 6px; }

/* Changes */
.chg { list-style: none; padding: 0; margin: 0; }
.chg li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.chg li:last-child { border-bottom: 0; }
.chg .what { display: inline-block; margin-right: 14px; font-size: 14px; }

/* Chart */
.controls { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.pick button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 10px 3px 8px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.pick button .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--ghost); }
.pick button.on { border-color: var(--text-2); font-weight: 600; }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-2); font-size: 11px; }
.chart .lbl { fill: var(--text); font-size: 12px; }
.chart .grid line { stroke: var(--grid); }
.chart .axis { stroke: var(--line); }
.chart .ghost { stroke: var(--ghost); stroke-width: 1; fill: none; }
.chart .ser { stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .xhair { stroke: var(--text-2); stroke-dasharray: 3 3; }
.s1 { stroke: var(--series-1); fill: var(--series-1); } .s2 { stroke: var(--series-2); fill: var(--series-2); }
.s3 { stroke: var(--series-3); fill: var(--series-3); } .s4 { stroke: var(--series-4); fill: var(--series-4); }
.s5 { stroke: var(--series-5); fill: var(--series-5); } .s6 { stroke: var(--series-6); fill: var(--series-6); }
.s7 { stroke: var(--series-7); fill: var(--series-7); } .s8 { stroke: var(--series-8); fill: var(--series-8); }
.ser.s1,.ser.s2,.ser.s3,.ser.s4,.ser.s5,.ser.s6,.ser.s7,.ser.s8 { fill: none; }
.bg1 { background: var(--series-1) !important; } .bg2 { background: var(--series-2) !important; }
.bg3 { background: var(--series-3) !important; } .bg4 { background: var(--series-4) !important; }
.bg5 { background: var(--series-5) !important; } .bg6 { background: var(--series-6) !important; }
.bg7 { background: var(--series-7) !important; } .bg8 { background: var(--series-8) !important; }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.18); max-width: 280px; }
.tip .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tip .sw { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.tip b { font-variant-numeric: tabular-nums; }
details summary { cursor: pointer; color: var(--text-2); font-size: 14px; margin-top: 8px; }
.empty { color: var(--text-2); font-style: italic; }
@media (max-width: 600px) { main { padding: 12px; } .top { padding: 10px 12px; } th, td { padding: 6px 7px; } }
