:root {
    --brand-pink: #E0189A;
    --brand-pink-dark: #A81174;
    --brand-orange: #F0A202;
    /* Pastilles de catégorie, couleurs Zwift */
    --cat-a: #E5332A;
    --cat-b: #3DBE62;
    --cat-c: #0CB4D1;
    --cat-d: #F7C531;
    --alert-red: #E5332A;
}

body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background-color: #F1E4D1;
    background-image: url('/assets/images/bg-mountains.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #e2e8f0;
    margin: 0;
    padding: 0;
}
header.site {
    background: #1e293b;
    padding: 12px 24px;
    position: relative;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
}
header.site .brand {
    color: var(--brand-pink);
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
}
.lang-switch {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 6px;
}
.lang-flag {
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    opacity: 0.45;
    filter: grayscale(70%);
    padding: 4px 6px;
    border-radius: 6px;
    transition: opacity 0.15s, filter 0.15s, background 0.15s;
}
.lang-flag:hover { opacity: 0.8; }
.lang-flag.active { opacity: 1; filter: none; background: #334155; }
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
}
.nav-link {
    color: #e2e8f0;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}
.nav-link:hover { background: #334155; }
.nav-link.active { background: var(--brand-pink); color: #fff; }
.nav-link-muted { color: #94a3b8; }

/* Cloche admin : demandes en attente */
.nav-bell { position: relative; font-size: 18px; line-height: 1; padding: 6px 12px; }
.nav-bell-count {
    position: absolute;
    top: 0;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--alert-red);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #1e293b;
}
.nav-bell-count.is-zero { background: #475569; color: #cbd5e1; }
.nav-bell-dropdown summary.nav-bell { color: inherit; }
.nav-bell-dropdown .dropdown-menu { left: auto; right: 0; min-width: 260px; }
.nav-bell-item-count {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    margin-right: 6px;
    border-radius: 999px;
    background: var(--alert-red);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}
.dropdown-empty { display: block; padding: 8px 10px; color: #94a3b8; font-size: 13px; }

.nav-dropdown { position: relative; }
.nav-dropdown summary {
    cursor: pointer;
    list-style: none;
    color: var(--brand-orange);
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown[open] summary { background: #334155; border-radius: 6px; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 6px;
    min-width: 200px;
    z-index: 20;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.dropdown-menu a {
    display: block;
    padding: 8px 12px;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
}
.dropdown-menu a:hover { background: #334155; }

.nav-toggle-checkbox { display: none; }
.nav-toggle-btn {
    display: none;
    color: #e2e8f0;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
}

.breadcrumb {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--brand-pink); text-decoration: none; }
.breadcrumb-sep { margin: 0 6px; }
.breadcrumb-current { color: #e2e8f0; }

@media (max-width: 720px) {
    body { background-attachment: scroll; }
    .nav-toggle-btn { display: block; }
    .main-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-top: 12px;
    }
    .nav-toggle-checkbox:checked ~ .main-nav { display: flex; }
    .nav-bell { align-self: flex-start; }
    .dropdown-menu { position: static; box-shadow: none; margin-top: 4px; }
}

/* ---- Page d'accueil ---- */
main.wide { max-width: 1000px; }

.hero {
    text-align: center;
    padding: 24px 16px 40px;
}
.hero h1 {
    font-size: 36px;
    margin-bottom: 8px;
}
.hero .tagline {
    color: #94a3b8;
    font-size: 17px;
    max-width: 560px;
    margin: 0 auto 24px;
}
.hero-dates { color: var(--brand-orange); font-weight: bold; font-size: 17px; margin: -12px 0 6px; }
.hero-deadline { color: #94a3b8; font-size: 14px; margin: 0 0 22px; }
.hero .cta-group { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero .cta-group .btn { margin-top: 0; }

.hero-logo {
    max-width: 420px;
    width: 100%;
    height: auto;
    margin: 0 auto 16px;
    display: block;
    /* Logo à texte noir sur fond blanc : posé dans un encart blanc pour rester lisible sur le fond sombre */
    box-sizing: border-box;
    background: #fff;
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.hero .btn-secondary {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.section-title {
    font-size: 22px;
    margin: 48px 0 8px;
    text-align: center;
}
.section-subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 24px;
}

.stage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stage-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px;
}
.stage-card .stage-number {
    display: inline-block;
    background: var(--brand-pink);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.stage-card h3 { margin: 4px 0; font-size: 16px; }
.stage-card p { margin: 0; color: #94a3b8; font-size: 13px; }
.stage-card .stage-route-name { color: var(--brand-orange); font-weight: bold; margin-top: 6px; }
.stage-card .stage-route-stats { font-size: 12px; margin-bottom: 6px; }
.stage-card .stage-dates { color: #e2e8f0; font-size: 12px; font-weight: bold; margin-bottom: 6px; }
.stage-card .stage-slot { display: block; }
.section-subtitle .slot-times { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; margin-top: 8px; color: var(--brand-orange); font-size: 15px; }
.section-subtitle .slot-times span { white-space: nowrap; }

.stage-card-link {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: border-color 0.15s, transform 0.15s;
}
.stage-card-link:hover {
    border-color: var(--brand-pink);
    transform: translateY(-2px);
}

.elevation-chart {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px 16px 4px;
    margin: 16px 0 32px;
}
.elevation-chart svg { width: 100%; height: auto; display: block; }
.elevation-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    font-size: 12px;
    color: #94a3b8;
    padding: 6px 0 10px;
}
.legend-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.legend-dot.kom { background: #ef4444; border: none; }
.legend-dot.sprint { background: #22c55e; }

.jersey-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.jersey-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.jersey-swatch {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    margin-top: 2px;
}
.jersey-swatch.general { background: linear-gradient(135deg, #facc15, #eab308); }
.jersey-swatch.teams { background: linear-gradient(135deg, var(--brand-pink), var(--brand-pink-dark)); }
.jersey-swatch.green { background: linear-gradient(135deg, #4ade80, #16a34a); }
.jersey-swatch.polka {
    background: #fff;
    background-image: radial-gradient(#dc2626 30%, transparent 31%);
    background-size: 10px 10px;
    border: 1px solid #334155;
}
.jersey-card h3 { margin: 0 0 4px; font-size: 15px; }
.jersey-card p { margin: 0; color: #94a3b8; font-size: 13px; }

.howto-steps {
    counter-reset: step;
    display: grid;
    gap: 12px;
}
.howto-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 16px;
}
.howto-step .num {
    counter-increment: step;
    background: var(--brand-orange);
    color: #1e1300;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0;
}
.howto-step p { margin: 0; font-size: 14px; }
.howto-step strong { color: #e2e8f0; }

.todo-note {
    margin-top: 48px;
    padding: 14px 16px;
    border: 1px dashed #475569;
    border-radius: 10px;
    color: #94a3b8;
    font-size: 13px;
}
.todo-note strong { color: var(--brand-orange); }

.quota-box {
    margin-top: 10px;
    padding: 10px 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
}


main {
    max-width: 640px;
    margin: 40px auto;
    background: #1e293b;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}
h1, h2 { color: var(--brand-pink); }
label { display: block; margin-top: 16px; font-weight: bold; }
input, select {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border-radius: 6px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    box-sizing: border-box;
}
textarea {
    width: 100%; padding: 8px; margin-top: 4px; border-radius: 6px; border: 1px solid #334155;
    background: #0f172a; color: #e2e8f0; box-sizing: border-box; font: inherit; resize: vertical;
}
.checkbox-label { display: flex; gap: 10px; align-items: flex-start; font-weight: normal; margin-top: 18px; }
.checkbox-label input { width: auto; margin-top: 3px; flex-shrink: 0; }
button, .btn {
    margin-top: 24px;
    padding: 10px 20px;
    background: var(--brand-pink);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
}
.alert-error {
    background: #7f1d1d;
    color: #fecaca;
    padding: 12px;
    border-radius: 6px;
    margin-top: 16px;
}
.alert-success {
    background: #14532d;
    color: #bbf7d0;
    padding: 12px;
    border-radius: 6px;
    margin-top: 16px;
}
table { width: 100%; border-collapse: collapse; margin-top: 16px; }
th, td { padding: 8px; border-bottom: 1px solid #334155; text-align: left; }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #334155;
}

/* Section « Les équipes » de l'accueil : plafonds par catégorie */
.team-card { max-width: 480px; margin: 0 auto; text-align: center; border-top: 3px solid var(--brand-pink); }
.team-card .team-quota { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin: 4px 0 12px; font-size: 18px; font-weight: bold; color: #e2e8f0; }
.team-card .team-quota-item { display: inline-flex; align-items: center; gap: 8px; }

.cat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}
.cat-badge-sm { width: 22px; height: 22px; font-size: 12px; vertical-align: middle; }
.cat-A { background: var(--cat-a); }
.cat-B { background: var(--cat-b); }
.cat-C { background: var(--cat-c); }
.cat-D { background: var(--cat-d); }
.team-card strong { color: var(--brand-orange); }

/* ---- Règlement (reglement.php) ---- */
.rules { max-width: 760px; margin: 0 auto; line-height: 1.65; }
.rules h2 { margin-top: 36px; padding-bottom: 6px; border-bottom: 2px solid var(--brand-pink); scroll-margin-top: 16px; }
.rules p { color: #cbd5e1; }
.rules-toc { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.rules-toc a {
    color: #e2e8f0; text-decoration: none; font-size: 13px;
    padding: 4px 12px; border: 1px solid #334155; border-radius: 999px;
}
.rules-toc a:hover { border-color: var(--brand-pink); color: #fff; }
.rules-callout, .rules-faq {
    margin: 16px 0; padding: 12px 16px; border-radius: 8px; background: #0f172a;
    border-left: 4px solid var(--brand-orange); color: #e2e8f0;
}
.rules-faq { border-left-color: var(--brand-pink); }
.rules-faq p { margin: 4px 0; color: #e2e8f0; }
.rules-table { max-width: 420px; }
.rules-table th, .rules-table td { text-align: center; }
.rules-version { margin-top: 40px; text-align: right; font-size: 13px; color: #94a3b8; }

/* ---- Résultats (resultats.php + admin) ---- */
.muted { color: #94a3b8; }
.stage-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 8px 0 20px; }
.stage-tab {
    flex: 1 0 120px; display: block; padding: 8px 12px; border: 1px solid #334155; border-radius: 10px;
    background: #0f172a; color: #e2e8f0; text-decoration: none;
}
.stage-tab:hover { border-color: var(--brand-pink); }
.stage-tab.active { border-color: var(--brand-pink); background: var(--brand-pink); color: #fff; }
.stage-tab.is-empty:not(.active) { opacity: 0.55; }
.stage-tab-num { display: block; font-size: 12px; font-weight: bold; text-transform: uppercase; opacity: 0.85; }
.stage-tab-name { display: block; font-size: 14px; }
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.cat-filter-item {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border: 1px solid #334155;
    border-radius: 999px; color: #e2e8f0; text-decoration: none; font-size: 14px; font-weight: bold;
}
.cat-filter-item:first-child { padding-left: 12px; }
.cat-filter-item:hover { border-color: var(--brand-pink); }
.cat-filter-item.active { border-color: var(--brand-pink); background: rgba(224, 24, 154, 0.18); }
.cat-filter-item.is-empty { opacity: 0.45; }
.cat-filter-count { color: #94a3b8; font-weight: normal; font-size: 13px; }
.results-section { margin-top: 32px; padding-bottom: 6px; border-bottom: 2px solid var(--brand-pink); }
.results-cat, .results-segment { display: flex; align-items: center; gap: 10px; margin: 24px 0 4px; font-size: 17px; }
.results-segment .muted { font-weight: normal; font-size: 14px; }
.results-table { margin-top: 8px; }
.results-table-compact { margin-bottom: 12px; }
.results-pos { font-weight: bold; width: 40px; }
.results-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.podium-1 .results-pos { color: #facc15; }
.podium-2 .results-pos { color: #cbd5e1; }
.podium-3 .results-pos { color: #d97706; }
.jersey-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.jersey-dot.green { background: #22c55e; }
.jersey-dot.polka { background: radial-gradient(circle, #dc2626 32%, transparent 36%) 1px 1px / 5px 5px, #fff; }

.stage-tab-general { border-color: var(--brand-orange); }
.stage-tab-general:not(.active) .stage-tab-num { color: var(--brand-orange); }
.stage-tab-general.active { background: var(--brand-orange); border-color: var(--brand-orange); color: #1e293b; }
.cumul-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.cumul-tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid #334155; border-radius: 8px;
    color: #e2e8f0; text-decoration: none; font-weight: bold; font-size: 14px; background: #0f172a;
}
.cumul-tab:hover { border-color: var(--brand-orange); }
.cumul-tab.active { border-color: var(--brand-orange); background: rgba(240, 162, 2, 0.16); }
.gc-table .gc-stage { text-align: center; font-variant-numeric: tabular-nums; }
.gc-table .gc-total { white-space: nowrap; }
.team-stage-table .team-best { white-space: nowrap; }
.team-stage-table .team-best .muted { font-size: 12px; }
.gc-table .gc-count { font-size: 12px; margin-left: 4px; }
.gc-out td { opacity: 0.7; }
.gc-out-header td { font-size: 12px; color: #94a3b8; padding-top: 14px; border-bottom: 1px dashed #475569; }

/* ---- Contact ---- */
.contact-form { max-width: 560px; }
.contact-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Pied de page ---- */
.site-footer { background: #1e293b; color: #94a3b8; text-align: center; padding: 18px 16px 22px; margin-top: 40px; font-size: 14px; }
.site-footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 22px; }
.site-footer-links a { color: #e2e8f0; text-decoration: none; }
.site-footer-links a:hover { color: var(--brand-pink); }
.site-footer-copy { margin: 10px 0 0; font-size: 12px; }

/* ---- Dashboard admin ---- */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 8px; }
.dash-stat { background: #0f172a; border: 1px solid #334155; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.dash-stat.is-warn { border-color: var(--brand-orange); }
.dash-stat-num { font-size: 26px; font-weight: bold; color: #fff; font-variant-numeric: tabular-nums; }
.dash-stat-num small { font-size: 15px; color: #94a3b8; font-weight: normal; }
.dash-stat-label { font-size: 13px; color: #94a3b8; }
.dash-group { margin: 28px 0 12px; font-size: 18px; padding-bottom: 6px; border-bottom: 2px solid var(--brand-pink); }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.dash-tile {
    position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 10px;
    background: #0f172a; border: 1px solid #334155; color: #e2e8f0; text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.dash-tile:hover { border-color: var(--brand-pink); transform: translateY(-2px); }
.dash-tile.has-badge { border-color: #7f1d1d; }
.dash-tile-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }
.dash-tile-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dash-tile-title { font-weight: bold; font-size: 15px; color: #fff; }
.dash-tile-desc { font-size: 13px; color: #94a3b8; }
.dash-tile-info { font-size: 12px; color: var(--brand-orange); font-weight: bold; overflow-wrap: anywhere; }
.dash-tile-badge {
    position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; padding: 0 7px; box-sizing: border-box;
    border-radius: 999px; background: var(--alert-red); color: #fff; font-size: 13px; font-weight: bold;
    line-height: 24px; text-align: center; box-shadow: 0 0 0 3px #1e293b;
}
.dash-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dash-cat { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; border-radius: 10px; background: #0f172a; border: 1px solid #334155; }
.dash-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dash-team {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; padding: 10px 12px; border-radius: 8px;
    background: #0f172a; border: 1px solid #334155; color: #e2e8f0; text-decoration: none; font-size: 14px;
}
.dash-team:hover { border-color: var(--brand-pink); }
.dash-team-name { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-team-count { color: #94a3b8; font-variant-numeric: tabular-nums; }
.dash-team-bar { grid-column: 1 / -1; height: 5px; border-radius: 999px; background: #334155; overflow: hidden; }
.dash-team-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-pink), var(--brand-orange)); }
@media (max-width: 560px) {
    .dash-tiles { grid-template-columns: 1fr; gap: 8px; }
    .dash-tile { padding: 12px; }
    .dash-cats { grid-template-columns: repeat(2, 1fr); }
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Statistiques de visite (admin) ---- */
.stats-chart { position: relative; background: #0f172a; border: 1px solid #334155; border-radius: 10px; padding: 12px 8px 4px; }
.stats-chart svg { display: block; width: 100%; height: auto; }
.stats-grid { stroke: #1e293b; stroke-width: 1; }
.stats-baseline { stroke: #475569; stroke-width: 1; }
.stats-axis { fill: #94a3b8; font-size: 11px; font-variant-numeric: tabular-nums; }
.stats-col { fill: var(--brand-pink); }
.stats-hit { fill: transparent; }
.stats-bar:hover .stats-col, .stats-bar:focus .stats-col { fill: #f0389f; }
.stats-bar:hover .stats-hit, .stats-bar:focus .stats-hit { fill: rgba(255, 255, 255, 0.04); }
.stats-bar:focus { outline: none; }
.stats-tooltip {
    position: absolute; pointer-events: none; background: #1e293b; border: 1px solid #475569; border-radius: 8px;
    padding: 8px 10px; font-size: 13px; color: #e2e8f0; box-shadow: 0 6px 18px rgba(0,0,0,0.4); white-space: nowrap;
}
.stats-tooltip strong { font-size: 16px; }
.stats-tooltip-title { color: #94a3b8; font-size: 12px; margin-bottom: 2px; }
.stats-table-toggle { margin-top: 10px; }
.stats-table-toggle summary { cursor: pointer; color: #94a3b8; font-size: 13px; }
.stats-grid-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 28px; }
.stats-rank { margin-top: 4px; }
.stats-rank td { border-bottom: 1px solid #1e293b; padding: 6px 4px; font-size: 14px; }
.stats-rank-label { width: 45%; overflow-wrap: anywhere; }
.stats-rank-bar span { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--brand-pink); min-width: 2px; }
.stats-rank-value { width: 1%; text-align: right; font-variant-numeric: tabular-nums; font-weight: bold; white-space: nowrap; }
@media (max-width: 560px) {
    .stats-rank { display: table; } /* pas de défilement horizontal pour ces petites listes */
    /* Graphique : largeur minimale pour garder des axes lisibles, défilement horizontal dans son cadre */
    .stats-chart { overflow-x: auto; }
    .stats-chart svg { min-width: 620px; }
}

/* ---- Mobile : contenu et tableaux larges ----
   En fin de fichier pour passer après les règles générales de main / table / th, td. */
@media (max-width: 720px) {
    /* Moins de marges autour de la carte pour laisser la place aux tableaux */
    main { margin: 16px 8px; padding: 20px 14px; }
    /* Tableaux larges (résultats, coureurs…) : défilement horizontal DANS la carte,
       au lieu de déborder et d'élargir toute la page */
    main table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    main th { white-space: nowrap; }
    main th, main td { padding: 8px 6px; }
}
@media (max-width: 560px) {
    /* Résultats publics : colonnes secondaires (écart, créneau) masquées, l'essentiel tient sans défiler */
    .results-table .col-opt { display: none; }
    /* Onglets des étapes sur 2 lignes de 3 : le « Classement général » reste visible sans défiler */
    .stage-tabs { flex-wrap: wrap; overflow: visible; }
    .stage-tab { flex: 1 0 calc(33.333% - 8px); padding: 6px 8px; }
    .stage-tab-name { font-size: 13px; }
}
