:root {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface-1: #1a1a19;
  --surface-2: #222220;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --up: #0ca30c; --down: #e66767;
  --long: #3987e5; --short: #d95926;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text-primary);
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--s1); text-decoration: none; }
header.top { display: flex; align-items: center; gap: 18px; padding: 10px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-1); position: sticky; top: 0; z-index: 20; }
header.top .brand { font-weight: 650; letter-spacing: .2px; }
header.top .brand small { color: var(--text-muted); font-weight: 400; margin-left: 6px; }
header.top nav a { color: var(--text-secondary); padding: 6px 10px; border-radius: 6px; }
header.top nav a.on { color: var(--text-primary); background: var(--surface-2); }
header.top .spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px;
  background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); display: inline-block; }
.dot.ok { background: var(--good); } .dot.bad { background: var(--critical); } .dot.warn { background: var(--warning); }
main { padding: 16px 18px 40px; display: grid; gap: 14px; }
.row { display: grid; gap: 14px; }
.c2 { grid-template-columns: 1fr 1fr; } .c3 { grid-template-columns: repeat(3, 1fr); }
.c32 { grid-template-columns: 3fr 2fr; } .c23 { grid-template-columns: 2fr 3fr; }
@media (max-width: 1200px) { .c2, .c3, .c32, .c23 { grid-template-columns: 1fr; } }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.card h2 { font-size: 13px; font-weight: 600; margin: 0 0 2px; color: var(--text-primary); }
.card .sub { color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.card .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card .head .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; }
.tile .k { color: var(--text-muted); font-size: 11.5px; }
.tile .v { font-size: 20px; font-weight: 600; margin-top: 2px; white-space: nowrap; }
.tile .d { font-size: 11.5px; color: var(--text-secondary); margin-top: 1px; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--text-muted); } .sec { color: var(--text-secondary); }
.chart { width: 100%; height: 300px; }
.chart.tall { height: 380px; } .chart.short { height: 220px; } .chart.xs { height: 120px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { color: var(--text-muted); font-weight: 500; font-size: 11.5px; position: sticky; top: 0; background: var(--surface-1);
  cursor: pointer; user-select: none; }
th:first-child, td:first-child { text-align: left; }
td.l, th.l { text-align: left; }
tr:hover td { background: var(--surface-2); }
.scroll { max-height: 420px; overflow: auto; }
.scroll.tall { max-height: 640px; }
button, select, input { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 12px; }
button { cursor: pointer; } button.on { background: var(--s1); border-color: var(--s1); color: #fff; }
.seg { display: inline-flex; } .seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 6px 0 0 6px; } .seg button:last-child { border-radius: 0 6px 6px 0; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 17px; }
.tag.long, .tag.buy { background: rgba(57, 135, 229, .18); color: #86b6ef; }
.tag.short, .tag.sell { background: rgba(217, 89, 38, .2); color: #ec9a76; }
.tag.taker { background: rgba(250, 178, 25, .18); color: var(--warning); }
.tag.maker { background: rgba(255, 255, 255, .07); color: var(--text-secondary); }
.tag.k { background: rgba(144, 133, 233, .2); color: #bdb5f3; }
.note { color: var(--text-muted); font-size: 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.flash-up { animation: fu 1s; } .flash-down { animation: fd 1s; }
@keyframes fu { from { background: rgba(12, 163, 12, .25); } to { background: transparent; } }
@keyframes fd { from { background: rgba(208, 59, 59, .25); } to { background: transparent; } }
.mkt-chips { display: inline-flex; gap: 4px; }
.chip { border-radius: 999px; padding: 3px 10px; color: var(--text-muted); }
.chip.on { background: rgba(57,135,229,.18); border-color: var(--s1); color: var(--text-primary); }
.picker { position: relative; display: inline-block; }
.pick-btn.on { border-color: var(--s1); }
.pick-panel { position: absolute; z-index: 50; top: 30px; right: 0; width: 340px; background: var(--surface-2);
  border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.pick-search { width: 100%; margin-bottom: 6px; }
.pick-tools { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.pick-list { max-height: 340px; overflow: auto; }
.pick-list label { display: grid; grid-template-columns: 18px 1fr auto 70px; gap: 6px; align-items: center; padding: 3px 4px;
  border-radius: 4px; cursor: pointer; font-size: 12px; }
.pick-list label:hover { background: rgba(255,255,255,.05); }
.pick-list label span:last-child { text-align: right; }
details summary { cursor: pointer; color: var(--text-secondary); }
.empty { color: var(--text-muted); padding: 24px; text-align: center; }
