:root {
  --bg: #0e1116;
  --panel: #171b22;
  --line: #2a303b;
  --text: #e9edf2;
  --muted: #9aa4b2;
  --accent: #e8a33d;
  --good: #4cc38a;
  --bad: #e5534b;
  --radius: 14px;
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { min-height: 100dvh; }
main { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.5rem; margin: 4px 0 2px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
p { line-height: 1.45; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 8px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.card.warn { border-color: var(--accent); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; background: var(--line); color: var(--muted); }
.pill.on { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.pill.off { background: color-mix(in srgb, var(--bad) 22%, transparent); color: var(--bad); }

button, .button {
  font: inherit; color: var(--text); background: var(--line); border: 0; border-radius: 12px;
  padding: 12px 16px; min-height: 48px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px;
}
button:disabled { opacity: .45; }
button.primary, .button.primary { background: var(--accent); color: #1a1205; font-weight: 700; }
button.big { width: 100%; min-height: 64px; font-size: 1.2rem; }
button.link { background: none; color: var(--accent); padding: 8px 0; min-height: 0; }
button.danger { color: var(--bad); }

input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: .9rem; }

.blocks { list-style: none; padding: 0; margin: 0; }
.blocks li { padding: 10px 0; border-top: 1px solid var(--line); }
.blocks li:first-child { border-top: 0; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
td.num, th.num { text-align: right; }

.choices { display: flex; gap: 8px; }
.choices .choice { flex: 1; }
.choice.on { background: var(--accent); color: #1a1205; font-weight: 700; }

nav#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--panel);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
nav#tabs a { flex: 1; text-align: center; padding: 16px 0; color: var(--muted); text-decoration: none; font-weight: 600; }
nav#tabs a.on { color: var(--accent); }

/* ── Session runner: readable from 2 m ─────────────────────────────── */
.runner { display: flex; flex-direction: column; min-height: calc(100dvh - 32px); }
.runner .top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .9rem; }
.runner .title { font-size: 1.6rem; font-weight: 700; margin: 8px 0 0; }
.runner .sub { color: var(--muted); margin: 2px 0 0; }
.runner .center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 16px 0; }
.runner .huge { font-size: clamp(4rem, 22vw, 8rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.runner .label { color: var(--muted); font-size: 1.1rem; margin-top: 6px; }
.runner .shots { font-size: 1.4rem; font-variant-numeric: tabular-nums; margin-top: 12px; min-height: 1.6em; }
.runner .dots { font-size: 1.6rem; letter-spacing: .15em; margin-top: 10px; }
.runner .actions { display: grid; gap: 10px; }
.runner .calls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.runner .calls button { min-height: 72px; font-size: 1.5rem; font-weight: 800; }
.runner .calls button.on { background: var(--accent); color: #1a1205; }
.runner .scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.runner .scores button { min-height: 80px; font-size: 2rem; font-weight: 800; }
.runner .late { width: 100%; }
.runner .late.on { background: var(--bad); color: #fff; }
.runner.live .huge { color: var(--accent); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.ratings .row { margin: 6px 0; }
.ratings .choices .choice { min-height: 44px; padding: 8px 0; }
a.card { display: block; color: inherit; text-decoration: none; }
details.card summary { cursor: pointer; font-weight: 600; }
input[type=checkbox] { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
label.row { color: var(--text); font-size: 1rem; flex-wrap: nowrap; }
