/* =====================================================================
   Race Creator – timetable & results layoutrc-head rc-condensed
   Colours and fonts come from the event's DB options injected by _LayoutData:
     --primary-color, --secondary-color, --secondary-color-fade(80),
     --accent-color, --text-body, --cat1..10 (via .RaceClassN)
   The only new tokens are the neutral ones below, which flip for dark mode.
   Breakpoint: 768px (phone below, tablet/desktop above).
   ===================================================================== */

:root {
    --rc-bg: #FCFCFC;
    --rc-line: #E3E5E8;
    --rc-zebra: #F5F6F7;
    --rc-muted: #5F6670;
    --rc-bar: #E9ECF0;                      /* race / category bar */
    /* event colours, via tokens so dark mode can swap them */
    --rc-accent: var(--secondary-color);
    --rc-accent-fade: var(--secondary-color-fade);
    --rc-strong: var(--primary-color);
    --rc-on-accent: var(--accent-color);
    --rc-text: var(--text-body);
    --rc-shadow: 0 1px 2px rgba(0,0,0,.08), 0 1px 5px rgba(0,0,0,.06);
    --rc-shadow-open: 0 2px 4px rgba(0,0,0,.10), 0 4px 14px rgba(0,0,0,.10);
    --rc-head-h: 0px;   /* set by rc-results.js */
}

@media (prefers-color-scheme: dark) {
    :root {
        --rc-bg: #17171e;
        --rc-line: #2C2D36;
        --rc-zebra: #1D1D25;
        --rc-muted: #C8CAD2;
        --rc-bar: #262630;
        --rc-shadow: 0 1px 3px rgba(0,0,0,.5);
        --rc-shadow-open: 0 2px 10px rgba(0,0,0,.6);
    }
    /* sitestyle inverts every <img> in dark mode – keep flags in colour */
    .rc-nat img { filter: none !important; }
}

/* always reserve room for the scrollbar, so opening a race/category (which makes the page
   tall enough to need one) doesn't shift everything sideways */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }

.rc-body {
    margin: 0; background: var(--rc-bg);
    overflow-x: clip;   /* nothing can push the page wider than the screen (clip keeps sticky working) */
    /* page is always at least one screen tall, so the footer sits on the bottom edge even
       when there's little content, and stays pinned there (sticky) when there's a lot */
    min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column;
}

/* ---------- helpers ---------- */
.rc-meta { display: block; font-size: 12.5px; color: var(--rc-muted); font-weight: 400; }
.rc-wide, .rc-wide-inline { display: none; }
.rc-empty { padding: 12px; margin: 0; color: var(--rc-muted); font-size: 14px; text-align:center; }
.rc-loading { display: flex; justify-content: center; padding: 14px; }

/* ---------- loading placeholders ---------- */
.rc-skel-wrap { padding: 0 10px; }
/* sized to match the real rows as closely as possible */
.rc-skel-head { height: 31px; border-bottom: 1px solid var(--rc-line); }
.rc-skel-head.rc-skel-head-res { display: none; }         /* results have no headings on phones */
.rc-skel-row {
    display: grid; grid-template-columns: 28px minmax(0, 1fr) 64px; gap: 12px; align-items: center;
    height: 51px; border-bottom: 1px solid var(--rc-line);  /* start list on phone: name + club line */
}
.rc-skel-row.rc-skel-res { height: 86px; }                 /* phone result row + splits line */
@media (min-width: 768px) {
    .rc-skel-row { height: 37px; }                         /* start list: one line */
    .rc-skel-row.rc-skel-res { height: 58px; }             /* result row + team line */
    .rc-skel-head.rc-skel-head-res { display: block; }
}
.rc-skel-line {
    display: flex;
    align-items: center;
    height: 43px;
}
    /* = height of .rc-empty */
    .rc-skel-line .rc-skel-b {
        width: 45%;
    }
