/* ============================================================
   OBSAH

   HOME PAGE                                            r. 1676
   RESPONSIVE — Tablet (640–1024px)                     r. 2114
   RESPONSIVE — Mobile (<640px)                         r. 2247
   RESPONSIVE — Small phones (<=480px)                  r. 2337
   PRINT                                                r. 2387
   TOUCH TARGETS                                        r. 2390
   REDUCED MOTION                                       r. 2426
   PRINT                                                r. 2447
   RESULTS TABS — horizontální tab-bar nad tabulkou     r. 2475
   CONTENT PAGES — Rules, Points, FAQ                   r. 2593
   ADJUSTMENTS — 2026-03-30 checklist fixes             r. 2878
   ADVERTISING (Google AdSense — manual units only)     r. 3173
   CONTENT PAGES — doplňky (pravidla, FAQ, sponzoring)  r. 3243
   ADMIN — sdílené prvky formulářů a filtrů             r. 3319
   ADMIN — správa uživatelů a audit log                 r. 3383
   PAGE-SPECIFIC                                        r. 3530
   UTILITIES                                            r. 3769

   Pořadí pravidel v souboru je záměrně ponecháno tak, jak vzniklo.
   Přeskládání do tematických bloků by u shodné specificity změnilo
   kaskádu a při ~3900 řádcích a 40 šablonách to nelze spolehlivě
   ověřit. Orientaci proto řeší tento obsah, ne přesuny.
   ============================================================ */

/* ============================================================
   TipujBiatlon v2 — Main Stylesheet

   Colour system is derived from the site logo (public/images/logo-full.png):
   charcoal #333333 ground, targets in carmine. The logo's original fire-engine
   red #CE1719 was replaced by a deeper #A4161A — it reads less cheap at large
   sizes, clears WCAG AA on white with room to spare (7.76:1 vs 5.58:1), and
   leaves the brighter red free to mean "error" without the two colliding.

   Breakpoints: mobile <640px, tablet 640–1024px, desktop >1024px
   ============================================================ */

/* ── Webfont ──────────────────────────────────────────────── */
/* Barlow Semi Condensed (SIL OFL 1.1, see fonts/OFL.txt). Self-hosted: no
   third-party request, and the CSP in public/index.php allows 'self' only.
   Subset to Latin plus Czech/Slovak/Polish diacritics — 179 glyphs, ~10.7 kB
   per weight instead of ~87 kB for the full face. Only headings and numerals
   use it; body copy stays on the system stack, which costs nothing to load
   and reads better at paragraph sizes than a condensed face. */
@font-face {
    font-family: 'Barlow Semi Condensed';
    src: url('../fonts/barlow-semicondensed-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Barlow Semi Condensed';
    src: url('../fonts/barlow-semicondensed-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── Design tokens ────────────────────────────────────────── */
:root {
    /* Neutrals — the two darkest values are lifted straight off the logo. */
    --n-0:    #FFFFFF;
    --n-50:   #FAF9F8;
    --n-100:  #F4F2F0;
    --n-200:  #E7E4E1;
    --n-300:  #D5D1CD;
    --n-400:  #A8A29D;
    --n-500:  #78716C;   /* 4.80:1 na bílé, ale jen 4.30:1 na --n-100 a na
                            medailových podbarveních řádků — proto ho
                            --color-text-muted už nepoužívá. */
    --n-600:  #57534E;
    --n-700:  #3D3A37;
    --n-800:  #333333;   /* logo ground */
    --n-900:  #242426;   /* logo lower band */

    /* Sémantické barvy pro panely, které jsou tmavé v obou tématech (pruh
       rozpočtu v sestavení týmu, hlavička detailu týmu). Světlé tóny: --c-success
       (#15803D) a --c-danger (#C62828) jsou určené na světlý podklad a na --n-900
       spadnou na 2–2.8:1, takže „-100 €“ nad rozpočtem bylo hůř čitelné než
       zbytek pruhu. Hodnoty jsou tytéž, které používá tmavé téma. */
    --c-success-on-dark: #4ADE80;
    --c-danger-on-dark:  #F87171;
    --c-warning-on-dark: #FBBF24;

    /* Brand */
    --brand:            #A4161A;   /* on white 7.76:1 ✓ | white on it 7.76:1 ✓ */
    --brand-hover:      #7F1113;   /* white on it 10.5:1 ✓ */
    --brand-on-dark:    #F08A8A;   /* text/links on --n-800 — 5.24:1 ✓ */
    --brand-tint:       #FBF0F0;
    /* Dvě červené v logu: sytá pro slovo BIATLON, světlejší pro obrysy
       terčů, které jsou tenké a v té syté by na tmavé liště zmizely.
       #CD2C32 leží mezi #a81c1c a #E63946 a drží na --n-900 3.26:1, tedy
       nad hranicí AA pro velký text (26px/700). */
    --color-logo-mark:    #CD2C32;
    --color-logo-target:  #E63946;
    --brand-tint-hover: #F6E0E1;

    /* Semantic states */
    --c-success:     #15803D;
    --c-success-bg:  #F0FDF4;
    --c-success-br:  #BBF7D0;

    --c-warning:     #B45309;   /* on white 5.02:1 ✓ — "closing soon" */
    --c-warning-bg:  #FEF3C7;
    --c-warning-br:  #FCD34D;

    /* Brighter and lighter than --brand on purpose: an alarm colour should
       out-shout the resting brand colour, and the two stay distinguishable
       even in greyscale. Never carried by colour alone — always icon + text. */
    --c-danger:      #C62828;   /* on white 5.62:1 ✓ */
    --c-danger-bg:   #FDECEA;
    --c-danger-br:   #F5C6C2;

    --c-danger-hover: #9B1F1F;  /* white on it 8.05:1 ✓ */

    --c-info:        #57534E;
    --c-info-bg:     #F4F2F0;
    --c-info-br:     #D5D1CD;

    /* Pohlaví závodu — modrá muži, karmínová ženy, barva textu smíšené.
       Karmínová se záměrně neváže na --brand: značka je taky karmínová a
       ikona ženského závodu není odkaz ani ovládací prvek, takže by se dvě
       různé role o jednu barvu dělily. Oba tóny drží na bílé nad 4.5:1,
       tedy s rezervou proti 3:1, které WCAG 1.4.11 žádá po grafice. */
    --c-gender-m:    #1D4ED8;   /* on white 6.30:1 ✓ */
    --c-gender-f:    #BE185D;   /* on white 5.60:1 ✓ */
    --c-gender-x:    var(--color-text);

    /* Amber, not brand red: the admin link has to stand out inside a dark bar
       without competing with the brand. On --n-900 it reads 7.19:1. */
    --color-nav-admin:       #F59E0B;
    --color-nav-admin-hover: #FBBF24;

    /* Surface & text aliases */
    --color-bg:            var(--n-100);
    --color-body-bg:       var(--n-100);
    --color-surface:       var(--n-0);
    --color-content-bg:    var(--n-0);
    --color-sidebar-bg:    var(--n-0);
    --color-surface-alt:   var(--n-50);   /* zebra rows, quiet panels */
    --color-surface-sunk:  var(--n-100);  /* inset areas, group headers */
    --color-border:        var(--n-200);
    --color-border-strong: var(--n-300);
    --color-text:          var(--n-900);
    /* --n-600, ne --n-500: sekundární text stojí i na --n-100 (pozadí stránky)
       a na medailových řádcích, kde --n-500 spadne na 4.0–4.3:1. --n-600 drží
       6.4:1 na obou. */
    --color-text-muted:    var(--n-600);

    --color-accent:        var(--brand);
    --color-accent-hover:  var(--brand-hover);
    --color-accent-dark:   var(--brand-hover);
    --color-accent-light:  var(--brand-on-dark);

    --color-banner-bg:     var(--n-800);
    --color-nav-bg:        var(--n-900);
    --color-header-bg:     var(--n-900);
    --color-nav-text:      #E5E1DE;    /* on --n-900 → 12.1:1 ✓ */
    --color-nav-hover:     var(--n-0);
    --color-nav-active:    var(--brand);
    --color-footer-bg:     var(--n-900);
    --color-footer-text:   #B0ABA6;    /* on --n-900 → 6.2:1 ✓ */

    /* Race / tip status */
    --color-open:          var(--c-success);
    --color-open-bg:       var(--c-success-bg);
    --color-closed:        var(--brand);
    --color-closed-bg:     var(--brand-tint);
    /* Obráceně proti ostatním odznakům: šedý text na skoro bílém podkladu se
       na bílé kartě výsledků ztrácel. Plná tmavá výplň drží 10.6:1 a odznak je
       vidět jako odznak. Neutrální tón, aby „Dokončeno“ nepřekřičelo stavy,
       které po uživateli něco chtějí (Otevřeno / Uzavřeno). */
    --color-finished:      var(--n-0);
    --color-finished-bg:   var(--n-700);
    --color-urgent:        var(--c-warning);
    --color-urgent-bg:     var(--c-warning-bg);
    --color-scheduled:     var(--n-600);

    --color-success:       var(--c-success);
    --color-success-bg:    var(--c-success-bg);
    --color-error:         var(--c-danger);
    --color-error-bg:      var(--c-danger-bg);
    --color-info:          var(--c-info);
    --color-info-bg:       var(--c-info-bg);

    /* Medals & the logged-in user's own row */
    --medal-gold:          #FDF3D0;
    --medal-silver:        #EFEDEB;
    --medal-bronze:        #F2E5D2;
    --row-me:              #FFF3C4;
    --medal-gold-hover:    #F7E7A8;
    --medal-silver-hover:  #E2DFDC;
    --medal-bronze-hover:  #E9D8BE;
    --row-me-hover:        #F7E27A;
    --color-gold-bg:       var(--medal-gold);
    --color-silver-bg:     var(--medal-silver);
    --color-bronze-bg:     var(--medal-bronze);
    --color-current-bg:    var(--row-me);

    /* Buttons */
    --color-btn-primary:       var(--brand);
    --color-btn-primary-hover: var(--brand-hover);
    --color-btn-danger:        var(--c-danger);
    --color-btn-secondary:     var(--n-600);

    /* Typography */
    --font-display: 'Barlow Semi Condensed', 'Segoe UI Semibold', system-ui, sans-serif;
    --font-family:  system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-numeric: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

    /* Type scale. Before this the file carried 24 ad-hoc rem values; nothing
       outside this ladder should appear in a font-size declaration. */
    --fs-3xs: 0.625rem;    /* 10px — jen stavové odznaky (verzálky, tučné) */
    --fs-2xs: 0.6875rem;   /* 11px — ad label, fine print */
    --fs-xs:  0.75rem;     /* 12px — badges, meta */
    --fs-sm:  0.875rem;    /* 14px — tables, nav, secondary text */
    --fs-md:  1rem;        /* 16px — body copy */
    --fs-lg:  1.125rem;    /* 18px — lead paragraph */
    --fs-xl:  1.375rem;    /* 22px — h2 */
    --fs-2xl: 1.75rem;     /* 28px — h1 */
    --fs-3xl: 2.25rem;     /* 36px — hero */

    /* Legacy aliases kept so existing declarations keep resolving. */
    --font-size-base:      var(--fs-md);
    --font-size-sm:        var(--fs-sm);
    --font-size-lg:        var(--fs-lg);
    --line-height:         1.6;

    /* Radii */
    --radius-sm:           4px;
    --radius:              8px;
    --radius-lg:           12px;
    --radius-pill:         100px;

    /* Shadows — tinted with the neutral ink rather than pure black */
    --shadow-sm: 0 1px 2px rgba(36,36,38,.06), 0 1px 3px rgba(36,36,38,.08);
    --shadow:    0 2px 4px rgba(36,36,38,.06), 0 4px 12px rgba(36,36,38,.10);
    --shadow-lg: 0 4px 8px rgba(36,36,38,.08), 0 12px 32px rgba(36,36,38,.14);

    /* Focus — a dark ring plus a brand halo stays visible on any background,
       including on top of a brand-coloured button. */
    --focus-outline: 2px solid var(--n-900);
    --focus-ring:    0 0 0 4px rgba(164,22,26,.35);

    --header-height:       64px;
    /* 300 px, ne 280: reklamní jednotka v sidebaru je široká přesně jako
       sloupec a 300×250 je nejlépe vyplňovaný formát AdSense. Do 280 px se
       nevejde a zbyl by slabší čtverec 250×250. Obsah přišel o 20 px, což se
       na šířce tabulek neprojeví. */
    --sidebar-width:       300px;
    --container-max:       1200px;
    --spacing-xs:          0.25rem;
    --spacing-sm:          0.5rem;
    --spacing:             1rem;
    --spacing-lg:          1.5rem;
    --spacing-xl:          2rem;
    --spacing-2xl:         3rem;

    --transition:          150ms ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent-dark);
    text-decoration: underline;
}

/* ── Focus ────────────────────────────────────────────────── */
/* A single brand-coloured outline disappears on top of a brand-coloured
   button. Two layers — a dark ring plus a translucent brand halo — stay
   visible on white, on the charcoal bar and on the buttons themselves. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: var(--focus-outline);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

/* On the dark bar the dark ring would vanish, so the roles are swapped. */
.site-header :where(a, button):focus-visible,
.site-banner :where(a, button):focus-visible,
.site-footer :where(a, button):focus-visible {
    outline: 2px solid var(--n-0);
    box-shadow: 0 0 0 4px rgba(240,138,138,.45);
}

/* ── Skip link ────────────────────────────────────────────── */
/* With a twelve-item navigation, reaching the content by keyboard otherwise
   costs a dozen Tab presses on every page. */
.skip-link {
    position: absolute;
    left: var(--spacing-sm);
    top: -100px;
    z-index: 999;
    padding: 10px 16px;
    background: var(--color-surface);
    color: var(--color-accent);
    font-weight: 600;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transition: top var(--transition);
}

.skip-link:focus {
    top: var(--spacing-sm);
    text-decoration: none;
}

/* The skip target must not draw a focus ring around the whole page. */
.site-main:focus {
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ── Container ────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--spacing-lg);
}

/* ── Layout: Content + Sidebar ───────────────────────────── */
.layout-with-sidebar {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-xl);
    padding-block: var(--spacing-xl);
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    flex-shrink: 0;
}

/* ── Banner ───────────────────────────────────────────────── */
/* The site logo sits in its own band above the navigation. Its ground colour
   is the same charcoal that is baked into the image, so the artwork has no
   visible edge against the page. It deliberately does not stick: the artwork
   is 7.7:1, and pinning it would cost a fifth of a phone screen. */
.site-banner {
    background-color: var(--color-banner-bg);
    overflow: hidden;
}

/* Alignment depends on the matching markup: the banner link must be wrapped
   in a .container in layout.htm. Deploying this file without that template
   change leaves the logo flush against the viewport edge, because the rule
   below has nothing to apply to and the link no longer centres itself. */
.site-banner .container {
    padding-block: 0;
}

.site-banner-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    text-decoration: none;
}

.site-banner-link:hover {
    text-decoration: none;
}

/* Decorative only — the alt text lives on the wordmark image. */
.site-banner-photo {
    flex-shrink: 0;
    width: 398px;
    height: 125px;
}

.site-banner-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-block: 12px;
    min-width: 0;
    flex-shrink: 1;
    /* Na domovské stránce je tenhle prvek <h1>, jinde <span> (layout.htm).
       Bez těchto dvou řádek by se na domovské stránce projevily výchozí
       styly nadpisu — spodní odsazení by odtlačilo hlavičku a velikost by
       zvětšila claim. Takhle je vzhled na všech stránkách totožný. */
    margin: 0;
    font-size: inherit;
}

.site-banner-img {
    width: 100%;
    max-width: 544px;
    height: auto;
}

/* The claim is HTML text, not part of the artwork: the version baked into the
   original JPEG is Czech, which every other locale would have to display too. */
.site-banner-claim {
    color: var(--color-nav-text);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.3;
}

@media (max-width: 899.98px) {
    .site-banner-photo { display: none; }
}

/* Fotografie vlevo a wordmark vpravo jsou dva výřezy téhož původního obrázku
   a jejich vodorovné pruhy na sebe mají navazovat. Svisle se míjely o pixel —
   výřezy se lišily o jeden řádek. Posun se týká jen displejů, kde je fotka
   vidět; bez ní není na co navazovat. */
@media (min-width: 900px) {
    .site-banner-mark {
        position: relative;
        top: 1px;
    }
}

@media (max-width: 640px) {
    .site-banner-mark  { padding-block: 10px; width: 100%; }
    .site-banner-claim { font-size: var(--fs-2xs); letter-spacing: 0.05em; }
}

/* ── Header ───────────────────────────────────────────────── */
.site-header {
    background-color: var(--color-nav-bg);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(36,36,38,.35);
}

.site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ── Logo ─────────────────────────────────────────────────── */
.logo {
    text-decoration: none;
    flex-shrink: 0;
}

/* Bílý štítek „Tipuj" a vedle něj sloupec „BIATLON" + řádka terčů. Celá
   sazba visí na jediné proměnné --logo-unit, takže se na mobilu mění jen
   ta jedna hodnota a poměry zůstanou. Vlastní tmavé pozadí lockup nemá:
   lišta pod ním už je --color-nav-bg a druhý odstín tmavé by se v ní
   rýsoval jako obdélník. Řádkování 1 a útlá vnitřní odsazení drží blok
   kolem 34 px, tedy pod 44 px — výška lišty (--header-height) se nemění. */
.logo-lockup {
    --logo-unit: 1.625rem;   /* 26px — velikost slova BIATLON, základ sazby */
    display: inline-flex;
    align-items: center;
    gap: calc(var(--logo-unit) * 0.31);
    line-height: 1;
    white-space: nowrap;
}

/* Bílý štítek. --n-0 se v tmavém motivu nepřepisuje, takže zůstane bílý
   i v noci a černý text na něm drží 17:1. */
.logo-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--n-0);
    border-radius: var(--radius-sm);
    padding: calc(var(--logo-unit) * 0.15) calc(var(--logo-unit) * 0.38);
}

.logo-tipuj {
    color: var(--n-900);
    font-size: calc(var(--logo-unit) * 1.15);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 0.9;
}

.logo-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

/* Řez italic ve fontu nemáme — prohlížeč ho dopočítá jako oblique, což je
   přesně ten mírný sklon, o který jde. */
.logo-biatlon {
    color: var(--color-logo-mark);
    font-family: var(--font-display);
    font-size: var(--logo-unit);
    font-weight: 700;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: -0.008em;
    line-height: 0.85;
}

/* Terče: tři zásahy (plné), dvě rány mimo (jen obrys). */
.logo-targets {
    display: flex;
    gap: calc(var(--logo-unit) * 0.096);
    margin-top: calc(var(--logo-unit) * 0.077);
}

.logo-target {
    width: calc(var(--logo-unit) * 0.27);
    height: calc(var(--logo-unit) * 0.27);
    border: 1.2px solid var(--color-logo-mark);
    border-radius: 50%;
    box-sizing: border-box;
    position: relative;
}

.logo-target.is-hit {
    background-color: var(--n-0);
    border-color: var(--n-0);
}

