:root {
  --bg: #f5f7fb; --panel: #ffffff; --ink: #172033; --muted: #66708a; --line: #e4e8f1;
  --accent: #2f6fed; --good: #1f9d55; --bad: #d64545; --warn: #d9822b; --chip: #eef2fb;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1729; --panel: #172238; --ink: #e8edf7; --muted: #94a0bb; --line: #26334f;
          --accent: #6c9cff; --good: #3ecf7e; --bad: #ff6b6b; --warn: #ffad5c; --chip: #1f2c47; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", Rubik, Arial, sans-serif; font-size: 15px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--bg); }
.brand { font-weight: 700; font-size: 20px; display: flex; gap: 8px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.updated { color: var(--muted); font-size: 12px; }
.tabs { position: sticky; top: calc(48px + env(safe-area-inset-top)); z-index: 4; display: flex; gap: 6px;
  overflow-x: auto; padding: 0 16px 10px; background: var(--bg); scrollbar-width: none; }
.tabs button { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--chip);
  color: var(--ink); font: inherit; cursor: pointer; }
.tabs button.on { background: var(--accent); color: #fff; }
main { padding: 0 16px 24px; max-width: 1100px; margin: 0 auto; }
.tab { display: none; } .tab.on { display: block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.panel h2 { font-size: 15px; margin: 0 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.card .k { color: var(--muted); font-size: 12px; } .card .v { font-size: 20px; font-weight: 700; margin-top: 4px; }
.card .s { font-size: 12px; margin-top: 2px; }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); } .muted { color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td.note { white-space: normal; color: var(--muted); font-size: 12.5px; min-width: 160px; }
.scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--chip); }
.cat { margin-bottom: 14px; } .cat h3 { font-size: 14px; margin: 0 0 8px; }
.chart svg { width: 100%; height: 220px; display: block; }
.empty { color: var(--muted); padding: 6px 0; }
.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