.rc-skel {
    display: block; height: 12px; border-radius: 6px;
    background: linear-gradient(90deg, var(--rc-bar) 0%, var(--rc-line) 50%, var(--rc-bar) 100%);
    background-size: 200% 100%;
    animation: rc-shimmer 1.2s ease-in-out infinite;
}
.rc-skel-a { width: 22px; }
.rc-skel-b { width: 70%; }
.rc-skel-c { width: 100%; }
@keyframes rc-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .rc-skel { animation: none; } }

@media (min-width: 768px) {
    .rc-phone { display: none !important; }
    .rc-wide { display: table-cell; }
    .rc-wide-inline { display: inline; }
}

/* ---------- sticky header (shrinks once scrolled) ---------- */
.rc-head {
    position: sticky; top: 0; z-index: 20;
    background: var(--rc-bg); text-align: center; padding: 2px 12px 0;
}
.rc-logo { display: flex; justify-content: center; padding: 0.4em;}
.rc-bar { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
/* event name: hidden on phones (logo only, like the old site); shown from 768px */
.rc-title { display: none; margin: 6px 0 10px; font-size: 20px; font-weight: 700; }
.rc-pills {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);                   /* equal-width pills, however many */
    gap: 8px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 10px;
}
.rc-pills .custom-pill {
    flex: none;                                          /* cancels sitestyle's flex: .4 */
    display: flex; align-items: center; justify-content: center; text-align: center;
}
.rc-searchwrap { max-width: 520px; margin: 0 auto; }
.rc-search {
    display: block; width: 100%; height: 40px; padding: 0 10px;
    border: 1px solid var(--rc-accent); border-radius: 4px;
    background: var(--rc-bg); color: var(--rc-text); font-size: 15px;
}
.rc-search:focus { outline: none; border-color: var(--rc-strong); box-shadow: var(--rc-accent-fade) 0 0 8px 3px; }
.rc-head .custom-hr { margin-top: 10px; }

.rc-head.rc-condensed { padding-top: 6px; }
/* search stays visible when the header shrinks (slightly shorter) */
.rc-head.rc-condensed .rc-searchwrap { margin-top: 6px; }
.rc-head.rc-condensed .rc-search { height: 34px; font-size: 14px; }
.rc-head.rc-condensed .rc-bar { flex-direction: row; align-items: center; gap: 10px; }
/* phones: small logo + tabs (no event name) */
.rc-head.rc-condensed .rc-logo { flex-shrink: 0; }
.rc-head.rc-condensed .headerlogo { max-height: 30px !important; max-width: 90px; width: auto; }
.rc-head.rc-condensed .rc-title { display: none; }
.rc-head.rc-condensed .rc-pills { width: auto; max-width: none; margin: 0 0 0 auto; flex-shrink: 0; }
.rc-head.rc-condensed .rc-pills .custom-pill { padding: .25rem .8rem; font-size: 12px; }
.rc-head.rc-condensed .custom-hr { margin-top: 6px; }

@media (min-width: 768px) {
    .rc-title { display: block; font-size: 28px; }
    /* tablet/desktop: small logo + event name + tabs */
    .rc-head.rc-condensed .rc-title {
        display: block; flex: 1; margin: 0; font-size: 17px; text-align: left; min-width: 0;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
}

/* ---------- main + footer ---------- */
.rc-main { flex: 1 0 auto; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 8px 24px; color: var(--rc-text); }
@media (min-width: 768px) { .rc-main { padding: 0 20px 32px; } }

.rc-sponsor { display: flex; justify-content: center; padding: 16px 10px 8px; }

.rc-foot {
    position: sticky; bottom: 0; z-index: 20;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--rc-bg);
    border-top: 2px solid var(--rc-accent);
    font-size: 11.5px; color: var(--rc-muted); white-space: nowrap;
}
.rc-foot a { color: var(--rc-muted); }
.rc-foot-logo { height: 22px; width: auto; }
.rc-long { display: none; }
@media (min-width: 768px) {
    .rc-foot { font-size: 12.5px; padding: 8px 10px; }
    .rc-long { display: inline; }
}

/* ---------- full-width bars (races + categories share this) ---------- */
.rc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.rc-item {
    border: 1px solid var(--rc-line); border-radius: 4px; overflow: clip;
    background: var(--rc-bg); box-shadow: var(--rc-shadow);
    scroll-margin-top: calc(var(--rc-head-h) + 8px);
}
/* sticky category header: solid background underneath so the (semi-transparent) hover
   colour never lets scrolling results show through; -1px closes any rounding gap */
