:root {
  --bg: #eef2f7; --card: #ffffff; --text: #0f1b2d; --muted: #66748a; --line: #e3e9f1;
  --accent: #2f7df6; --warm: #f2994a; --cold: #3aa0ff; --good: #2fb67c; --bad: #e5484d;
  --shadow: 0 1px 2px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.06);
  --grid: rgba(15,27,45,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --card: #131c2e; --text: #e8eef9; --muted: #8b9bb4; --line: #202c43;
    --accent: #5aa2ff; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --grid: rgba(255,255,255,.07);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --card: #131c2e; --text: #e8eef9; --muted: #8b9bb4; --line: #202c43;
  --accent: #5aa2ff; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); --grid: rgba(255,255,255,.07);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 16px 8px; max-width: 1280px; margin: 0 auto; }
h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
h2 { margin: 0; font-size: 18px; } h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.sub { color: var(--muted); font-size: 13px; } .sub span + span::before { content: " · "; }
main { max-width: 1280px; margin: 0 auto; padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.icon-btn { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; font-size: 18px; cursor: pointer; box-shadow: var(--shadow); }
.card { background: var(--card); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; gap: 14px; }
.hero-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.hero { grid-column: span 2; background: linear-gradient(135deg, var(--accent), #6f5cf0); color: #fff; }
.hero .label, .hero .minmax, .hero-sub { color: rgba(255,255,255,.85); }
.hero-main { display: flex; align-items: baseline; gap: 6px; margin: 4px 0; }
.big { font-size: 76px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.hero .unit { color: #fff; font-size: 28px; }
.hero-sub { display: flex; gap: 18px; flex-wrap: wrap; } .hero-sub b { color: #fff; }
.minmax { margin-top: 10px; font-size: 13px; }
.trend { font-size: 22px; margin-left: 6px; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 6px; }
.val { display: flex; align-items: baseline; gap: 6px; }
.mid { font-size: 34px; font-weight: 650; letter-spacing: -.02em; }
.unit, .muted { color: var(--muted); font-size: 14px; font-weight: 500; }
.foot { color: var(--muted); font-size: 13px; margin-top: 6px; } .foot b, .kv dd { color: var(--text); }
.gauge-wrap { display: flex; justify-content: center; } .gauge-wrap svg { width: 100%; max-width: 170px; height: auto; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 10px 0 0; font-size: 13px; color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; }
.spark { width: 100%; height: 44px; margin-top: 6px; }
.trend-line { font-size: 13px; color: var(--muted); }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin-top: 10px; } .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd166, #f2994a); border-radius: 999px; transition: width .6s; }
.row-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 6px 14px; border-radius: 9px; cursor: pointer; font: inherit; }
.tabs button.on { background: var(--accent); color: #fff; }
.chart-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.chart-box { position: relative; height: 240px; } .chart-box.short { height: 150px; grid-column: span 2; }
.light-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: start; }
.pill { background: var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); } .pill.active { background: #f2c94c; color: #3b2f00; }
.stats { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stats th, .stats td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); } .stats th:first-child, .stats td:first-child { text-align: left; } .stats th { color: var(--muted); font-weight: 600; font-size: 12px; } .stats td.t { color: var(--muted); }
.err { background: #ffe8e8; color: #8a1c1c; border-radius: 12px; padding: 10px 14px; } footer { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 28px; }
svg text { fill: var(--text); font-family: inherit; } svg .m { fill: var(--muted); }
@media (max-width: 560px) { .hero { grid-column: 1 / -1; } .big { font-size: 64px; } .chart-box.short { grid-column: 1 / -1; } .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