/* Střed zásahu, aby bílý puntík četl jako terč a ne jako tečka. */
.logo-target.is-hit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(var(--logo-unit) * 0.077);
    height: calc(var(--logo-unit) * 0.077);
    background-color: var(--n-900);
    border-radius: 50%;
}

/* ── Navigation ───────────────────────────────────────────── */
.main-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-left: auto;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-list > li {
    position: relative;
}

.nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing);
    color: var(--color-nav-text);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--transition), background-color var(--transition);
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: var(--n-0);
    background-color: rgba(255,255,255,.08);
    text-decoration: none;
}

/* Vyplněné tlačítko — nese hlavní akci lišty (přihlášení). */
.nav-login {
    background-color: var(--brand);
    color: var(--n-0) !important;
    border-radius: var(--radius-sm);
    padding-inline: var(--spacing);
}

.nav-login:hover {
    background-color: var(--brand-hover) !important;
    color: var(--n-0) !important;
}

/* Druhá, tišší akce vedle vyplněného přihlášení. */
.nav-login-outline {
    border: 1.5px solid var(--brand-on-dark);
    color: var(--brand-on-dark) !important;
    border-radius: var(--radius-sm);
    padding-inline: var(--spacing);
}

.nav-login-outline:hover {
    background-color: var(--brand-on-dark);
    color: var(--n-900) !important;
}

/* Nav-list má kvůli obyčejným odkazům nulovou mezeru, takže by se ta dvě
   tlačítka dotýkala rámečky. V mobilním menu jsou položky pod sebou přes celou
   šířku, tam by odsazení jen rozhodilo řádek — proto jen nad breakpointem. */
@media (min-width: 1024px) {
    .nav-login,
    .nav-login-outline,
    .nav-logout {
        margin-left: var(--spacing-sm);
    }
}

/* Admin link */
.nav-admin {
    color: var(--color-nav-admin) !important;
}

.nav-admin:hover {
    color: var(--color-nav-admin-hover) !important;
}

/* Odhlášení je obtažené tlačítko, stejné jako registrace na druhé straně
   přihlášení — je to jediná akce v liště, která něco mění, a jako holý odkaz
   splývala s navigací. `font-family` a `font-size` se berou z .nav-link, ne
   z `inherit`: <button> jinak spadne na fonty prohlížeče a text v něm byl
   o kus menší a jiným písmem než odkazy vedle. */
.nav-logout {
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: inherit;
    border: 1.5px solid var(--brand-on-dark);
    color: var(--brand-on-dark) !important;
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm) var(--spacing);
}

.nav-logout:hover {
    background-color: var(--brand-on-dark);
    color: var(--n-900) !important;
}

/* ── Dropdown menu ────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

/* The caret used to be a pseudo-element on the link, so the only way to open
   the submenu was hovering — impossible on a touch screen, where the first tap
   just follows the link. It is now a real button beside the link, reachable by
   tap, click and keyboard alike. */
.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-nav-text);
    font-size: var(--fs-2xs);
    line-height: 1;
    padding: var(--spacing-sm) 8px;
    margin-left: -10px;
    border-radius: var(--radius-sm);
    transition: transform var(--transition), color var(--transition);
}

.nav-dropdown-toggle:hover {
    color: var(--n-0);
    background-color: rgba(255,255,255,.08);
}

.nav-dropdown-toggle[aria-expanded="true"] {
    transform: rotate(180deg);
    color: var(--n-0);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    padding-top: 4px;
    left: 0;
    min-width: 200px;
    background-color: var(--color-nav-bg);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding-block: var(--spacing-xs);
}

.dropdown-menu li a {
    display: block;
    padding: var(--spacing-sm) var(--spacing);
    color: var(--color-nav-text);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}

.dropdown-menu li a:hover {
    background-color: rgba(255,255,255,.08);
    color: var(--n-0);
}

/* .open is the primary mechanism (set by the toggle button, works everywhere). */
.nav-dropdown.open .dropdown-menu {
    display: block;
}

/* Hover a focus-within jsou jen pohodlí na desktopu. V mobilním menu je
   podnabídka statická a musí zůstat sbalená, dokud ji uživatel nerozklikne —
   proto tahle pravidla nesmí platit pod breakpointem, kde by je :hover na
   dotykovém displeji (a focus-within po klepnutí na odkaz) trvale rozbalil. */
@media (min-width: 1024px) {
    .nav-dropdown:hover .dropdown-menu,
    .nav-dropdown:focus-within .dropdown-menu {
        display: block;
    }
}

/* ── Language Switcher ────────────────────────────────────── */
.lang-switcher {
    display: flex;
    gap: var(--spacing-xs);
    border-left: 1px solid rgba(255,255,255,.15);
    padding-left: var(--spacing);
    flex-shrink: 0;
    align-items: center;
}

/* ── Custom language picker (replaces native select) ──────── */
.lang-picker {
    position: relative;
}
.lang-picker-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--n-800);
    color: var(--color-nav-text);
    border: 1px solid var(--n-700);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: var(--fs-sm);
    line-height: 1;
    white-space: nowrap;
}
.lang-picker-btn:hover {
    border-color: var(--color-accent);
}
.lang-picker-arrow {
    font-size: var(--fs-2xs);
    opacity: .7;
}
.lang-flag {
    height: 16px;
    width: auto;
    vertical-align: middle;
    border-radius: 1px;
}
.lang-picker-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    min-width: 130px;
    z-index: 9999;
    overflow: hidden;
}
.lang-picker.open .lang-picker-menu {
    display: block;
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    color: var(--n-900);
    text-decoration: none;
    font-size: var(--fs-sm);
    white-space: nowrap;
}
.lang-option:hover {
    background: var(--color-surface-sunk);
}
.lang-option.active {
    font-weight: 700;
    color: var(--color-accent);
}

/* ── Hamburger button ─────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* 44x44 is the minimum comfortable touch target (WCAG 2.5.5 / iOS HIG). */
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
    gap: 5px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition);
}

.hamburger:hover {
    background-color: rgba(255,255,255,.1);
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-surface);
    border-radius: 2px;
    transition: transform 250ms ease, opacity 150ms ease;
    transform-origin: center;
}

/* Animated × when open */
.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Main content area ────────────────────────────────────── */
.site-main {
    flex: 1;
}

/* ── Sidebar widgets ──────────────────────────────────────── */
.sidebar-widget {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--spacing);
    margin-bottom: var(--spacing);
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-accent);
}

/* ── Userbox widget ───────────────────────────────────────── */
/* Jméno a „(uživatelské jméno)“ jsou dvě položky jednoho řádku, ne dva odstavce:
   `flex-wrap` je nechá vedle sebe, dokud se do šířky sidebaru vejdou, a zalomí
   je teprve tehdy, když se nevejdou. Zkracování tečkami zůstává na položkách —
   proto `min-width: 0`, bez něj flexová položka odmítne zúžit pod obsah. */
.userbox-name {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: .35em;
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

.userbox-name > span {
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.userbox-username {
    font-weight: 400;
    color: var(--color-text-muted);
}

.userbox-stat {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.userbox-stat strong {
    color: var(--color-text);
    font-weight: 700;
}

/* ── Rankings tabs (sidebar) ──────────────────────────────── */
.rankings-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}




/* ── Rankings widget list ─────────────────────────────────── */
/* The markup in partials/rankings.htm referenced these classes without any
   rule existing for them. It went unnoticed because the widget rendered empty
   until it started deriving the standings from imported results — with data,
   the flag <img> carries no width and falls back to its intrinsic size, which
   blows the sidebar apart. */
.rankings-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.rankings-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--color-border);
}

.rankings-list li:last-child {
    border-bottom: none;
}

.rank-pos {
    min-width: 1.4rem;
    flex-shrink: 0;
    font-weight: 700;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* Dlouhá jména (BOE Johannes Thingnes) se zkrátí; bodový součet drží vpravo
   a nesmí se zalomit, jinak by řádky měly různou výšku. */
.rank-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-points {
    margin-left: auto;
    padding-left: 6px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.flag-xs {
    height: 12px;
    width: auto;
    flex-shrink: 0;
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(36,36,38,.25);
}

/* ── Flash messages ───────────────────────────────────────── */
.flash {
    padding: var(--spacing-sm) var(--spacing);
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
    font-size: var(--font-size-sm);
    font-weight: 500;
    /* Ne flex: obsahem hlášky je běžný inline text (ikona je znak, ne prvek).
       Ve flexu se každý textový uzel a každý <strong> stal samostatnou flex
       položkou, takže se na úzkém displeji lámaly nezávisle a mezi slovy
       vznikaly mezery — viz nápověda nad seznamem závodů na /tip. */
    display: block;
    line-height: 1.5;
}

.flash-success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--c-success-br);
}

.flash-error {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--c-danger-br);
}

.flash-info {
    background-color: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid var(--n-300);
}

/* ── Page headings ────────────────────────────────────────── */
/* The display face is condensed, so it carries more characters per line at the
   same size — headings can stay large without crowding the sidebar. */
h1, h2, h3,
.logo-tipuj,
.section-title,
.widget-title,
.card-title,
.position-badge,
.site-banner-claim,
.history-section-title,
.section-drill-title {
    font-family: var(--font-display);
    letter-spacing: -0.005em;
}

h1 {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

h2 {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing);
    line-height: 1.25;
}

h3 {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

/* A heading that follows body content needs space above it, or it reads as the
   last line of that content rather than the start of a new subsection. Only
   headings with something before them get it: a heading opening a card or a
   section is already spaced by the container. */
:is(p, ul, ol, dl, table, blockquote, figure) + :is(h2, h3, h4) {
    margin-top: var(--spacing-lg);
}

/* ── Tabular numerals ─────────────────────────────────────── */
/* Scores, times, positions and prices are read by comparing them down a
   column. Proportional digits make that noticeably harder. */
table,
.rank-pos,
.rank-points,
.userbox-stat strong,
.formula,
.pagination,
.position-badge,
.status-badge {
    font-variant-numeric: tabular-nums;
}

/* ── Tables ───────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: var(--font-size-sm);
}

thead {
    background-color: var(--color-nav-bg);
    color: var(--n-0);
}

thead th {
    padding: var(--spacing-sm) var(--spacing);
    text-align: left;
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color var(--transition);
    /* An opaque background of its own, so the sticky first column on phones
       can inherit one — otherwise scrolled content shows through it. */
    background-color: var(--color-surface);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background-color: var(--color-surface-alt);
}

td {
    padding: var(--spacing-sm) var(--spacing);
    vertical-align: middle;
}

/* Row rank colours */
.rank-1 { background-color: var(--color-gold-bg); }
.rank-2 { background-color: var(--color-silver-bg); }
.rank-3 { background-color: var(--color-bronze-bg); }
.rank-current { background-color: var(--color-current-bg); }

.rank-1:hover { background-color: var(--medal-gold-hover); }
.rank-2:hover { background-color: var(--medal-silver-hover); }
.rank-3:hover { background-color: var(--medal-bronze-hover); }
.rank-current:hover { background-color: var(--row-me-hover); }
.rank-1.rank-current:hover { background-color: var(--medal-gold-hover); }
.rank-2.rank-current:hover { background-color: var(--medal-silver-hover); }
.rank-3.rank-current:hover { background-color: var(--medal-bronze-hover); }

/* Responsive table wrapper */
.table-responsive {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

/* Hint that there is more to the right. Removed by app.js once the table is
   scrolled to its end, and never shown when the table already fits. */
.table-responsive::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(to right, rgba(36,36,38,0), rgba(36,36,38,.12));
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition);
}

.table-responsive.is-scrollable::after {
    opacity: 1;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 0.5rem 1.25rem;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    text-decoration: none;
}


.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-btn-primary);
    color: var(--n-0);
    border-color: var(--color-btn-primary);
}

.btn-primary:hover {
    background-color: var(--color-btn-primary-hover);
    border-color: var(--color-btn-primary-hover);
    color: var(--n-0);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-secondary:hover {
    background-color: var(--brand);
    color: var(--n-0);
}

.btn-danger {
    background-color: var(--color-btn-danger);
    color: var(--n-0);
    border-color: var(--color-btn-danger);
}

.btn-danger:hover {
    background-color: var(--c-danger-hover);
    border-color: var(--c-danger-hover);
    color: var(--n-0);
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: var(--fs-xs);
}

/* ── Forms ────────────────────────────────────────────────── */
form {
    /* No default styles — each form has its own context */
}

.form-group {
    margin-bottom: var(--spacing);
}

label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: inherit;
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.8;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    accent-color: var(--color-accent);
}

/* Needitovatelná hodnota ve formuláři (stav závodu) — stojí na místě inputu,
   takže potřebuje jeho odsazení, ne odsazení odstavce. */
.form-static {
    margin: 0;
}

.form-hint {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}


input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--color-error);
    box-shadow: 0 0 0 4px rgba(198, 40, 40, .18);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding-inline: var(--spacing-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}

.pagination a {
    color: var(--color-accent);
    border: 1px solid var(--color-border);
    background-color: var(--color-surface);
}

.pagination a:hover {
    background-color: var(--brand);
    color: var(--n-0);
    border-color: var(--color-accent);
    text-decoration: none;
}

/* Only the current page is a filled chip. This used to also match every
   plain <span> in the bar, which is why "Stránka X z Y" had to be patched
   back to looking like text further down the file. */
.pagination .current {
    background-color: var(--brand);
    color: var(--n-0);
    border: 1px solid var(--color-accent);
    font-weight: 700;
}

.pagination .disabled {
    color: var(--color-text-muted);
    border-color: var(--color-border);
    background-color: var(--color-surface);
    cursor: not-allowed;
    opacity: 0.5;
}

/* ── Status badges ────────────────────────────────────────── */
/* Odznak je doprovodný údaj vedle názvu závodu, ne jeho konkurent — proti
   původní velikosti je zhruba o třetinu menší (písmo --fs-xs → --fs-3xs, užší
   vnitřní okraje a sevřenější řádkování). Tučné verzálky drží čitelnost i na
   10 px, níž už jít nechci. Levý okraj drží odznak z názvu závodu, na který
   jinak doléhal — mezera ve značkách na to sama nestačí. */
.status-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    padding: 1px 6px;
    border-radius: 100px;
    font-size: var(--fs-3xs);
    line-height: 1.45;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.status-open {
    background-color: var(--color-open-bg);
    color: var(--color-open);
}

.status-closed {
    background-color: var(--color-closed-bg);
    color: var(--color-closed);
}

.status-finished {
    background-color: var(--color-finished-bg);
    color: var(--color-finished);
}

.status-scheduled {
    background-color: var(--color-surface-sunk);
    color: var(--color-scheduled);
}

/* Zrušený závod. Červená je tu na místě — na rozdíl od ostatních stavů nejde
   o fázi tipování, ale o zprávu, že se závod nekoná. Tokeny --c-danger-* jsou
   definované ve všech třech motivech, takže odznak nepotřebuje vlastní. */
.status-cancelled {
    background-color: var(--c-danger-bg);
    color: var(--c-danger);
}

/* ── Tip list row states ──────────────────────────────────── */

/* Urgent — less than 60 min left, not tipped.
   Amber rather than red: "closing soon" is a warning, not an error, and the
   brand now owns the red end of the spectrum. It also fixes the older problem
   where the urgent and open states were red-vs-green — indistinguishable to
   the most common form of colour blindness. */
.race-row-urgent {
    background-color: var(--c-warning-bg);
    border-left: 4px solid var(--c-warning);
    animation: pulse-urgent 2s ease-in-out infinite;
}

.race-row-urgent:hover {
    background-color: var(--c-warning-br);
}

@keyframes pulse-urgent {
    0%, 100% { border-left-color: var(--c-warning); }
    50%      { border-left-color: var(--c-warning-br); }
}

/* Open, not tipped.
   Bez zeleného podbarvení: otevřený závod už nese tučný čas a zelený odznak
   „Otevřeno“, takže vybarvený řádek říkal totéž potřetí a v seznamu, kde je
   otevřená celá polovina závodů, z toho byla souvislá zelená plocha. Zůstává
   pruh vlevo jako značka stavu a zelený hover, který drží zpětnou vazbu na
   najetí myší. */
.race-row-open-notipped {
    border-left: 4px solid var(--c-success);
}

.race-row-open-notipped:hover {
    background-color: var(--c-success-bg);
}

/* Open, already tipped — same hue, far quieter */
.race-row-open-tipped {
    border-left: 4px solid var(--c-success-br);
}

.race-row-open-tipped:hover {
    background-color: var(--c-success-bg);
}

/* Closed */
.race-row-closed {
    background-color: var(--color-closed-bg);
    border-left: 4px solid var(--brand);
}

.race-row-closed:hover {
    background-color: var(--brand-tint-hover);
}

/* Finished */
.race-row-finished {
    background-color: var(--color-surface-alt);
    border-left: 4px solid var(--n-400);
    color: var(--color-text-muted);
}

.race-row-finished:hover {
    background-color: var(--color-surface-sunk);
}

/* Scheduled — not yet open for tipping, not clickable */
.race-row-scheduled {
    background-color: var(--color-surface);
    border-left: 4px solid var(--n-300);
    opacity: 0.75;
    cursor: default;
}

/* Zrušený — jako plánovaný (bez odkazu, ztlumený), jen s červeným pruhem, aby
   se ve výpisu nedal splést s tím, na co se ještě bude tipovat. */
.race-row-cancelled {
    background-color: var(--color-surface);
    border-left: 4px solid var(--c-danger-br);
    opacity: 0.7;
    cursor: default;
}

/* Přeškrtnutý název závodu je to jediné, co i bez barev řekne „nekonal se“ —
   ztlumení samo o sobě vypadá jako „ještě není na řadě“. Odznak stavu se
   přeškrtnout nesmí, ten svoje slovo nese sám. */
.race-row-cancelled td a:not(.status-badge),
.race-row-cancelled .calendar-race-name {
    text-decoration: line-through;
}

