/* Veřejný web Časomíry – designový systém.
   1. tokeny (barvy, písmo, mezery, zaoblení, stíny, pohyb) – světlý a tmavý režim
   2. základ a rozvržení (hlavička, obsah, patička)
   3. komponenty (tlačítka, štítky, přepínače, hledání, tabulky, karty, formulář, stavy)
   Barvy vycházejí z administrace (frontend/src/styles.css); značkovou barvu jde změnit v config.js (brandColor). */

/* ---------- písmo (Barlow, OFL – fonts/OFL.txt) ---------- */
@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Barlow; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- 1. tokeny ---------- */
:root {
  /* plochy a text */
  --bg: #eef0ea; --surface: #ffffff; --surface-2: #f5f6f2;
  --ink: #18222f; --muted: #5d6876; --subtle: #87919c;
  --line: #e2e5dd; --line-strong: #c9cec3;
  /* značka (config.js → brandColor) */
  --brand: #1d7a4c; --brand-ink: #ffffff;
  /* hlavička: výchozí světlá (z ploch), tmavá přes config.js → headerStyle: 'dark' */
  --hero: var(--surface); --hero-ink: var(--ink); --hero-muted: var(--muted); --hero-line: var(--line);
  --hero-glow: 12%; --hero-glow-2: 6%;
  /* významové barvy */
  --good: #1d7a4c; --good-soft: #dcefe4; --bad: #c2362b; --bad-soft: #f7dfdb;
  --warn: #9a6200; --warn-soft: #fbefd6; --info: #2f5fa8; --info-soft: #e1e9f5;
  /* stupně vítězů */
  --gold: #9a7000; --gold-soft: #f8ebbf; --silver: #5f6b78; --silver-soft: #e5e8ec; --bronze: #96501f; --bronze-soft: #f3e0d1;
  /* písmo */
  --font: Barlow, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", Barlow, system-ui, sans-serif;
  --text-xs: 12px; --text-sm: 14px; --text-md: 16px; --text-lg: 18px; --text-xl: 22px; --text-2xl: 28px;
  --text-3xl: clamp(34px, 7vw, 52px);
  /* mezery */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  /* zaoblení, stíny, pohyb */
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(24 34 47 / .06), 0 0 0 1px rgb(24 34 47 / .06);
  --shadow-2: 0 12px 32px -12px rgb(24 34 47 / .28), 0 0 0 1px rgb(24 34 47 / .06);
  --dur: .16s; --ease: cubic-bezier(.2, .7, .2, 1);
  --wrap: 1120px;
  /* odvozené */
  --brand-soft: color-mix(in srgb, var(--brand) 13%, var(--surface));
  --brand-text: color-mix(in srgb, var(--brand) 82%, var(--ink));
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
  color-scheme: light;
}
/* tmavá hlavička (config.js → headerStyle: 'dark') */
:root[data-header="dark"] {
  --hero: #18222f; --hero-ink: #ffffff; --hero-muted: #aab4bf; --hero-line: rgb(255 255 255 / .14);
  --hero-glow: 42%; --hero-glow-2: 18%;
}

/* ---------- 2. základ a rozvržení ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink); font: var(--text-md)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; padding-top: var(--s5); padding-bottom: var(--s7); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; }
p { margin: 0; }
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s4); }
@media (min-width: 720px) { .wrap { padding-inline: var(--s5); } }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 65%, white); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon {
  width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* hlavička: lišta s názvem + úvod stránky + záložky */
.hero { position: relative; background: var(--hero); color: var(--hero-ink); overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(900px 360px at 92% -20%, color-mix(in srgb, var(--brand) var(--hero-glow), transparent), transparent 65%),
    radial-gradient(600px 300px at -10% 120%, color-mix(in srgb, var(--brand) var(--hero-glow-2), transparent), transparent 70%);
}
.hero > .wrap { position: relative; }
.topbar { display: flex; align-items: center; gap: var(--s3); min-height: 60px; border-bottom: 1px solid var(--hero-line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 var(--text-xl)/1 var(--font-display); text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; }
.top-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--hero-muted); font-size: var(--text-sm); text-decoration: none; }
.top-link:hover { color: var(--hero-ink); }
.hero-body { padding: var(--s6) 0 var(--s7); }
.hero-body.with-tabs { padding-bottom: 0; }
.hero h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: .2px; }
.hero .lead { color: var(--hero-muted); font-size: var(--text-lg); margin-top: var(--s2); max-width: 62ch; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--s4);
  color: var(--hero-muted); font-size: var(--text-sm); text-decoration: none;
}
.back:hover { color: var(--hero-ink); }
.race-head { display: flex; align-items: center; gap: var(--s4); }
.race-head > div { min-width: 0; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s2); color: var(--hero-muted); }
.hero-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.tabs { display: flex; gap: var(--s1); margin-top: var(--s5); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; padding: var(--s3) var(--s4) 14px; white-space: nowrap;
  color: var(--hero-muted); font-weight: 600; text-decoration: none; transition: color var(--dur) var(--ease);
}
.tabs a:hover { color: var(--hero-ink); }
.tabs a[aria-current="page"] { color: var(--hero-ink); }
.tabs a[aria-current="page"]::after {
  content: ""; position: absolute; left: var(--s4); right: var(--s4); bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--brand);
}
@media (max-width: 560px) { .race-head { align-items: flex-start; } .hero-body { padding-top: var(--s5); } }