.rc-item-h { margin: 0; font: inherit; position: sticky; top: calc(var(--rc-head-h) - 1px); z-index: 5; background: var(--rc-bg); }

.rc-bar-btn {
    all: unset; box-sizing: border-box; width: 100%; cursor: pointer;
    display: grid; gap: 8px; align-items: baseline;
    padding: 10px; background: var(--rc-bar); color: var(--rc-text);
}
/* a faint tint of the event's primary colour, where the browser supports it */
@supports (background: color-mix(in srgb, red 10%, white)) {
    .rc-bar-btn { background: color-mix(in srgb, var(--rc-strong) 7%, var(--rc-bar)); }
}
/* open cards stand out from what's around them */
.rc-item:has(.rc-bar-btn[aria-expanded="true"]) { box-shadow: var(--rc-shadow-open); }
@media (hover: hover) {
    .rc-bar-btn:hover { background: linear-gradient(var(--rc-accent-fade), var(--rc-accent-fade)), var(--rc-bar); }
}
.rc-bar-btn:focus-visible { outline: 2px solid var(--rc-accent); outline-offset: -2px; }
.rc-bar-btn[aria-expanded="true"] { border-bottom: 2px solid var(--rc-accent); }

.rc-caret {
    display: inline-block; width: 0; height: 0;
    border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
    transition: transform .15s;
}
.rc-bar-btn[aria-expanded="true"] .rc-caret { transform: rotate(90deg); }

.rc-txt { min-width: 0; }
.rc-info, .rc-dist { display: none; font-size: 13.5px; color: var(--rc-muted); white-space: nowrap; }

/* race bar: caret | time | name (+ system · distance on phones) */
.rc-race { grid-template-columns: 12px 48px minmax(0, 1fr); }
.rc-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-num { color: var(--rc-muted); margin-right: 6px; }
.rc-name-inline { font-weight: 600; }

/* category bar: caret | (parent label) name (+ entries on phones) */
.rc-catbtn { grid-template-columns: 12px minmax(0, 1fr); }
.rc-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-parent { display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--rc-muted); }
.rc-catbtn .rc-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 768px) {
    .rc-bar-btn { padding: 11px 14px; }
    .rc-race { grid-template-columns: 12px 56px minmax(0, 1fr) 180px 90px; }
    .rc-catbtn { grid-template-columns: 12px minmax(0, 1fr) auto; }
    .rc-info, .rc-dist { display: block; }
    .rc-info { text-align: left; }
    .rc-catbtn .rc-info { text-align: right; }
    .rc-dist { text-align: right; font-weight: 600; color: var(--rc-text); font-variant-numeric: tabular-nums; }
}

.rc-item-b { padding-bottom: 6px; }