/* Zrušený závod v kalendáři v sidebaru. */
.calendar-race-cancelled .calendar-race-name {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

/* Závod, který je na řadě — cíl kotvy „Aktuální závod“. Barvu pozadí si nechává
   po svém stavu (otevřeno / plánováno / dojeto), přidává jen obrys značky, aby
   po skoku bylo vidět, kam kotva mířila, a aby to nepřebilo stavové barvy. */
/* Bez ztučnění celého řádku: datum a čas už tučné jsou (u všech otevřených
   i uzavřených závodů), takže se tu sčítalo tučné s tučným a řádek na řadě
   vypadal jinak než ostatní otevřené. Obrys značky sám o sobě stačí. */
.race-row-anchor > td {
    box-shadow: inset 0 1px 0 var(--brand), inset 0 -1px 0 var(--brand);
}
.race-row-anchor > td:first-child {
    box-shadow: inset 1px 1px 0 var(--brand), inset 0 -1px 0 var(--brand);
}
.race-row-anchor > td:last-child {
    box-shadow: inset -1px 1px 0 var(--brand), inset 0 -1px 0 var(--brand);
}
/* Kotva vede do tabulky pod lepivou hlavičkou — bez odsazení by řádek skončil
   pod ní. */
.race-row-anchor {
    scroll-margin-top: calc(var(--header-height) + var(--spacing));
}

/* Clickable rows cursor. The row itself is a mouse convenience only — the real
   navigation is a link inside the row, so the keyboard reaches it too. */
tr[data-href] {
    cursor: pointer;
}

/* Show the row highlight when the link inside it takes focus, so a keyboard
   user sees the same affordance a mouse user gets on hover. */
tr[data-href]:focus-within {
    background-color: var(--brand-tint) !important;
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

/* The in-row link inherits the row's text colour: it is a whole-row target,
   not a piece of inline link text that should stand out on its own. */
.row-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.row-link:hover,
.row-link:focus-visible {
    color: var(--brand);
    text-decoration: none;
}

/* ── Tip list legend ──────────────────────────────────────── */
.tip-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.legend-icon {
    flex-shrink: 0;
    font-size: var(--fs-xs);
    line-height: 1;
}

/* Kept in lockstep with the .race-row-* rules above. */
.legend-urgent    { background: var(--c-warning-bg); border-left: 3px solid var(--c-warning); }
.legend-open      { background: var(--c-success-bg); border-left: 3px solid var(--c-success); }
.legend-tipped    { background: var(--color-surface-alt);         border-left: 3px solid var(--c-success-br); }
.legend-closed    { background: var(--brand-tint);   border-left: 3px solid var(--brand); }
.legend-finished  { background: var(--color-surface-alt);         border-left: 3px solid var(--n-400); }
.legend-scheduled { background: var(--color-surface); border-left: 3px solid var(--n-300); }

/* ── Athlete photo thumbnail ──────────────────────────────── */
.athlete-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Country flag images ──────────────────────────────────── */
.flag {
    display: inline-block;
    height: 16px;
    width: auto;
    vertical-align: middle;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(36,36,38,.25);
    margin-right: 4px;
}


/* ── Score tooltip ────────────────────────────────────────── */
.score-tooltip {
    position: fixed;
    z-index: 9999;
    min-width: 264px;
    max-width: 408px;
    background: var(--color-surface-sunk);
    border: 1.5px solid var(--n-700);
    border-radius: 8px;
    padding: 6px;
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-xs);
    color: var(--n-900);
    pointer-events: none;
}

.score-tooltip-header {
    background: var(--n-700);
    color: var(--n-0);
    font-weight: 700;
    font-size: var(--fs-xs);
    padding: 4px 8px 4px 8px;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.score-tooltip table {
    width: 100%;
    background: var(--color-surface);
    border-collapse: collapse;
    box-shadow: none;
    border-radius: 4px;
    overflow: hidden;
}

.score-tooltip td {
    color: var(--n-900);
    border-bottom: 1px solid var(--color-border);
    padding: 3px 7px;
}

.score-tooltip td:last-child {
    text-align: right;
    white-space: nowrap;
    padding-left: 12px;
}

.score-tooltip tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--color-border);
    border-bottom: none;
    background: var(--color-surface-sunk);
}

/* ── Tip form ─────────────────────────────────────────────── */
.tip-form {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.tip-form h2 {
    margin-bottom: var(--spacing);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--color-accent);
}

.tip-form .form-group {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--spacing-sm) var(--spacing);
    margin-bottom: var(--spacing-sm);
}

.tip-form label {
    margin-bottom: 0;
    white-space: nowrap;
}

.tip-form .position-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--color-nav-bg);
    color: var(--n-0);
    border-radius: 50%;
    font-weight: 700;
    font-size: var(--fs-sm);
    flex-shrink: 0;
}


.tip-row-drag {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    transition: background 0.15s, box-shadow 0.15s;
    cursor: default;
}

.tip-row-drag:hover {
    background: var(--color-surface-sunk);
    box-shadow: var(--shadow-sm);
}

.drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
    font-size: var(--fs-md);
    line-height: 1;
    user-select: none;
    padding: 0 4px;
    flex-shrink: 0;
    letter-spacing: -1px;
}

.drag-handle:active {
    cursor: grabbing;
}

/* ── Reorder buttons ──────────────────────────────────────── */
/* The visible control on touch and keyboard; the drag handle stays as a
   mouse-only shortcut. 44px total height meets the minimum touch target. */
.tip-reorder {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 2px;
}

.btn-reorder {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Minimum 24x24 podle WCAG 2.5.8 — 28x21 se na dotyk míjelo, a jsou to
       jediné ovládání řazení, které funguje na telefonu i z klávesnice. */
    width: 32px;
    height: 24px;
    padding: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition),
                border-color var(--transition);
}

.btn-reorder:hover:not(:disabled) {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--n-0);
}

.btn-reorder:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.position-badge {
    background: var(--brand);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    font-weight: bold;
    flex-shrink: 0;
}

.tip-row-drag.dragging {
    opacity: 0.4;
    box-shadow: var(--shadow);
}

.tip-row-drag.drag-over {
    border: 2px dashed var(--color-accent);
    background: var(--brand-tint);
}

.athlete-select {
    flex: 1;
    min-width: 0;
}

.tip-drag-hint {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin-top: 8px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tip-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.tip-section h2 {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: .75rem;
    padding-left: .6rem;
    border-left: 3px solid var(--color-accent);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.no-start {
    font-style: italic;
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    padding: .75rem 0;
    margin: 0;
}






.news-content p:last-child { margin-bottom: 0; }


/* ── Error / 404 pages ────────────────────────────────────── */
.page-error {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing);
}

.page-error h1 {
    font-size: var(--fs-3xl);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing);
}

.page-error p {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-lg);
}

/* 404 se vykresluje v layoutu, takže stojí v kartě jako ostatní obsah. */
.page-404 {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Deliberately off the type ladder: the giant "404" numeral is display
   artwork, not a heading — the <h1> below carries the page's meaning. */
.page-404-code {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-border-strong);
    margin: 0 0 var(--spacing);
}

.page-404 h1 {
    font-size: var(--fs-2xl);
    margin-bottom: var(--spacing);
}

.page-404 p {
    color: var(--color-text-muted);
    margin: 0 auto var(--spacing);
    max-width: 36rem;
}

/* Střelnice: čtyři zásahy a jedna rána vedle. */
.page-404-targets {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.page-404-target {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 3px solid var(--color-text);
}

.page-404-target.is-hit {
    background: var(--color-text);
}

.page-404-target:not(.is-hit) {
    border-color: var(--brand);
}

.page-404-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-lg) 0;
}

.page-404 .page-404-contact {
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: var(--spacing-lg) 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing);
    flex-wrap: wrap;
}

.footer-copy {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: rgba(255,255,255,.8);
}

.footer-links {
    font-size: var(--font-size-sm);
}

.footer-links a {
    color: var(--color-footer-text);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--color-accent-light);
}

.footer-updated {
    font-size: var(--fs-xs);
    /* rgba(255,255,255,.4) dává na patičce 3.7:1. Stejná barva jako
       ostatní text patičky splňuje AA a nic vizuálně nerozbíjí. */
    color: var(--color-footer-text);
}

/* ══════════════════════════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────── */













/* ── Next race strip ──────────────────────────────────────── */
/* The one thing a returning visitor comes back for, so it sits directly under
   the hero instead of being buried in the sidebar. */
.next-race {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 5px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing) var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Under an hour to go the whole strip switches to the warning colour — the
   same amber the tip list uses for an urgent race, so the two agree. */
.next-race.is-closing {
    border-left-color: var(--c-warning);
    background: var(--c-warning-bg);
}

.next-race-body {
    min-width: 0;
}

.next-race-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.next-race-name {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 700;
    line-height: 1.25;
}

.next-race-name a {
    color: inherit;
    text-decoration: none;
}

.next-race-name a:hover,
.next-race-name a:focus-visible {
    text-decoration: underline;
}

.next-race-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-top: 2px;
}

.next-race-sep {
    color: var(--color-text-muted);
}

.next-race-side {
    display: flex;
    align-items: center;
    gap: var(--spacing);
    flex-shrink: 0;
}

.next-race-countdown {
    text-align: right;
}

.next-race-remaining {
    display: block;
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.countdown-value {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.is-closing .countdown-value {
    color: var(--c-warning);
}

/* ── Section head with a trailing link ────────────────────── */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing);
    flex-wrap: wrap;
}

.section-head .section-title {
    flex: 1;
    min-width: 0;
}

/* ── Standings preview & news ─────────────────────────────── */
.home-standings,
.home-news {
    margin-bottom: var(--spacing-xl);
}

.col-narrow {
    width: 1%;
    white-space: nowrap;
}

/* ── Empty states ─────────────────────────────────────────── */
/* A bare sentence in the middle of a page reads as a fault. A framed block
   with an icon and a next step reads as a state. */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing);
    background: var(--color-surface-alt);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: var(--fs-2xl);
    line-height: 1;
    opacity: 0.5;
    margin-bottom: var(--spacing-sm);
}

.empty-state-title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.empty-state-text {
    font-size: var(--fs-sm);
    max-width: 44ch;
    margin-inline: auto;
    margin-bottom: var(--spacing-sm);
}

/* Sidebar widgets are ~300px wide; the full-size block would dwarf them. */
.empty-state-compact {
    padding: var(--spacing) var(--spacing-sm);
    text-align: left;
}

.empty-state-compact .empty-state-title {
    font-size: var(--fs-sm);
}

.empty-state-compact .empty-state-text {
    font-size: var(--fs-xs);
    margin-inline: 0;
}


@media (max-width: 640px) {




    .next-race {
        flex-direction: column;
        align-items: stretch;
    }

    .next-race-side {
        justify-content: space-between;
    }

    .next-race-countdown {
        text-align: left;
    }
}

/* ── Admin section styles ─────────────────────────────────── */
.admin-nav {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.admin-nav a {
    padding: var(--spacing-xs) var(--spacing);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    transition: background-color var(--transition), color var(--transition);
    text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a.active {
    background-color: var(--brand);
    color: var(--n-0);
}


.tab-link {
    padding: var(--spacing-sm) var(--spacing);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
}

.tab-link:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.tab-link.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}



/* ── Action row (form controls row) ──────────────────────── */
.action-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: var(--spacing);
}

/* ── Utility classes ──────────────────────────────────────── */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.text-bold   { font-weight: 700; }
.text-sm     { font-size: var(--font-size-sm); }

.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-1  { margin-bottom: var(--spacing); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-1  { margin-top: var(--spacing); }
.mt-lg { margin-top: var(--spacing-lg); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet (640–1024px)
   ══════════════════════════════════════════════════════════ */
/* Upper bound is 1023.98px so a tablet in landscape (exactly 1024 CSS px,
   e.g. iPad) still gets the desktop layout with the sidebar alongside. */
@media (max-width: 1023.98px) {
    .layout-with-sidebar {
        flex-direction: column;
        /* Bez tohoto zůstává v platnosti align-items:flex-start z desktopové
           varianty. Ve sloupcovém směru je to příčná osa, takže se
           .content-area zúží/rozšíří na svůj obsah — a široká tabulka pak
           roztáhne stránku do strany, přes .table-responsive i přes
           min-width:0. Projevovalo se to vodorovným posunem celé stránky
           na /tip, /showresults, /myteam a /admin/athletes. */
        align-items: stretch;
    }

    /* A flex row gave every widget the same width regardless of content, so a
       two-line userbox sat next to a six-line standings list and the row read
       as ragged. A grid sizes each column the same but lets the boxes keep
       their own heights. */
    .sidebar {
        width: 100%;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        align-items: start;
        gap: var(--spacing);
    }

    .sidebar-widget {
        margin-bottom: 0;
    }

    /* The tall ad belongs after the widgets, not wedged between them. */
    .sidebar .ad-sidebar {
        grid-column: 1 / -1;
    }

    /* ── Collapsed navigation ─────────────────────────────────────────────
       Nine links plus two dropdowns and the language picker stop fitting on
       one line well before the phone breakpoint. Left to wrap they pushed the
       fixed-height header out of shape, so the hamburger takes over here —
       the same 1024px boundary the sidebar uses. */
    /* Show hamburger, hide nav by default */
    .hamburger {
        display: flex;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--color-nav-bg);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow-y: auto;
        z-index: 99;
        padding: var(--spacing);
    }

    /* Show mobile nav when body has .nav-open class */
    body.nav-open .main-nav {
        display: flex;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-list > li {
        width: 100%;
    }

    /* Odkaz a šipka drží řádek, podnabídka se zalomí pod ně přes celou šířku. */
    .nav-dropdown {
        flex-wrap: wrap;
    }

    .nav-dropdown > .nav-link {
        flex: 1;
    }

    .nav-link {
        padding: var(--spacing-sm) var(--spacing);
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,.06);
        font-size: var(--font-size-base);
    }

    /* V mobilním menu jde o tlačítko přes celou šířku, stejně jako Registrace —
       spodní linku řádků seznamu by jinak přebila jeho vlastní rámeček. */
    .nav-logout {
        width: 100%;
        text-align: center;
        border-radius: var(--radius-sm);
        margin-top: var(--spacing-sm);
    }

    .nav-dropdown > .nav-link::after {
        display: none;
    }

    /* Podnabídka je tu součástí toku, ne plovoucí panel — ale zůstává sbalená.
       Rozbalená by „Další“ zabralo půl obrazovky hned po otevření menu a
       zatlačilo ostatní položky pod okraj. Otevírá ji šipka vedle odkazu. */
    .dropdown-menu {
        display: none;
        flex-basis: 100%;
        position: static;
        background-color: rgba(255,255,255,.05);
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .dropdown-menu li a {
        padding-left: var(--spacing-xl);
        border-bottom: 1px solid rgba(255,255,255,.04);
        font-size: var(--font-size-sm);
    }

    /* Přihlásit se a Registrovat jsou tlačítka, ne řádky seznamu: dostanou
       rámeček na všech stranách (spodní linku řádků výše by jinak přebila
       tu růžovou) a mezeru, aby se nedotýkaly. */
    .nav-login,
    .nav-login-outline {
        text-align: center;
        border-bottom: none;
        border-radius: var(--radius-sm);
        margin-top: var(--spacing-sm);
    }

    .nav-login-outline {
        border: 1.5px solid var(--brand-on-dark);
    }

    /* Přepínač jazyka patří na začátek menu, ne pod poslední odkaz — po
       otevření musí být vidět bez scrollování. Vpravo nahoře sedí pod křížkem,
       kterým se menu zavírá, tedy tam, kam se ruka právě dívá. */
    .lang-switcher {
        order: -1;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,.15);
        padding-left: 0;
        padding-bottom: var(--spacing);
        margin-bottom: var(--spacing-sm);
        justify-content: flex-end;
    }

    /* Samotná vlajka neřekne, že jde o volbu jazyka. V hamburger menu je
       na název místo, tak ho zobrazíme i vidícím uživatelům. */
    .lang-picker-btn .visually-hidden {
        position: static;
        width: auto;
        height: auto;
        clip: auto;
        overflow: visible;
    }

    .lang-picker-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        gap: 6px;
    }

    /* The fullscreen menu is positioned from the top of the viewport, so the
       header it hangs off has to actually be there. Without this the banner
       above it pushes the header down whenever the page is scrolled to the
       top, and the open menu detaches from the bar that opened it. */
    body.nav-open .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    /* Stops the page behind the open menu from scrolling under it. */
    body.nav-open {
        overflow: hidden;
    }

}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (<640px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    :root {
        --spacing-xl:  1.25rem;
        --spacing-2xl: 2rem;
        /* A tall bar costs about a fifth of the screen on a phone held in
           landscape (viewport ~390-430px tall). The sticky header and the
           fullscreen nav offset both derive from this variable. */
        --header-height: 56px;
    }

    /* Menší základ sazby, ať se logo na úzké liště vejde vedle hamburgeru
       a nepřeteče. Poměry uvnitř lockupu se tím nemění. */
    .logo-lockup {
        --logo-unit: 1.3125rem;   /* 21px */
    }

    .container {
        padding-inline: var(--spacing);
    }

    /* Header adjustments */
    .site-header .container {
        padding-inline: var(--spacing);
    }

    /* Layout */
    .layout-with-sidebar {
        flex-direction: column;
        padding-block: var(--spacing);
        gap: var(--spacing);
    }

    .sidebar {
        flex-direction: column;
    }

    .sidebar-widget {
        min-width: 0;
    }

    /* Typography */
    h1 { font-size: var(--fs-xl); }
    h2 { font-size: var(--fs-lg); }

    /* Tables */
    table {
        font-size: var(--fs-xs);
    }

    /* Once the table scrolls sideways the reader loses track of whose row they
       are looking at, so the first column stays pinned. `background: inherit`
       only works because tbody tr now carries an opaque background. */
    .table-responsive th:first-child,
    .table-responsive td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: inherit;
        box-shadow: 1px 0 0 var(--color-border);
    }

    .table-responsive thead th:first-child {
        background: var(--color-nav-bg);
        z-index: 2;
    }

    thead th,
    td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    /* Forms */
    .tip-form .form-group {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }

    /* Error pages */
    .page-404-code {
        font-size: 3.5rem;
    }
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — Small phones (<=480px)
   Covers the 320px (iPhone SE 1st gen, older Android) and 360px
   (most Android) widths, where the 640px rules alone leave the
   layout cramped.
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .container {
        padding-inline: var(--spacing-sm);
    }

    /* The tooltip must fit a 320px viewport: 264px + 2x8px margin already
       leaves almost nothing, and JS shrinks max-width to the viewport. */
    .score-tooltip {
        min-width: 0;
        font-size: var(--fs-xs);
    }

    /* Clickable player names sit in dense table cells; give them a real
       touch target without inflating every row. */
    .score-detail-trigger {
        display: inline-block;
        min-height: 32px;
        line-height: 32px;
    }

    /* Long display names and venue names must wrap rather than force the
       table wider than the horizontal scroll container. */
    td, th {
        overflow-wrap: anywhere;
    }

    /* Pagination controls stack instead of overflowing. */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-xs);
    }

    .pagination a,
    .pagination span {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    h1 { font-size: var(--fs-lg); }
    h2 { font-size: var(--fs-md); }
}