/* datum jako „kalendářní lístek“ */
.datetile {
  flex: none; width: 76px; overflow: hidden; text-align: center; border-radius: var(--r);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1);
}
.datetile .m { display: block; padding: 5px 0 4px; background: var(--brand); color: var(--brand-ink); font: 700 11px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; }
.datetile .d { display: block; padding-top: 6px; font: 700 34px/1 var(--font-display); }
.datetile .y { display: block; padding: 2px 0 7px; color: var(--muted); font-size: var(--text-xs); }
.datetile.sm { width: 58px; }
.datetile.sm .d { font-size: 26px; }
.datetile.sm .y { padding-bottom: 5px; }
.datetile.none .d { font-size: 22px; padding: 10px 0 12px; color: var(--subtle); }

/* sekce obsahu */
.section + .section { margin-top: var(--s7); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3); margin-bottom: var(--s4); }
.section-head h2 { font-size: var(--text-2xl); font-weight: 700; }
.section-head .count { color: var(--muted); font-size: var(--text-sm); }
.section-head .aside { margin-left: auto; }

.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2) var(--s4);
  padding-top: var(--s5); padding-bottom: var(--s6); border-top: 1px solid var(--line);
  color: var(--subtle); font-size: var(--text-sm);
}
.footer a { color: var(--muted); }

/* ---------- 3. komponenty ---------- */

/* tlačítka: výchozí, primary (značka), quiet (jen text), velikosti sm / lg, block */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 10px 18px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: 600 var(--text-md)/1.2 var(--font);
  text-decoration: none; cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 86%, black); border-color: color-mix(in srgb, var(--brand) 86%, black); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--brand-text); padding-inline: var(--s2); }
.btn.quiet:hover { background: var(--brand-soft); }
.btn.sm { padding: 7px 12px; border-radius: var(--r-sm); font-size: var(--text-sm); }
.btn.lg { padding: 14px 26px; font-size: var(--text-lg); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.hero .btn:not(.primary) { background: transparent; border-color: var(--hero-line); color: var(--hero-ink); }
.hero .btn:not(.primary):hover { border-color: var(--hero-ink); }
.spinner {
  width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

/* štítky */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--muted); font: 600 var(--text-xs)/1 var(--font); white-space: nowrap;
}
.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.info { background: var(--info-soft); color: var(--info); }
.pill.live { background: var(--bad-soft); color: var(--bad); }
.pill.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
[data-header="dark"] .hero .pill { background: var(--hero-line); color: var(--hero-ink); }
[data-header="dark"] .hero .pill.live { background: #c2362b; color: #fff; }
[data-header="dark"] .hero .pill.good { background: color-mix(in srgb, var(--brand) 40%, transparent); color: #fff; }
@keyframes pulse { 50% { opacity: .25; } }

/* oznámení v obsahu */
.note { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--info-soft); }
.note > .icon { margin-top: 3px; color: var(--info); }
.note.good { background: var(--good-soft); } .note.good > .icon { color: var(--good); }
.note.bad { background: var(--bad-soft); } .note.bad > .icon { color: var(--bad); }
.note.warn { background: var(--warn-soft); } .note.warn > .icon { color: var(--warn); }
.note a { font-weight: 600; }
.note.spaced { margin-bottom: var(--s5); }
.note.error-note { margin-top: var(--s4); }
.pre { white-space: pre-line; }

/* hledání a stav obnovování */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search input {
  width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: var(--text-md) var(--font);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.status-line { margin-left: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); color: var(--muted); font-size: var(--text-sm); }

/* přepínače kategorií */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  font: 600 var(--text-sm)/1 var(--font); cursor: pointer; transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip .n { color: var(--subtle); font-weight: 500; }
.chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip[aria-selected="true"] .n { color: inherit; opacity: .7; }

/* statistiky nad seznamem */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.stat { padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-1); }
.stat b { display: block; font: 700 var(--text-2xl)/1.15 var(--font-display); }
.stat span { color: var(--muted); font-size: var(--text-sm); }

/* karty */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: var(--s5); }
@media (min-width: 720px) { .card.pad { padding: var(--s6); } }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