/* ---------- live search (message only shown when nothing matches) ---------- */
.rc-filterbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
    margin-top: 12px; padding: 10px 12px; border-radius: 3px;
    background: var(--rc-accent-fade); font-size: 14px;
}
.rc-filterbar .rc-meta { display: inline; }
.rc-linkbtn {
    margin-left: auto; border: 0; background: none; padding: 4px 0; cursor: pointer;
    color: var(--rc-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.rc-hit td { background: var(--rc-accent-fade) !important; }

/* ---------- timetable: day overview + sticky day headings ---------- */
.rc-dayidx {
    display: flex; flex-wrap: wrap; gap: 6px 24px;
    padding: 12px 0; border-bottom: 1px solid var(--rc-line); font-size: 14px;
}
.rc-dayidx a { color: var(--rc-text); text-decoration: none; }
.rc-dayidx a b { text-decoration: underline; text-decoration-color: var(--rc-accent); text-underline-offset: 3px; }
.rc-dayidx .rc-meta { display: inline; margin-left: 4px; }

.rc-day-h {
    position: sticky; top: calc(var(--rc-head-h) - 1px); z-index: 6;
    background: var(--rc-bg); margin: 18px 0 0; padding: 10px 0 6px;
    font-size: 17px; border-bottom: 2px solid var(--rc-strong);
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
    scroll-margin-top: var(--rc-head-h);
}
.rc-day-h .rc-meta { display: inline; font-family: inherit; }

/* ---------- results: jump dropdown ---------- */
.rc-catidx { padding: 12px 0; border-bottom: 1px solid var(--rc-line); }
.rc-select {
    width: 100%; height: 40px; padding: 0 8px;
    border: 1px solid var(--rc-accent); border-radius: 4px;
    background: var(--rc-bg); color: var(--rc-text); font-size: 15px;
}
@media (min-width: 768px) { .rc-select { display: block; max-width: 420px; margin: 0 auto; } }

/* ---------- sheet tables (start lists + results) ---------- */
.rc-sheet { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--rc-text); }
.rc-sheet th {
    font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--rc-muted); text-align: left; padding: 8px 6px 6px;
    border-bottom: 1px solid var(--rc-accent); white-space: nowrap;
}
.rc-sheet td { padding: 7px 6px; border-bottom: 1px solid var(--rc-line); vertical-align: top; }
.rc-sheet td:first-child, .rc-sheet th:first-child { padding-left: 10px; }
.rc-sheet .rc-r { text-align: right; }
@media (min-width: 768px) {
    .rc-sheet { font-size: 14.5px; }
    .rc-sheet td, .rc-sheet th { padding-left: 10px; padding-right: 10px; }
}

