:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #14171f; --muted: #5d6676; --grid: #e6e9ef; --axis: #c9cfda;
  --line: #155eef; --fill: rgba(21,94,239,.12); --ring: #fff; --chip: #eaeef6; --chip-on: #14171f; --chip-on-ink: #fff;
  --up: #0a7a3d; --down: #c4281c; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116; --panel: #161a22; --ink: #eef1f6; --muted: #98a2b3; --grid: #252b36; --axis: #3a4250;
    --line: #5b9bff; --fill: rgba(91,155,255,.16); --ring: #161a22; --chip: #222835; --chip-on: #eef1f6; --chip-on-ink: #0e1116;
    --up: #3ccf7a; --down: #ff7b72; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 920px; margin: 0 auto; padding: 24px 16px 32px; }
.ticker b { font-size: 15px; letter-spacing: .08em; }
.ticker span, .muted { color: var(--muted); font-size: 14px; }
.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.price { font-size: clamp(34px, 8vw, 48px); font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.change { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.change.up { color: var(--up); } .change.down { color: var(--down); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 10px; }
.ranges { display: flex; gap: 4px; flex-wrap: wrap; }
.ranges button { all: unset; cursor: pointer; padding: 6px 12px; min-height: 32px; border-radius: 999px; background: var(--chip); font-size: 14px; font-weight: 600; }
.ranges button[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
button:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
.link { all: unset; cursor: pointer; color: var(--line); font-size: 14px; font-weight: 600; padding: 6px 4px; }
.link:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
.panel { background: var(--panel); border-radius: 14px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.chart-wrap { position: relative; height: clamp(260px, 52vw, 420px); }
#chart, #chart svg { width: 100%; height: 100%; display: block; }
#chart svg { touch-action: pan-y; }
.status { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 16px; pointer-events: none; }
.status:empty { display: none; }
.tip { position: absolute; top: 0; left: 0; pointer-events: none; background: var(--panel); border: 1px solid var(--axis); border-radius: 8px; padding: 6px 10px; font-size: 13px; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.tip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.tip span { color: var(--muted); display: block; }
.table-wrap { max-height: 420px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--grid); font-size: 14px; }
th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-weight: 600; }
.num { text-align: right; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
footer { margin-top: 14px; }
svg text { font: 12px system-ui, sans-serif; fill: var(--muted); }
