/* event.html-only rules (races table, entry banner/fullscreen mode,
   arrivals-live, liens publics). See base.css's header comment for why a
   rule ending up here instead of base.css is a filing choice, not a
   loading boundary. */


/* Houses #connection-status (pinned top-left, see above) and #feedback,
   above the entry form - keeping the operator's eyes in one place instead
   of having to glance below the bib field for a result message, and letting
   the quick-entry card be exactly as tall as the entry form itself rather
   than reserving a fixed clearance band for the status indicator plus a
   whole separate line for feedback underneath. */
.quick-entry-header {
    position: relative;
    margin-bottom: 8px;
}

/* Event detail page's own header content (event.html's page_header block) -
   scoped to these classes rather than restyling the bare h1/p that
   index.html/admin.html/race.html also put in .page-header-title, so their
   plainer titles are unaffected. */
.event-header-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a2b3c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.event-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
    margin: 0;
}

.event-header-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.event-header-meta-icon { font-size: 14px; }

.event-header-meta-sep { color: #ccc; }

/* Recent-entries table on the quick-entry ("Chronométrage") tab: rows are
   shown ~45% shorter (reduced vertical padding, in two successive passes)
   and with a slightly smaller font so more history fits on screen while
   the operator is entering bibs. Edit/delete icons are scaled down to
   match the tighter row height. */
#section-entry table th,
#section-entry table td {
    padding: 4.5px 6px;
    font-size: 13px;
}

/* Kept as narrow as the LED itself - a whole extra table column (see the
   quick-entry history) is otherwise enough to push a wide, already-tight
   table (many nowrap columns) past the viewport, forcing a horizontal
   scroll that used to fit without one. */
.col-sync { width: 1%; padding-left: 4px; padding-right: 4px; }

.public-link-status-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    vertical-align: middle;
}