/* lane colour comes from .RaceClassN (sitestyle.css → --cat1..10), set per race by OnGetRaceData */
.rc-lane { display: inline-block; min-width: 24px; text-align: center; font-weight: 700; border-radius: 3px; color: #000; padding: 1px 4px; }
:where(.rc-lane) { background-color: var(--rc-strong); } /* fallback only */
/* category colours defined here too (higher specificity), so lanes don't depend on sitestyle.min.css */
.rc-lane.RaceClass1 { background-color: var(--cat1); }
.rc-lane.RaceClass2 { background-color: var(--cat2); }
.rc-lane.RaceClass3 { background-color: var(--cat3); }
.rc-lane.RaceClass4 { background-color: var(--cat4); }
.rc-lane.RaceClass5 { background-color: var(--cat5); }
.rc-lane.RaceClass6 { background-color: var(--cat6); }
.rc-lane.RaceClass7 { background-color: var(--cat7); }
.rc-lane.RaceClass8 { background-color: var(--cat8); }
.rc-lane.RaceClass9 { background-color: var(--cat9); }
.rc-lane.RaceClass10 { background-color: var(--cat10); }
.rc-nat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; margin-right: 6px; vertical-align: 1px; }
.rc-nat img { width: 18px; height: 12px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.rc-teamlogo { max-height: 1.1em; max-width: 1.5em; vertical-align: -2px; margin-right: 3px; }

/* a single tab (entries-only events) doesn't stretch across */
.rc-pills:has(> :only-child) { max-width: 170px; }

/* ---------- entries page: By category / By team switch ---------- */
.rc-viewtoggle { display: flex; justify-content: center; margin: 12px auto 0; }
.rc-viewtoggle a {
    min-width: 120px; padding: 7px 14px; text-align: center; text-decoration: none;
    font-size: 14px; font-weight: 600;
    border: 1px solid var(--rc-accent); color: var(--rc-accent) !important;   /* !important: sitestyle forces white links in dark mode */
}
.rc-viewtoggle a:first-child { border-radius: 4px 0 0 4px; }
.rc-viewtoggle a:last-child { border-radius: 0 4px 4px 0; border-left: 0; }
.rc-viewtoggle a.active { background: var(--rc-accent); color: var(--rc-on-accent) !important; }
.rc-entries td.rc-entry-n { width: 30px; color: var(--rc-muted); }

/* ---------- start list ---------- */
/* category: full name, right-aligned, wraps if long */
.rc-draw td.rc-cat { text-align: right; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
/* smaller club names on phones */
.rc-draw .rc-meta { font-size: 11.5px; }
@media (min-width: 768px) {
    .rc-draw td.rc-cat { font-size: 14px; white-space: nowrap; }
    .rc-draw .rc-meta { font-size: 12.5px; }
}

/* ---------- results table ---------- */
.rc-scroll { overflow-x: auto; }
.rc-res thead { display: none; }                         /* no headings on phones */
.rc-res tbody.rc-c:nth-of-type(even) td { background: var(--rc-zebra); }
.rc-res td.rc-pl { width: 30px; text-size-adjust:1.4rem; text-align:center; font-weight: 700; padding-right: 8px; }
.rc-res td.rc-pl.rc-podium { /*color: var(--rc-strong);*/ }
.rc-res .rc-cname { font-weight: 600; }
.rc-res td.rc-result { text-align: right; white-space: nowrap; font-weight: 700; }
.rc-res td.rc-sc { white-space: nowrap; }
.rc-res td.rc-sc b { font-weight: 600; }
.rc-res sup { font-size: 10.5px; color: var(--rc-muted); margin-left: 2px; vertical-align: 4px; }
.rc-shoot { color: var(--rc-accent); }
.rc-res tbody.rc-dq td { color: var(--rc-muted); }
.rc-res tbody.rc-grp td {
    background: transparent !important; padding-top: 12px;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--rc-muted); border-bottom: 1px solid var(--rc-accent);
}
.rc-p {
    display: inline-block; font-size: 10px; font-weight: 700; line-height: 1;
    padding: 2px 4px; border-radius: 3px; margin-left: 5px; vertical-align: 2px;
    background: var(--rc-accent); color: var(--rc-on-accent);
}

/* one border per competitor (around its tbody), not per row */
.rc-res td { border-bottom: 0; }
.rc-res tbody.rc-c { border-bottom: 1px solid var(--rc-line); }
.rc-res tr.rc-row td { padding-bottom: 3px; }
.rc-res tbody.rc-c:not(.rc-has-sp) tr.rc-row td { padding-bottom: 7px; }

/* phone: splits on their own full-width row, 6 per line */
.rc-res tr.rc-sp td { padding: 0 6px 8px 10px; }
.rc-sgrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; text-align:center; }
.rc-sgrid span { min-width: 0; }
.rc-sgrid i { display: block; font-style: normal; font-size: 10px; color: var(--rc-muted); letter-spacing: .03em; }
.rc-sgrid b { display: block; font-weight: 500; font-size: 12.5px; white-space: nowrap; }
.rc-sgrid sup { font-size: 9.5px; margin-left: 1px; vertical-align: 3px; }

/* tablet/desktop: team on its own line under the name, free to run under the splits */
.rc-res tr.rc-teamrow { display: none; }

/* too wide for the screen: drop every other split column (set by rc-results.js) */
.rc-res.rc-thin .rc-alt { display: none !important; }

@media (min-width: 768px) {
    .rc-res thead { display: table-header-group; }
    .rc-res tr.rc-sp { display: none; }
    .rc-res tbody.rc-c tr.rc-row td { padding-bottom: 2px !important; }
    .rc-res tr.rc-teamrow { display: table-row; }
    .rc-res tr.rc-teamrow td { padding-top: 0; padding-bottom: 8px; }
    .rc-res tr.rc-teamrow .rc-meta { white-space: nowrap; }
}

.rc-note { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 6px 10px 0; font-size: 12px; color: var(--rc-muted); }
.rc-note .rc-p { margin-left: 0; }

/* ---------- print: only what's open, full table layout ---------- */
@media print {
    .rc-head, .rc-foot, .rc-item-h, .rc-day-h { position: static; }
    .rc-item:not(:has(> .rc-item-b:not([hidden]))) { display: none; }
    .rc-res thead { display: table-header-group; }
    .rc-res tr.rc-sp, .rc-phone { display: none !important; }
    .rc-wide { display: table-cell !important; }
    .rc-wide-inline { display: inline !important; }
}


