:root {
  --bg: #F4F6FA; --card: #FFFFFF; --soft: #EEF1F7; --text: #0B1020; --muted: #5B6478; --faint: #8A93A6; --line: #E2E6EE;
  --accent: #1E5EFF; --accent-soft: #E8EFFF; --pos: #138A4B; --pos-soft: #E3F5EA; --neg: #D1342C; --neg-soft: #FCE9E7; --gold: #B7791F; --gold-soft: #FBF1DC;
  --hero: #1E5EFF; --shadow: 0 1px 2px rgba(11, 16, 32, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1020; --card: #141A2E; --soft: #1B2340; --text: #EEF1FA; --muted: #A4ADC4; --faint: #7B849C; --line: #26304F;
    --accent: #5B8CFF; --accent-soft: #1B2749; --pos: #4ADE80; --pos-soft: #12301F; --neg: #FF7A70; --neg-soft: #3A1A1A; --gold: #F5C453; --gold-soft: #3A2E12;
    --hero: #1E3FA8; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body.popup { width: 400px; min-height: 560px; }
body.full { min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .tiny { font-size: 12px; margin: 6px 0 0; } small { font-size: 12px; } .dim { opacity: .55; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.pad { padding: 8px 0; margin: 0; }

/* shell */
#root { display: flex; flex-direction: column; min-height: inherit; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; } .brand img { border-radius: 6px; }
.right-top { display: flex; align-items: center; gap: 8px; }
.status { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.ok { background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); } .dot.warn { background: #F59E0B; } .dot.bad { background: var(--neg); }
.icon { border: 0; background: var(--soft); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; }
.tabs { display: flex; gap: 4px; padding: 0 12px 8px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.tab { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 7px 4px; cursor: pointer; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12px; font-weight: 600; }
.tab .ic { font-size: 15px; line-height: 1; } .tab:hover { background: var(--soft); } .tab.on { background: var(--accent-soft); color: var(--accent); }
.view { padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
body.full #root { max-width: 920px; margin: 0 auto; width: 100%; }
body.full .view { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; gap: 12px; padding: 8px 16px 32px; }
body.full .tabs { justify-content: center; padding-bottom: 12px; } body.full .tab { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 8px 16px; font-size: 14px; }
body.full .top { padding: 20px 16px 12px; } body.full .brand { font-size: 18px; }
body.full .view > .card.hero { grid-column: 1 / -1; }

/* cards and pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.card.hero { background: var(--hero); border-color: transparent; color: #fff; }
.card.hero .eyebrow, .card.hero .muted, .card.hero .tiny { color: rgba(255, 255, 255, .78); } .card.hero h2 { color: #fff; }
.card.hero .hero-num.pos, .card.hero .hero-num.neg { color: #fff; }
.card.hero .pos, .card.hero .neg { color: #fff; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.1px; color: var(--faint); }
.hero-num { font-size: 34px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.row { display: flex; gap: 8px; } .row.between { justify-content: space-between; } .row.center { align-items: center; } .row.gap { gap: 8px; align-items: center; }
.row.off { opacity: .45; pointer-events: none; } .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { background: var(--soft); border-radius: 12px; padding: 10px; min-width: 0; }
.tile-label { font-size: 11px; color: var(--muted); font-weight: 600; } .tile-value { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tile-sub { font-size: 11px; color: var(--muted); }
.line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.card > .line:first-of-type, h2 + .line, .tiny + .line { border-top: 0; }
.line.total { font-size: 15px; border-top: 2px solid var(--line); }
.line b.pos, .line.neg b { font-weight: 700; } .line.neg span { color: var(--muted); }
.chip { display: inline-block; padding: 3px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); } .chip.pos { background: var(--pos-soft); color: var(--pos); } .chip.neg { background: var(--neg-soft); color: var(--neg); }
.rank { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.mult { display: inline-block; min-width: 38px; text-align: center; padding: 2px 8px; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--m); background: color-mix(in srgb, var(--m) 14%, transparent); font-variant-numeric: tabular-nums; }
.live .live-mult { display: flex; flex-direction: column; } .live-mult .x { font-size: 44px; font-weight: 800; letter-spacing: -1.5px; color: var(--m, var(--faint)); line-height: 1; font-variant-numeric: tabular-nums; }
.live-mult small, .live .right small { color: var(--muted); }
.timer { font-size: 30px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--soft); border-radius: 6px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.table { display: flex; flex-direction: column; } .trow { display: grid; grid-template-columns: 28px 1fr 64px 64px; gap: 6px; padding: 8px 6px; border-top: 1px solid var(--line); align-items: center; font-variant-numeric: tabular-nums; }
.trow.thead { border-top: 0; font-size: 11px; color: var(--faint); font-weight: 700; } .trow.mine { background: var(--accent-soft); border-radius: 10px; font-weight: 700; border-top-color: transparent; }
.trow .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .r { text-align: right; } i.up { color: var(--pos); font-style: normal; } i.down { color: var(--neg); font-style: normal; }
.spark { width: 100%; height: 60px; } .bars { display: flex; gap: 3px; align-items: flex-end; height: 90px; padding-top: 6px; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; } .bars .b i { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; } .bars .b span { font-size: 9px; color: var(--faint); height: 12px; }

/* forms */
.btn { border: 0; background: var(--accent); color: #fff; padding: 9px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; } .btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--soft); color: var(--text); }
.search { display: flex; gap: 8px; } input[type=search], input[type=number], .select { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.search input { flex: 1; } .select { max-width: 160px; }
.results { display: flex; flex-direction: column; gap: 6px; } .result { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; } .result:hover { border-color: var(--accent); } .result span { font-size: 12px; color: var(--muted); }
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; } .field input[type=number] { width: 120px; text-align: right; }
.check { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; } .check input { width: 17px; height: 17px; accent-color: var(--accent); }