/* ══════════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════════ */
/* ══════════════════════════════════════════════════════════
   TOUCH TARGETS
   WCAG 2.5.5 and the iOS HIG both want 44x44 CSS px. Measured in a browser at
   390px, six controls fell short — all on height, not width. The query covers
   a narrow screen and any coarse pointer, since a tablet or a touchscreen
   laptop can be wide and still be tapped with a finger.
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px), (pointer: coarse) {
    .logo,
    .btn-small,
    .btn-xs,
    .btn-link-inline,
    .lang-option,
    .pagination a,
    .pagination span {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    /* Block-level links in widgets should fill the row rather than become a
       44px-tall inline box floating inside it. */
    .widget-ibu-link,
    .calendar-venue-name,
    .calendar-race-link {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    /* Šipka „tipovat“ vedle názvu závodu — ikona má 20px, cíl musí mít 44. */
    .calendar-race-tip {
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    /* The two arrows together make one 46px target. */
    .btn-reorder {
        height: 22px;
        width: 34px;
    }
}

/* ══════════════════════════════════════════════════════════
   REDUCED MOTION
   The tip list pulses an urgent row indefinitely and the page scrolls
   smoothly; both are unpleasant for people with vestibular disorders, and
   an endless animation is a WCAG 2.2.2 problem regardless.
   ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ══════════════════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════════════════ */
@media print {
    .site-banner,
    .site-header,
    .sidebar,
    .site-footer,
    .hamburger,
    .btn,
    .pagination {
        display: none !important;
    }

    .layout-with-sidebar {
        display: block;
    }

    .content-area {
        width: 100%;
    }

    body {
        color: var(--n-900);
        background: var(--color-surface);
    }
}

/* ══════════════════════════════════════════════════════════
   RESULTS TABS — horizontální tab-bar nad tabulkou
   ══════════════════════════════════════════════════════════ */
.results-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.results-tab {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--fs-md);
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    background: none;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}
.results-tab:hover {
    color: var(--color-accent);
}
.results-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}
.results-tab.disabled {
    color: var(--n-500);
    cursor: default;
    pointer-events: none;
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--color-accent);
    text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--color-text-muted); }
.breadcrumb-current { color: var(--color-text); font-weight: 500; }

/* ── Drill-down venue/race tabulky ───────────────────────── */
.section-drill {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-border);
}
.section-drill-title {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}
.section-drill-hint {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}
/* Nápověda vlevo, přepínač rozbalení vpravo — obojí patří k téže tabulce, tak
   stojí na jednom řádku místo dvou pruhů nad daty. Na úzkém displeji se zalomí
   pod sebe a přepínač zůstane vlevo pod textem, ne osamocený vpravo. */
.section-drill-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: 1rem;
}
.section-drill-bar .section-drill-hint,
.section-drill-bar .accordion-controls {
    margin-bottom: 0;
}
/* Nápověda nese tutéž ikonu jako odkazy a řádky tabulky — jen staticky, není
   to ovládací prvek, takže se s najetím nikam neposouvá. Text je tlumený,
   ikona ale zůstává karmínová: ukazuje na tabulku pod sebou. */
.section-drill-hint .drill-icon {
    width: 21px;
    height: 21px;
    flex: none;
    color: var(--color-accent);
}
.drill-table tbody tr[onclick],
.drill-table tbody tr[data-href] {
    cursor: pointer;
    transition: background 0.1s;
}
.drill-table tbody tr[onclick]:hover,
.drill-table tbody tr[data-href]:hover {
    background: var(--brand-tint-hover);
}
.drill-arrow {
    color: var(--color-accent);
    text-align: right;
    width: 1%;
}
/* Šipka do detailu byla jen textové „→“ v barvě odkazu — v tabulce plné textu
   ji nešlo odlišit od obsahu. Kolečko s chevronem je znatelně větší cíl a
   s najetím na řádek se rozsvítí, takže je vidět, že řádek někam vede. */
.drill-icon {
    display: inline-block;
    width: 26px;
    height: 26px;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: color .12s, transform .12s;
}
.drill-icon .drill-icon-ring {
    stroke-width: 1.4;
    opacity: .5;
}
.drill-table tbody tr:hover .drill-icon {
    color: var(--brand);
    transform: translateX(2px);
}
.drill-table tbody tr:hover .drill-icon .drill-icon-ring {
    opacity: 1;
    fill: var(--brand-tint);
}

/* Sloupec pohlaví nese jen ikonu a jedno slovo — ať si nebere šířku, kterou
   potřebuje název závodu. */
.col-gender {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

/* Součet bodů si bere jen tolik, kolik číslo potřebuje — zbytek řádku patří
   jménu tipujícího, které se na mobilu jinak lámalo do dvou řádků. */
.col-total {
    width: 1%;
    white-space: nowrap;
}

/* Maximum: na mobilu je pět sloupců o dva víc, než se vejde. Jméno tipu jde
   pryč jako první — pořadí, jméno tipujícího, body a podnik nesou zprávu, tip
   sám je detail. Na širších displejích zůstává. */
@media (max-width: 640px) {
    .col-max-pick {
        display: none;
    }
}

/* ── Race tabs (Tipovací pořadí / Skutečné výsledky) ─────── */
.race-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.race-tab-btn {
    padding: 9px 18px;
    cursor: pointer;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}
.race-tab-btn:hover { color: var(--color-accent); }
.race-tab-btn.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}





/* ═══════════════════════════════════════════════════════════
   CONTENT PAGES — Rules, Points, FAQ
   ═══════════════════════════════════════════════════════════ */

/* ── Shared content page styles ──────────────────────────── */
.page-rules h1,
.page-points h1,
.page-faq h1,
.page-example h1,
.page-sponzoring h1 {
    margin-bottom: 1.5rem;
}

/* ── Ordered / unordered lists in content pages ──────────── */
.rules-list,
.page-rules ol,
.page-rules ul,
.page-points ol,
.page-points ul,
.page-example ol,
.page-example ul {
    padding-left: 1.5rem;
    margin: 1rem 0 1.5rem;
}

.rules-list li,
.page-rules li,
.page-points li,
.page-example li {
    padding: 0.45rem 0 0.45rem 0.25rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--color-border);
    list-style: decimal;
}

.rules-list li:last-child,
.page-rules li:last-child,
.page-points li:last-child,
.page-example li:last-child {
    border-bottom: none;
}

.rules-intro {
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
    font-size: var(--font-size-sm);
}

.rules-footer,
.faq-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* ── Points page sections ─────────────────────────────────── */
.points-section {
    margin-bottom: 2.5rem;
}

.points-section h2 {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-text);
}

.formula-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-size: var(--fs-md);
}

.formula {
    font-size: var(--fs-md);
    font-family: 'Courier New', monospace;
    color: var(--color-accent);
}

.formula-example-link {
    margin-bottom: var(--spacing-lg);
}

/* Two IBU point tables, side by side across the full content width. An
   auto-fill track fitted a third column that has nothing to put in it, so the
   tables were squeezed into two thirds and the rest sat empty. */
.points-ibu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 700px) {
    .points-ibu-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Table improvements ───────────────────────────────────── */
/* Air around a table that sits in running text. A table that is the only thing
   in its container keeps its edges flush, so panels and cards are unaffected. */
.table {
    border-collapse: collapse;
    width: 100%;
    margin-block: var(--spacing-lg);
}

.table:first-child {
    margin-top: 0;
}

.table:last-child {
    margin-bottom: 0;
}

.table th,
.table td {
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.table th {
    font-weight: 700;
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,.02);
}

.table-compact th,
.table-compact td {
    padding: 0.4rem 0.7rem;
}

/* ── FAQ accordion ────────────────────────────────────────── */
/* Native <details>/<summary>: collapse, keyboard operation and the right ARIA
   semantics for free. Fifteen answers permanently expanded made the page
   impossible to scan; all of them start collapsed. */
.faq-list {
    margin: 1.5rem 0;
}

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: var(--color-surface);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: var(--fs-md);
    color: var(--color-text);
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    list-style: none;          /* Firefox marker */
}

/* Chrome/Safari draw their own disclosure triangle. */
.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question:hover {
    background: var(--color-surface-alt);
}

/* The "Q" disc from the previous design, now correctly centred because the
   summary is a flex container. */
.faq-question::before {
    content: 'Q';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
    background: var(--brand);
    color: var(--n-0);
    border-radius: 50%;
    font-size: var(--fs-2xs);
    font-weight: 800;
}

.faq-question::after {
    content: '+';
    margin-left: auto;
    flex-shrink: 0;
    font-size: var(--fs-xl);
    line-height: 1;
    color: var(--brand);
}

.faq-item[open] .faq-question::after {
    content: '−';   /* U+2212 minus sign, not a hyphen */
}

.faq-answer {
    padding: 0 1.1rem 0.95rem 3.1rem;
    font-size: var(--fs-sm);
    color: var(--color-text);
    line-height: 1.7;
}

/* ── Sidebar calendar widget ──────────────────────────────── */
.calendar-widget .widget-title {
    margin-bottom: var(--spacing-sm);
}

.calendar-venues {
    list-style: none;
    padding: 0;
    margin: 0;
}

.calendar-venue {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--font-size-sm);
}

.calendar-venue:last-child {
    border-bottom: none;
}

/* Pruh přes celou šířku widgetu má odsazení v základu, ne až na :hover —
   jinak by řádek při najetí myší poskočil. */
.calendar-venue-name {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 -0.5rem;
    padding: 2px 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
}

/* Odkazy v kalendáři se při najetí myší nepodtrhávají — podtržení by v sloupci
   krátkých řádků vypadalo jako chyba sazby. Stejný signál jako u ostatních
   navigačních odkazů webu (.quicknav-link): barva značky, tady navíc s tichým
   podbarvením řádku, protože jde o celý řádek, ne o slovo ve větě. */
a.calendar-venue-name:hover,
a.calendar-venue-name:focus-visible {
    background-color: var(--color-surface-sunk);
    color: var(--color-accent);
    text-decoration: none;
}

/* Sousední podniky jsou kontext, ne cíl — ztišené, aby rozbalený aktuální
   podnik mezi nimi vystoupil sám, bez rámečku nebo podbarvení. */
.calendar-venue-past .calendar-venue-name,
.calendar-venue-future .calendar-venue-name {
    font-weight: 400;
    color: var(--color-text-muted);
}

/* Odjezděný podnik nese stejnou šedou jako odjezděné závody v tom aktuálním —
   ztišený text sám ho neodlišil ani od aktuálního podniku, ani od toho
   příštího, který teprve přijde a šedý proto není. */
.calendar-venue-past .calendar-venue-name {
    background-color: var(--color-surface-alt);
}

/* Sousedy kalendáře nese samotný název místa — bez popisku nebylo poznat, jestli
   se v Oberhofu jelo, nebo pojede. Popisek je proto nad názvem, drobný a tichý:
   je to zařazení v čase, ne cíl kliknutí. */
.calendar-venue-note {
    display: block;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Hranice sezóny je popisek, ne odkaz: nikde není stránka „před sezónou“. */
.calendar-season-edge {
    font-style: italic;
}

.calendar-races {
    list-style: none;
    padding: 0;
    margin: 0.35rem 0 0;
}

/* Geometrie pruhu je společná všem stavům závodu (dojeto / na řadě / hover),
   aby podbarvené řádky tvořily jeden svislý sloupec a přepnutí stavu nebo
   najetí myší nikde neposunulo text. Negativní okraj vyrovnává odsazení
   sidebaru, aby pruh nekončil uprostřed. */
.calendar-race {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 -0.5rem;
    padding: 3px 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
}

.calendar-race-link {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    color: var(--color-text);
    text-decoration: none;
}

.calendar-race-time {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.calendar-race-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Šipka „tipovat“ u otevřeného závodu. Dřív tu bylo plné tlačítko v barvě
   značky — ve sloupci pěti řádků to byl jediný barevný prvek widgetu a bral
   pozornost názvu závodu. Ikona je stejná jako v drill-down tabulkách, jen
   menší: řádek widgetu má výšku jednoho řádku textu. */
.calendar-race-tip {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    color: var(--color-accent);
}

.calendar-race-tip .drill-icon {
    width: 20px;
    height: 20px;
}

.calendar-race:hover .calendar-race-tip .drill-icon,
.calendar-race-tip:focus-visible .drill-icon {
    color: var(--brand);
    transform: translateX(2px);
}

.calendar-race:hover .calendar-race-tip .drill-icon-ring,
.calendar-race-tip:focus-visible .drill-icon-ring {
    opacity: 1;
    fill: var(--brand-tint);
}

/* Odjezděné závody v aktuálním podniku se drží vzadu — jinak by v pěti řádcích
   soupeřily o pozornost s tím nejbližším. Jen ztišený text, bez podbarvení:
   uvnitř rozbaleného podniku je řádků nejvíc a pruhy by z widgetu udělaly
   žebřík, ve kterém by se ztratil ten jeden zvýrazněný „na řadě". */
.calendar-race-finished .calendar-race-link,
.calendar-race-finished .calendar-race-time {
    color: var(--color-text-muted);
}

.calendar-next-label {
    margin-top: 0.35rem;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-accent);
}

.calendar-race-next {
    background-color: var(--brand-tint);
    font-weight: 700;
}

.calendar-race-next .calendar-race-time {
    color: var(--color-text);
}

/* Hover musí stát za stavovými pravidly, jinak by ho přebilo podbarvení
   dojezděného řádku i toho, co je na řadě. */
.calendar-race:hover {
    background-color: var(--color-surface-sunk);
}

/* Závod, který je na řadě, si při najetí myší nechává barvu značky — šedá by
   z jediného zvýrazněného řádku ve widgetu udělala ten nejtišší. */
.calendar-race-next:hover {
    background-color: var(--brand-tint-hover);
}

.calendar-race-link:hover,
.calendar-race-link:focus-visible,
.calendar-race:hover .calendar-race-link {
    color: var(--color-accent);
    text-decoration: none;
}

.no-races {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
    padding: 0.5rem 0;
}

/* ── Teams link on results page ─────────────────────────────────── */
.teams-results-link {
    margin-bottom: 1rem;
    font-size: var(--fs-sm);
}


/* ── News grid ───────────────────────────────────────────────────── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.news-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.news-tile .news-date {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin-bottom: .4rem;
}

/* ── Lang picker (close on outside click) ────────────────────────── */

/* ── Tooltip trigger cursor ──────────────────────────────────────── */
/* Rozpis bodů se otevírá z jména tipujícího. Dřív to byl <span onclick>:
   z klávesnice nedosažitelný a od běžného textu nerozeznatelný, takže
   interakci našel jen ten, kdo si přečetl kurzívní nápovědu nad tabulkou.
   Teď je to <button>, který se tváří jako odkaz s tečkovaným podtržením. */
.score-detail-trigger {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px dotted var(--color-border-strong);
}

.score-detail-trigger:hover {
    color: var(--color-accent);
    border-bottom-color: currentColor;
}

/* ═══════════════════════════════════════════════════════════
   ADJUSTMENTS — 2026-03-30 checklist fixes
   ═══════════════════════════════════════════════════════════ */

/* ── Jump to my position button ─────────────────────────── */
.btn-jump-to-me {
    font-size: var(--fs-xs);
    padding: .2rem .7rem;
    background: var(--color-surface-sunk);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    cursor: pointer;
    color: var(--color-text);
    margin-bottom: .5rem;
}
.btn-jump-to-me:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ── Alternating zebra rows ──────────────────────────────── */
/* Zebra is the default and every special row state simply overrides it. The
   previous form chained a :not() per state, so adding a seventh row state
   meant editing this selector — and forgetting to was a silent bug. */
tbody tr:nth-child(even) {
    background-color: var(--color-surface-alt);
}

tbody tr.rank-1        { background-color: var(--medal-gold); }
tbody tr.rank-2        { background-color: var(--medal-silver); }
tbody tr.rank-3        { background-color: var(--medal-bronze); }
tbody tr.rank-current  { background-color: var(--row-me); }

/* „Moje řádka“ se pozná pruhem u levé hrany, ne odstínem. Žlutá --row-me byla
   od zlaté --medal-gold nerozeznatelná, takže vedoucí uživatel neviděl ani
   jedno z toho — a šablony navíc volily jen jednu ze dvou tříd, takže mu zlatý
   řádek úplně zmizel. Pruh funguje i v odstínech šedé a nebere medaili barvu. */
tbody tr.rank-1.rank-current { background-color: var(--medal-gold); }
tbody tr.rank-2.rank-current { background-color: var(--medal-silver); }
tbody tr.rank-3.rank-current { background-color: var(--medal-bronze); }

/* Na <tr> se box-shadow s border-collapse:collapse nespoléhá — nese ho
   první buňka řádku. */
tbody tr.rank-current > td:first-child {
    box-shadow: inset 4px 0 0 var(--brand);
}
tbody tr.venue-row     { background-color: var(--color-surface); }
tbody tr.race-sub-row  { background-color: var(--color-surface-alt); }

/* ── Back/navigation pill links ─────────────────────────── */
.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: .35rem .9rem;
    background: var(--color-surface-sunk);
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    font-size: var(--fs-sm);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: border-color .15s, color .15s, background .15s;
}
.btn-link:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--brand-tint);
    text-decoration: none;
}

/* Na tmavém pruhu (pruh rozpočtu ve výběru týmu) by světlá pilulka křičela
   víc než samotný obsah pruhu — drží se proto v jeho barevnosti. */
.text-inverse .btn-link {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .35);
    color: var(--n-0);
}
.text-inverse .btn-link:hover {
    background: rgba(255, 255, 255, .18);
    border-color: var(--n-0);
    color: var(--n-0);
}
.text-inverse .nav-arrow-link .drill-icon,
.text-inverse .nav-arrow-link:hover .drill-icon,
.text-inverse .nav-arrow-link:focus-visible .drill-icon {
    color: var(--n-0);
}
.text-inverse .nav-arrow-link:hover .drill-icon-ring,
.text-inverse .nav-arrow-link:focus-visible .drill-icon-ring {
    fill: rgba(255, 255, 255, .2);
}

/* Row of back links */
.back-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

/* ── Inline orange arrow link ────────────────────────────── */
.btn-link-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-sm);
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}
.btn-link-inline:hover {
    color: var(--color-accent-dark);
    text-decoration: none;
}

/* ── Small action button ─────────────────────────────────── */
/* Velikostní varianta tlačítka pro těsná místa. Barvu si nese volající —
   v kalendáři sidebaru ji vystřídala šipka .calendar-race-tip. */
.btn-xs {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: var(--fs-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}

/* ── Table links: no underline ───────────────────────────── */
table a {
    text-decoration: none;
}
table a:hover {
    text-decoration: none;
    color: var(--color-accent);
}

/* ── Quick navigation pill buttons ──────────────────────── */
.quicknav-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .75rem 0 1.25rem;
    align-items: center;
}
.quicknav-label {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin-right: .25rem;
}
.quicknav-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    background: var(--color-surface-sunk);
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    font-size: var(--fs-xs);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: border-color .15s, color .15s;
}
.quicknav-link:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}
/* Skok na aktuální podnik nese barvu značky — ze sousedních skoků je to ten
   nejčastěji hledaný cíl, tak nesplývá se zbytkem řádku. */
.quicknav-link-current {
    background: var(--brand-tint);
    border-color: var(--color-accent);
    color: var(--color-accent);
}
.quicknav-link-current:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--n-0);
}

/* ── Odkaz s přechodovou šipkou ──────────────────────────── */
/* Šipky z fontu (→ ↓) byly u odkazů sotva znatelné — ve velikosti okolního
   textu je čtenář přehlédl a nepoznal, že jde o přechod jinam. Používá se
   proto stejné kolečko s chevronem jako v drill-down tabulkách podniků
   (partials/drill_arrow.htm, dolů mířící drill_arrow_down.htm): jeden
   rozpoznatelný prvek pro „odsud se jde dál" na celém webu. */