/* =====================================================================
   DARK MODE – neutral greys + outlines. The only event colour kept is a
   LIGHTENED secondary colour (same hue, readable on dark), used for open
   outlines, underlines, day lines, highlights, links and the P badge.
   Lane category colours are left as they are.
   ===================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --rc-accent: #9DB7D5;                         /* fallback if color-mix isn't supported */
        --rc-accent-fade: rgba(157, 183, 213, .16);
        --rc-strong: var(--rc-accent);
        --rc-on-accent: #111216;
        --rc-bar: #24252E;
        --rc-outline: #4B4D5B;
        --rc-text: #F2F2F5;      /* the DB body colour is usually dark – use near-white instead */
        --rc-shadow: none;
        --rc-shadow-open: none;
    }
    @supports (color: color-mix(in oklab, red 50%, white)) {
        :root {
            --rc-accent: color-mix(in oklab, var(--primary-color) 40%, #ffffff);
            --rc-accent-fade: color-mix(in srgb, var(--rc-accent) 16%, transparent);
        }
    }

    /* cards: grey outline instead of shadow; open card outlined in the accent */
    .rc-item { border-color: var(--rc-outline); }
    .rc-item:has(.rc-bar-btn[aria-expanded="true"]) { border-color: var(--rc-accent); }

    /* bars: plain grey, no event tint */
    .rc-bar-btn { background: var(--rc-bar) !important; }
    @media (hover: hover) {
        .rc-bar-btn:hover { background: linear-gradient(var(--rc-accent-fade), var(--rc-accent-fade)), var(--rc-bar) !important; }
    }

    /* tables: slightly stronger row lines so rows separate on dark */
    .rc-res tbody.rc-c { border-bottom-color: var(--rc-outline); }
    .rc-search, .rc-select { border-color: var(--rc-outline); color: var(--rc-text); }
    .rc-search:focus { border-color: var(--rc-accent); box-shadow: 0 0 0 3px var(--rc-accent-fade); }
}


/* ---------- phone: one heading block per category instead of labels on every competitor ---------- */
.rc-res tbody.rc-phead td {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rc-muted);
    background: transparent !important;
    padding-top: 8px;
    padding-bottom: 2px;
}

.rc-res tbody.rc-phead tr.rc-sp td {
    padding-top: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--rc-accent);
}

.rc-res tbody.rc-phead .rc-sgrid b {
    font-size: 11px;
    font-weight: 600;
    color: var(--rc-muted);
}

.rc-sgrid .rc-none {
    color: var(--rc-muted);
    font-weight: 400;
}

/* ---------- OPTIONAL tablet/desktop: club straight under the name (no gap), instead of on its own row ---------- */
@media (min-width: 768px) {
    .rc-res tr.rc-teamrow {
        display: none !important;
    }

    .rc-res .rc-meta.rc-phone {
        display: block !important;
    }

    .rc-res tbody.rc-c tr.rc-row td {
        padding-bottom: 8px !important;
    }
}


/* ---------- phone: one heading block per category instead of labels on every competitor ---------- */
.rc-res tbody.rc-phead td {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rc-muted);
    background: transparent !important;
    padding-top: 8px;
    padding-bottom: 2px;
}

.rc-res tbody.rc-phead tr.rc-sp td {
    padding-top: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--rc-accent);
}

.rc-res tbody.rc-phead .rc-sgrid b {
    font-size: 11px;
    font-weight: 600;
    color: var(--rc-muted);
}

.rc-sgrid .rc-none {
    color: var(--rc-muted);
    font-weight: 400;
}

/* ---------- OPTIONAL tablet/desktop: club straight under the name (no gap), instead of on its own row ---------- */
@media (min-width: 768px) {
    .rc-res tr.rc-teamrow {
        display: none !important;
    }

    .rc-res .rc-meta.rc-phone {
        display: block !important;
    }

    .rc-res tbody.rc-c tr.rc-row td {
        padding-bottom: 8px !important;
    }
}

/* ---------- country: flag + code sit on the same baseline as the competitor's name ---------- */
/* (was inline-flex, which lines things up by the flag image and lifts the code above the name) */
.rc-nat {
    display: inline;
    vertical-align: baseline;
    margin-right: 6px;
}

    .rc-nat img {
        vertical-align: -1px;
        margin-right: 4px;
    }


