:root {
  --bg: #f6f7f9; --surface: #fff; --text: #1a1d21; --muted: #667085; --line: #e3e6ea;
  --accent: #2a6df4; --win: #1f9d55; --loss: #d64545; --win-bg: #e3f5ea; --loss-bg: #fbe6e6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --surface: #1d2025; --text: #e8eaed; --muted: #9aa3ae; --line: #2c3037;
    --accent: #6a9bff; --win: #4cc884; --loss: #ef7676; --win-bg: #1c3a2b; --loss-bg: #402424;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
header h1 { font-size: 18px; margin: 0; flex: 1; }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
section { margin-bottom: 28px; }
h2 { font-size: 16px; margin: 0 0 10px; }
select, input, button { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
button { cursor: pointer; }
button[type=submit] { background: var(--accent); border-color: var(--accent); color: #fff; }
#loginForm { max-width: 340px; margin: 60px auto; display: grid; gap: 10px; }
#loginError { color: var(--loss); margin: 0; min-height: 1.4em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
th.sortable { cursor: pointer; user-select: none; }
th.sorted { color: var(--text); }
.pos { color: var(--win); } .neg { color: var(--loss); } .muted { color: var(--muted); }
.form { display: inline-flex; gap: 2px; vertical-align: middle; }
.form i { width: 8px; height: 16px; border-radius: 2px; background: var(--win); }
.form i.l { background: var(--loss); }
.cell-win { background: var(--win-bg); } .cell-loss { background: var(--loss-bg); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 2px 0; }
.empty { padding: 16px; color: var(--muted); }
#weeks svg { display: block; min-width: 100%; }
#weeks text { fill: var(--muted); font-size: 11px; }
#weeks rect { fill: var(--accent); }