.nav-arrow-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.nav-arrow-link .drill-icon {
    /* Menší než v tabulce (26 px): tam stojí sám ve sloupci, tady vedle
       textu velikosti --fs-xs, kde by 26 px řádek roztahovalo. */
    width: 21px;
    height: 21px;
    flex: none;
    color: var(--color-accent);
}
.nav-arrow-link:hover .drill-icon,
.nav-arrow-link:focus-visible .drill-icon {
    color: var(--brand);
    transform: translateX(2px);
}
.nav-arrow-link:hover .drill-icon-down,
.nav-arrow-link:focus-visible .drill-icon-down {
    transform: translateY(2px);
}
/* Odkazy „zpět" nesou tutéž ikonu jen vodorovně překlopenou
   (partials/drill_arrow_back.htm): stojí před textem a s najetím se posouvá
   doleva, aby pohyb odpovídal směru, kterým odkaz vede. */
.nav-arrow-link:hover .drill-icon-back,
.nav-arrow-link:focus-visible .drill-icon-back {
    transform: translateX(-2px);
}
.nav-arrow-link:hover .drill-icon-ring,
.nav-arrow-link:focus-visible .drill-icon-ring {
    opacity: 1;
    fill: var(--brand-tint);
}
/* Pilulka quicknav má vpravo odsazení pro text; kolečko šipky si nese vlastní
   vnitřní okraj, takže by pravá strana vypadala širší než levá. Totéž platí
   pro pilulku .btn-link a — zrcadlově — pro šipku „zpět" stojící vlevo. */
.quicknav-link.nav-arrow-link,
.btn-link.nav-arrow-link {
    padding-right: .4rem;
}
.quicknav-link.nav-arrow-back {
    padding-right: .75rem;
    padding-left: .4rem;
}
.btn-link.nav-arrow-back {
    padding-right: .9rem;
    padding-left: .4rem;
}
/* Na vyplněné pilulce (skok na aktuální podnik) se kolečko musí odlišit od
   karmínového podkladu, jinak by po najetí zmizelo. */
.quicknav-link-current:hover .drill-icon {
    color: var(--n-0);
}
.quicknav-link-current:hover .drill-icon-ring {
    fill: none;
}

/* ── Odkaz na IBU ve widgetech sidebaru ──────────────────── */
/* Byl to prostý textový odkaz, který v sešitém widgetu splýval s posledním
   řádkem seznamu. Nese teď tutéž pilulku jako skoky nad tabulkami
   (.quicknav-link v šabloně), jen přes celou šířku widgetu a s obsahem na
   střed — sloupec je úzký a pilulka zarovnaná vlevo v něm vypadala utrženě.
   Definice musí stát až za .quicknav-link, jinak by ji ta přebila. */
.widget-ibu-link {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: .75rem;
}
.widget-ibu-link:hover {
    text-decoration: none;
}

/* ── Venue row drill-down design ─────────────────────────── */
/* Řádek podniku rozbaluje své závody, proto ukazuje kurzor sám za sebe —
   pravidlo pro tr[data-href] se na něj po zavedení rozbalování nevztahuje. */
.venue-row {
    cursor: pointer;
    transition: background 0.1s;
}
.venue-row td a {
    color: var(--color-text);
    font-weight: 600;
    text-decoration: none;
}
.venue-row:hover {
    background: var(--brand-tint) !important;
}
.venue-row:hover td a {
    color: var(--color-accent);
}
/* Proklik na podnik zůstal na šipce vpravo — ta si bere barvu z buňky
   (.drill-arrow), ne text z pravidel pro odkazy v řádku podniku. */
.venue-row .drill-arrow a {
    color: inherit;
    display: inline-flex;
}
.venue-row-current {
    background: var(--brand-tint) !important;
    border-left: 3px solid var(--color-accent);
}

/* Tlačítko nese jen šipku a název — vypadá jako text v buňce, ale je to
   ovládací prvek, aby rozbalení šlo i z klávesnice. */
.venue-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    width: 100%;
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.venue-toggle strong {
    font-weight: 600;
}
.venue-row:hover .venue-toggle strong {
    color: var(--color-accent);
}
.venue-row-current .venue-toggle strong {
    color: var(--brand);
}
.venue-toggle-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--color-accent);
    transition: transform 0.15s;
}
.venue-row.is-open .venue-toggle-icon,
.tip-group-header.is-open .venue-toggle-icon {
    transform: rotate(90deg);
}

/* ── Race sub-row ────────────────────────────────────────── */
.race-sub-row {
    background: var(--color-surface-alt);
}
.race-sub-row:hover {
    background: var(--brand-tint) !important;
    cursor: pointer;
}
.race-sub-row td {
    font-size: var(--fs-sm);
}

/* ── Results section heading ─────────────────────────────── */
.results-section {
    margin-bottom: 2rem;
}
.section-title {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--color-accent);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Badge (inline label) ────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 100px;
    font-size: var(--fs-2xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

/* ── Alert box ───────────────────────────────────────────── */
.alert {
    padding: var(--spacing-sm) var(--spacing);
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
}
.alert-info {
    background: var(--color-info-bg);
    border: 1px solid var(--n-300);
    color: var(--color-info);
}

/* ── Table hint text ─────────────────────────────────────── */
.table-hint {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin-bottom: .5rem;
    font-style: italic;
}

/* ── "Me" label in standings ─────────────────────────────── */
.me-label {
    font-size: var(--fs-xs);
    color: var(--color-accent);
    font-weight: 600;
}

/* ── Admin icon in standings ─────────────────────────────── */
.user-admin-icon {
    /* Relativně k textu řádku, ne pevně: hvězdička má být menší než jméno,
       ale zmenšovat se s ním. */
    display: inline-block;
    font-size: .85em;
    line-height: 1;
    color: var(--c-warning);
    margin-left: .2rem;
    /* `vertical-align: middle` srovnává na polovinu x-výšky, tedy na střed
       malých písmen — proti jménu s verzálkami tak hvězdička sedí viditelně
       nízko. Posun o desetinu em ji vrátí do optické osy textu. */
    vertical-align: middle;
    position: relative;
    top: -.1em;
}



/* ── Sort indicator in sortable tables ───────────────────── */
.sort-indicator {
    font-size: var(--fs-xs);
    color: var(--color-accent);
}

/* ── Pagination container margin ─────────────────────────── */
.pagination-container {
    margin-top: .75rem;
}

/* "Stránka X z Y" — plain text between the arrows. */
.pagination .pagination-info {
    color: var(--color-text-muted);
    font-weight: 500;
    cursor: default;
}

/* "Zobrazit moji pozici" is a server-side link now, but keeps the pill look
   it had as a <button>. */
a.btn-jump-to-me {
    display: inline-block;
    text-decoration: none;
}

a.btn-jump-to-me:hover {
    text-decoration: none;
}

/* ══════════════════════════════════════════════════════════
   ADVERTISING (Google AdSense — manual units only)
   ══════════════════════════════════════════════════════════ */

/* Deliberately understated: no border, no background, generous whitespace
   above so the unit reads as separate from the content rather than as part
   of it. min-height reserves space before the ad loads, which prevents the
   layout shift that would otherwise hurt Core Web Vitals (CLS). */
.ad-unit {
    margin-block: var(--spacing-xl) var(--spacing);
    text-align: center;
    overflow: hidden;
}

.ad-unit .adsbygoogle {
    display: block;
    width: 100%;
}

.ad-label {
    display: block;
    font-size: var(--fs-2xs);
    line-height: 1.4;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--n-500);
    margin-bottom: 2px;
    user-select: none;
}

/* Below the main content — leaderboard proportions. */
.ad-content {
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing);
}

.ad-content .adsbygoogle {
    min-height: 90px;
}

/* Ve zlomu obsahu — oddělená vlasovými linkami nahoře i dole, aby čtenář
   poznal, kde končí text webu a začíná reklama. Fluid jednotka si výšku řídí
   sama; min-height drží aspoň hrubou rezervu proti poskočení layoutu. */
.ad-inarticle {
    margin-block: var(--spacing-xl);
    padding-block: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.ad-inarticle .adsbygoogle {
    min-height: 120px;
}

/* Uvnitř seznamu otázek na /faq stojí jednotka mezi kartami, takže vlastní
   linky by se sčítaly s jejich okraji. */
.faq-list .ad-inarticle {
    border: 0;
    margin-block: var(--spacing);
}

/* Sidebar — last widget, narrower unit. */
.ad-sidebar {
    margin-top: var(--spacing);
}

.ad-sidebar .adsbygoogle {
    min-height: 250px;
}

@media (max-width: 1023.98px) {
    /* Sidebar becomes a horizontal strip on tablets; a tall rectangle there
       would push the footer far down for little benefit. */
    .ad-sidebar .adsbygoogle {
        min-height: 100px;
    }
}

@media (max-width: 640px) {
    .ad-content .adsbygoogle,
    .ad-sidebar .adsbygoogle {
        min-height: 100px;
    }
}

/* ── Ukotvená lišta na dně displeje (jen mobil) ───────────────
   Vědomě nenápadná varianta anchor reklamy: leží přes obsah (nic neshazuje),
   je nízká, dá se zavřít a app.js ji vytáhne až po odscrollování. Skrytá je
   výchozí stav — `.is-visible` ji vloží do layoutu, `.is-shown` ji vysune,
   takže vyjetí zdola je vidět. */
.ad-sticky {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    /* Pod consent panelem Google (ten si sahá výš): kdyby se lišty potkaly,
       souhlas musí zůstat nahoře. */
    z-index: 800;
    margin: 0;
    padding: 2px 0;
    padding-bottom: max(2px, env(safe-area-inset-bottom));
    /* .ad-unit má overflow:hidden — zavírací tlačítko přečnívá nad hranu
       lišty, takže by se odstřihlo. */
    overflow: visible;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .15);
    transform: translateY(100%);
    transition: transform .3s ease-out;
}

.ad-sticky.is-visible {
    display: block;
}

.ad-sticky.is-shown {
    transform: none;
}

/* Na tabletu a výš ukotvenou reklamu nechceme vůbec — tam je dost místa pro
   jednotku v sidebaru. !important, protože třídy z JS jsou specifičtější. */
@media (min-width: 640px) {
    .ad-sticky {
        display: none !important;
    }
}

.ad-sticky .adsbygoogle {
    display: block;
    width: 100%;
    /* Nízký pruh — vodorovná responzivní jednotka dodá na telefon 320×50,
       nejvýš 320×100. `max-height` tu vědomě není: odřezávat kreativu je
       porušení podmínek AdSense a 100px pruh, který jde zavřít, je pořád
       zlomek toho, co zabírala anchor reklama z Auto ads. */
    min-height: 50px;
}

/* Popisek „Reklama“ tady nemá kam — pruh je sám o sobě oddělený od obsahu
   a každý pixel navíc jde na úkor stránky. */
.ad-sticky .ad-label {
    display: none;
}

.ad-sticky-close {
    position: absolute;
    top: -13px;
    right: 8px;
    width: 26px;
    height: 26px;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
    cursor: pointer;
}

@media print {
    .ad-unit {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════
   CONTENT PAGES — doplňky (pravidla, FAQ, sponzoring)
   ═══════════════════════════════════════════════════════════ */

.rules-outro {
    margin-top: 1.25rem;
    line-height: 1.7;
}

.rules-outro.text-muted {
    font-size: var(--font-size-sm);
}

.faq-intro,
.faq-outro {
    line-height: 1.7;
    margin: 1rem 0;
}

.faq-outro {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* ── Sponzoring ───────────────────────────────────────────── */
.sponzoring-section {
    margin-bottom: 2rem;
}

.sponzoring-partner-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sponzoring-partner-row p {
    flex: 1 1 260px;
    line-height: 1.7;
    margin: 0;
}

.sponzoring-logo {
    max-width: 200px;
    height: auto;
}

.sponzoring-prizes,
.sponzoring-list {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.sponzoring-prizes li,
.sponzoring-list li {
    padding: 0.4rem 0;
    line-height: 1.6;
    border-bottom: 1px solid var(--color-border);
}

.sponzoring-prizes li:last-child,
.sponzoring-list li:last-child {
    border-bottom: none;
}

.sponzoring-prizes li {
    list-style: none;
    font-weight: 600;
}

.sponzoring-thanks {
    margin-top: 1rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN — sdílené prvky formulářů a filtrů
   ═══════════════════════════════════════════════════════════ */

.admin-hint {
    margin-bottom: 1.25rem;
    font-size: var(--font-size-sm);
}

.admin-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.admin-filter-form .form-group {
    margin: 0;
    min-width: 180px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.input-narrow {
    max-width: 7rem;
}

/* Přepínač sezón na stránce historických výsledků */
.season-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.archive-note {
    font-size: var(--font-size-sm);
    margin: 0.5rem 0 0.75rem;
}

/* Tipovačka a soutěž týmů jedné sezóny vedle sebe. Dvě patnáctiřádkové
   tabulky se na monitoru vejdou pohodlně; pod 1000 px se skládají pod sebe,
   protože jméno + skóre už by se do poloviny šířky nevešlo. */
.hof-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
    gap: 0 2rem;
    align-items: start;
}

.hof-column > h3 { margin-top: 0; }

@media (max-width: 999px) {
    .hof-columns { grid-template-columns: 1fr; }
    .hof-column + .hof-column > h3 { margin-top: 1.5rem; }
}

/* Medaile u prvních tří míst. Barvy jsou skutečné kovy, ne světlé podbarvení
   řádku (--medal-*), aby kolečko bylo vidět na světlém i tmavém pozadí. */
.medal {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-left: 4px;
    border-radius: 50%;
    vertical-align: baseline;
    box-shadow: inset 0 -1px 1px rgba(0, 0, 0, .35);
}

.medal-1 { background: radial-gradient(circle at 35% 30%, #F5DC7A, #D4AF37 70%); }
.medal-2 { background: radial-gradient(circle at 35% 30%, #E4E6E8, #A8A9AD 70%); }
.medal-3 { background: radial-gradient(circle at 35% 30%, #D9A273, #A97142 70%); }

/* ═══════════════════════════════════════════════════════════
   ADMIN — správa uživatelů a audit log
   ═══════════════════════════════════════════════════════════ */

.admin-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }
}

.admin-side-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.admin-side-panel .section-title {
    margin-top: 0;
}

.meta-list {
    margin: 0 0 1.25rem;
    font-size: var(--font-size-sm);
}

.meta-list dt {
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.meta-list dd {
    margin: 0;
    font-weight: 600;
}

.inline-form {
    display: inline-block;
    margin: 0 0.4rem 0.5rem 0;
}

/* Řádek smazaného (soft-deleted) účtu — čitelný, ale zjevně neaktivní */
.row-deleted td {
    opacity: 0.6;
    text-decoration: line-through;
}

.row-deleted td .badge {
    text-decoration: none;
    opacity: 1;
}

.badge-muted {
    background: var(--color-border);
    color: var(--color-text-muted);
}

.badge-accent {
    background: var(--brand);
    color: var(--n-0);
}

.col-actions {
    text-align: right;
    white-space: nowrap;
}

.audit-details {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: var(--fs-xs);
    word-break: break-word;
}

/* Upozornění nad výsledky (např. import z náhradního zdroje dat) */
.alert-warning {
    background: var(--c-warning-bg);
    border: 1px solid var(--c-warning-br);
    border-left: 4px solid var(--c-warning);
    color: var(--c-warning);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-warning p {
    margin: 0;
}

/* Upozornění se zavíracím křížkem. Text drží místo pro křížek přes padding
   wrapperu, aby se pod něj na úzkém displeji nepodtekl poslední řádek. */
.alert-dismissible {
    position: relative;
    padding-right: 2.5rem;
}

.alert-close {
    position: absolute;
    top: 0.35rem;
    right: 0.4rem;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    line-height: 1;
    color: inherit;
    background: none;
    border: 0;
    border-radius: 50%;
    opacity: 0.65;
    cursor: pointer;
}

.alert-close:hover,
.alert-close:focus-visible {
    opacity: 1;
    background: rgb(0 0 0 / 0.06);
}

/* Výzvu zavřenou v tomhle sezení skrývá skript v <head> ještě před
   vykreslením — proto třídou, ne až sáhnutím na element z app.js. */
.email-notice-hidden #emailUnverifiedNotice {
    display: none;
}

/* ── Zamčené tlačítko po odeslání (data-lock-submit) ──────────────────────
   Popisek zůstává, jen před něj přibude spinner: tlačítko tak nemění šířku
   a řádek pod ním nepodskočí. Barva se bere z textu, takže to sedí na
   primární i sekundární variantu bez dalších pravidel. */
.btn.is-loading {
    cursor: progress;
    opacity: .75;
}

.btn.is-loading::before {
    content: "";
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-right: 0.5em;
    vertical-align: -0.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* Točení se nesmí vypnout úplně — je to jediná zpětná vazba, že se něco děje.
   Zpomalené otáčení splní i vkus nastavení „omezit pohyb“. */
@media (prefers-reduced-motion: reduce) {
    .btn.is-loading::before {
        animation-duration: 2.4s;
    }
}

/* ══════════════════════════════════════════════════════════
   PAGE-SPECIFIC
   Moved here from <style> blocks that lived inside the view
   templates. There they bypassed the design tokens, duplicated one
   another and blocked first render.
   ══════════════════════════════════════════════════════════ */

/* ── admin.htm ─────────────────────────────────────── */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.admin-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: box-shadow 150ms ease, transform 150ms ease;
    display: flex;
    flex-direction: column;
}
.admin-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    transform: translateY(-2px);
}
/* Inline SVG místo emoji — velikost a barva se řídí tokeny, ne fontem systému. */
.admin-icon {
    width: 28px;
    height: 28px;
    margin-bottom: .75rem;
    color: var(--color-accent);
}
.admin-card-title { font-size: 1.1rem; font-weight: 700; color: var(--color-text); margin-bottom: .4rem; }
.admin-card-desc { font-size: .875rem; color: var(--color-text-muted); flex: 1; margin-bottom: 1rem; line-height: 1.5; }
/* Neutrální, ne karmínová: červená na tomto webu znamená chybu, a „24
   aktivních závodníků“ je běžný stav. Tlačítko drží dole, aby karty
   s metrikou a bez ní měly akci na stejné lince. */
.admin-stats { font-size: .8rem; color: var(--color-text-muted); font-weight: 600; margin-bottom: .75rem; }
.admin-stats strong { color: var(--color-text); }
.admin-card > .btn { margin-top: auto; align-self: flex-start; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--brand); }
.stat-label { font-size: .8rem; color: var(--color-text-muted); }

/* ── admin_athletes.htm ─────────────────────────────────────── */
/* Wrapper around the photo in the admin athlete list. Deliberately a
   different name from .athlete-thumb, which is the <img> itself elsewhere —
   the two carried incompatible rules under one name. */
.athlete-thumb-box {
    width: 36px; height: 36px; background: var(--color-surface-sunk); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-2xs); color: var(--color-text-muted); border: 1.5px solid var(--color-border);
    overflow: hidden;
}
.athlete-thumb-box img { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; }
.active-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-green { background: var(--c-success); }
.dot-red   { background: var(--c-danger); }

/* ── admin_seasons.htm ─────────────────────────────────────── */
/* Formulář nové sezóny je pod tlačítkem přes celou šířku stránky; bez
   omezení by se pole roztáhla na celou obrazovku. */
.season-create { max-width: 420px; }

/* ── Značka pohlaví (sloupec závodů, seznam uživatelů) ───── */
/* Kreslené ikony místo znaků ♂ ♀ ⚧ z Unicode: ty si každý systém bere
   z jiného fontu, takže vedle sebe ve sloupci měly různou velikost, sílu
   tahu i posazení k účaří (a ⚧ se na Androidu vykreslilo jako barevné
   emoji). Viz partials/gender_icon.htm.

   Velikost drží 1em, aby ikona rostla s textem řádku; barvu nese fill
   i stroke, protože kruh je nevyplněný a šipka s křížkem jsou jen tahy. */
.gender-icon {
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.22em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gender-icon-m { color: var(--c-gender-m); }
.gender-icon-f { color: var(--c-gender-f); }
.gender-icon-x { color: var(--c-gender-x); }

/* Ikona a popisek drží na jednom účaří a nelámou se mezi sebou. */
.gender-cell {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    white-space: nowrap;
}

/* Pohlaví je doplňková informace, ne hlavní — v seznamu uživatelů stojí
   vedle jména, takže popisek nemá a nese ho jen title. */
.gender-mark {
    margin-right: .3em;
}

/* ── admin_news.htm ─────────────────────────────────────── */
/* Datum má pevný tvar (bez sekund), takže `width:1%` + nowrap smrskne sloupec
   přesně na obsah a zbylé místo zůstane textu novinky. Dřív si oba datumové
   sloupce braly rovný díl šířky a tlačítka akcí přetékala z tabulky ven. */
.news-col-date {
    width: 1%;
    white-space: nowrap;
}
/* Text novinky se ořízne na dva řádky — na jeden se vešel jen útržek,
   celý obsah by naopak řádky rozházel do nestejné výšky. */
.news-col-content { width: 100%; }
.news-content-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.4;
}

/* ── edit.htm ─────────────────────────────────────── */
/* No top padding — same reason as .login-wrapper: the layout already spaces
   the content area from the menu, so a second gap dropped the card below the
   sidebar next to it. */
.edit-wrapper {
    display: flex;
    justify-content: center;
    padding-block: 0 2.5rem;
}
.edit-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    width: 100%;
    max-width: 100%;
}
/* Selektory musí obsahovat i typ prvku: základní pravidlo pro pole je
   `input[type="email"]` atd., což má vyšší specificitu než samotná třída
   `.field-readonly` — ta se proto vůbec neprojevila a e-mail v profilu
   vypadal jako běžné editovatelné pole. Přidán i atribut [readonly] /
   [disabled], aby zamčené pole vypadalo zamčené i bez pomocné třídy. */
input.field-readonly,
select.field-readonly,
textarea.field-readonly,
input[readonly],
textarea[readonly],
select[disabled] {
    background-color: var(--color-surface-sunk);
    color: var(--color-text-muted);
    cursor: not-allowed;
}
.readonly-note {
    font-size: .8rem;
    color: var(--brand);
    margin-top: .25rem;
    display: block;
}
/* Profile tabs */
.profile-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.profile-tab {
    padding: .5rem .9rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
}
.profile-tab:hover { color: var(--color-accent); }
/* Bez podbarvení: aktivní tab se na zbytku webu (.results-tab, .race-tab-btn)
   pozná podtržením a barvou textu. Růžová plocha navíc tady dělala z téhož
   prvku vizuálně jinou komponentu. */
.profile-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}
.profile-panel { display: none; }
.profile-panel.active { display: block; }

/* Rozbalovací blok — sbalené pole, které se otevře až na vyžádání
   (změna e-mailu v profilu). Postaveno na <details>, takže funguje
   i bez JS a čtečkám hlásí stav rozbalení samo. */
.collapsible {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.collapsible-summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .8rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--color-accent);
    cursor: pointer;
    user-select: none;
    /* Výchozí trojúhelníček nahrazuje vlastní ikona +/− */
    list-style: none;
}
.collapsible-summary::-webkit-details-marker { display: none; }
.collapsible-summary:hover { background: var(--brand-tint); }
.collapsible-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-weight: 700;
    line-height: 1;
}
.collapsible-icon::before { content: "+"; }
.collapsible[open] .collapsible-icon::before { content: "\2212"; }
.collapsible-body {
    padding: .8rem;
    border-top: 1px solid var(--color-border);
}
.collapsible-body .form-group:last-child { margin-bottom: 0; }

/* ── login.htm ─────────────────────────────────────── */
/* No top padding: the layout already spaces the content area from the menu,
   and a second gap here pushed the card visibly below the sidebar it sits
   next to. */
.login-wrapper {
    display: flex;
    justify-content: center;
    padding-block: 0 3rem;
}
.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    width: 100%;
    max-width: 500px;
}
.login-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--n-900);
}
.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: .5rem;
    font-size: .8rem;
}
.divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.25rem 0;
}
.register-hint {
    text-align: center;
    font-size: .875rem;
    color: var(--color-text-muted);
}