/* ---------- phone: one heading block per category instead of labels on every competitor ---------- */
.rc-res tbody.rc-phead td {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rc-muted);
    background: transparent !important;
    padding-top: 8px;
    padding-bottom: 2px;
}

.rc-res tbody.rc-phead tr.rc-sp td {
    padding-top: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--rc-accent);
}

.rc-res tbody.rc-phead .rc-sgrid b {
    font-size: 11px;
    font-weight: 600;
    color: var(--rc-muted);
}

.rc-sgrid .rc-none {
    color: var(--rc-muted);
    font-weight: 400;
}

/* ---------- OPTIONAL tablet/desktop: club straight under the name (no gap), instead of on its own row ---------- */
@media (min-width: 768px) {
    .rc-res tr.rc-teamrow {
        display: none !important;
    }

    .rc-res .rc-meta.rc-phone {
        display: block !important;
    }

    .rc-res tbody.rc-c tr.rc-row td {
        padding-bottom: 8px !important;
    }
}

/* ---------- country: flag + code sit on the same baseline as the competitor's name ---------- */
/* (was inline-flex, which lines things up by the flag image and lifts the code above the name) */
.rc-nat {
    display: inline;
    vertical-align: baseline;
    margin-right: 6px;
}

    .rc-nat img {
        vertical-align: -1px;
        margin-right: 4px;
    }

/* ---------- phones: bigger place number, split headings and values centred, tighter gaps ---------- */
@media (max-width: 767.98px) {
    .rc-res td.rc-pl {
        font-size: 1.4rem;
        line-height: 1.1;
        text-align: left;
        width: 38px;
        padding-right: 4px;
    }

    .rc-sgrid {
        gap: 2px;
    }

        .rc-sgrid span {
            text-align: center;
        }
}

/* ---------- sticky header: smooth shrink / grow ---------- */
.rc-head {
    transition: padding .2s ease;
}

    .rc-head .rc-searchwrap, .rc-head .custom-hr {
        transition: margin .2s ease;
    }

    .rc-head .rc-search {
        transition: height .2s ease, font-size .2s ease;
    }

    .rc-head .rc-pills .custom-pill {
        transition: padding .2s ease, font-size .2s ease;
    }
    /* the logo/title/tabs swap from stacked to one row, which can't be animated as such:
   a quick fade hides the swap so it doesn't look like a jump */
    .rc-head.rc-anim .rc-bar {
        /* animation: rc-headswap .25s ease;*/
      /*  animation: rc-head-fade-in 400ms ease forwards;*/
        animation: rc-head-fade-in 180ms ease-out;
    }


    @keyframes rc-head-fade-in {
        from {
            opacity: 0.3;
        }

        to {
            opacity: 1;
        }
    }
}

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

.rc-draw .rc-subcat {
    display: block;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--rc-muted);
    white-space: normal;
}


/* =====================================================================
LIVE RACE (timetable) – classes set by the live-status polling
.rc-live on every running race's card (can be several)
===================================================================== */
:root {
    --rc-live: #1E8E3E; /* green on light backgrounds */
    --rc-live-fade: rgba(30, 142, 62, .10);
}

@media (prefers-color-scheme: dark) {
    :root {
        --rc-live: #5BD17E; /* brighter green on dark */
        --rc-live-fade: rgba(91, 209, 126, .14);
    }
}

/* running race: green outline + faint green tint on its bar */
.rc-item.rc-live {
    border-color: var(--rc-live) !important; /* beats the open-card outline in dark mode */
    box-shadow: 0 0 0 1px var(--rc-live), var(--rc-shadow);
}

    .rc-item.rc-live .rc-bar-btn {
        background: linear-gradient(var(--rc-live-fade), var(--rc-live-fade)), var(--rc-bar) !important;
    }

/* small LIVE tag after the race name */
.rc-live-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    vertical-align: 2px;
    white-space: nowrap;
}

.rc-live-tag {
    background: var(--rc-live);
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    .rc-live-tag {
        color: #0E1A12;
    }
}
