:root {
  --bg: #121417; --panel: #1b1e23; --panel2: #23272e; --line: #2e333b;
  --text: #ece8df; --muted: #9aa0a8; --accent: #f2a900; --accent-ink: #1a1400;
  --ok: #4caf50; --bad: #e5533d; --warn: #f0b429; --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section { padding: 32px 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* top bar */
.topbar { background: #0c0d0f; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.brand img { height: 38px; }
.brand:hover { text-decoration: none; }
.mainnav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.mainnav > a, .dd > a { color: var(--text); padding: 8px 12px; border-radius: 6px; font-weight: 600; font-size: .95rem; display: block; }
.mainnav > a:hover, .dd > a:hover { background: var(--panel2); text-decoration: none; }
.adminlink { background: var(--accent); color: var(--accent-ink) !important; }
.dd { position: relative; }
.dd-menu { display: none; position: absolute; right: 0; top: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 260px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.dd:hover .dd-menu, .dd:focus-within .dd-menu { display: block; }
.dd-menu a { display: block; padding: 8px 10px; color: var(--text); border-radius: 6px; }
.dd-menu a:hover { background: var(--panel2); text-decoration: none; }
.navtoggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); font-size: 1.3rem; border-radius: 6px; padding: 4px 10px; }

.eventbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.eventbar-in { display: flex; align-items: center; gap: 6px 16px; min-height: 48px; flex-wrap: wrap; padding-top: 4px; padding-bottom: 4px; }
.eventbar .ev-name { color: var(--text); font-weight: 700; }
.eventbar nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.eventbar nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: .92rem; }
.eventbar nav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
.livedot { display: inline-block; width: 8px; height: 8px; background: var(--bad); border-radius: 50%; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* hero */
.hero { position: relative; background: linear-gradient(180deg, rgba(10,11,13,.55), rgba(10,11,13,.92)), var(--hero, linear-gradient(135deg, #2b2f25, #14161a)) center/cover; padding: 96px 0 72px; border-bottom: 1px solid var(--line); }
.hero.small { padding: 56px 0 40px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); text-transform: uppercase; font-weight: 900; margin-bottom: .3em; }
.kicker { color: var(--accent); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .9rem; margin-bottom: 8px; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; color: #d6d2c8; font-weight: 600; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 700; cursor: pointer; font-size: .95rem; font-family: inherit; }
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: rgba(255,255,255,.06); }
.btn.big { padding: 14px 26px; font-size: 1.05rem; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 800; vertical-align: middle; }
.pill.live, .live { color: #fff; background: var(--bad); }
span.live { padding: 0 6px; border-radius: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 0; }
aside .card { margin-bottom: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: .85rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; }
.list { display: grid; gap: 10px; margin-bottom: 12px; }
.evitem { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.evitem:hover { border-color: var(--accent); text-decoration: none; }
.evdate { color: var(--accent); font-weight: 700; font-size: .85rem; }
.evname { font-weight: 700; font-size: 1.05rem; }
.yearhdr { margin-top: 18px; color: var(--muted); }
.links { margin: 0; padding-left: 18px; }
.links li { margin: 4px 0; }

.prose { max-width: 860px; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose table { border-collapse: collapse; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }

/* forms */
.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: .92rem; }
.form input, .form select, .form textarea, .inp { width: 100%; margin-top: 5px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #0f1114; color: var(--text); font: inherit; font-weight: 400; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 2px; margin: 0 0 18px; }
.form legend { padding: 0 6px; font-weight: 800; color: var(--accent); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .check input { width: auto; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.req { color: var(--bad); }
label.err input, label.err select { border-color: var(--bad); }
.errmsg { color: var(--bad); font-weight: 600; }
.notice { background: var(--panel); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 6px; margin: 0 0 18px; }
.flashes { padding-top: 14px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; background: var(--panel2); border: 1px solid var(--line); }
.flash.ok { border-color: var(--ok); }
.flash.error { border-color: var(--bad); color: #ffb4a8; }

/* tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 26px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { text-align: left; background: var(--panel2); color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 9px 10px; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }
.tbl tbody tr:hover { background: rgba(242,169,0,.06); }
.tbl .num { text-align: right; width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .time { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .total { font-weight: 800; }
.tbl .rank { font-weight: 800; color: var(--accent); }
.tbl tr.incomplete td { color: var(--muted); }
.coef { color: var(--accent); font-size: .72rem; }
.st { font-size: .7rem; font-weight: 800; padding: 1px 5px; border-radius: 4px; background: var(--panel2); }
.st-dnf { background: #5a3d0a; color: #ffd27a; }
.st-dns { background: #3a3f48; color: #cfd5de; }
.st-dsq { background: #6b1f14; color: #ffb4a8; }
.pen { color: var(--warn); font-weight: 800; }
.clshdr { margin-top: 26px; display: flex; gap: 10px; align-items: baseline; }
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.on, .tabs a:hover { color: var(--text); border-bottom-color: var(--accent); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips a { padding: 5px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: .85rem; font-weight: 600; }
.chips a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.show-sm { display: none; }

.footer { border-top: 1px solid var(--line); background: #0c0d0f; margin-top: 40px; }
.footer-in { display: flex; justify-content: space-between; gap: 16px; padding: 24px 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .navtoggle { display: block; }
  .mainnav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: #0c0d0f; flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--line); }
  body.navopen .mainnav { display: flex; }
  .dd-menu { position: static; display: block; box-shadow: none; border: 0; padding-left: 12px; }
  .grid2, .grid-main, .row2, .row3 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .show-sm { display: block; }
  .eventbar-in { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
  .eventbar nav { flex-wrap: nowrap; }
  .hero { padding: 64px 0 48px; }
}

/* =================== ADMIN (light, high contrast for outdoor use) =================== */
body.adm { --bg: #f3f4f6; --panel: #fff; --panel2: #f0f1f3; --line: #d9dce1; --text: #16181c; --muted: #646b75; --accent: #c77700; --accent-ink: #fff; background: var(--bg); color: var(--text); font-size: 15px; }
.adm a { color: #9a5c00; }
.adm-top { background: #16181c; color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 16px; min-height: 52px; position: sticky; top: 0; z-index: 40; }
.adm-top a { color: #e9e6df; font-weight: 600; padding: 6px 8px; border-radius: 6px; }
.adm-top a:hover { background: #2a2e35; text-decoration: none; }
.adm-top .brand { color: #f2a900; }
.adm-top .sp { flex: 1; }
.adm-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 52px); }
.adm-side { background: #fff; border-right: 1px solid var(--line); padding: 14px 10px; }
.adm-side .evtitle { font-weight: 800; padding: 4px 10px 10px; font-size: .95rem; }
.adm-side a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); font-weight: 600; }
.adm-side a:hover { background: var(--panel2); text-decoration: none; }
.adm-side a.on { background: #fff3dc; color: #7a4a00; }
.adm-side .grp { margin: 14px 10px 4px; font-size: .72rem; text-transform: uppercase; color: var(--muted); font-weight: 800; letter-spacing: .06em; }
.adm-main { padding: 22px 26px 60px; min-width: 0; }
.adm .card { box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.adm .tbl th { background: #f6f7f9; }
.adm .tbl tbody tr:hover { background: #fff8ea; }
.adm .form input, .adm .form select, .adm .form textarea, .adm .inp { background: #fff; color: var(--text); border-color: #c9cdd3; padding: 8px 10px; }
.adm .form label { margin-bottom: 12px; }
.adm .btn { background: #fff; border-color: #c9cdd3; color: var(--text); }
.adm .btn.primary { background: #16181c; border-color: #16181c; color: #fff; }
.adm .btn.accent { background: #f2a900; border-color: #f2a900; color: #1a1400; }
.adm .btn.danger { background: #c0392b; border-color: #c0392b; color: #fff; }
.adm .flash.ok { background: #e8f6ea; }
.adm .flash.error { background: #fdecea; color: #8c1d12; }
.adm .notice { background: #fff; }
.adm .tbl tr.incomplete td { color: #8a9099; }
.adm .st-dnf { background: #ffe9c2; color: #7a4a00; }
.adm .st-dns { background: #e6e8ec; color: #39404a; }
.adm .st-dsq { background: #fdd9d3; color: #8c1d12; }
.adm .rank { color: #9a5c00; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stat b { display: block; font-size: 1.7rem; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .sp { flex: 1; }
.toolbar form { display: inline; margin: 0; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .75rem; font-weight: 800; }
.b-pending { background: #fff3dc; color: #7a4a00; }
.b-confirmed { background: #e3f4e5; color: #1d6a26; }
.b-withdrawn { background: #eceef1; color: #646b75; text-decoration: line-through; }
.b-draft { background: #eceef1; color: #646b75; }
.b-upcoming { background: #e5efff; color: #1b4f9c; }
.b-live { background: #c0392b; color: #fff; }
.b-finished { background: #e3f4e5; color: #1d6a26; }
.b-pub { background: #e3f4e5; color: #1d6a26; }
.inline { display: inline; }
.tbl input.cell, .tbl select.cell { width: 100%; min-width: 70px; padding: 5px 6px; border: 1px solid #c9cdd3; border-radius: 5px; font: inherit; font-variant-numeric: tabular-nums; background: #fff; }
.tbl input.cell:focus, .tbl select.cell:focus { outline: 2px solid #f2a900; border-color: transparent; }
.tbl input.cell.warn { border-color: #f0b429; background: #fff6df; }
.timing td.crew { white-space: nowrap; }
.tbl input.cell.bad { border-color: #c0392b; background: #fdecea; }
.tbl tr.saved td { animation: savedflash 1s; }
@keyframes savedflash { 0% { background: #e3f4e5; } 100% { background: transparent; } }
.timing td { padding: 5px 6px; vertical-align: middle; }
.timing .calc { font-weight: 800; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timing input.w-time { width: 96px; }
.timing input.w-pen { width: 82px; }
.timing input.w-note { min-width: 140px; }
.hint { font-size: .82rem; color: var(--muted); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.check-grid label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check-grid input[type=checkbox] { width: auto; margin: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
.login { max-width: 380px; margin: 10vh auto; }
@media (max-width: 860px) {
  .adm-layout { grid-template-columns: 1fr; }
  .adm-side { border-right: 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 2px; }
  .adm-side .grp, .adm-side .evtitle { width: 100%; }
  .adm-main { padding: 16px; }
}

.bibno { font-weight: 800; }

/* =================== TIMING =================== */
.tm-stages { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 2px; }
.tm-stage { flex: 0 0 auto; min-width: 150px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--text) !important; }
.tm-stage:hover { border-color: #f2a900; text-decoration: none; }
.tm-stage .nm { font-weight: 800; white-space: nowrap; }
.tm-stage .ct { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.tm-stage .pg { grid-column: 1 / -1; height: 5px; border-radius: 9px; background: #eceef1; overflow: hidden; }
.tm-stage .pg i { display: block; height: 100%; background: #f2a900; border-radius: 9px; }
.tm-stage.full .pg i { background: #2e9d43; }
.tm-stage.on { background: #16181c; border-color: #16181c; color: #fff !important; }
.tm-stage.on .ct { color: #c9ccd2; }
.tm-stage.on .pg { background: #3a3e46; }

.tm-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 28px; margin-bottom: 14px; }
.tm-title { flex: 1; min-width: 260px; }
.tm-title h1 { margin: 0 0 8px; font-size: 1.9rem; }
.tm-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.adm .chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: #39404a; }
.adm .chip.strong { background: #16181c; border-color: #16181c; color: #fff; }
.tm-stats { display: flex; gap: 8px; }
.tm-stats > div { min-width: 78px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.tm-stats b { display: block; font-size: 1.55rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tm-stats span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.tm-stats .miss b { color: #b45f00; }
.tm-stats .dnf { border-color: #f3cf8b; } .tm-stats .dns { border-color: #cfd3da; } .tm-stats .dsq { border-color: #f1b3a8; }

.tm-bar { position: sticky; top: 52px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 0 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.tm-bar .sp { flex: 1; }
.tm-jump { display: flex; align-items: center; border: 2px solid #16181c; border-radius: 9px; overflow: hidden; }
.tm-jump span { background: #16181c; color: #fff; font-weight: 800; padding: 7px 10px; }
.tm-jump input { border: 0; padding: 7px 10px; width: 150px; font: inherit; font-weight: 700; font-size: 1.05rem; outline: none; }
.tm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tm-chips a, .tm-seg a { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); color: var(--text) !important; font-size: .85rem; font-weight: 700; background: #fff; }
.tm-chips a:hover, .tm-seg a:hover { border-color: #f2a900; text-decoration: none; }
.tm-chips a.on, .tm-seg a.on { background: #f2a900; border-color: #f2a900; color: #1a1400 !important; }
.tm-seg { display: flex; gap: 2px; }
.tm-toggle { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .88rem; cursor: pointer; }
.tm-help { position: relative; }
.tm-help summary { list-style: none; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; }
.tm-help summary::-webkit-details-marker { display: none; }
.tm-help > div { position: absolute; right: 0; top: 38px; width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; box-shadow: 0 12px 30px rgba(0,0,0,.14); font-size: .88rem; z-index: 5; }
.tm-help code, .tm-help kbd { background: #f0f1f3; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: .85em; }

.tm-wrap { background: #fff; }
.tm-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.tm-grid thead th { position: sticky; top: 0; background: #16181c; color: #fff; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; padding: 9px 8px; text-align: left; white-space: nowrap; z-index: 2; }
.tm-grid td { padding: 6px 8px; border-top: 1px solid #eceef1; vertical-align: middle; }
.tm-grid tbody tr { box-shadow: inset 4px 0 0 transparent; transition: background .2s; }
.tm-grid tbody tr.done { box-shadow: inset 4px 0 0 #2e9d43; }
.tm-grid tbody tr.st-dnf { box-shadow: inset 4px 0 0 #e09b19; background: #fffaf0; }
.tm-grid tbody tr.st-dns { box-shadow: inset 4px 0 0 #8a929e; background: #f7f8f9; }
.tm-grid tbody tr.st-dsq { box-shadow: inset 4px 0 0 #c0392b; background: #fff5f3; }
.tm-grid tbody tr:focus-within { background: #fff8e6; }
.tm-grid tbody tr.hide { display: none; }
.tm-grid .c-bib { width: 1%; }
.bibtag { display: inline-grid; place-items: center; min-width: 46px; height: 34px; padding: 0 6px; border: 2px solid #16181c; border-radius: 7px; font-weight: 900; font-size: 1.1rem; }
tr.done .bibtag { background: #16181c; color: #fff; }
.tm-grid .crew { min-width: 170px; line-height: 1.2; }
.tm-grid .crew b { display: block; font-size: .95rem; }
.tm-grid .crew span { display: block; font-size: .8rem; color: var(--muted); }
.tm-grid .crew em { font-style: normal; font-size: .7rem; font-weight: 800; color: #7a4a00; background: #fff3dc; padding: 0 6px; border-radius: 4px; }
.tm-grid input.cell, .tm-grid select.cell { width: 100%; padding: 7px 8px; border: 1px solid #c9cdd3; border-radius: 6px; font: inherit; font-weight: 700; font-size: 1rem; background: #fff; font-variant-numeric: tabular-nums; }
.tm-grid input.cell:focus, .tm-grid select.cell:focus { outline: 3px solid #f2a900; outline-offset: -1px; border-color: transparent; }
.tm-grid input.cell:placeholder-shown { background: #fbfbfc; }
.tm-grid .c-in input { width: 108px; font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; }
.tm-grid .c-pen input { width: 78px; font-family: ui-monospace, Consolas, monospace; }
.tm-grid .c-st select { width: 78px; }
.tm-grid input.note { min-width: 150px; font-weight: 400; }
.tm-grid input.cell.warn { border-color: #e09b19; background: #fff4d6; }
.tm-grid input.cell.bad { border-color: #c0392b; background: #fdecea; }
.tm-grid .c-out { text-align: right; white-space: nowrap; font-weight: 700; }
.tm-grid .c-out.strong { font-weight: 900; font-size: 1.02rem; }
.tm-grid .c-pos { text-align: center; font-weight: 900; width: 1%; color: #9a5c00; }
.tm-grid tr.saved td { animation: savedflash 1s; }
.tm-toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 420px; padding: 10px 16px; border-radius: 10px; background: #16181c; color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.tm-toast.bad { background: #c0392b; }
.tm-toast.ok::before { content: "✓ "; color: #7ee08f; }

/* =================== RESULTS (admin) =================== */
.rs-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.rs-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--text) !important; font-weight: 700; }
.rs-tabs a:hover { border-color: #f2a900; text-decoration: none; }
.rs-tabs a.on { background: #16181c; border-color: #16181c; color: #fff !important; }
.rs-tabs a.cfg { margin-left: auto; color: var(--muted) !important; font-weight: 600; }
.rs-tabs .dot { width: 9px; height: 9px; border-radius: 50%; background: #c3c7ce; }
.rs-tabs .dot.pub { background: #2e9d43; box-shadow: 0 0 0 3px rgba(46,157,67,.2); }
.rs-head { display: flex; flex-wrap: wrap; gap: 18px 30px; align-items: center; margin-bottom: 14px; padding: 20px 22px; }
.rs-info { flex: 1; min-width: 260px; }
.rs-info h1 { margin: 0 0 8px; font-size: 1.8rem; }
.rs-nums { display: flex; gap: 18px; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.rs-nums b { color: var(--text); font-size: 1.15rem; }
.rs-nums .warn b { color: #b45f00; }
.rs-actions { display: grid; gap: 12px; justify-items: start; }
.rs-pub { display: flex !important; align-items: center; gap: 12px; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 99px; border: 0; background: #c9cdd3; cursor: pointer; padding: 0; transition: background .2s; flex: 0 0 auto; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s; }
.rs-pub.on .switch { background: #2e9d43; }
.rs-pub.on .switch i { left: 25px; }
.rs-pub b { display: block; }
.rs-print { display: flex; gap: 8px; flex-wrap: wrap; }
.rs-jump { margin: 0 0 14px; }
.rs-sec { padding: 0; margin-bottom: 18px; overflow: hidden; scroll-margin-top: 70px; }
.rs-sec-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.rs-sec-h h2 { margin: 0; font-size: 1.25rem; }
.rs-sec-h .sp { flex: 1; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.rs-table { border: 0; border-radius: 0; margin: 0; }
.rs-table .tbl td { vertical-align: middle; font-variant-numeric: tabular-nums; }
.rs-table .tbl td.time { white-space: nowrap; }
.rs-table .tbl td.total { font-weight: 900; }
.adm .tbl tr.p1 td.rank, .adm .tbl tr.p2 td.rank, .adm .tbl tr.p3 td.rank { font-size: 1.05rem; }
.adm .tbl tr.p1 td.rank::before { content: "🥇 "; } .adm .tbl tr.p2 td.rank::before { content: "🥈 "; } .adm .tbl tr.p3 td.rank::before { content: "🥉 "; }
.adm .tbl tr.p1 td { background: #fffaee; }

/* =================== PAYMENTS =================== */
.p-paid { background: #e3f4e5; color: #1d6a26; }
.p-partial { background: #fff3dc; color: #7a4a00; }
.p-unpaid { background: #fde8e6; color: #a3261a; }
.p-free, .p-none { background: #eceef1; color: #646b75; }
td.pay .hint { margin-top: 2px; white-space: nowrap; }
.pay-sum { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.pay-sum > div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-width: 150px; display: flex; flex-direction: column; }
.pay-sum span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #646b75; font-weight: 700; }
.pay-sum b { font-size: 1.25rem; }
.pay-sum small { color: #646b75; }
.pay-sum .ok b { color: #1d6a26; }
.pay-sum .warn b { color: #a3261a; }
.pay-row { display: flex; gap: 6px; align-items: center; }
.pay-row input { flex: 1; min-width: 0; }