/* ── register.htm ─────────────────────────────────────── */
.reg-wrapper {
    display: flex;
    justify-content: center;
    padding-block: 0 2.5rem;
}
.reg-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    width: 100%;
    max-width: 620px;
}
.reg-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--n-900);
    text-align: center;
}
.section-heading {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--color-text-muted);
    margin: 1.5rem 0 .75rem;
    padding-bottom: .4rem;
    border-bottom: 2px solid var(--brand);
}
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: .25rem;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 400;
    cursor: pointer;
}

/* ── Simple form pages (forgot password / username, reset password) ───────── */
/* One definition for all three; they were three copies that disagreed on the
   title spacing, and the last one silently won for all of them. */
/* Horní odsazení je nulové, jako u přihlášení: karta má začínat na stejné
   výšce jako sidebar vedle ní, jinak visí o kus níž než všechno ostatní na
   stránce. Šířku drží na 500 px, taky podle přihlašovací karty — 440 px z ní
   vedle sousedního sloupce dělalo užší útvar bez důvodu. */
.simple-form-wrapper {
    display: flex;
    justify-content: center;
    padding-block: 0 var(--spacing-2xl);
}

.simple-form-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
}

/* Kontakt není přihlašovací dialog — má delší text a víceřádkovou zprávu, tak
   zabírá celý obsahový sloupec jako profil (.edit-card). Zapomenuté heslo,
   zapomenuté jméno a obnova hesla zůstávají na 500 px podle přihlášení. */
.simple-form-card-wide {
    max-width: 100%;
}

/* Kontakt má úvod ve dvou odstavcích a pod nimi odkaz na FAQ. Mezi nimi patří
   malá mezera, velká až před formulář — proto skupina, ne tři samostatné
   odstavce s vlastními okraji. */
.contact-intro-group {
    margin-bottom: var(--spacing-lg);
}
.contact-intro-group > p {
    margin-bottom: var(--spacing-xs);
}
.contact-intro-group > p:last-child {
    margin-bottom: 0;
}

.simple-form-title {
    font-size: var(--fs-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.simple-form-intro {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

/* Reset password has no intro paragraph, so the form would otherwise sit
   directly under the heading. */
.simple-form-title + form {
    margin-top: var(--spacing);
}

/* ══════════════════════════════════════════════════════════
   UTILITIES
   Small single-purpose classes replacing the inline style= attributes the
   templates used to carry. Deliberately few: anything that needs more than
   one or two of these is a component and gets its own class.
   ══════════════════════════════════════════════════════════ */
.text-left    { text-align: left; }
.text-danger  { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-inverse { color: var(--n-0); }
/* Tři odstíny šedé jako pevné neutrály se v tmavém režimu nepřebarvují —
   .text-dim a .text-strong tam padaly na 1.2–2.0:1 a .text-faint nesl reálný
   text („Žádné novinky“, datumy). Barvy proto vedou přes sémantické tokeny,
   které se s tématem překlápí. */
.text-faint   { color: var(--color-text-muted); }
.text-dim     { color: var(--color-text-muted); }
.text-strong  { color: var(--color-text); }
.text-ink     { color: var(--color-text); }

.text-xs { font-size: var(--fs-xs); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }

.fw-normal   { font-weight: 400; }
.fw-medium   { font-weight: 500; }
.fw-semibold { font-weight: 600; }

.uppercase { text-transform: uppercase; letter-spacing: .05em; }
.nowrap    { white-space: nowrap; }
.italic    { font-style: italic; }

.d-flex        { display: flex; }
.d-grid        { display: grid; }
.d-block       { display: block; }
.d-inline      { display: inline; }
.d-inline-flex { display: inline-flex; }
.d-none        { display: none; }

.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1    { flex: 1; min-width: 0; }

.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-xl { margin-bottom: var(--spacing-xl); }
.mt-xl { margin-top: var(--spacing-xl); }

.w-full { width: 100%; }
.w-auto { width: auto; }

.cursor-pointer { cursor: pointer; }

/* ── Extracted one-off rules ──────────────────────────────────
   Declarations from the old inline style= attributes that no utility covers.
   Named by content hash so identical rules share one class. Candidates for
   folding into proper component classes over time.
   ────────────────────────────────────────────────────────────── */
.u-f97483 { padding:.75rem 1rem; background:var(--c-warning-bg); border:1px solid var(--c-warning-br); border-radius:8px; }
.u-82611c { padding:1.25rem; background: var(--color-surface); border:1px solid var(--color-border); border-radius:8px; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.u-9840c2 { padding:.5rem 0; border-bottom:1px solid var(--n-100); }
.u-c3bb0d { margin-right:.5rem; }
.u-8a59a7 { margin-left:.5rem; }
.u-313b25 { max-width:400px; margin-left:auto; }
.u-68dba3 { width:50px; }
.u-c66b41 { font-family:monospace; }
.u-96e70a { padding:2rem; }
.u-40b2cc { margin-top:.25rem; }
.u-b56ad7 { min-width:280px; max-width:560px; }
.u-019128 { min-width:220px; }
.u-98df36 { width:100px; height:125px; object-fit:cover; border-radius:6px; border:1px solid var(--color-border); }
.u-7f45a6 { max-width:640px; }
.u-ae925e { resize:vertical; }
.u-978c7e { background:var(--c-success-bg); padding:.2rem .5rem; border-radius:4px; }
.u-5f2767 { background: var(--color-surface-sunk); padding:.2rem .5rem; border-radius:4px; }
.u-e7fa4c { max-width:560px; }
/* Pevné `1fr 1fr` se na telefonu nezlomilo do jednoho sloupce — dva panely
   vedle sebe roztáhly stránku do strany (/myteam, formulář závodu, TOP5).
   auto-fit s min(100%, …) drží dva sloupce na širokém a jeden na úzkém. */
.u-74e594 { grid-template-columns:repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.u-6cf3a8 { padding-bottom:.4rem; border-bottom:2px solid var(--brand); }
.u-4f2844 { font-size:.7rem; background:var(--brand); padding:.1rem .4rem; border-radius:4px; margin-left:.4rem; }
.u-9abc12 { background:var(--c-warning-bg); padding:.2rem .5rem; border-radius:4px; }
.u-498da9 { max-width:480px; }
.u-3fe91b { flex-direction:column; margin-top:.25rem; }
.u-fb9172 { margin-top:3px; }
.u-bba4d2 { background: var(--color-surface); border:1px solid var(--color-border); border-radius:8px; padding:1.25rem 1.5rem; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.u-239f28 { padding-bottom:.5rem; border-bottom:2px solid var(--brand); }
.u-26f7c9 { padding:.75rem; background: var(--color-surface-sunk); border-radius:6px; }
.u-f7f2c1 { list-style:none; padding:0; margin:0 0 1rem; }
.u-b88a24 { padding:.4rem 0; border-bottom:1px solid var(--n-100); }
.u-c8419c { min-width:120px; }
.u-63a060 { letter-spacing:.05em; padding-bottom:.25rem; border-bottom:2px solid var(--brand); }
.u-13bb9e { flex-direction:column; }
.u-4b4104 { background:var(--n-900); border-radius:8px; padding:1rem 1.5rem; gap:1rem 2rem; }
.u-06d51c { font-size:1.5rem; }
.u-90d2de { color:rgba(255,255,255,.6); letter-spacing:.05em; }
.u-221e55 { margin-left:auto; }
.u-c2b447 { color:rgba(255,255,255,.6); }
.u-fdeb72 { letter-spacing:.07em; padding-bottom:.5rem; border-bottom:2px solid var(--brand); }
.u-95e677 { padding-top:1rem; border-top:1px solid var(--color-border); }
.u-bbb9de { min-width:150px; max-width:280px; }
.u-9c6a2d { width:48px; }
.u-88111d { width:44px; }
.u-95ba54 { padding-left:1.5rem; }
.u-8c2b02 { background:var(--n-900); border-radius:12px; padding:1.5rem 2rem; }
.u-3e1a6c { font-size:1.6rem; }
.u-d7f23b { color:rgba(255,255,255,.7); }
/* Pruh detailu týmu je tmavý (--n-900) v obou tématech, takže tu nepomůže
   ani --color-accent (ve světlém karmín, 2:1), ani --row-me — to je
   navíc token pro *pozadí* vlastního řádku, v tmavém režimu tmavý, takže
   jméno vlastníka mizelo úplně (1.2:1). Světlá varianta brandu drží
   5.2:1 na obou. */
.u-746ec5 { color:var(--n-0); }
.u-ba2c5c { font-size:2rem; color:var(--brand-on-dark); }
.u-c59dfc { margin-top:.25rem; color:rgba(255,255,255,.5); }
.u-9784ab { color:rgba(255,255,255,.8); }
.u-6eb99b { padding:1rem; background: var(--color-surface-sunk); border-radius:8px; }
.u-8f9307 { grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); }
.u-a73fc1 { background: var(--color-surface); border:1px solid var(--color-border); border-radius:8px; padding:1rem; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.u-1b8315 { width:80px; height:80px; border-radius:50%; object-fit:cover; border:2px solid var(--color-border); margin:0 auto .75rem; }
.u-122c9d { min-width:90px; }
.u-a722ee { min-width:160px; }
.u-217b49 { min-width:110px; }
/* Mezititulek podniku v seznamu tipů. Sunk pozadí a tlumený text ho stavěly
   na stejnou úroveň jako řádky závodů pod ním a nadpis se v tabulce ztrácel —
   teď nese barvu značky a svislý pruh, takže je vidět, kde skupina začíná. */
/* Řádek podniku rozbaluje své závody — kurzor to musí dát najevo, jinak
   vypadá jako obyčejný mezititulek. */
.tip-group-header {
    cursor: pointer;
}

/* Sdílené pro harmoniku tipovačky i výsledků: vlevo skok na aktuální podnik,
   vpravo přepínač rozbalení. Na úzkém displeji se zalomí pod sebe. */
.accordion-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

/* Vyplněná varianta btn-secondary — skok na aktuální podnik je to, co člověk
   na stránce hledá nejčastěji, tak nese barvu značky. Odstíny přebírá po
   quicknav odkazu, ze kterého se sem přestěhoval. */
.btn-current-venue {
    background-color: var(--brand-tint);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.btn-current-venue:hover {
    background-color: var(--brand);
    color: var(--n-0);
}

.tip-group-name {
    background: var(--brand-tint);
    color: var(--color-accent);
    letter-spacing: .06em;
    padding: .5rem .75rem;
    border-top: 2px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
}
.u-5ec688 { gap:.5rem .75rem; }
.u-cf8428 { background:var(--c-warning-bg); border:1.5px solid var(--c-warning); border-radius:8px; padding:.9rem 1.2rem; }
.u-ebc214 { font-size:1.2rem; }
.u-03655f { padding-left:0; list-style:none; margin:0; }
.u-8f87d3 { margin:1rem 0; border:none; border-top:1px solid var(--color-border); }
.u-aeb737 { cursor:default; }
/* Vpravo stojí dvouciferná pozice, ne druhé stejně velké pole — při 1fr 1fr
   měl vstup pro číslo 1–99 stejných ~390 px jako select se jménem. */
.u-009a31 { grid-template-columns:minmax(0, 24rem) 12rem; align-items:end; }
.u-46af53 { padding:.6rem 2rem; }
.u-6f5915 { padding-bottom:.5rem; }

/* ── Admin table row states ───────────────────────────────── */
/* Applied through a conditional attribute (<tr <check …>class="…"</check>>),
   so they never appear as a plain literal in the markup. */
.row-inactive {
    opacity: .6;
}

.row-season-active {
    background: var(--c-warning-bg);
}

/* ══════════════════════════════════════════════════════════
   DARK MODE
   Only the tokens are redefined; not a single component rule is duplicated.
   Two selectors carry the same block: the media query follows the operating
   system, the [data-theme] attribute lets the footer switch override it in
   either direction (a light page on a dark OS, or the reverse).
   ══════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg:            var(--n-900);
        --color-body-bg:       var(--n-900);
        --color-surface:       #2C2C2E;
        --color-surface-alt:   #333336;
        --color-surface-sunk:  #26262A;
        --color-content-bg:    #2C2C2E;
        --color-sidebar-bg:    #2C2C2E;
        --color-border:        #3D3A37;
        --color-border-strong: #57534E;
        --color-text:          #F4F2F0;
        --color-text-muted:    #A8A29D;

        /* The deep carmine sits at 1.7:1 on a dark ground and is unreadable
           there; the rose used in the header takes over as the link colour. */
        --color-accent:        var(--brand-on-dark);
        --color-accent-hover:  #F5A5A5;

        /* Sytá modrá i karmínová padnou na tmavém podkladu pod 3:1, což je
           hranice pro grafiku (WCAG 1.4.11) — na tmavu je proto nese světlejší
           tón téhož odstínu. Smíšené závody jdou přes --color-text, ten se
           převrací sám. */
        --c-gender-m:          #93B4FF;
        --c-gender-f:          #F7A8C4;
        --color-nav-bg:        #1A1A1C;
        --color-header-bg:     #1A1A1C;
        --color-footer-bg:     #1A1A1C;

        /* #2E2E2E = #333333 (podklad zapečený do obou PNG s logem, ověřeno
           v IDAT) × brightness(.9) z pravidla pro tmavý režim níže. Bez
           toho svítil kolem loga světlejší obdélník. */
        --color-banner-bg:     #2E2E2E;
        --brand-tint:          #3A1E20;
        --brand-tint-hover:    #4A2427;

        --medal-gold:          #403A24;
        --medal-silver:        #3A3A3A;
        --medal-bronze:        #3B322B;
        --row-me:              #3A331A;
        /* Bez tmavých hover variant zůstaly v platnosti ty světlé z :root,
           takže přejetí myší přes medailový nebo vlastní řádek problesklo
           světlým podkladem se světlým textem. */
        --medal-gold-hover:    #4E472C;
        --medal-silver-hover:  #474747;
        --medal-bronze-hover:  #493E35;
        --row-me-hover:        #4A4222;
        --color-gold-bg:       var(--medal-gold);
        --color-silver-bg:     var(--medal-silver);
        --color-bronze-bg:     var(--medal-bronze);
        --color-current-bg:    var(--row-me);

        --c-success:           #4ADE80;
        --c-success-bg:        #14301F;
        --c-success-br:        #1F5233;
        --c-warning:           #FBBF24;
        --c-warning-bg:        #3A2A10;
        --c-warning-br:        #5A431A;
        --c-danger:            #F87171;
        --c-danger-bg:         #3A1A18;
        --c-danger-br:         #5A2926;
        --c-info:              #A8A29D;
        --c-info-bg:           #2C2C2E;

        --color-open:          var(--c-success);
        --color-open-bg:       var(--c-success-bg);
        --color-closed:        var(--brand-on-dark);
        --color-closed-bg:     var(--brand-tint);
        /* Inverze i tady, jen opačným směrem: odznak byl doteď ve stejné barvě
           jako povrch karty (#2C2C2E), takže na ní nebyl vidět vůbec. */
        --color-finished:      var(--n-900);
        --color-finished-bg:   var(--n-300);
        --color-urgent:        var(--c-warning);
        --color-urgent-bg:     var(--c-warning-bg);
        --color-scheduled:     var(--color-text-muted);
        --color-success:       var(--c-success);
        --color-success-bg:    var(--c-success-bg);
        --color-error:         var(--c-danger);
        --color-error-bg:      var(--c-danger-bg);
        --color-info:          var(--c-info);
        --color-info-bg:       var(--c-info-bg);

        --color-btn-primary:       var(--brand);
        --color-btn-primary-hover: #C01B20;
        --color-btn-danger:        #A32320;
        --color-btn-secondary:     var(--n-400);

        --shadow-sm: 0 1px 3px rgba(0,0,0,.45);
        --shadow:    0 4px 12px rgba(0,0,0,.55);
        --shadow-lg: 0 12px 32px rgba(0,0,0,.65);

        --focus-outline: 2px solid var(--n-0);
        --focus-ring:    0 0 0 4px rgba(240,138,138,.45);
    }
}

:root[data-theme="dark"] {
    --color-bg:            var(--n-900);
    --color-body-bg:       var(--n-900);
    --color-surface:       #2C2C2E;
    --color-surface-alt:   #333336;
    --color-surface-sunk:  #26262A;
    --color-content-bg:    #2C2C2E;
    --color-sidebar-bg:    #2C2C2E;
    --color-border:        #3D3A37;
    --color-border-strong: #57534E;
    --color-text:          #F4F2F0;
    --color-text-muted:    #A8A29D;
    --color-accent:        var(--brand-on-dark);
    --color-accent-hover:  #F5A5A5;
    --c-gender-m:          #93B4FF;
    --c-gender-f:          #F7A8C4;
    --color-nav-bg:        #1A1A1C;
    --color-header-bg:     #1A1A1C;
    --color-footer-bg:     #1A1A1C;
    /* #2E2E2E = #333333 (podklad zapečený do obou PNG s logem, ověřeno
       v IDAT) × brightness(.9) z pravidla pro tmavý režim níže. Bez
       toho svítil kolem loga světlejší obdélník. */
    --color-banner-bg:     #2E2E2E;
    --brand-tint:          #3A1E20;
    --brand-tint-hover:    #4A2427;
    --medal-gold:          #403A24;
    --medal-silver:        #3A3A3A;
    --medal-bronze:        #3B322B;
    --row-me:              #3A331A;
    --medal-gold-hover:    #4E472C;
    --medal-silver-hover:  #474747;
    --medal-bronze-hover:  #493E35;
    --row-me-hover:        #4A4222;
    --color-gold-bg:       var(--medal-gold);
    --color-silver-bg:     var(--medal-silver);
    --color-bronze-bg:     var(--medal-bronze);
    --color-current-bg:    var(--row-me);
    --c-success:           #4ADE80;
    --c-success-bg:        #14301F;
    --c-success-br:        #1F5233;
    --c-warning:           #FBBF24;
    --c-warning-bg:        #3A2A10;
    --c-warning-br:        #5A431A;
    --c-danger:            #F87171;
    --c-danger-bg:         #3A1A18;
    --c-danger-br:         #5A2926;
    --c-info:              #A8A29D;
    --c-info-bg:           #2C2C2E;
    --color-open:          var(--c-success);
    --color-open-bg:       var(--c-success-bg);
    --color-closed:        var(--brand-on-dark);
    --color-closed-bg:     var(--brand-tint);
    /* Viz poznámka u světlé varianty — odznak splýval s povrchem karty. */
    --color-finished:      var(--n-900);
    --color-finished-bg:   var(--n-300);
    --color-urgent:        var(--c-warning);
    --color-urgent-bg:     var(--c-warning-bg);
    --color-scheduled:     var(--color-text-muted);
    --color-success:       var(--c-success);
    --color-success-bg:    var(--c-success-bg);
    --color-error:         var(--c-danger);
    --color-error-bg:      var(--c-danger-bg);
    --color-info:          var(--c-info);
    --color-info-bg:       var(--c-info-bg);
    --color-btn-primary:       var(--brand);
    --color-btn-primary-hover: #C01B20;
    --color-btn-danger:        #A32320;
    --color-btn-secondary:     var(--n-400);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.45);
    --shadow:    0 4px 12px rgba(0,0,0,.55);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.65);
    --focus-outline: 2px solid var(--n-0);
    --focus-ring:    0 0 0 4px rgba(240,138,138,.45);
}

/* The banner keeps its charcoal in both themes: the logo artwork has that
   colour baked in, so lightening the band would leave a visible rectangle
   around the image. Slight dimming keeps it from glaring at night. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .site-banner-img,
    :root:not([data-theme="light"]) .site-banner-photo {
        filter: brightness(.9);
    }
}

:root[data-theme="dark"] .site-banner-img,
:root[data-theme="dark"] .site-banner-photo {
    filter: brightness(.9);
}

/* ── Theme switcher ───────────────────────────────────────── */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: rgba(255,255,255,.08);
    border-radius: var(--radius-pill);
}

.theme-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 26px;
    padding: 0 8px;
    background: none;
    border: none;
    border-radius: var(--radius-pill);
    color: var(--color-footer-text);
    font-family: inherit;
    font-size: var(--fs-xs);
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
}

.theme-switch button:hover {
    color: var(--n-0);
}

.theme-switch button[aria-pressed="true"] {
    background: rgba(255,255,255,.16);
    color: var(--n-0);
    font-weight: 700;
}

/* In the open list the flag accompanies a written language name, so it can go
   back to the smaller size; only the collapsed button needs the larger one. */
.lang-option .lang-flag {
    height: 14px;
}

/* ══════════════════════════════════════════════════════════
   HOME — NEWS FEED
   First thing on the page. Three entries are visible and the rest is reached
   by scrolling inside the feed, so a long history never pushes the shortcuts
   below the fold.
   ══════════════════════════════════════════════════════════ */
.news-feed-section {
    margin-bottom: var(--spacing-xl);
}

.news-feed {
    /* Three items plus a sliver of the fourth, which is what tells the reader
       there is more to scroll to. Entries vary in height (one or two lines of
       text), so this is a close approximation rather than an exact count. */
    max-height: 15.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* The feed is scrollable, so it has to be focusable — otherwise a keyboard
   user cannot reach the content past the third item. */
.news-feed:focus-visible {
    outline: var(--focus-outline);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

.feed-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--spacing) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    border-left: 3px solid transparent;
    transition: border-color var(--transition), background-color var(--transition);
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-item:hover {
    background: var(--color-surface-alt);
    border-left-color: var(--brand);
}

/* Novinka od minulého přihlášení. Používá značkovou červenou, kterou má
   proužek na hover — jen natrvalo a silněji, doplněnou o jemné podbarvení.
   Barva sama by nestačila (a nikomu, kdo ji nerozliší, neřekne nic), proto
   k ní patří i štítek „Nové“ vedle data. */
.feed-item-new {
    border-left: 4px solid var(--brand);
    background: var(--brand-tint);
}

.feed-item-new:hover {
    background: var(--brand-tint-hover);
}

.feed-new-badge {
    align-self: flex-start;
    padding: 1px 6px;
    border-radius: 100px;
    background: var(--brand);
    color: #FFF;
    font-size: var(--fs-3xs);
    font-weight: 700;
    line-height: 1.45;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.feed-time {
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    letter-spacing: .02em;
}

/* Clamped to two lines: the feed is a glance, not a reading view. */
.feed-text {
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-text p {
    margin: 0;
}

.feed-text p + p,
.feed-text ul,
.feed-text ol {
    display: none;   /* only the opening paragraph belongs in a feed row */
}

/* Rozbalená novinka — celý text, všechny odstavce i seznamy. */
.feed-item-open .feed-text {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.feed-item-open .feed-text p + p,
.feed-item-open .feed-text ul,
.feed-item-open .feed-text ol {
    display: block;
    margin-top: .5em;
}

.feed-item-open .feed-text ul,
.feed-item-open .feed-text ol {
    padding-left: 1.25em;
}

.feed-item-open .feed-text li + li {
    margin-top: .25em;
}

/* S rozbalenou novinkou se proud nesmí scrollovat ve výřezu 15,5 rem —
   dlouhý text by se četl v malém okénku. */
.news-feed:has(.feed-item-open),
.news-feed.has-open {
    max-height: none;
}

.feed-more {
    align-self: flex-start;
    margin-top: 2px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-accent);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
}

.feed-more:hover,
.feed-more:focus-visible {
    text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════
   HOME — SHORTCUT CARDS
   Two equal signposts, the same pair for every visitor: the standings tables
   live on their own pages, and the sponsor. Both cards are wide and low —
   their content sits in rows rather than stacking.
   ══════════════════════════════════════════════════════════ */
.link-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing);
    margin-bottom: var(--spacing-xl);
}

.link-card {
    display: flex;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.link-card:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow);
}

/* The whole card is the link, so the anchor fills it rather than sitting as a
   small target inside a large box. */
.link-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    padding: var(--spacing) var(--spacing-lg);
    color: inherit;
    text-decoration: none;
}

.link-card-body:hover {
    text-decoration: none;
    color: inherit;
}

.link-card-title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--color-text);
}