.public-link-status-badge.public-link-status-active { background: #eaf3de; color: #27500a; }
.public-link-status-badge.public-link-status-inactive { background: #eee; color: #666; }

/* "Vues publiques" tab: two categories, each with a heading + bulk toggle
   button (see toggleCategory in event/public-links.js) above its own table
   of views - identically structured for both categories now that every
   view keeps its own switch alongside the bulk one. */
.public-views-category { margin-top: 20px; }
.public-views-category:first-of-type { margin-top: 8px; }

.public-views-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.public-views-category-title { margin: 0; font-size: 16px; }

.race-name-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.race-name-row input[type="text"] {
    flex: 1;
}

.race-color-input {
    -webkit-appearance: none;
    appearance: none;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0 4px;
    border: 1px solid #bbb;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    flex: none;
}
.race-color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.race-color-input::-webkit-color-swatch { border: none; border-radius: 4px; }
.race-color-input::-moz-color-swatch { border: none; border-radius: 4px; }

.tab-icon { font-size: 14px; line-height: 1; }

#tab-entry {
    /* Tighter than the base .tab's inherited 18px right padding: the
       fullscreen toggle butts flush against this tab's right edge (see
       .entry-fullscreen-toggle below), so that much padding just reads as
       a wide gap between the "Chronométrage" label and the toggle icon. */
    padding-right: 0px;
}

/* Lives right after #tab-entry in the tab bar by default (see event.html) -
   a plain sibling rather than nested inside that button (buttons can't
   nest), butted up against it with a matching background/negative margin
   (see the #tab-entry(...)+.entry-fullscreen-toggle rules below) so it reads
   as part of the "Chronométrage" tab's own title instead of a separate tab.
   dockEntryFullscreenToggle() (event.html) physically moves this same
   element into .entry-banner-wrap while fullscreen is active, since that
   whole tab bar is hidden then (body.entry-fullscreen .tabs below) and this
   control would otherwise vanish with it - see .entry-banner-wrap
   .entry-fullscreen-toggle further down for how it looks once relocated
   there. Icon-only + title tooltip (no visible label) keeps it compact.
   Same navy/cyan colors as .tab/.tab.tab-active (see the
   #tab-entry.tab-active + .entry-fullscreen-toggle override in base.css for
   its own active-state match) - this tab used to be permanently orange/red,
   now styled the same as every other tab. */
.entry-fullscreen-toggle {
    width: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    background: #0f3b47;
    color: #fff;
    border: none;
    border-radius: 0 8px 0 0;
    margin-left: -4px;
}

.entry-fullscreen-toggle:hover { background: #154a5c; }

/* #tab-entry's own top-right corner is squared off (rather than the 8px
   .tab default) so it butts flush against the toggle instead of leaving a
   rounded sliver of tab background peeking out between the two. */
#tab-entry { border-top-right-radius: 0; }

/* Docked here (not the tab bar) while fullscreen is active - see
   dockEntryFullscreenToggle() in event.html. Pinned to the top-right corner
   of the black race-clocks banner (.entry-banner-wrap has position:relative
   for this to anchor against) - same corner-pin idea as .connection-status
   in .quick-entry, just the opposite corner - and restyled back to a
   free-floating icon button since it's no longer flush against a tab. */
.entry-banner-wrap .entry-fullscreen-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    margin-left: 0;
}

.entry-banner-wrap .entry-fullscreen-toggle:hover { background: rgba(255, 255, 255, 0.22); }

/* Two-column layout: the entry form (fixed width) and the "Dernière
   saisie" card (fills the rest) side by side - overrides .quick-entry's
   own centered text-align (base.css), same way .entry-form's text-align
   below used to on its own before this wrapper existed. */
.quick-entry-grid {
    display: flex;
    align-items: stretch;
    gap: 20px;
    flex-wrap: wrap;
    text-align: left;
}

.entry-form {
    width: 360px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 16px 18px;
    text-align: left;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
}

.entry-form-label {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(15, 59, 71, 0.45);
}

.entry-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

/* Colors matched to .entry-race-panel/.entry-banner above (same cyan/navy
   theme) rather than the app's generic blue, so the quick-entry field the
   operator actually types into reads as part of the same banner. Font size
   deliberately huge (58px) - this is the one field an operator's eyes must
   find instantly without hunting, glancing down at a bib list. */
.bib-input {
    flex: 1;
    min-width: 0;
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 58px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-align: center;
    padding: 6px 10px;
    border: 2px solid #3bbbda;
    border-radius: 12px;
    background: #fff;
    color: #0f3b47;
}

.bib-input:focus {
    outline: none;
    border-color: #3bbbda;
    box-shadow: 0 0 0 4px rgba(59, 187, 218, 0.25);
}

.bib-input::placeholder {
    color: #8fb8cc;
    opacity: 1;
}

/* Grouped-arrival entry ("45-46-47", see recordEntry/multiBibEntryEnabled in
   event.html): shrunk (rather than widened - the field already fills its
   row via flex:1) so several hyphen-separated bibs stay readable instead of
   overflowing or forcing the card wider. */
.bib-input.bib-input-wide {
    font-size: 28px;
}

/* Same accent color as .entry-panel-action-start above (the race panels'
   own "Démarrer Course" button) so it reads as part of that banner too. */
.record-entry-button {
    width: 104px;
    flex: none;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 17px;
    font-weight: 800;
    border-radius: 12px;
    background: #3bbbda;
    color: #0f3b47;
}

.record-entry-button:hover,
.record-entry-button:active {
    background: #2fa5c2;
    color: #fff;
}

/* Abandon toggle (main entry form and the "Modifier le passage" popup's
   #edit-entry-dnf - see edit-entry-toggle-label below): a real
   <input type="checkbox"> underneath (native keyboard/screen-reader
   semantics, same pattern as .short-select-control elsewhere in this app)
   with a track+knob pair drawn as its sibling/label rather than the
   checkbox's own default appearance - the visible control the operator
   actually sees is entirely CSS, driven off :checked. Pink accent
   (#EC1E79/#C21464) reuses the app's own existing "corrective, not
   alarming" color pair (see .rsc-reset-button, race.css) rather than the
   plain red this control used to have. */
.dnf-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    align-self: flex-start;
}

.dnf-toggle-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dnf-toggle-track {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: rgba(15, 59, 71, 0.18);
    position: relative;
    flex: none;
    transition: background 0.15s;
}

.dnf-toggle-checkbox:checked + .dnf-toggle-track {
    background: #EC1E79;
}

.dnf-toggle-checkbox:focus-visible + .dnf-toggle-track {
    box-shadow: 0 0 0 3px rgba(59, 187, 218, 0.4);
}

.dnf-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: left 0.15s;
}