.race-card { position: relative; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease); }
.race-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.race-card .top { display: flex; align-items: flex-start; gap: var(--s4); }
.race-card h3 { font-size: var(--text-xl); font-weight: 700; }
.race-card h3 a { text-decoration: none; }
.race-card h3 a:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-top: 6px; color: var(--muted); font-size: var(--text-sm); }
.meta > span { display: inline-flex; align-items: center; gap: 5px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s2); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; }

/* obsazenost závodu */
.capacity { display: grid; gap: 6px; }
.bar { height: 8px; overflow: hidden; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.bar.full i { background: var(--bad); }
.capacity .legend { display: flex; justify-content: space-between; gap: var(--s2); color: var(--muted); font-size: var(--text-sm); }
.capacity .legend b { color: var(--ink); }

/* seznam (proběhlé závody) */
.list { overflow: hidden; }
.list-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row h3 { font-size: var(--text-lg); font-weight: 700; }
.list-row h3 a { text-decoration: none; }
.list-row h3 a:hover { text-decoration: underline; }
.list-row .actions { margin: 0; justify-content: flex-end; }
@media (max-width: 560px) { .list-row { flex-wrap: wrap; } .list-row .actions { width: 100%; justify-content: flex-start; padding-left: 74px; } }

/* tabulky výsledků a startovky */
.cat + .cat { margin-top: var(--s6); }
.cat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.cat-head h3 { font-size: var(--text-xl); font-weight: 700; }
.cat-head .count { color: var(--muted); font-size: var(--text-sm); }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
th {
  padding: 12px 10px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; text-align: left;
  color: var(--subtle); font: 600 var(--text-xs)/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase;
}
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: var(--s4); }
th:last-child, td:last-child { padding-right: var(--s4); }
tbody tr:not(.detail):hover td { background: var(--surface-2); }
th.r, td.r { text-align: right; }
td.rank { width: 4em; }
.place { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: var(--r-pill); font: 700 var(--text-lg)/1 var(--font-display); color: var(--muted); }
.place.p1 { background: var(--gold-soft); color: var(--gold); }
.place.p2 { background: var(--silver-soft); color: var(--silver); }
.place.p3 { background: var(--bronze-soft); color: var(--bronze); }
.bib {
  display: inline-block; min-width: 2.8em; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--muted); text-align: center; font: 600 var(--text-sm)/1 var(--font-display);
}
.who b { font-weight: 600; }
.who .sub { display: none; margin-top: 2px; color: var(--muted); font-size: var(--text-sm); }
.time { font: 700 var(--text-lg)/1 var(--font-display); white-space: nowrap; }
.time .pill { margin-left: 6px; vertical-align: 2px; }
.soft { color: var(--muted); font-family: var(--font-display); font-size: var(--text-md); white-space: nowrap; }
.off { color: var(--subtle); text-decoration: line-through; }
.col-toggle { display: none; }
.toggle {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--subtle); cursor: pointer;
}
.toggle .icon { transition: transform var(--dur) var(--ease); }
tr.open .toggle .icon { transform: rotate(180deg); }
tr.detail { display: none; }
tr.detail td { padding: var(--s3) var(--s4) var(--s4); background: var(--surface-2); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--s3) var(--s4); margin: 0; }
.kv dt { color: var(--subtle); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; }
.kv dd { margin: 2px 0 0; font: 600 var(--text-lg)/1.2 var(--font-display); }
.out-card td { color: var(--muted); }

@media (max-width: 720px) {
  .col-year, .col-club, .col-cat, .col-split, .col-bib, .col-gap { display: none; }
  .who .sub { display: block; }
  th, td { padding: 10px 6px; }
  th:first-child, td:first-child { padding-left: var(--s3); }
  th:last-child, td:last-child { padding-right: var(--s2); }
  .col-toggle { display: table-cell; width: 40px; }
  tr.expandable { cursor: pointer; }
  tr.open + tr.detail { display: table-row; }
  tr.open td { background: var(--surface-2); }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--s4)); padding: 2px var(--s4); }
  .chips::-webkit-scrollbar { display: none; }
  .search { max-width: none; }
  .status-line { margin-left: 0; }
}

/* řada závodů série */
.race-legend { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); padding: 0; list-style: none; }
.race-legend li { display: inline-flex; align-items: center; gap: var(--s2); padding: 6px 12px 6px 6px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); font-size: var(--text-sm); }
.race-legend .no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 700 var(--text-sm)/1 var(--font-display); }
.race-legend a { font-weight: 600; }