.link-card-desc {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.link-card-arrow {
    margin-top: auto;
    padding-top: var(--spacing-sm);
    color: var(--color-accent);
    font-weight: 600;
    font-size: var(--fs-sm);
}

/* Both standings share one card, so it carries two buttons rather than being
   a single link. Side by side now that the cards are wide — stacking them cost
   a whole button of height for nothing. They share the row evenly, since two
   buttons of differing width read as a mistake, and wrap on a narrow card. */
.link-card-standings {
    flex-direction: column;
    gap: 2px;
    padding: var(--spacing) var(--spacing-lg);
}

.link-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: auto;
    padding-top: var(--spacing);
}

.link-card-cta {
    flex: 1 1 12ch;
    text-align: center;
}

/* Sponsor card: the logo carries the recognition, the small label above it
   states outright that this is sponsorship rather than site content. */
.link-card-label {
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

/* Logo and blurb side by side: stacked, they made the sponsor card a good
   third taller than the standings card next to it. The logo keeps its own
   width and the text takes the rest; below ~360px of card width they stack,
   which is the only point at which the two-column form starts to squeeze the
   sentence into slivers. */
.link-card-sponsor-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing);
    margin-top: var(--spacing-xs);
}

.link-card-sponsor-row .link-card-desc {
    flex: 1 1 14ch;
}

.link-card-sponsor-logo {
    flex: 0 0 auto;
    max-width: 100%;
    width: 140px;
    height: auto;
}

/* ══════════════════════════════════════════════════════════
   HOME — ABOUT (last on the page)
   ══════════════════════════════════════════════════════════ */
