:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #0f172a;
  --muted: #5b6475;
  --border: #dde2ea;
  --grid: rgba(15, 23, 42, .08);
  --accent: #d99a00;
  --accent-ink: #1a1300;
  --cheap: #16a34a;
  --mid: #d99a00;
  --high: #dc2626;
  --neg: #2563eb;
  --up: #dc2626;
  --down: #2563eb;
  --alt: #7c3aed;
  --alt2: #0d9488;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121a2b; --surface-2: #1a2438; --text: #e6ebf3; --muted: #93a0b5;
    --border: #243049; --grid: rgba(230, 235, 243, .08); --accent: #facc15; --accent-ink: #1a1300;
    --cheap: #22c55e; --mid: #eab308; --high: #ef4444; --neg: #3b82f6;
    --up: #f87171; --down: #60a5fa; --alt: #a78bfa; --alt2: #2dd4bf;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121a2b; --surface-2: #1a2438; --text: #e6ebf3; --muted: #93a0b5;
  --border: #243049; --grid: rgba(230, 235, 243, .08); --accent: #facc15; --accent-ink: #1a1300;
  --cheap: #22c55e; --mid: #eab308; --high: #ef4444; --neg: #3b82f6;
  --up: #f87171; --down: #60a5fa; --alt: #a78bfa; --alt2: #2dd4bf;
  --shadow: none; color-scheme: dark;
}

* { 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, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 18px; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.brand b { color: var(--accent); }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.tools { display: flex; gap: 8px; align-items: center; }
select, .seg button, .icon-btn {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.icon-btn { display: grid; place-items: center; padding: 6px; }
.icon-btn svg { width: 18px; height: 18px; }

/* layout */
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 8px; }
.intro h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; }
.intro p { margin: 0 0 18px; color: var(--muted); max-width: 760px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }

.hero { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; }
.dial-card { padding: 12px; display: grid; place-items: center; }
#dial { width: 100%; max-width: 320px; height: auto; display: block; }
#dial .tick { stroke: var(--muted); stroke-width: 1; opacity: .6; }
#dial .hour { fill: var(--muted); font-size: 10px; text-anchor: middle; dominant-baseline: middle; }
#dial .hand { stroke: var(--text); stroke-width: 2.5; stroke-linecap: round; }
#dial .hub { fill: var(--accent); }
#dial .big { fill: var(--text); font-size: 30px; font-weight: 700; text-anchor: middle; }
#dial .small { fill: var(--muted); font-size: 10.5px; text-anchor: middle; }
#dial .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 22; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-content: start; }
.stat { padding: 14px 16px; min-width: 0; overflow-wrap: anywhere; }
.hero > *, #charts > * { min-width: 0; }
.intro h1 { overflow-wrap: anywhere; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 28px; font-weight: 700; margin: 2px 0; letter-spacing: -.01em; }
.stat .value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat .sub { color: var(--muted); font-size: 13px; }
.stat .row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-top: 4px; }
.stat .row span:first-child { color: var(--muted); }
.stat.highlight { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 18px 0 12px; }
.toolbar .group { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; }
.seg button { border-radius: 0; margin-left: -1px; padding: 6px 12px; }
.seg button:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.seg button:last-child { border-radius: 0 8px 8px 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; position: relative; }

.chart-card { padding: 14px 16px 10px; margin-bottom: 14px; }
.chart-card h2 { font-size: 16px; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chart-card h2 span { color: var(--muted); font-weight: 500; font-size: 13px; }
.chart-box { position: relative; height: 320px; }
.empty { color: var(--muted); padding: 36px 0; text-align: center; }
.chart-card.compact .chart-box { height: 230px; }
a.open { color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; }
a.open:hover { text-decoration: underline; }

/* overview tiles */
.section-title { font-size: 18px; margin: 22px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.tile { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tile-head h2 { font-size: 18px; margin: 0; min-width: 0; }
.tile-head h2 span { color: var(--muted); font-size: 12.5px; font-weight: 500; margin-left: 4px; }
.tile-head a.open { font-size: 14px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
.metric .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.metric .value { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.metric .value small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.metric .sub { color: var(--muted); font-size: 12.5px; }
.tile .chart-box { height: 140px; margin-top: auto; }

footer { max-width: 1180px; margin: 0 auto; padding: 12px 16px 32px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
footer .domains a { text-decoration: none; color: var(--text); }

@media (max-width: 760px) {
  .top-inner { flex-wrap: wrap; gap: 8px 12px; }
  .tabs { order: 3; flex-basis: 100%; }
  .tools { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .dial-card #dial { max-width: 280px; }
  .cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat .value { font-size: 22px; }
  .chart-box { height: 260px; }
  .intro h1 { font-size: 20px; }
}
@media (max-width: 400px) { .cards { grid-template-columns: 1fr; } }
