/* Operator console (/admin, renewal of 2026-11-04) and the sign-in page.
   Layout: a left rail with the five places an operator goes; every page puts what needs attention first,
   then what is happening, then what happened. Colours are tokens; blue and red belong to the League sides. */
:root {
  --bg: #f4f4f7;
  --surface: #ffffff;
  --surface-2: #f1f1f5;
  --line: #e3e3eb;
  --ink: #16161e;
  --muted: #62627a;
  --accent: #5a48d6;
  --accent-soft: #eeebfd;
  --on-accent: #ffffff;
  --good: #12785a;
  --good-soft: #e2f4ec;
  --warn: #a85a07;
  --warn-soft: #fcf0de;
  --bad: #c03030;
  --bad-soft: #fce8e7;
  --blue: #2d6ee0;
  --red: #d5364b;
  --shadow: 0 1px 2px rgb(20 20 40 / .05), 0 6px 18px rgb(20 20 40 / .05);
  --font-body: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e13; --surface: #16161d; --surface-2: #1e1e27; --line: #2b2b37; --ink: #ececf3; --muted: #9d9db2;
    --accent: #9285f6; --accent-soft: #26223f; --on-accent: #0e0e13;
    --good: #43cf95; --good-soft: #10291f; --warn: #f0a64c; --warn-soft: #2c2011; --bad: #f3736d; --bad-soft: #331718;
    --blue: #6ea3ff; --red: #ff7083;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e13; --surface: #16161d; --surface-2: #1e1e27; --line: #2b2b37; --ink: #ececf3; --muted: #9d9db2;
  --accent: #9285f6; --accent-soft: #26223f; --on-accent: #0e0e13;
  --good: #43cf95; --good-soft: #10291f; --warn: #f0a64c; --warn-soft: #2c2011; --bad: #f3736d; --bad-soft: #331718;
  --blue: #6ea3ff; --red: #ff7083;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
.loading, .noscript { color: var(--muted); padding: 24px 0; }

/* Rail */
.app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: 600 12px/1 var(--font-mono); letter-spacing: .04em; flex: none; }
.brand strong { display: block; font-size: 14px; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .count { margin-left: auto; font: 600 11px/1 var(--font-mono); padding: 3px 7px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.rail-foot .who { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; text-align: left; }
.linkish:hover { color: var(--ink); }

/* Main */
.main { padding: 22px 32px 56px; min-width: 0; }
.wrap { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.refresh { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.refresh .dot { background: var(--good); }
.refresh.paused .dot { background: var(--muted); animation: none; }
.refresh.error { color: var(--bad); }
.refresh.error .dot { background: var(--bad); animation: none; }
.back { font-size: 13px; color: var(--muted); text-decoration: none; align-self: flex-start; }
.back:hover { color: var(--ink); }
.banner { padding: 12px 16px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.live { background: var(--accent-soft); color: var(--accent); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; display: inline-block; }
.pill.live .dot, .refresh .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Cards and sections */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.section { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.section-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.section-head .n { font: 600 12px/1 var(--font-mono); color: var(--muted); }
.section-head .more { margin-left: auto; font-size: 13px; color: var(--accent); text-decoration: none; }
.section-head .more:hover { text-decoration: underline; }
.calm { padding: 16px 18px; display: flex; gap: 10px; align-items: center; color: var(--muted); }
.calm.good { color: var(--good); font-weight: 600; }

/* Attention */
.attn { overflow: hidden; }
.attn-item { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
.attn-item:first-child { border-top: 0; }
a.attn-item:hover { background: var(--surface-2); }
.attn-item .stripe { align-self: stretch; border-radius: 0 4px 4px 0; background: var(--warn); }
.attn-item.bad .stripe { background: var(--bad); }
.attn-item strong { display: block; font-size: 14px; }
.attn-item p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.attn-item .go { font-size: 13px; color: var(--accent); white-space: nowrap; }

/* Home */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Live card */
.live-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; text-decoration: none; }
.live-card:hover { border-color: var(--accent); }
.live-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.live-top .right { margin-left: auto; font-family: var(--font-mono); }
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
.team { display: flex; flex-direction: column; min-width: 0; }
.team.right { text-align: right; align-items: flex-end; }
.team b { font-size: 22px; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.team span { font-size: 12px; color: var(--muted); }
.score { font: 600 34px/1 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.score i { font-style: normal; color: var(--muted); margin: 0 8px; }
.sets-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: flex; flex-direction: column; gap: 2px; min-width: 116px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.chip b { font-size: 13px; color: var(--ink); }
.chip.cur { background: var(--accent-soft); color: var(--accent); }
.chip.cur b { color: var(--accent); }
.chip.empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.chip.badset { background: var(--bad-soft); }
.live-foot { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.live-foot b { color: var(--ink); font-weight: 600; }

/* Rows */
.rows { overflow: hidden; }
.row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); text-decoration: none; }
.row:first-child { border-top: 0; }
a.row:hover { background: var(--surface-2); }
.when { font: 500 13px/1.35 var(--font-mono); font-variant-numeric: tabular-nums; }
.when small { display: block; color: var(--muted); font: 400 12px/1.35 var(--font-body); }
.row .what b { display: block; font-weight: 600; }
.row .what span { color: var(--muted); font-size: 13px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { font-weight: 600; color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12px; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover { background: var(--surface-2); }
td .sub { display: block; color: var(--muted); font-size: 12px; }
td.r, th.r { text-align: right; white-space: nowrap; }
td .mono, td.mono { white-space: nowrap; }
td.wrap-text { overflow-wrap: anywhere; min-width: 160px; }
td a { color: var(--accent); }
.table-foot { display: flex; justify-content: center; padding: 12px; border-top: 1px solid var(--line); }

/* Panels */
.panel { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.panel-head h2 { font-size: 14px; }
.panel-head .aside { color: var(--muted); font-size: 12px; }
.panel-head a { margin-left: auto; font-size: 12px; color: var(--accent); text-decoration: none; }
.pc-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; padding-top: 8px; border-top: 1px solid var(--line); }
.pc-line:first-of-type { border-top: 0; padding-top: 0; }
.pc-line .dot { background: var(--muted); }
.pc-line.on .dot { background: var(--good); }
.pc-line small { color: var(--muted); font-size: 12px; }
.stat-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; font-size: 13px; margin: 0; }
.stat-list dt { color: var(--muted); }
.stat-list dd { margin: 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
.meter.warn span { background: var(--warn); }
.meter.bad span { background: var(--bad); }
.panel-note { font-size: 12px; color: var(--muted); }

/* Match detail */
.match-head { padding: 20px 22px; display: flex; flex-direction: column; gap: 18px; }
.match-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.facts-inline { display: flex; gap: 6px 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.facts-inline b { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.set { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.set.attn-warn { border-color: var(--warn); }
.set.attn-bad { border-color: var(--bad); }
.set-head { display: flex; align-items: center; gap: 8px; }
.set-head .dur { margin-left: auto; font: 500 12px var(--font-mono); color: var(--muted); }
.sides { display: flex; flex-direction: column; gap: 4px; }
.side { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 0; }
.side .bar { align-self: stretch; border-radius: 2px; background: var(--line); }
.side.blue .bar { background: var(--blue); }
.side.red .bar { background: var(--red); }
.side .who b { display: block; font-size: 14px; }
.side .who span { font-size: 12px; color: var(--muted); }
.side.lost .who b { color: var(--muted); font-weight: 500; }
.win { font: 700 11px/1 var(--font-body); padding: 4px 7px; border-radius: 6px; background: var(--ink); color: var(--surface); }
.timing { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.timing-line { display: flex; justify-content: space-between; gap: 8px; }
.timing-line b { font-family: var(--font-mono); font-weight: 600; }
.tbar { position: relative; height: 6px; border-radius: 999px; background: var(--surface-2); }
.tbar span { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: inherit; background: var(--good); }
.tbar span.over { background: var(--warn); }
.tbar i { position: absolute; top: -4px; bottom: -4px; left: 50%; width: 2px; background: var(--ink); opacity: .35; }
.verdict { font-size: 12px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.verdict.good { background: var(--good-soft); color: var(--good); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.verdict.warn { background: var(--warn-soft); color: var(--warn); }
.ev { display: flex; gap: 4px 12px; flex-wrap: wrap; font: 500 12px var(--font-mono); color: var(--muted); }
.set-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.player { display: flex; flex-direction: column; gap: 8px; }
.player video { width: 100%; max-height: 60vh; border-radius: 10px; background: #000; }
/* AI markers under the recording player (2026-11-13); a moment's button moves the player there. */
.markers-box { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; max-height: 32vh; overflow: auto; }
.markers-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.marker-game { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.marker-game.current { border-color: var(--accent); background: var(--accent-soft); }
.marker-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.marker-tag { padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.marker-moments { display: flex; gap: 6px; flex-wrap: wrap; }
.marker-moment { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.marker-moment:hover { border-color: var(--accent); }
.marker-moment .mono { color: var(--muted); }
.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.tl { list-style: none; margin: 0; padding: 6px 18px 12px; }
.tl li { display: grid; grid-template-columns: 96px 12px minmax(0, 1fr); gap: 10px; padding: 7px 0; font-size: 13px; position: relative; }
.tl li::before { content: ""; position: absolute; left: 111px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl li:first-child::before { top: 14px; }
.tl li:last-child::before { bottom: calc(100% - 14px); }
.tl time { font: 500 12px/1.6 var(--font-mono); color: var(--muted); text-align: right; }
.tl .node { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--muted); }
.tl li.good .node { background: var(--good); box-shadow: none; }
.tl li.warn .node { background: var(--warn); box-shadow: none; }
.tl li.bad .node { background: var(--bad); box-shadow: none; }
.tl li.live .node { background: var(--accent); box-shadow: none; }
.tl .tl-text { overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
details.adv > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.adv[open] > summary::before { transform: rotate(90deg); }
details.adv > summary span { color: var(--muted); font-weight: 400; font-size: 13px; }
details.adv .adv-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 14px; }
pre.json { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font: 12px/1.6 var(--font-mono); overflow-x: auto; max-height: 480px; }

/* Toolbar */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg button .n { font-family: var(--font-mono); font-size: 11px; margin-left: 4px; color: var(--muted); }

/* Stats */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font: 600 26px/1.25 var(--font-mono); font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.kpi .note { font-size: 12px; color: var(--muted); }
.chart { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .lbl { fill: var(--muted); font: 12px var(--font-body); }
.chart .val { fill: var(--ink); font: 500 11px var(--font-mono); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .goal { stroke: var(--ink); stroke-opacity: .5; stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .b-ok { fill: var(--good); }
.chart .b-over { fill: var(--warn); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--good); }
.legend i.over { background: var(--warn); }

/* Recorders */
.pcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.pc { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.pc-head { display: flex; align-items: center; gap: 10px; }
.pc-head h2 { font-size: 15px; }
.pc-head .pill { margin-left: auto; }
.slots { display: flex; gap: 6px; flex-wrap: wrap; }
.slots span { width: 28px; height: 8px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.slots span.used { background: var(--accent); box-shadow: none; }
.workers { display: flex; flex-direction: column; gap: 10px; }
.worker { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.worker-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.worker-head b { font-weight: 600; }
.worker-head .pill { margin-left: auto; }
.worker a { color: var(--accent); }
.manage { display: flex; flex-direction: column; gap: 8px; }
.manage > summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input { flex: 1 1 160px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

/* Forms */
.form-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field label { color: var(--muted); }
.field input, .field select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.field input[readonly] { background: var(--surface-2); }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.toggle input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; margin: 0; transition: background .15s; flex: none; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: transform .15s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); }
.toggle input:disabled { opacity: .5; cursor: not-allowed; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 12px; font-weight: 500; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-status { font-size: 12px; color: var(--muted); }
.form-status.error { color: var(--bad); }
.form-status.ok { color: var(--good); }

/* Dialog and toast */
.dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); width: min(480px, calc(100vw - 32px)); }
.dialog.wide { width: min(960px, calc(100vw - 32px)); }
td .btn, td .muted.small { white-space: nowrap; }
.dialog::backdrop { background: rgb(10 10 20 / .45); }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.dialog-body p { color: var(--muted); }
.dialog-actions { justify-content: flex-end; }
.secret { font: 13px/1.5 var(--font-mono); padding: 10px 12px; border-radius: 9px; background: var(--surface-2); overflow-wrap: anywhere; user-select: all; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--surface); font-size: 13px; box-shadow: var(--shadow); z-index: 20; max-width: calc(100vw - 32px); }
.toast.error { background: var(--bad); color: #fff; }

/* Sign-in page */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.login-card .brand { padding: 0; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .btn { width: 100%; padding: 11px 14px; }
.form-alert { padding: 10px 12px; border-radius: 9px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }

/* Responsive */
@media (max-width: 1120px) {
  .home, .two { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .rail .brand-text { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .rail-foot { margin-top: 0; margin-left: auto; flex-direction: row; align-items: center; white-space: nowrap; }
  .rail-foot .who span { display: none; }
  .main { padding: 16px 16px 48px; }
}
@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .team b { font-size: 17px; }
  .score { font-size: 26px; }
  .score i { margin: 0 4px; }
  .row { grid-template-columns: 78px minmax(0, 1fr); }
  .row > :last-child { grid-column: 2; justify-self: start; }
  .attn-item { grid-template-columns: 4px minmax(0, 1fr); }
  .attn-item .go { grid-column: 2; }
  .tl li { grid-template-columns: 70px 12px minmax(0, 1fr); }
  .tl li::before { left: 85px; }
  .rail-foot #theme-toggle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pill.live .dot, .refresh .dot { animation: none; }
  details.adv > summary::before, .toggle input, .toggle input::after { transition: none; }
}