.about-section {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.about-title {
    font-size: var(--fs-md);
    margin-bottom: var(--spacing-sm);
}

.about-text {
    font-size: var(--fs-sm);
    line-height: 1.6;
    max-width: 68ch;
    margin-bottom: var(--spacing-sm);
}

@media (max-width: 860px) {
    .link-cards {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════
   HOME — SIGNED-IN PANEL
   Charcoal, so it reads as an extension of the header rather than as a third
   unrelated block. Rank comes first: it is what a returning player checks.
   ══════════════════════════════════════════════════════════ */
.user-panel {
    background: var(--n-800);
    color: var(--n-0);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.user-panel-name {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    color: var(--n-0);
    line-height: 1.15;
    margin-bottom: var(--spacing);
    /* Prvek je <h2> (dřív <h1>, viz home.htm). Na mobilu mu předchází
       odstavec „Můj účet“, což by spustilo obecné pravidlo
       `:is(p, ul, …) + :is(h2, h3, h4) { margin-top: … }` a nadpis by se
       odtrhl od svého panelu. */
    margin-top: 0;
}

/* The real name is secondary to the username people compete under. */
.user-panel-realname {
    font-weight: 400;
    color: var(--color-footer-text);
}

.user-panel-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing) var(--spacing-xl);
}

.user-panel-stat {
    display: flex;
    flex-direction: column;
}

.user-panel-stat dd {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.user-panel-stat dt {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--color-footer-text);
}

/* Části panelu, které na telefonu nahrazují schovaný widget „Můj účet".
   Nad 640 px se nezobrazují — desktopová podoba panelu zůstává beze změny. */
.panel-mobile-only {
    display: none;
}

@media (max-width: 640px) {
    .user-panel {
        padding: var(--spacing) var(--spacing-lg);
    }

    .user-panel-name {
        font-size: var(--fs-xl);
    }

    .user-panel-stat dd {
        font-size: var(--fs-xl);
    }

    .panel-mobile-only {
        display: block;
    }

    /* Nadpis pruhu — drobný a potlačený, hlavní řádek zůstává jméno hráče. */
    .user-panel-title {
        font-size: var(--fs-xs);
        text-transform: uppercase;
        letter-spacing: .07em;
        color: var(--color-footer-text);
        margin-bottom: var(--spacing-xs);
    }

    .user-panel-lastlogin {
        margin-top: var(--spacing);
        font-size: var(--fs-xs);
        color: var(--color-footer-text);
    }

    .user-panel-lastlogin strong {
        color: var(--n-0);
        font-weight: 600;
    }

    /* Sidebarový widget „Můj účet" je na telefonu jen kopií pruhu nahoře. */
    .sidebar-widget.userbox {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════
   TOUCH TARGETS — late overrides
   These two components are declared further down the file than the main
   touch-target block, so their rules would otherwise win on source order.
   ══════════════════════════════════════════════════════════ */
@media (max-width: 640px), (pointer: coarse) {
    /* A 26px pill by design; on touch it needs the full target height. */
    .theme-switch button {
        min-height: 45px;
        min-width: 48px;
        padding-inline: 12px;
    }

    /* A small glyph, but the only way to open the submenu on a touch screen. */
    .nav-dropdown-toggle {
        min-height: 45px;
        min-width: 45px;
    }
}


/* ══════════════════════════════════════════════════════════
   SEZNAM ZÁVODŮ — akce ve sloupci „Váš tip“ a karty na telefonu
   ══════════════════════════════════════════════════════════ */

/* Buňka nese odkaz na akci. Odkaz, ne text: u otevřeného závodu vede na
   úpravu tipu, u dojetého na výsledek — dřív tam byla u všech stavů stejná
   věta „✓ Váš tip byl odeslán.“ bez jakékoli cesty dál. */
.tip-action {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tip-action:hover { text-decoration: underline; }

/* „Upravit tip“ je odkaz jako každý jiný — v barvě odkazu. Zelená zůstává
   jen fajfce, která hlásí, že závod už je natipovaný. */
.tip-action-tipped { color: var(--color-accent); }
.tip-action-check  { color: var(--color-success); }
.tip-action-todo   { color: var(--color-accent); }
.tip-action-urgent { color: var(--color-urgent); }
.tip-action-quiet  { color: var(--color-text-muted); }
.tip-action-quiet:hover { color: var(--color-accent); }

/* Odkaz na výsledek nese jen šipku v kroužku — stejný prvek jako v drill-down
   tabulkách. Podtržení z .tip-action:hover by kolem ikony nakreslilo linku. */
.tip-action-arrow {
    color: var(--color-accent);
}

.tip-action-arrow:hover {
    text-decoration: none;
}

.race-list-table tbody tr:hover .drill-icon {
    color: var(--brand);
    transform: translateX(2px);
}

.race-list-table tbody tr:hover .drill-icon .drill-icon-ring {
    opacity: 1;
    fill: var(--brand-tint);
}

/* Legenda stavů — sbalitelná. Na desktopu otevřená, na telefonu zavřená:
   šest položek tam zabralo víc místa než tabulka, kterou vysvětlují. */
.tip-legend-summary {
    cursor: pointer;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    padding: .25rem 0;
    width: fit-content;
}

.tip-legend-summary:hover { color: var(--color-accent); }

/* ── Seznam závodů jako karty na telefonu ─────────────────────────────────
   Vodorovné posouvání tabulky na 390 px odřezávalo sloupec „Stav“ a celý
   sloupec „Váš tip“ — tedy stav závodu a jedinou akci na stránce. Řádek se
   proto pod 640 px překlápí do karty: každá buňka je řádek „popisek →
   hodnota“, popisek bere z data-label, takže tu není druhá kopie hlaviček. */
@media (max-width: 639.98px) {
    .race-list-table thead {
        /* Ne display:none — hlavička má zůstat pro čtečky obrazovky. */
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .race-list-table,
    .race-list-table tbody,
    .race-list-table tr,
    .race-list-table td {
        display: block;
        width: auto;
    }

    .race-list-table tr:not(.tip-group-header) {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-left-width: 4px;
        border-radius: var(--radius);
        padding: .5rem .75rem;
        margin-bottom: .5rem;
    }

    .race-list-table td {
        border: none;
        padding: .2rem 0;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: .75rem;
        text-align: right;
    }

    .race-list-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: var(--fs-2xs);
        text-transform: uppercase;
        letter-spacing: .04em;
        font-weight: 600;
        color: var(--color-text-muted);
        text-align: left;
    }

    /* Název závodu je titulek karty, ne další položka seznamu. */
    .race-list-table td[data-label]:nth-child(2) {
        display: block;
        text-align: left;
        font-size: var(--fs-md);
        padding-bottom: .35rem;
    }

    .race-list-table td[data-label]:nth-child(2)::before { display: none; }

    /* Sbalené závody musí zůstat schované i tady — karetní layout přepisuje
       tr na display:block, což by [hidden] přebilo. */
    .race-list-table tr[hidden] {
        display: none;
    }

    /* Skupina podniku zůstává mezititulkem nad kartami. */
    .race-list-table tr.tip-group-header {
        background: none;
        border: none;
        padding: 0;
        margin: 1rem 0 .5rem;
    }

    .race-list-table tr.tip-group-header td {
        display: block;
        text-align: left;
        border-top: none;
        border-left: none;
        background: none;
        padding: 0;
    }

    /* Pohlaví je už v názvu závodu („Sprint Muži“) a u smíšené štafety je
       záměrně prázdné — na kartě by to byl řádek bez informace. */
    .race-list-table td.cell-gender { display: none; }

    /* Sbalená legenda na telefonu. */
    .tip-legend-wrap .tip-legend { gap: 8px; }
}

@media (min-width: 640px) {
    /* Na desktopu není co skrývat — legenda se vejde pod tabulku, takže se
       obsah <details> vynutí bez ohledu na to, že prvek není [open].
       content-visibility je tu kvůli prohlížečům, které skrývání neřeší
       přes display, ale přes ně. */
    .tip-legend-wrap > .tip-legend {
        display: flex !important;
        content-visibility: visible !important;
    }
    .tip-legend-summary { display: none; }
}

/* ══════════════════════════════════════════════════════════
   ŠÍŘKY FORMULÁŘOVÝCH POLÍ
   Pole přes celou šířku karty (~770 px) pro přezdívku o 25 znacích nebo
   pro dvouciferné číslo nedává žádnou informaci o tom, co se do něj má
   napsat — šířka pole je nejsilnější nápověda k očekávané délce hodnoty.
   Cap, ne fixní šířka: v úzkém sloupci se pole chová dál jako dřív.
   ══════════════════════════════════════════════════════════ */
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select {
    max-width: 26rem;
}

.form-group input[type="number"] {
    max-width: 8rem;
}

/* ── Uzávěrka tipů nad formulářem ─────────────────────────── */
.tip-deadline {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-bottom: var(--spacing-lg);
    padding: .6rem .9rem;
    background: var(--color-surface-sunk);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-open);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
}

.tip-deadline-label {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    color: var(--color-text-muted);
}

.tip-deadline-left {
    margin-left: auto;
    color: var(--color-text-muted);
}

/* Stejný odpočet jako na homepage (.countdown-value) — jeden údaj, jedno písmo. */
.tip-deadline-left strong {
    font-family: var(--font-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--color-text);
}

/* Poslední hodina: uzávěrka přestává být údaj a začíná být upozornění. */
.tip-deadline.is-closing {
    border-left-color: var(--color-urgent);
    background: var(--color-urgent-bg);
}

.tip-deadline.is-closing .tip-deadline-left strong { color: var(--color-urgent); }

.tip-deadline.is-over {
    border-left-color: var(--color-closed);
    background: var(--color-closed-bg);
}

@media (max-width: 639.98px) {
    .tip-deadline-left { margin-left: 0; }
    /* Dvojice „závodník + tipovaná pozice“ se na telefon nevejde vedle sebe. */
    .u-009a31 { grid-template-columns: 1fr; }
}

/* Body týmu jako odkaz na jeho sestavu. Zůstává tabulkovým číslem, jen
   dá najevo, že se dá rozkliknout. */
/* Bez `--font-numeric`: dílčí zisky byly jediná čísla na webu psaná
   monospacem, takže v řádku vedle součtu a vedle žebříčku tipovačky vypadaly
   jako jiný druh údaje. Sloupce drží pod sebou `font-variant-numeric:
   tabular-nums` z pravidla pro tabulky, na to monospace potřeba není. */
.team-score-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--color-border-strong);
}

.team-score-link:hover {
    color: var(--color-accent);
    border-bottom-color: currentColor;
}

/* Pořadí týmů: na telefonu se do řádku nevejde jméno vlastníka, dva sloupce
   bodů a součet, takže se jméno lámalo přes tři řádky. Sloupce „Body muži“ a
   „Body ženy“ se proto slévají do jednoho „Body (M/Ž)“ ve tvaru 1000/1000 a
   sloupec pořadí se zúží na šířku čísla. Obě varianty jsou v HTML pořád —
   přepíná se jen která se zobrazuje. */
.col-score-merged {
    display: none;
}

.score-sep {
    padding-inline: 2px;
    color: var(--color-text-muted);
}

@media (max-width: 640px) {
    .col-score-split {
        display: none;
    }

    th.col-score-merged,
    td.col-score-merged {
        display: table-cell;
    }

    /* Pevných 48 px na dvouciferné pořadí byla polovina mezery, kterou
       potřebuje jméno vedle. Vyšší specifičnost než .u-9c6a2d, ať nezáleží
       na pořadí pravidel v souboru. */
    th.col-rank {
        width: 1%;
    }

    .page-teams thead th:first-child,
    .page-teams tbody td:first-child {
        padding-right: 2px;
    }

    .page-teams thead th:nth-child(2),
    .page-teams tbody td:nth-child(2) {
        padding-left: 4px;
    }
}

/* Odkaz mimo stránku v řádku skoků — odsazený doprava, aby se nepletl
   s odkazy v rámci téže stránky. */
.quicknav-link-away {
    margin-left: auto;
}

@media (max-width: 639.98px) {
    .quicknav-link-away { margin-left: 0; }
}

/* ── Nezaplněné reklamní jednotky ─────────────────────────────
   AdSense označí <ins> jako data-ad-status="unfilled", když pro slot nemá co
   dodat. Rámeček s popiskem „Reklama“ nad prázdným místem pak vypadá jako
   rozbitá stránka — a v mimosezónním provozu to byl obvyklý stav. */
.ad-unit:has(ins[data-ad-status="unfilled"]) {
    display: none;
}

/* Odsazení patičky, dokud svítí ukotvená reklama. Lišta obsah nikde neposouvá,
   jen by jinak překryla poslední řádky patičky. Přidává se až v momentě
   vyjetí, tedy hluboko pod prvním pohledem. */
body.has-sticky-ad .site-footer {
    padding-bottom: 5rem;
}

/* Stránka bez sidebaru — obsah bere celou šířku kontejneru. */
.layout-with-sidebar.layout-full-width .content-area {
    width: 100%;
}

/* ── Trvale tmavé panely ──────────────────────────────────────
   Pruh rozpočtu i hlavička týmu mají tmavé pozadí bez ohledu na téma, takže
   sémantické barvy pro světlý podklad tu nestačí. */
.budget-bar .text-success { color: var(--c-success-on-dark); }
.budget-bar .text-danger  { color: var(--c-danger-on-dark); }
.budget-bar .text-warning { color: var(--c-warning-on-dark); }
.budget-bar .text-accent  { color: var(--brand-on-dark); }

/* ── Tlačítko „Načíst dalších X“ ──────────────────────────────
   Alternativa ke stránkování pod tabulkou. Stojí pod stránkovací navigací a
   záměrně vypadá tišeji než ona — stránkování zůstává hlavní cestou, tohle je
   zkratka pro čtení žebříčku vcelku. Bez JavaScriptu je to obyčejný odkaz na
   další stránku, proto se stylují i stavy odkazu. */
/* Prodloužení seznamu je pokračování čtení, ne samostatná akce — proto obyčejný
   textový odkaz vlevo pod tabulkou, ne tlačítko. Tlačítkový vzhled ho stavěl na
   roveň hlavním akcím stránky a přebíjel stránkování hned pod ním. */
.load-more {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .35rem;
}

.load-more-link {
    font-size: var(--fs-sm);
    font-weight: 600;
}

/* Během načítání odkaz nereaguje, ale nemizí — jinak by kliknutí utrhlo
   obsah zpod kurzoru a uživatel by nevěděl, jestli se něco děje. */
.load-more-link.is-loading {
    opacity: .6;
    pointer-events: none;
    cursor: progress;
}

.load-more-status {
    font-size: var(--fs-xs);
    color: var(--color-error);
    min-height: 1em;
}

/* ── Hledání v žebříčku ───────────────────────────────────────
   Sbalený řádek nad tabulkou. Vypadá tiše — je to nástroj pro menšinu návštěv,
   která hledá konkrétní jméno, a nesmí odsouvat samotný žebříček dolů. Sbalení
   a rozbalení řeší <details>, uvnitř je obyčejný GET formulář, takže celý box
   funguje i bez JavaScriptu. */
.table-filter {
    margin-bottom: var(--spacing);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.table-filter-summary {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.45rem 0.75rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    list-style: none;          /* trojúhelníček nahrazuje lupa */
    border-radius: var(--radius);
}

.table-filter-summary::-webkit-details-marker { display: none; }

.table-filter-summary:hover { color: var(--color-accent); }

.table-filter-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    color: var(--color-accent);
}

/* Aktivní hledaný výraz zůstává vidět i po sbalení — bez něj by useknutá
   tabulka po obnovení stránky vypadala jako chybějící data. */
.table-filter-term {
    margin-left: auto;
    padding: 0.1rem 0.5rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-accent);
    background: var(--brand-tint);
    border-radius: var(--radius-pill);
}

.table-filter-term::before { content: '„'; }
.table-filter-term::after  { content: '“'; }

.table-filter-body {
    padding: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.table-filter-label {
    margin-bottom: var(--spacing-xs);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    font-weight: 600;
}

.table-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
}

.table-filter-input {
    flex: 1 1 16rem;
    width: auto;
    font-size: var(--fs-sm);
}

/* Počet nalezených je odpověď na zadaný dotaz, proto stojí výš a výrazněji
   než trvalá nápověda pod ním. */
.table-filter-status {
    margin: var(--spacing-sm) 0 0;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-text);
    min-height: 1em;
}

.table-filter-status:empty { display: none; }

.table-filter-hint {
    margin: var(--spacing-xs) 0 0;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

.table-filter-clear {
    font-size: var(--fs-sm);
    white-space: nowrap;
}

/* Během dotazu tabulka zesvětlá, ale zůstane čitelná a na místě: mizející
   obsah pod kurzorem je horší než chvilka staré hodnoty. */
.table-filter.is-searching ~ .results-tabs,
.table-filter.is-searching ~ .standings-tab-panel,
.table-filter.is-searching ~ .teams-tab-panel,
.table-filter.is-searching ~ .search-target {
    opacity: 0.55;
    transition: opacity var(--transition);
}

/* ═══════════════════════════════════════════════════════════
   SCORE PANEL — rozpis bodů (nahrazuje vzhled .score-tooltip)

   Původní podoba byla účtenka: jednosloupcová tabulka, kde se typ zisku
   a jméno závodníka lišily jen pomlčkou mezi nimi. Panel to rozděluje do
   dvou řádků (kdo → za co), body dává do monospace sloupce a kategorii
   kóduje barevným proužkem vlevo. Panel je zároveň interaktivní: má křížek
   a dá se za záhlaví přetáhnout, takže na rozdíl od tooltipu musí přijímat
   kliknutí (pointer-events). Pravidla jsou schválně až na konci souboru —
   přebíjejí starší .score-tooltip včetně mobilní media query výš.
   ═══════════════════════════════════════════════════════════ */

.score-panel {
    /* Barvy kategorií; --sp-national nemá v tokenech protějšek (--c-info je
       šedá), proto je tu literálem i s tmavou variantou níž. Každá má i tón
       podbarvení pro štítek s popiskem — ostatní ho berou z tokenů států.
       #1D4ED8 (ne #2563EB): štítek je text, a ten potřebuje 4.5:1. */
    --sp-hit:         var(--color-accent);
    --sp-position:    var(--c-warning);
    --sp-national:    #1D4ED8;
    --sp-national-bg: #E8F0FE;
    --sp-bonus:       var(--c-success);
    --sp-neutral:     var(--color-border-strong);

    width: max-content;
    min-width: 340px;
    max-width: 460px;
    padding: 0;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    /* Tři vrstvy: kontaktní stín u okraje, střední pro odsazení od karty
       a široký měkký, aby panel jasně plul nad stránkou. */
    box-shadow:
        0 1px 2px rgba(36,36,38,.10),
        0 12px 24px -8px rgba(36,36,38,.25),
        0 32px 64px -16px rgba(36,36,38,.35);
    font-size: var(--fs-sm);
    color: var(--color-text);
    pointer-events: auto;
    animation: sp-appear .12s ease-out;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .score-panel {
        --sp-national:    #93B4FF;
        --sp-national-bg: #1C2B45;
        /* Na tmavém podkladu stín skoro nejde vidět; drží ho světlý vlas
           po obvodu plus silnější tmavý závoj. */
        box-shadow:
            0 0 0 1px rgba(255,255,255,.06),
            0 12px 24px -8px rgba(0,0,0,.55),
            0 32px 64px -16px rgba(0,0,0,.65);
    }
}
:root[data-theme="dark"] .score-panel {
    --sp-national:    #93B4FF;
    --sp-national-bg: #1C2B45;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.06),
        0 12px 24px -8px rgba(0,0,0,.55),
        0 32px 64px -16px rgba(0,0,0,.65);
}

@keyframes sp-appear {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .score-panel { animation: none; }
}

/* ── Záhlaví (úchyt pro tažení) ───────────────────────────── */
.score-panel .sp-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: .45rem .45rem .45rem .85rem;
    background: linear-gradient(180deg, var(--n-700), var(--n-900));
    color: var(--n-0);
    cursor: grab;
    user-select: none;
    /* Bez tohohle by dotykové tažení scrollovalo stránku pod panelem. */
    touch-action: none;
}

.score-panel.is-dragging .sp-head { cursor: grabbing; }

.score-panel .sp-head-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.score-panel .sp-title {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-panel .sp-subtitle {
    font-size: var(--fs-3xs);
    letter-spacing: .09em;
    text-transform: uppercase;
    color: rgba(255,255,255,.60);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-panel .sp-close {
    flex: none;
    margin-left: auto;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: var(--fs-xs);
    line-height: 1;
    color: rgba(255,255,255,.75);
    background: rgba(255,255,255,.10);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.score-panel .sp-close:hover {
    background: rgba(255,255,255,.22);
    color: var(--n-0);
}

.score-panel .sp-close:focus-visible {
    outline: 2px solid var(--n-0);
    outline-offset: 1px;
}

/* ── Tělo ─────────────────────────────────────────────────── */
.score-panel .sp-body {
    max-height: min(58vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.score-panel .sp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Rozpis běžně vyjde na 10–15 řádků, takže vertikální rytmus je hutný — ale ne
   tak, aby se popisek lepil na jméno (na to si stěžovali testeři). Řádek proto
   dýchá svisle o něco víc a druhý řádek je odsazený štítkem, ne jen mezerou. */
.score-panel .sp-item {
    /* Kategorie řádku jednou proměnnou: nese ji proužek vlevo i štítek
       s popiskem, takže barva a text říkají totéž. */
    --sp-kind:    var(--sp-neutral);
    --sp-kind-bg: var(--color-surface-sunk);

    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: .4rem .8rem .45rem .7rem;
    border-left: 3px solid var(--sp-kind);
    border-bottom: 1px solid var(--color-border);
}

.score-panel .sp-item:last-child { border-bottom: none; }

.score-panel .sp-item[data-kind="hit"]      { --sp-kind: var(--sp-hit);      --sp-kind-bg: var(--brand-tint); }
.score-panel .sp-item[data-kind="position"] { --sp-kind: var(--sp-position); --sp-kind-bg: var(--c-warning-bg); }
.score-panel .sp-item[data-kind="national"] { --sp-kind: var(--sp-national); --sp-kind-bg: var(--sp-national-bg); }
.score-panel .sp-item[data-kind="bonus"]    { --sp-kind: var(--sp-bonus);    --sp-kind-bg: var(--c-success-bg); }

/* Souhrnné bonusy (za celý tip, ne za konkrétního závodníka) tvoří vždy
   poslední blok nad součtem — řadí je tam JS, ne body. Podbarvení a Barlow
   je oddělují od per-závodníkových řádků na první pohled; jinak by mezi nimi
   splynuly, protože jsou taky jednořádkové. */
.score-panel .sp-item.is-bonus {
    background: var(--c-success-bg);
}

.score-panel .sp-item.is-bonus .sp-primary {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: 600;
    letter-spacing: .005em;
}

/* Silnější linka jen nad prvním bonusem = předěl mezi bloky. */
.score-panel .sp-item.is-bonus-first {
    border-top: 2px solid var(--color-border-strong);
}

.score-panel .sp-item-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    flex: 1 1 auto;
    min-width: 0;
}

/* Jméno závodníka (u bonusů popis) — nese to hlavní sdělení řádku. */
.score-panel .sp-primary {
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

/* Doplněk k prvnímu řádku — u závodů datum, u bonusu závodník. O stupeň
   menší než jméno (dřív o dva) a s mezerou nad sebou: dva těsně nalepené
   řádky splývaly v jeden blok a ten spodní se v něm ztrácel. */
.score-panel .sp-secondary {
    display: inline-block;
    max-width: 100%;
    font-size: var(--fs-xs);
    line-height: 1.35;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

/* Když druhý řádek říká, za co body jsou, je z něj štítek v barvě kategorie
   na jejím vlastním podbarvení. Od jména ho pak odlišuje tvar a barva, ne
   velikost — může tedy zůstat čitelný a přitom druhý v pořadí. Barva je
   stejná jako proužek vlevo, takže kategorii nese dvakrát totéž. */
.score-panel .sp-item[data-kind="hit"]      .sp-secondary,
.score-panel .sp-item[data-kind="position"] .sp-secondary,
.score-panel .sp-item[data-kind="national"] .sp-secondary {
    padding: .05rem .4rem .1rem;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--sp-kind);
    background: var(--sp-kind-bg);
    border-radius: var(--radius-sm);
}

/* Bez vlastního fontu — zůstává písmo webu. Sloupec drží zarovnaný jen
   tabular-nums (stejně široké číslice) a pevná minimální šířka; monospace
   by v hutném seznamu působil jako výpis z konzole. */
.score-panel .sp-pts {
    flex: none;
    min-width: 3.4rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

.score-panel .sp-pts.is-zero { color: var(--color-text-muted); font-weight: 600; }
.score-panel .sp-pts.is-neg  { color: var(--color-error); }

/* ── Součet ───────────────────────────────────────────────── */
.score-panel .sp-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing);
    padding: .5rem .85rem .55rem;
    background: var(--color-surface-sunk);
    border-top: 2px solid var(--color-border-strong);
}

.score-panel .sp-total-label {
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.score-panel .sp-total-pts {
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--color-text);
}

/* Načítání / chyba / prázdno */
.score-panel .sp-state {
    padding: var(--spacing) var(--spacing-lg);
    color: var(--color-text-muted);
}

.score-panel .sp-state-error { color: var(--color-error); }

.score-panel.is-loading { min-width: 240px; }

/* ── Mobil ────────────────────────────────────────────────── */
/* Na úzkém displeji je šířka daná viewportem (JS sráží max-width), tažení
   nemá kam a řádky musí být hutnější, ať se rozpis vejde na obrazovku. */
@media (max-width: 640px) {
    .score-panel {
        min-width: 0;
        max-width: 100%;
        border-radius: var(--radius);
    }

    .score-panel .sp-head { padding-left: .65rem; cursor: default; }
    .score-panel .sp-title { font-size: var(--fs-sm); }
    .score-panel .sp-item { padding: .3rem .55rem .34rem .5rem; gap: var(--spacing-xs); }
    .score-panel .sp-item-text { gap: .15rem; }
    .score-panel .sp-body { max-height: 62vh; }
    .score-panel .sp-total { padding: .45rem .6rem; }
    .score-panel .sp-total-pts { font-size: var(--fs-md); }

    /* Křížek musí zůstat pohodlně trefitelný prstem. */
    .score-panel .sp-close { width: 34px; height: 34px; }
}
