:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #5b6878;
  --line: #dde3ea;
  --brand: #0d2a4a;
  --brand-ink: #ffffff;
  --accent: #1f7ae0;
  --accent-soft: #e8f1fd;
  --ok: #1d7a46;
  --ok-soft: #e4f4ea;
  --warn: #9a5b00;
  --warn-soft: #fff3dc;
  --err: #b42318;
  --err-soft: #fdecea;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141c; --surface: #16202b; --ink: #e6edf5; --muted: #98a6b6; --line: #273443;
    --brand: #0a1a2c; --accent: #5aa2f0; --accent-soft: #15283d; --ok: #5ccf8b; --ok-soft: #12291c;
    --warn: #f0b552; --warn-soft: #2d2412; --err: #ff8a80; --err-soft: #321816;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 0.95rem; margin: 0; }
h3 { font-size: 0.9rem; margin: 1.25rem 0 0.5rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--brand); color: var(--brand-ink); }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { color: inherit; text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.brand em { font-style: normal; font-weight: 400; opacity: 0.75; }
.mark { width: 14px; height: 14px; border-radius: 50%; background: linear-gradient(135deg, #5aa2f0, #8fd3ff); }
.nav { display: flex; gap: 4px; }
.nav a { color: inherit; text-decoration: none; padding: 6px 10px; border-radius: 6px; opacity: 0.8; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,0.12); opacity: 1; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.who span { opacity: 0.8; }
button.link { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

main.wrap { padding-top: 28px; padding-bottom: 40px; }
.foot { color: var(--muted); font-size: 0.8rem; padding-bottom: 32px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.picker { display: flex; align-items: center; gap: 8px; }
.picker label { font-size: 0.85rem; color: var(--muted); }
select, input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
select:focus, input:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn { font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: var(--accent-soft); color: var(--accent); }
.btn-small { padding: 4px 10px; font-size: 0.82rem; }

.cards { display: grid; gap: 16px; margin-bottom: 20px; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.cards.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards.four { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card h2 { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.card .big { font-size: 2.2rem; font-weight: 700; line-height: 1.15; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.card .sub { color: var(--muted); font-size: 0.85rem; }
.card.accent { border-top: 3px solid var(--accent); }
.panel { margin-bottom: 20px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
.board td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.board tr:last-child td { border-bottom: 0; }
.board .num { text-align: right; white-space: nowrap; }
.board .rank { width: 3rem; color: var(--muted); font-weight: 700; }
.board tr.me td { background: var(--accent-soft); font-weight: 600; }
.board tr.me .rank { color: var(--accent); }
.board tr.gap td { color: var(--muted); padding: 2px 8px; }
.board tr.dim td { color: var(--muted); }
.board .code { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.board.wide { min-width: 720px; }
.board.stations input { width: 100%; min-width: 120px; }
.scroll { overflow-x: auto; }

.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: #fff; vertical-align: 1px; }
.tag-muted { background: var(--line); color: var(--muted); }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--err-soft); color: var(--err); }
.health { padding: 8px 12px; border-radius: 8px; font-size: 0.85rem; margin: 0 0 16px; }
.health.ok { background: var(--ok-soft); color: var(--ok); }
.health.warn, .note.warn { background: var(--warn-soft); color: var(--warn); }
.note { padding: 8px 12px; border-radius: 8px; font-size: 0.9rem; }
.secret { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.secret code { font-size: 1.2rem; background: var(--surface); color: var(--ink); padding: 4px 10px; border-radius: 6px; user-select: all; }

.login { max-width: 380px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.stack { display: grid; gap: 14px; margin: 18px 0; }
.stack label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.check { display: flex; gap: 8px; align-items: center; }
.audit { list-style: none; padding: 0; margin: 0; font-size: 0.82rem; display: grid; gap: 4px; }

@media (max-width: 600px) {
  h1 { font-size: 1.3rem; }
  .card .big { font-size: 1.8rem; }
  .top-in { gap: 8px 16px; padding: 10px 16px; }
  .who { margin-left: 0; }
  .picker { width: 100%; }
  .picker select { flex: 1; }
}