/* přihláška */
.reg-layout { display: grid; gap: var(--s5); align-items: start; }
@media (min-width: 920px) {
  .reg-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .reg-aside { position: sticky; top: var(--s4); }
}
.info-list { display: grid; gap: var(--s4); margin: 0; }
.info-item { display: flex; align-items: flex-start; gap: var(--s3); }
.info-item > .icon { margin-top: 2px; color: var(--brand-text); }
.info-item dt { color: var(--muted); font-size: var(--text-sm); }
.info-item dd { margin: 0; font-weight: 600; }
.info-item dd small { display: block; color: var(--muted); font-weight: 400; font-size: var(--text-sm); }
.aside-note { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); }
.aside-note h3 { margin-bottom: var(--s2); color: var(--ink); font: 600 var(--text-sm)/1.3 var(--font); }

.form-section + .form-section { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.form-section > h2 { margin-bottom: var(--s4); font-size: var(--text-xl); font-weight: 700; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.fields .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-weight: 600; font-size: var(--text-sm); }
.label .opt { color: var(--subtle); font-weight: 400; }
.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: var(--text-md) var(--font);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder { color: var(--subtle); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--bad); }
select.input {
  appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2387919c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
}
.field-error { color: var(--bad); font-size: var(--text-sm); font-weight: 600; }
.hint { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); font-size: var(--text-sm); }
.hint .icon { margin-top: 1px; }
.hint.good { color: var(--good); }
.hint.warn { color: var(--warn); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.seg label {
  position: relative; display: flex; align-items: center; justify-content: center; gap: var(--s2); padding: 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r); font-weight: 600; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.seg label:hover { border-color: var(--ink); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand); }
.seg label:has(input:focus-visible) { box-shadow: var(--ring); }
.seg[aria-invalid="true"] label { border-color: var(--bad); }
.consent { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--surface-2); cursor: pointer; font-size: var(--text-sm); }
.consent input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); }
.consent[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--bad); }
.seg.multi { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit-row { display: grid; gap: var(--s3); margin-top: var(--s5); }
.submit-row .fine { color: var(--subtle); font-size: var(--text-sm); text-align: center; }

/* potvrzení přihlášky */
.success { text-align: center; }
.success .badge {
  display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto var(--s4); border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-text); animation: pop .35s var(--ease);
}
.success .badge .icon { width: 34px; height: 34px; stroke-width: 2.5; }
.success h2 { font-size: var(--text-2xl); }
.success .lead { margin-top: var(--s2); color: var(--muted); }
.success .actions { justify-content: center; margin-top: var(--s5); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.pay-card { margin-top: var(--s5); overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); text-align: left; }
.pay-card header { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); background: var(--surface-2); font-weight: 600; }
.pay-card dl { margin: 0; }
.pay-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.pay-row dt { flex: 0 0 8.5em; color: var(--muted); font-size: var(--text-sm); }
.pay-row dd { flex: 1; min-width: 0; margin: 0; font: 700 var(--text-xl)/1.2 var(--font-display); overflow-wrap: anywhere; }
.pay-card .pay-note { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--text-sm); }
.copy {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted); font: 600 var(--text-sm)/1 var(--font); cursor: pointer;
}
.copy:hover { color: var(--ink); border-color: var(--ink); }
.copy.done { color: var(--good); border-color: var(--good); }
@media (max-width: 480px) { .pay-row { flex-wrap: wrap; } .pay-row dt { flex-basis: 100%; } }

/* prázdné a chybové stavy */
.empty-state { padding: var(--s7) var(--s4); text-align: center; color: var(--muted); }
.empty-state > .icon { width: 44px; height: 44px; margin-bottom: var(--s3); color: var(--subtle); stroke-width: 1.6; }
.empty-state h2 { margin-bottom: var(--s2); color: var(--ink); font-size: var(--text-2xl); }
.empty-state .actions { justify-content: center; margin-top: var(--s5); }

/* načítání */
.sk {
  border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2) 30%, var(--line) 50%, var(--surface-2) 70%);
  background-size: 300% 100%; animation: sk 1.3s ease-in-out infinite;
}
[data-header="dark"] .hero .sk { background-image: linear-gradient(90deg, rgb(255 255 255 / .07) 30%, rgb(255 255 255 / .16) 50%, rgb(255 255 255 / .07) 70%); }
.sk-title { width: min(440px, 80%); height: 46px; margin-bottom: var(--s3); }
.sk-line { width: 240px; max-width: 60%; height: 18px; }
.sk-block { height: 180px; margin-bottom: var(--s4); border-radius: var(--r-lg); }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .hero, .footer, .toolbar, .chips, .actions, .toggle, .btn { display: none !important; }
  body, main { background: #fff; color: #000; }
  main { padding: 0; }
  .card, .table-card { box-shadow: none; border: 1px solid #ccc; }
  .col-year, .col-club, .col-cat, .col-split, .col-bib, .col-gap { display: table-cell !important; }
  .col-toggle { display: none !important; }
  .who .sub, tr.detail { display: none !important; }
  .cat { break-inside: avoid-page; }
}
