:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dfe3e8;
  --text: #11161d;
  --text-2: #4a5360;
  --muted: #6b7480;
  --brand: #0f62ae;
  --brand-ink: #ffffff;
  --win: #156b39;
  --loss: #e07070;
  --push: #8a929c;
  --grid: #e6e9ed;
  --good-ink: #187a42;
  --bad-ink: #c23b3b;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1116; --surface: #161a21; --surface-2: #1d222b; --border: #2a303a;
    --text: #eef1f5; --text-2: #b7bec8; --muted: #8b93a0; --brand: #3987e5; --brand-ink: #0e1116;
    --win: #24924f; --loss: #d46464; --push: #7d8590; --grid: #262c35;
    --good-ink: #5fcf8c; --bad-ink: #f19a9a; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1116; --surface: #161a21; --surface-2: #1d222b; --border: #2a303a;
  --text: #eef1f5; --text-2: #b7bec8; --muted: #8b93a0; --brand: #3987e5; --brand-ink: #0e1116;
  --win: #24924f; --loss: #d46464; --push: #7d8590; --grid: #262c35;
  --good-ink: #5fcf8c; --bad-ink: #f19a9a; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--brand); }
h1, h2, h3 { font-family: "Barlow Semi Condensed", "Barlow", sans-serif; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
header.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.logo { font: 700 20px "Barlow Semi Condensed", sans-serif; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.logo b { color: var(--brand); }
nav.tabs { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
nav.tabs a { padding: 6px 12px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-weight: 600; white-space: nowrap; font-size: 14px; }
nav.tabs a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 6px; font-weight: 700; text-decoration: none; white-space: nowrap; }

.hero { padding: 36px 0 20px; }
.hero p { color: var(--text-2); max-width: 640px; margin: 8px 0 0; }
.meta { color: var(--muted); font-size: 13px; margin-top: 10px; }

section.block { margin: 20px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card > header .sub { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .g2 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.kpi .v { font: 700 26px/1.1 "Barlow Semi Condensed", sans-serif; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .d { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pos { color: var(--good-ink); }
.neg { color: var(--bad-ink); }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 8px 0 16px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.filters select, .filters input { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; min-width: 120px; text-transform: none; letter-spacing: 0; }
.filters input[type=number] { width: 110px; min-width: 0; }
.filters .reset { font: inherit; font-size: 13px; background: none; border: 0; color: var(--brand); cursor: pointer; padding: 8px 0; }

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--push)); }
.pill.win { --dot: var(--win); }
.pill.loss { --dot: var(--loss); }
.pill.high { --dot: var(--brand); }
.empty { color: var(--text-2); padding: 18px; background: var(--surface-2); border-radius: 8px; }
.more { margin-top: 10px; font: inherit; font-size: 13px; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: 6px 12px; cursor: pointer; }

.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); display: inline-block; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .zero { stroke: var(--muted); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.14); white-space: nowrap; opacity: 0; transition: opacity .08s; z-index: 5; color: var(--text); }
.tip b { font-weight: 700; }

.method { color: var(--text-2); font-size: 14px; }
.method p { margin: 0 0 10px; max-width: 760px; }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 10px; padding: 16px 18px; }
.empty-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.empty-cta > span { flex: 1 1 320px; }
.empty-cta .btn { flex: none; }
.locked-body { position: relative; min-height: 220px; }
#upcoming.locked-body { min-height: 220px; }
.locked-rows { filter: blur(6px); opacity: .55; user-select: none; pointer-events: none; }
.locked-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px; color: var(--text); }
.locked-overlay svg { color: var(--brand); }
.locked-msg { color: var(--text-2); max-width: 420px; font-size: 14px; }
.locked-msg b { color: var(--text); font-size: 16px; }
.btn-lg { padding: 11px 28px; font-size: 16px; }
.locked-signin { font-size: 13px; }
footer { color: var(--muted); font-size: 12px; padding: 28px 0 40px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.btn-sm { padding: 6px 12px; font-size: 14px; }
#account { margin-left: 8px; flex: none; }
.locked-body .locked-rows { min-height: 180px; }