.dnf-toggle-checkbox:checked + .dnf-toggle-track .dnf-toggle-knob {
    left: 21px;
}

.dnf-toggle-text {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: rgba(15, 59, 71, 0.55);
}

.dnf-toggle-checkbox:checked ~ .dnf-toggle-text {
    color: #C21464;
}

/* Sits in .quick-entry-header, above the entry form/last-entry grid -
   min-height keeps that row's height stable whether or not a message is
   currently showing. Inherits .quick-entry's centered text-align, so it
   stays centered over the whole card rather than pinned to one side. */
.feedback {
    min-height: 26px;
    font-size: 18px;
    font-weight: 600;
}

.feedback.success { color: #27500a; }
.feedback.error { color: #791f1f; }
.feedback.dnf { color: #8a5a00; }
.row-dnf { color: #c0392b; }

/* "Dernière saisie" card (quick-entry tab, entry.js's renderLastEntryCard) -
   the successful-recording receipt, next to the entry form. Only ever
   populated after a genuine server 200 for a resolved (non-dnf, non-
   orphan, non-duplicate) crossing - errors/orphans/duplicates/dnf keep
   using #feedback above, exactly as before this card existed. */
.last-entry-card {
    flex: 1;
    min-width: 280px;
    border: 1px solid rgba(59, 187, 218, 0.35);
    background: rgba(59, 187, 218, 0.08);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.last-entry-empty {
    color: rgba(15, 59, 71, 0.45);
    font-size: 13px;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
}

.last-entry-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.last-entry-eyebrow {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(15, 59, 71, 0.45);
}

.last-entry-sync {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #3e9e5a;
    flex: none;
}

.last-entry-sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3e9e5a;
}

.last-entry-identity {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.last-entry-bib {
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 24px;
    font-weight: 800;
    background: #fff;
    border: 1px solid rgba(59, 187, 218, 0.4);
    border-radius: 9px;
    padding: 10px 14px;
}

.last-entry-name-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.last-entry-name {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 16px;
    font-weight: 800;
}

.last-entry-gender {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
}

/* Three-tone: the race name reads clearly (.7 opacity), the " · "
   separators recede (.35), category/club sit in between (.5) - matching
   the mockup rather than one flat color for the whole row. */
.last-entry-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
}

.last-entry-meta-race {
    font-size: 12px;
    font-weight: 700;
    color: rgba(15, 59, 71, 0.7);
}

.last-entry-meta-sep {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(15, 59, 71, 0.35);
}

.last-entry-meta-value {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(15, 59, 71, 0.5);
}

.last-entry-race-swatch {
    width: 4px;
    height: 13px;
    border-radius: 3px;
    flex: none;
}

.last-entry-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px 24px;
    width: 100%;
}

.last-entry-stat-label {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(15, 59, 71, 0.4);
}

.last-entry-stat-value {
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 18px;
    font-weight: 800;
    margin-top: 7px;
    color: #0f3b47;
}

/* "Point de chronométrage" is a name, not a number - Manrope at the
   .last-entry-stat-label's own rhythm rather than the big mono digits the
   other three stats (rank/heure/temps) use. */
.last-entry-stat-value-text {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    margin-top: 8px;
    color: #0f3b47;
}

.last-entry-stat-value-accent { color: #0B6A83; }

/* "Derniers passages enregistrés" header row: title, the three-way scope
   switcher (entry.js's renderEntryScopeTabs), a spacer, then the active
   point's own stats (entry.js's renderEntryPointStats) - only ever
   populated when the event has at least one custom timing point, same
   condition as the "Où chronométrez-vous ?" banner above (see
   docs/SPECIFICATIONS.md): with none, this whole row stays empty and the
   section looks exactly as it did before this feature existed. */
.recent-entries-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-bottom: 12px;
}

.recent-entries-title {
    margin: 0;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 15px;
    font-weight: 800;
}

.recent-entries-header-spacer {
    flex: 1;
}

.entry-scope-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid rgba(15, 59, 71, 0.14);
    border-radius: 11px;
    padding: 3px;
    background: #fafbfb;
}

.entry-scope-tab {
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 8px 13px;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(15, 59, 71, 0.7);
    cursor: pointer;
}

.entry-scope-tab.entry-scope-tab-active {
    background: #0f3b47;
    color: #fff;
}

.entry-point-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.entry-point-stats-item {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.entry-point-stats-value {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 16px;
    font-weight: 800;
}

.entry-point-stats-value-remaining { color: #0B6A83; }
.entry-point-stats-value-expected { color: rgba(15, 59, 71, 0.5); }

.entry-point-stats-label {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: rgba(15, 59, 71, 0.45);
}

.entry-point-stats-bar {
    width: 160px;
    height: 8px;
    border-radius: 8px;
    background: rgba(15, 59, 71, 0.08);
    overflow: hidden;
}

.entry-point-stats-bar-fill {
    height: 100%;
    border-radius: 8px;
    background: #3bbbda;
}

.entry-point-stats-pct {
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-size: 11.5px;
    font-weight: 700;
    color: #0B6A83;
}

/* Card header above the races table: title left, "Partager"/"Ajouter une
   course" buttons right - replaces the old plain <h2> with float:right
   icons. */
.races-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 4px;
}

.races-toolbar-title { margin: 0; }

.races-toolbar-actions {
    display: flex;
    gap: 10px;
}

/* Scoped to this one toolbar ("Partager"/"Ajouter une course", races
   listing screen) rather than the app-wide button/.secondary defaults, so
   only these two pick up the app's cyan accent with a black (not white)
   label - everywhere else keeps the standard blue/white button. */
.races-toolbar-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #3bbbda;
    color: white;
}

.races-toolbar-actions button:hover,
.races-toolbar-actions button:active {
    background: #2fa5c2;
    color: #000;
}

.races-toolbar-actions .btn-icon { font-size: 14px; line-height: 1; }

/* Race name cell: the same .color-swatch dot used elsewhere for a race's
   color (results tables, race.html's own header...) sits beside the name,
   and that same color also runs down the row's left edge as a border. */
.race-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Small solid dot before the status text, reusing the badge's own text
   color (currentColor) via background so it's never a color out of step
   with the pill it sits in - one color source (.status-badge.status-* in
   the block above) instead of a second copy per status. */
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 5px;
    vertical-align: middle;
}

/* Participants/Partants/Arrivés/Abandons cells: the count, then its share
   of this race's participants right underneath (see loadRaceStats) - same
   "value + context line" idea as the event-wide stat cards above the
   tabs. */
.cell-stat-value { font-weight: 700; }

.cell-stat-percent {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* "Temps" cell while a race is in_progress: the ticking value plus a small
   accent-colored "Temps réel" caption underneath (see updateLiveTime) -
   hidden entirely for a race with nothing live to show (finished / not yet
   started), where the value is just "-". */
.cell-live-time-caption {
    font-size: 11px;
    color: #3bbbda;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 2px;
}

/* Edit/delete + "next status" action merged into one cell (previously two
   separate columns) - the icon buttons on one line, the bold call-to-action
   button (when there is one) on its own line right underneath. */
.races-actions-cell { text-align: right; }

.races-actions-row {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* Same bordered-box language as the row-action icons above (rather than its
   old solid orange pill) so the races table's one text-labeled row action
   reads as part of the same family - just wider, to fit its label, and its
   own orange kept as the text/hover color instead of a fill. */
.race-next-status-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    height: 30px;
    background: white;
    color: #0f3b47;
    border: 1px solid #e0e0e0;
    font-weight: 700;
    white-space: nowrap;
    font-size: 12px;
    padding: 0 10px;
    border-radius: 8px;
}

.race-next-status-button:hover { background: #fff3e8; }

/* Entered bib matching no runner ("orphan"), or re-entered for a checkpoint
   it already has ("duplicate"): same bright red to flag unambiguously that
   the entry is suspect - the pencil icon lets you fix it (reconciling an
   orphan automatically, or promoting a leftover duplicate if the corrected
   record was the real one). */
.row-orphan, .row-duplicate { background: #ff1a1a; color: #fff; }

/* Per-row sync status in the quick-entry history: green once the server has
   confirmed the record, red while it only exists in this device's local
   offline queue (see event.html's pending-entries handling). */
.sync-led {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
}
.sync-led-synced { background: #2ecc71; box-shadow: 0 0 3px #2ecc71; }
.sync-led-pending { background: #ff1a1a; box-shadow: 0 0 3px #ff1a1a; }

/* A row that only exists in the local offline queue, not yet confirmed by
   the server: same idea as .row-orphan (little reliable info beyond
   bib/time) but a distinct muted style since it isn't suspect, only
   pending. */
.row-pending-sync { background: #fef3e2; color: #7a5200; font-style: italic; }

/* Chronométrage's own banner (renderEntryBanner in event.html): one dark
   cyan/navy panel per race, plus one for the event's own totals - same hue
   family as .topbar-clock's pill (see base.html), so it reads as part of
   this site's own cyan theme rather than a generic dark scoreboard. Also
   reused (without the stats panel or action buttons) for the "Dernières
   arrivées" tab's own read-only copy of the race panels - see
   renderEntryRacePanel/updateArrivalsClock in event.html. */
.entry-banner-wrap {
    position: relative;
    margin-bottom: 16px;
}

.entry-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.entry-race-panel,
.entry-stats-panel {
    flex: 1 1 260px;
    background: #0e3b47;
    border: 1px solid #1c5269;
    border-radius: 14px;
    padding: 12px 20px;
    color: #fff;
    text-align: center;
    /* .entry-banner's flex row already stretches every panel to the height
       of its tallest sibling. Every .entry-race-panel always renders the
       same rows in the same order - title, caption, time, (optionally)
       button - falling back to an invisible placeholder rather than being
       omitted when a race has no running time or no action to show (see
       renderEntryRacePanel in event.html), so each row's own height is
       identical across every panel. space-between (not center) then only
       has to distribute the leftover stretch height into equal gaps, which
       keeps title/caption/time/button on the same line across every card
       regardless of that leftover amount. */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.entry-panel-title {
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Race's own color as a small square before its name (rather than tinting
   the name text itself, now always white - see .entry-panel-title). */
.entry-panel-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex: none;
}

/* Doubles as the race's own status (EN COURS / TERMINÉE / REMISE DOSSARDS
   FERMÉE...) instead of a fixed "Temps de course" label - see
   renderEntryRacePanel - so status is stated once here rather than repeated
   on a second line underneath the time. */
.entry-panel-caption {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8fb8cc;
    margin-bottom: 4px;
}

.entry-panel-time {
    font-size: 32px;
    font-weight: 800;
    font-family: "Courier New", Courier, monospace;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}

/* Reserves the same line height as a real running time, for a race with
   nothing to show yet (e.g. still "en préparation") - see
   renderEntryRacePanel. */
.entry-panel-time-placeholder { visibility: hidden; }

/* Sized to fit "Démarrer Course" (longer than "Arrêter Course") so both
   variants share one width and a race's button doesn't visibly resize
   when it flips between the two on start/stop - rather than stretching to
   the panel's full width, which the shared .entry-race-panel flex column
   would otherwise do by default. */
.entry-panel-action-button {
    align-self: center;
    font-size: 14px;
    padding: 7px 18px;
    min-width: 168px;
    white-space: nowrap;
    border-radius: 8px;
    border: none;
    margin-top: 4px;
}

.entry-panel-action-start { background: #3bbbda; color: #06222c; }
.entry-panel-action-start:hover { background: #2fa5c2; }
.entry-panel-action-stop { background: #e05252; color: #fff; }
.entry-panel-action-stop:hover { background: #c43e3e; }

/* Reserves the same button height for a race with no start/stop action to
   show (already finished, or the viewer lacks manage_race_status) - see
   renderEntryRacePanel. */
.entry-panel-action-placeholder { visibility: hidden; background: none; }

/* Overrides the space-between shared with .entry-race-panel above: that
   rule exists to keep multi-row race panels (title/caption/time/button)
   aligned line-by-line across siblings, but the stats panel only has two
   rows (title, counters row). flex-start keeps the title pinned at the
   same top position as every race panel's own title (see
   .entry-panel-title) regardless of how much the card is stretched to
   match its tallest sibling; the counters row then centers itself in
   whatever space is left below via its own auto margins (see
   .entry-stats-row) rather than being glued to either end. */
.entry-stats-panel {
    justify-content: flex-start;
}

.entry-stats-title {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    color: #fff;
}

.entry-stats-row {
    display: flex;
    gap: 10px;
    margin: auto 0;
}

/* Equal-width columns (rather than space-around, whose gap only equalizes
   the leftover free space - not the columns themselves) so the three
   counters sit at even intervals regardless of label length. Bottom-aligned
   so a two-line label (e.g. "Reste à arriver") doesn't push its value lower
   than the single-line labels' values sitting next to it - every value ends
   up on the same baseline. */
.entry-stat-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.entry-stat-col-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #8fb8cc;
    margin-bottom: 4px;
}

.entry-stat-col-value {
    font-size: 24px;
    font-weight: 800;
}

.entry-stat-col-finishers .entry-stat-col-value { color: #4ade80; }
.entry-stat-col-dnf .entry-stat-col-value { color: #f87171; }
.entry-stat-col-remaining .entry-stat-col-value { color: #fbbf24; }

@media (max-width: 700px) {
    .entry-race-panel, .entry-stats-panel { padding: 10px 16px; }
    .entry-panel-time { font-size: 26px; }
    .entry-panel-title { font-size: 16px; }
    .entry-stat-col-value { font-size: 22px; }
}

@media (max-width: 700px) {
    .bib-input { font-size: 44px; padding: 16px 8px; }
    .feedback { font-size: 16px; }
}

.modal-box-timing-point { max-width: 560px; }

/* "Points de chronométrage" tab (event.html, app/static/event/timing-
   points.js): the "Plan des points de passage" diagram (one line per race,
   to the same km scale, with a marker per point) and the table/popup below
   it. Colors/fonts reuse the app's own existing palette throughout - dark
   navy for text/labels (matching thead th's own background), the app's
   cyan accent (already used for .races-toolbar-actions button, right next
   to this tab) for the hovered/selected states - rather than introducing a
   second visual language for just this one tab. */
/* Shown whenever a race has zero is_finish passages (see
   renderMissingFinishWarning, event/timing-points.js) - same persistent,
   red-tinted, JS-toggled pattern as .bib-assign-capacity-warning (base.css),
   not the transient .message toast, since this reflects standing
   configuration state rather than a one-off submit result. A race can't
   leave "en préparation" without one (set_race_status), so in practice this
   only ever shows while a race is still being configured. */
.tp-missing-finish-warning {
    background: #fdecea;
    border: 1px solid #f3b7ae;
    border-radius: 8px;
    color: #b3261e;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.tp-diagram-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 18px 20px 10px;
    background: #fafbfb;
    margin-bottom: 18px;
}

.tp-diagram-heading {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8f98;
    margin-bottom: 14px;
}

.tp-line {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.tp-line + .tp-line { margin-top: 4px; }

.tp-line-label { min-width: 0; }

.tp-line-label-name {
    font-weight: 800;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tp-line-label-dist {
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    color: #8a8f98;
    margin-top: 2px;
}

.tp-line-track {
    position: relative;
    height: 74px;
}

.tp-line-bar {
    position: absolute;
    top: 50%;
    left: 0;
    height: 8px;
    border-radius: 8px;
    transform: translateY(-50%);
}

.tp-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px;
    transform: translateX(-50%);
    cursor: default;
}

.tp-marker-label {
    order: 1;
    font-weight: 700;
    font-size: 10.5px;
    color: #0f3b47;
    line-height: 1.1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    height: 20px;
    display: flex;
    align-items: flex-end;
}

.tp-marker-below .tp-marker-label { order: 3; align-items: flex-start; }

.tp-marker-dot {
    order: 2;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #0f3b47;
    margin: 5px 0;
    flex: none;
}

.tp-marker-km {
    order: 3;
    font-family: "Courier New", Courier, monospace;
    font-size: 10px;
    color: #8a8f98;
    height: 14px;
}

.tp-marker-below .tp-marker-km { order: 1; }

/* A finish passage (TimingPointRace.is_finish) reuses the same .tp-marker
   shape as any other passage - it's just one more crossing of a point, now -
   but keeps a distinct, slightly bigger dot whose border picks up the race's
   own color (set as this marker's own `color`, via inline style in
   timing-points.js) rather than the fixed navy every other dot uses, so a
   race's actual finish still stands out along its line. */
.tp-marker-finish .tp-marker-dot {
    width: 14px;
    height: 14px;
    border-color: currentColor;
}

.tp-marker.tp-hover .tp-marker-dot {
    border-color: #3bbbda;
    background: #3bbbda;
    transform: scale(1.3);
    box-shadow: 0 0 0 5px rgba(59, 187, 218, 0.25);
}

.tp-marker.tp-hover .tp-marker-label,
.tp-marker.tp-hover .tp-marker-km { color: #2691a8; }

.tp-axis {
    position: relative;
    height: 18px;
    margin-top: 2px;
    margin-left: 146px;
    border-top: 1px dashed #ddd;
}

.tp-axis-tick {
    position: absolute;
    top: 5px;
    transform: translateX(-50%);
    font-family: "Courier New", Courier, monospace;
    font-size: 9.5px;
    color: #8a8f98;
}

.tp-race-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #e0e0e0;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 600;
    color: #0f3b47;
    margin: 2px 4px 2px 0;
}

.tp-race-pill-km {
    font-family: "Courier New", Courier, monospace;
    font-size: 11.5px;
    color: #8a8f98;
}

.tp-empty {
    text-align: center;
    padding: 40px 20px;
}

.tp-empty-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }

.tp-empty-text { font-size: 13px; color: #8a8f98; max-width: 420px; margin: 0 auto; }

.tp-race-checkbox-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 11px 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tp-race-checkbox-card.checked {
    border-color: #3bbbda;
    background: rgba(59, 187, 218, 0.07);
}

.tp-race-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    min-width: 180px;
}

.tp-race-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: #3bbbda; }

.tp-race-checkbox-name { font-weight: 700; font-size: 13.5px; color: #0f3b47; }

.tp-race-checkbox-dist { font-family: "Courier New", Courier, monospace; font-size: 11.5px; color: #8a8f98; }

.tp-km-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding-left: 26px;
}

/* One row per passage of this race through the point ("Passage 1", "Passage
   2"...) - a race checked with a single passage still renders one row, just
   with no remove button (see .tp-km-remove below). Each row's own
   .tp-passage-type-toggle picks whether this passage is an ordinary km
   marker (km input shown) or this race's finish (km implied by its own
   distance - input hidden entirely). */
.tp-km-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tp-km-field-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a8f98;
    min-width: 68px;
}

.tp-passage-type-toggle {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.tp-passage-type-btn {
    border: none;
    background: #fff;
    padding: 6px 11px;
    font-size: 11.5px;
    font-weight: 700;
    color: #0f3b47;
    cursor: pointer;
}

.tp-passage-type-btn + .tp-passage-type-btn { border-left: 1px solid #ccc; }

.tp-passage-type-btn.active {
    background: #0f3b47;
    color: #fff;
}

.tp-km-input {
    width: 84px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 7px 9px;
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    font-size: 13px;
    text-align: right;
}

.tp-km-remove {
    cursor: pointer;
    color: #8a8f98;
}

.tp-km-remove:hover { color: #c0392b; }

.tp-add-passage-btn {
    align-self: flex-start;
    border: 1px dashed rgba(15, 59, 71, 0.25);
    background: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 11px;
    color: #0b6a83;
    cursor: pointer;
}

.tp-add-passage-btn:hover { border-color: #3bbbda; color: #0f3b47; }

/* "Où chronométrez-vous ?" picker (quick-entry tab, event/entry.js) - one
   .cp-choice per timing point, plus the small always-visible banner
   (.chrono-point-banner) recalling the active one and offering to change
   it. Same navy/cyan palette as the timing-points tab above. Shares its
   dark header-bar treatment (.cp-modal-header/-title/-subtitle/-close)
   with .modal-box-edit-entry ("Modifier le passage") below - both are
   this same "Où chronométrez-vous ?" mockup's own popups. */

.modal-box-chrono-point,
.modal-box-edit-entry {
    max-width: 540px;
    padding: 0;
    border-radius: 18px;
}

.cp-modal-header {
    background: #0E3B49;
    color: #fff;
    padding: 18px 22px;
    border-radius: 18px 18px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cp-modal-header-text {
    min-width: 0;
}

.cp-modal-title {
    margin: 0;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
}

.cp-modal-subtitle {
    margin: 5px 0 0;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.6);
}

/* The record's own timing point, named right under the "Modifier le
   passage" title so the operator knows which point they're correcting
   without having to close the popup and check. */
.cp-modal-point-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 9px;
    flex-wrap: wrap;
}

.cp-modal-point-label {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-weight: 600;
    font-size: 9.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.cp-modal-point-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 187, 218, 0.16);
    border: 1px solid rgba(59, 187, 218, 0.4);
    border-radius: 999px;
    padding: 6px 12px;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-weight: 800;
    font-size: 12.5px;
    color: #8FDCEF;
}

.cp-modal-point-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3bbbda;
    flex: none;
}

.cp-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    width: 26px;
    height: 26px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    flex: none;
}

.cp-modal-close:hover { background: rgba(255, 255, 255, 0.24); }

.cp-modal-body {
    padding: 20px 22px;
}

.modal-box-edit-entry .cp-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cp-field-label {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(15, 59, 71, 0.45);
}

.cp-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cp-input,
.modal-box-edit-entry .runner-search-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(15, 59, 71, 0.16);
    background: #fafbfb;
    border-radius: 10px;
    outline: 0;
    padding: 11px 13px;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #0f3b47;
}

.cp-input:focus,
.modal-box-edit-entry .runner-search-input:focus {
    outline: none;
    border-color: #3bbbda;
    box-shadow: 0 0 0 3px rgba(59, 187, 218, 0.2);
}

.modal-box-edit-entry .runner-search-input {
    padding: 12px 14px;
}

.cp-input-mono {
    font-family: "JetBrains Mono", "Courier New", monospace;
}

/* "Annuler"/"Enregistrer" for this popup specifically match the mock-up's
   own outline/filled treatment (rather than the cyan .modal-actions button
   every other popup in the app shares) - a deliberate, scoped exception
   asked for explicitly, not a change to the shared convention itself. */
.cp-modal-actions {
    border-top: 1px solid rgba(15, 59, 71, 0.08);
    padding-top: 16px;
    margin-top: 0;
}

.cp-modal-actions button {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-weight: 700;
    font-size: 12.5px;
    border-radius: 10px;
    cursor: pointer;
}

.cp-modal-actions button.secondary {
    border: 1px solid rgba(15, 59, 71, 0.16);
    background: #fff;
    color: rgba(15, 59, 71, 0.7);
    padding: 10px 16px;
}

.cp-modal-actions button.secondary:hover {
    border-color: #0f3b47;
    color: #0f3b47;
    background: #fff;
}

.cp-modal-actions button[type="submit"] {
    border: 0;
    background: #0f3b47;
    color: #fff;
    padding: 11px 18px;
}

.cp-modal-actions button[type="submit"]:hover {
    background: #3bbbda;
    color: #0f3b47;
}

.cp-choice {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.cp-choice:hover {
    border-color: #3bbbda;
}

.cp-choice + .cp-choice {
    margin-top: 10px;
}

.cp-choice-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}

.cp-choice-text {
    flex: 1;
    min-width: 0;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
}

.cp-choice-name {
    display: block;
    font-weight: 800;
    font-size: 14.5px;
    color: #0f3b47;
}

.cp-choice-meta {
    display: block;
    font-weight: 600;
    font-size: 11.5px;
    color: rgba(15, 59, 71, 0.5);
    margin-top: 4px;
}

.cp-choice-badge {
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-weight: 700;
    font-size: 11px;
    color: #0B6A83;
    flex: none;
    white-space: nowrap;
}

.chrono-point-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    background: #0E3B49;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 14px;
    color: #fff;
}

.chrono-point-banner-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

/* Pulses steadily while this screen is recording against the point named
   next to it - a quiet, constant reminder of which point is live, not an
   alert (opacity fade only, no color/size change - see pulseDot below). */
.chrono-point-banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3FC1E0;
    animation: pulseDot 1.6s ease-in-out infinite;
    flex: none;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.chrono-point-banner-text {
    min-width: 0;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
}

.chrono-point-banner-label {
    font-weight: 600;
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.chrono-point-banner-name {
    font-weight: 800;
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-top: 5px;
}

.chrono-point-banner-legs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: none;
}

.chrono-point-banner-leg {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 6px 12px;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-weight: 700;
    font-size: 11.5px;
    color: #fff;
}

.chrono-point-banner-leg-swatch {
    width: 4px;
    height: 12px;
    border-radius: 3px;
    flex: none;
}

.chrono-point-banner-leg-km {
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-weight: 600;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.chrono-point-banner-change {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 9px 14px;
    color: #fff;
    font-family: "Manrope", -apple-system, system-ui, sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    flex: none;
}

.chrono-point-banner-change:hover {
    background: #3bbbda;
    color: #0f3b47;
    border-color: #3bbbda;
}
