/* ==========================================================================
   PhysioRun Lab — Design System
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }
a { color: inherit; }

/* ---------- Design tokens ---------- */
:root {
    /* Palette claire (défaut) */
    --bg: #f3f5f9;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f7f8fc;
    --surface-sunken: #eef0f6;
    --border: #e4e7f0;
    --border-strong: #d4d9e6;

    --text-primary: #0F172B;
    --text-secondary: #565c72;
    --text-muted: #9296a8;
    --text-on-accent: #ffffff;

    /* ---- Couleurs de marque PhysioRun ---- */
    --brand-navy: #0F172B;   /* --run-dark : bleu nuit profond du thème */
    --brand-blue: #16254F;   /* bleu centre clair (halo lumineux) */
    --brand-yellow: #FFC106; /* --run-yellow : jaune signature */
    --brand-gold: #D9A406;   /* --run-gold : jaune foncé (hover, accents) */
    --brand-gray: #334155;   /* --run-gray : texte secondaire du site */
    --brand-light: #f8fafc;  /* --run-light : fond clair du site */

    --accent-blue: #16254F;
    --accent-blue-light: #2b4a91;
    --accent-blue-dark: #0F172B;
    --accent-blue-soft: #e9edf6;

    --accent-orange: #e2652f;
    --accent-orange-dark: #c94f1e;
    --accent-orange-soft: #fdece3;

    --accent-emerald: #12946b;
    --accent-emerald-dark: #0d7856;
    --accent-emerald-soft: #e4f6ee;

    --accent-indigo: #16254F;
    --accent-indigo-dark: #0F172B;
    --accent-indigo-soft: #e9edf6;

    --accent-rose: #c62828;
    --accent-rose-dark: #9d1f1f;
    --accent-rose-soft: #fdeaea;

    --amber: #b88c1c;
    --amber-soft: #fff9e6;
    --amber-border: #f5e0a6;

    --sage: #2b7a4b;
    --sage-soft: #eef8f2;
    --sage-border: #bce3cc;

    --danger: #ba2b2b;
    --danger-soft: #fdf0f0;
    --danger-border: #f5c6c6;

    --dark-panel: #0F172B;
    --dark-panel-alt: #16254F;
    --dark-panel-border: #23386f;

    --shadow-color: 222deg 35% 55%;
    --shadow-sm: 0 1px 2px hsl(var(--shadow-color) / 0.08);
    --shadow-md: 0 6px 20px -4px hsl(var(--shadow-color) / 0.16), 0 2px 6px hsl(var(--shadow-color) / 0.08);
    --shadow-lg: 0 20px 45px -12px hsl(var(--shadow-color) / 0.28);
    --shadow-glow-blue: 0 8px 24px -6px rgb(22 37 79 / 0.40);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', var(--font-body);

    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --dur-fast: 160ms;
    --dur-base: 320ms;
    --dur-slow: 600ms;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    min-height: 100vh;
    transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
    overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Background FX (parallax blobs) ---------- */
.bg-fx {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .35;
    will-change: transform;
}
/* Halo principal en 2 calques superposés (bleu Course / vert Trail) : on
   fait un fondu d'opacité entre les deux au changement d'onglet plutôt que
   d'animer la couleur du dégradé (non interpolable nativement en CSS). */
.blob-1 {
    width: 46vw; height: 46vw; top: -14vw; left: -10vw;
    animation: drift1 26s ease-in-out infinite;
    transition: opacity 900ms ease;
}
.blob-1--road { background: radial-gradient(circle, var(--accent-blue) 0%, transparent 70%); opacity: .35; }
.blob-1--trail { background: radial-gradient(circle, var(--accent-emerald) 0%, transparent 70%); opacity: 0; }
#bg-fx.is-trail .blob-1--road { opacity: 0; }
#bg-fx.is-trail .blob-1--trail { opacity: .35; }
.blob-2 { width: 38vw; height: 38vw; bottom: -12vw; right: -8vw; background: radial-gradient(circle, var(--brand-yellow) 0%, transparent 70%); animation: drift2 32s ease-in-out infinite; }
.blob-3 { width: 30vw; height: 30vw; top: 40%; left: 55%; background: radial-gradient(circle, var(--accent-emerald) 0%, transparent 70%); animation: drift3 22s ease-in-out infinite; opacity: .2; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(4%, 6%) scale(1.08); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-5%, -4%) scale(1.05); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-6%, 5%) scale(1.1); } }

.grain { display: none; }

@media (prefers-reduced-motion: reduce) {
    .blob { animation: none !important; }
}

/* ---------- Layout ---------- */
.app-header, .app-main, .app-footer, .print-header { position: relative; z-index: 1; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--brand-navy);
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
}
.app-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: grid;
    /* 3 colonnes égales à gauche/droite : les onglets se retrouvent
       centrés au milieu de la page plutôt que collés à droite. */
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}
.app-header__inner .tabs { justify-self: center; }

.brand {
    display: flex; align-items: baseline; gap: 6px;
    font-family: 'Anton', var(--font-display);
    font-style: italic;
    text-decoration: none;
    transition: opacity var(--dur-fast) var(--ease-out);
}
.brand:hover { opacity: .8; }
/* Anton n'a qu'une seule graisse (déjà très pleine) : on simule un surcroît
   de gras avec un léger contour, en plus d'une taille nettement augmentée. */
.brand__mark { font-size: 1.7rem; font-weight: 400; color: var(--text-on-accent); letter-spacing: .01em; -webkit-text-stroke: .4px currentColor; }
.brand__mark strong { font-weight: 400; }
.brand__sub { font-size: 1.7rem; font-weight: 400; color: var(--brand-yellow); transition: color var(--dur-base) var(--ease-out); -webkit-text-stroke: .4px currentColor; }
.brand__sub.is-trail { color: var(--accent-emerald); }

.tabs {
    position: relative;
    display: flex;
    gap: 4px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: var(--radius-pill);
}
.tab {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color var(--dur-base) var(--ease-out);
}
.tab__icon { width: 15px; height: 15px; }
.tab.is-active { color: var(--text-on-accent); }
/* Onglet Course actif : fond jaune signature, texte lisible en bleu nuit
   plutôt qu'en blanc (contraste trop faible sur un jaune aussi clair). */
#tab-btn-road.is-active { color: var(--brand-navy); }
.tab-underline {
    position: absolute;
    z-index: 1;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: 108px;
    border-radius: var(--radius-pill);
    background: var(--brand-yellow);
    box-shadow: 0 8px 24px -6px rgb(255 193 6 / 0.45);
    transition: transform var(--dur-base) var(--ease-spring), width var(--dur-base) var(--ease-spring), background var(--dur-base) var(--ease-out);
}
.tab-underline.is-trail { background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-dark)); box-shadow: 0 8px 24px -6px rgb(18 148 107 / 0.35); }

/* ---------- Titre de page (façon hero du site) ---------- */
.hero-title { max-width: 1200px; margin: 0 auto; padding: 40px 20px 8px; text-align: center; position: relative; z-index: 1; }
.hero-title__h1 {
    font-family: 'Anton', var(--font-display);
    font-style: italic;
    text-transform: uppercase;
    font-size: 2.6rem;
    line-height: 1.05;
    color: var(--brand-navy);
    letter-spacing: .01em;
    margin-bottom: 14px;
}
.hero-title__desc {
    max-width: 720px;
    margin: 0 auto 22px;
    font-size: 1.02rem;
    line-height: 1.55;
    color: var(--brand-gray);
}
/* Phrase d'appel à l'action : gras navy + surlignage jaune façon marqueur. */
.hero-title__note {
    font-weight: 700;
    color: var(--brand-navy);
    background: linear-gradient(transparent 62%, rgb(255 193 6 / .55) 62%);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.hero-title__pill {
    display: inline-block;
    background: var(--brand-navy);
    color: var(--brand-yellow);
    font-weight: 800;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-decoration: none;
    padding: 12px 26px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
    transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.hero-title__pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); background: var(--dark-panel-alt); }
.hero-title__pill:active { transform: translateY(0) scale(.98); }

@media (max-width: 680px) {
    .hero-title { padding: 28px 16px 4px; }
    .hero-title__h1 { font-size: 1.9rem; }
    .hero-title__desc { font-size: .92rem; margin-bottom: 18px; }
    .hero-title__pill { font-size: .72rem; padding: 11px 20px; }
}

.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px 80px;
}

.panel { display: none; }
.panel.is-active { display: block; animation: panelIn var(--dur-slow) var(--ease-out); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.app-footer { text-align: center; padding: 8px 20px 48px; }

/* ---------- Reveal-on-load animation ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(18px);
}
[data-reveal].is-visible {
    animation: revealUp var(--dur-slow) var(--ease-out) forwards;
}
@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.card--form {
    /* Même traitement que le panneau Sprint : fond bleu nuit en dégradé,
       texte blanc. Les tokens sont surchargés localement pour que titre,
       indice et cadres imbriqués en héritent automatiquement. */
    --text-primary: #ffffff;
    --text-secondary: rgb(255 255 255 / .78);
    --text-muted: rgb(255 255 255 / .58);
    --border: var(--dark-panel-border);
    /* Halo jaune discret en haut à droite + lueur bleue en bas à gauche sur
       le bleu nuit : donne de la profondeur sans quitter la palette. */
    background:
        radial-gradient(600px circle at 100% 0%, rgb(255 193 6 / .13), transparent 55%),
        radial-gradient(500px circle at 0% 100%, rgb(43 74 145 / .35), transparent 60%),
        linear-gradient(155deg, var(--dark-panel), var(--dark-panel-alt));
    border-color: rgb(255 255 255 / .09);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgb(255 255 255 / .06);
    margin-bottom: 28px;
}
/* icon--blue (#16254F) est quasi invisible sur le dégradé bleu nuit : on
   passe l'icône du titre en jaune, cohérent avec les accents mis en valeur. */
.card--form .card__title-icon { color: var(--brand-yellow); }
.card__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.card__title--sm { font-size: 1.02rem; margin-bottom: 16px; }
.card__title-icon { width: 19px; height: 19px; }
.card__hint { font-size: .86rem; color: var(--text-muted); margin-bottom: 22px; }
.card__footnote { font-size: .78rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px; }
.card__footnote em { color: var(--text-secondary); font-style: normal; font-weight: 600; }

.icon--blue { color: var(--accent-blue); }
.icon--orange { color: var(--accent-orange); }
.icon--emerald { color: var(--accent-emerald); }
.icon--indigo { color: var(--accent-indigo); }
.icon--rose { color: var(--accent-rose); }

.card--analysis { display: flex; gap: 16px; align-items: flex-start; }
.card--analysis__icon {
    flex-shrink: 0;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text-secondary);
}
.card--analysis__icon svg { width: 18px; height: 18px; }
.card--analysis__text { font-size: .92rem; color: var(--text-secondary); line-height: 1.65; }
.card--analysis__text strong { color: var(--text-primary); }

.eyebrow { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--text-muted); margin-bottom: 8px; }
.eyebrow--emerald { color: var(--accent-emerald); }

/* ---------- Alerte de cohérence des données ---------- */
.alert-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--amber-soft);
    border: 1px solid var(--amber-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.alert-banner__icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; color: var(--amber); }
.alert-banner__title { font-weight: 700; font-size: .88rem; color: var(--amber); margin-bottom: 3px; }
.alert-banner__text { font-size: .84rem; color: var(--text-secondary); line-height: 1.55; }

/* ---------- Test blocks / forms ---------- */
.test-stack { display: flex; flex-direction: column; gap: 16px; }
.test-block {
    /* Palette du site : fond bleu nuit, texte blanc, accents en jaune.
       On surcharge les tokens de design localement : labels, indices, champs
       et case à cocher héritent automatiquement du thème sombre sans que
       leurs règles globales aient besoin d'être dupliquées. */
    --text-primary: #ffffff;
    --text-secondary: rgb(255 255 255 / .78);
    --text-muted: rgb(255 255 255 / .58);
    --border: var(--dark-panel-border);
    --border-strong: rgb(255 255 255 / .32);
    /* Champs plus sombres que le cadre : ils "s'enfoncent" dans la vitre. */
    --surface: rgb(15 23 43 / .6);
    --surface-alt: rgb(15 23 43 / .6);
    /* Effet verre dépoli : voile blanc translucide sur la carte englobante. */
    background: linear-gradient(160deg, rgb(255 255 255 / .07), rgb(255 255 255 / .025));
    border: 1px solid rgb(255 255 255 / .1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 20px;
    color: var(--text-primary);
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-base);
}
.test-block--optional { border-style: dashed; border-color: rgb(255 255 255 / .18); }
/* Coché : contour plein jaune et texte du titre en jaune. */
.test-block--optional.is-active { border-style: solid; border-color: var(--brand-yellow); }
.test-block--optional.is-active .test-block__label--muted { color: var(--brand-yellow); }
.test-block--optional.is-active .checkbox-visual { background: var(--brand-yellow); border-color: var(--brand-yellow); }
.test-block--accent { border-left: 3px solid var(--brand-yellow); box-shadow: -8px 0 24px -12px rgb(255 193 6 / .45); }
.test-block__label { font-size: .84rem; font-weight: 700; color: var(--brand-yellow); margin-bottom: 16px; display: block; }
.test-block__label--muted { color: var(--text-muted); margin-bottom: 0; }
.test-block__subtitle { font-size: .9rem; font-weight: 700; color: var(--text-primary); border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 16px; }
.test-block .input:focus { border-color: var(--brand-yellow); box-shadow: 0 0 0 4px rgb(255 193 6 / 0.18); }

.test-block__toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 4px; }
.test-block__toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox-visual {
    width: 20px; height: 20px; border-radius: 6px;
    border: 2px solid var(--border-strong);
    display: grid; place-items: center;
    transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
    flex-shrink: 0;
}
.checkbox-visual::after {
    content: '';
    width: 10px; height: 6px;
    border-left: 2px solid var(--brand-navy); border-bottom: 2px solid var(--brand-navy);
    transform: rotate(-45deg) scale(0);
    transition: transform var(--dur-fast) var(--ease-spring);
    margin-top: -2px;
}
.test-block__toggle input:checked + .checkbox-visual { background: var(--brand-gold); border-color: var(--brand-gold); transform: scale(1.05); }
.test-block__toggle input:checked + .checkbox-visual::after { transform: rotate(-45deg) scale(1); }
.test-block__toggle input:focus-visible + .checkbox-visual { outline: 2px solid var(--brand-gold); outline-offset: 2px; }

.test-block__fields { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; transition: max-height var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out), margin-top var(--dur-base); }
.test-block--optional.is-active .test-block__fields { max-height: 260px; opacity: 1; margin-top: 18px; }
#trail-sprint-container.is-active .test-block__fields { max-height: 900px; }

.field-grid { display: grid; gap: 16px; }
.field-grid--2 { grid-template-columns: repeat(2, 1fr); }
.field-grid--3 { grid-template-columns: repeat(3, 1fr); }
.field-grid--4 { grid-template-columns: repeat(4, 1fr); }
.field-grid--gap-lg { gap: 32px; }

.field label { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 7px; }
.field-duo { display: flex; align-items: center; gap: 8px; }
.field-duo__sep { color: var(--text-muted); font-weight: 700; }

.input {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    padding: 10px 13px;
    font-size: .92rem;
    color: var(--text-primary);
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.input::placeholder { color: var(--text-muted); opacity: .7; }
.input:hover { border-color: var(--text-muted); }
.input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-blue) 16%, transparent);
    transform: translateY(-1px);
}
.input--center { text-align: center; }
.input--emerald:focus { border-color: var(--accent-emerald); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-emerald) 16%, transparent); }
.input--dark { background: var(--dark-panel-alt); border-color: var(--dark-panel-border); color: #fff; }
.input--dark::placeholder { color: #6a6f83; }
.input--dark:focus { border-color: var(--brand-yellow); box-shadow: 0 0 0 4px rgb(255 193 6 / 0.18); }
.input--lg { padding: 13px 16px; font-size: 1.05rem; font-weight: 700; }

/* ---------- Metric cards ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric-card {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 22px;
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transform-style: preserve-3d;
    will-change: transform;
    transition: box-shadow var(--dur-base) var(--ease-out);
}
.metric-card::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(120px 120px at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.16), transparent 70%);
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out);
    pointer-events: none;
}
.metric-card:hover::after { opacity: 1; }
.metric-card:hover { box-shadow: var(--shadow-lg); }
.metric-card--orange { background: linear-gradient(150deg, #d9682f, var(--accent-orange-dark)); }
.metric-card--blue { background: linear-gradient(150deg, var(--accent-blue-light), var(--brand-navy)); }
.metric-card--emerald { background: linear-gradient(150deg, #12946b, var(--accent-emerald-dark)); }
.metric-card--red { background: linear-gradient(150deg, #d33b3b, var(--accent-rose-dark)); }

/* Carte metrique isolee (hors metric-grid), centree, ex. VAC precise Trail */
.metric-highlight-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.metric-card--standalone { width: 100%; max-width: 320px; }

.metric-card__label { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; opacity: .92; margin-bottom: 12px; }
.metric-card__value { display: flex; align-items: baseline; gap: 5px; }
.metric-card__number { font-family: var(--font-display); font-size: 2.35rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-card__number--solo { font-size: 2.35rem; margin-bottom: 4px; }
.metric-card__unit { font-size: 1rem; font-weight: 600; opacity: .95; }
.metric-card__pill { display: inline-block; background: rgba(255,255,255,.2); backdrop-filter: blur(4px); padding: 5px 12px; border-radius: 8px; font-size: .84rem; font-weight: 600; margin-top: 14px; }
.metric-card__caption { font-size: .84rem; font-weight: 500; opacity: .92; margin-top: 8px; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 480px; }
.data-table--dense { min-width: 760px; }

/* Tableau à en-tête figée : le conteneur devient la zone de défilement
   (vertical + horizontal), ce qui permet au thead de rester collé en haut. */
.table-scroll--sticky {
    max-height: min(70vh, 620px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.table-scroll--sticky .data-table {
    border-collapse: separate;
    border-spacing: 0;
}
.table-scroll--sticky thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface-alt);
    /* box-shadow plutôt que border : les bordures ne suivent pas un th sticky */
    box-shadow: inset 0 -1px 0 var(--border);
    border-bottom: none;
}
.table-scroll--sticky tbody td { border-bottom: 1px solid var(--border); }

/* Première colonne figée (repère "Pente %" toujours visible en défilement
   horizontal, essentiel sur téléphone où le tableau est large). */
.table-scroll--sticky th:first-child,
.table-scroll--sticky td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
}
.table-scroll--sticky thead th:first-child { z-index: 6; background: var(--surface-alt); }
.data-table thead th {
    text-align: left;
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    background: var(--surface-alt);
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table thead th.ta-center { text-align: center; }
.data-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; }
.data-table tbody tr { transition: background-color var(--dur-fast) var(--ease-out); }
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }
/* Ligne de référence (ex. 100 % VC) mise en avant */
.data-table tbody tr.row-highlight { background: var(--accent-blue-soft); }
.data-table tbody tr.row-highlight td { color: var(--accent-blue-dark); font-weight: 800; }
.data-table tbody tr.row-highlight:hover { background: var(--accent-blue-soft); }
/* Version cellule (table "à plat" du rapport PDF) */
.data-table th.row-highlight, .data-table td.row-highlight { background: var(--accent-blue-soft); color: var(--accent-blue-dark); font-weight: 800; }

/* Table "à plat" : 1 ligne d'en-têtes + 1 ligne de valeurs, colonnes égales. */
.data-table--flat { table-layout: fixed; width: 100%; }
.data-table--flat th, .data-table--flat td { text-align: center; white-space: nowrap; }
.data-table .cell-strong { color: var(--text-primary); font-weight: 700; }
.data-table .cell-accent { color: var(--accent-blue); font-weight: 700; }
.data-table .cell-accent-emerald { color: var(--accent-emerald); font-weight: 700; }
.data-table .cell-sub { font-size: .72rem; color: var(--text-muted); display: block; }
.data-table td.ta-center { text-align: center; }

/* ---------- Section blocks / Domains ---------- */
.section-block { margin: 32px 0; }
.section-block__title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 9px; padding: 0 4px; margin-bottom: 16px; }
.section-block__title svg { width: 19px; height: 19px; }
.section-block__header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.section-block__note { font-size: .86rem; color: var(--text-muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); padding: 18px 20px; text-align: center; }

.domains { display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.domain-band { padding: 22px 20px; }
/* En-tête de compartiment : titre + vitesse/allure sur la même ligne (alignées
   à droite), description en dessous sur toute la largeur. */
.domain-band__head { margin-bottom: 18px; }
.domain-band__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.domain-band__title { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; }
.domain-band__desc { font-size: .84rem; margin-top: 4px; }
.domain-band__figures { text-align: right; flex-shrink: 0; }
.domain-band__figures p:first-child { font-weight: 800; font-size: 1rem; }
.domain-band__figures p:last-child { font-size: .78rem; font-weight: 600; opacity: .85; }

/* Cartes de zones : pleine largeur sur 2 colonnes. Allure et vitesse sont
   empilées et resserrées (au lieu d'être côte à côte) ; la métrique "primary"
   (allure côté Course, VA côté Trail) est mise en avant, l'autre en retrait. */
.domain-band__zones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.domain-zone {
    background: color-mix(in srgb, var(--surface) 55%, transparent);
    border-radius: 10px;
    padding: 12px 14px;
    text-align: left;
    backdrop-filter: blur(2px);
}
.domain-zone__name { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.domain-zone__row { display: flex; flex-direction: column; gap: 1px; }
.domain-zone__value-primary { font-size: .96rem; font-weight: 800; white-space: nowrap; }
.domain-zone__value-secondary { font-size: .8rem; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }

.domain-band--moderate { background: var(--sage-soft); color: var(--sage); }
.domain-band--moderate .domain-zone { border: 1px solid var(--sage-border); }
.domain-band--high { background: var(--amber-soft); color: var(--amber); }
.domain-band--high .domain-zone { border: 1px solid var(--amber-border); }
.domain-band--severe { background: var(--danger-soft); color: var(--danger); }
.domain-band--severe .domain-zone { border: 1px solid var(--danger-border); }

/* Seuils : titre à gauche, vitesse + allure alignées à droite sur 2 lignes. */
.domain-divider {
    background: var(--surface);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.domain-divider__label { text-align: left; }
.domain-divider__title { font-weight: 800; font-size: .92rem; color: var(--text-primary); margin-bottom: 2px; }
.domain-divider__caption { font-size: .74rem; color: var(--text-muted); }
.domain-divider__value { display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 1px; flex-shrink: 0; }
.domain-divider__value-primary { font-family: var(--font-display); font-size: 1.08rem; font-weight: 800; color: var(--text-primary); line-height: 1.25; }
.domain-divider__value-primary--accent { color: var(--accent-orange); }
.domain-divider__value-secondary { font-size: .78rem; font-weight: 600; color: var(--text-secondary); }

/* ---------- FC grid ---------- */
/* 5 zones sur une seule ligne sur ordinateur */
.fc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.fc-zone {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur-fast) var(--ease-spring);
}
.fc-zone:hover { transform: translateY(-2px); }
.fc-zone__name { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.fc-zone__range { font-size: .82rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.fc-zone--1 { border-color: color-mix(in srgb, var(--accent-blue) 35%, var(--border)); color: var(--accent-blue); }
.fc-zone--2 { border-color: color-mix(in srgb, var(--sage) 35%, var(--border)); color: var(--sage); }
.fc-zone--3 { border-color: #a9c22c; color: #6b7d15; }
.fc-zone--4 { border-color: color-mix(in srgb, var(--accent-orange) 35%, var(--border)); color: var(--accent-orange); }
.fc-zone--5 { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); color: var(--danger); }

.badge { font-size: .72rem; font-weight: 700; background: var(--surface-alt); color: var(--text-secondary); padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border); }

/* ---------- Sprint panel ---------- */
.sprint-panel {
    background: linear-gradient(155deg, var(--dark-panel), var(--dark-panel-alt));
    border: 1px solid var(--dark-panel-border);
    border-radius: 24px;
    padding: 22px 28px;
    color: #fff;
    box-shadow: var(--shadow-lg);
    margin-top: 32px;
}
/* Section optionnelle : repliée par défaut, activée par la case à cocher. */
.sprint-panel__toggle {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: 0;
}
.sprint-panel__toggle em { font-style: normal; font-weight: 500; color: #9297ac; }
.sprint-panel__toggle .checkbox-visual { border-color: rgb(255 255 255 / .35); }
.sprint-panel__content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height var(--dur-slow) var(--ease-out), opacity var(--dur-base) var(--ease-out), margin-top var(--dur-base);
}
.sprint-panel__content.is-active { max-height: 900px; opacity: 1; margin-top: 24px; }
.sprint-panel__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.sprint-panel__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.sprint-panel__head h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 5px; }
.sprint-panel__head p { font-size: .84rem; color: #9297ac; }
.sprint-panel__head p span { color: #d5d8e6; font-weight: 600; }
.sprint-panel__asr { text-align: right; }
.sprint-panel__asr p { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--brand-yellow); line-height: 1; }
.sprint-panel__asr span { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #676c80; }

.sprint-bars { display: flex; flex-direction: column; gap: 16px; }
.sprint-bar__labels { display: flex; justify-content: space-between; font-size: .72rem; font-weight: 700; color: #9297ac; margin-bottom: 8px; }
.sprint-bar__track { width: 100%; height: 8px; background: rgb(255 255 255 / 0.12); border-radius: var(--radius-pill); overflow: hidden; }
.sprint-bar__fill { height: 100%; border-radius: var(--radius-pill); width: 0%; transition: width 900ms var(--ease-out); }
.sprint-bar__fill--aero { background: linear-gradient(90deg, var(--accent-blue-light), #6c8dff); }
.sprint-bar__fill--anaero { background: linear-gradient(90deg, var(--accent-rose), #f06a6a); }

.sprint-panel__input-box { background: var(--dark-panel-alt); border: 1px solid var(--dark-panel-border); border-radius: var(--radius-md); padding: 22px; }
.sprint-panel__input-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sprint-panel__input-head p { font-weight: 700; font-size: .96rem; }
.sprint-panel__input-head span { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #676c80; }
.sprint-panel__input-box label { display: block; font-size: .78rem; color: #9297ac; margin-bottom: 8px; }

/* ---------- Trail hero ---------- */
.trail-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.trail-hero.trail-hero--single { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
.trail-hero__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transform-style: preserve-3d;
    will-change: transform;
}
.trail-hero__card--accent { background: color-mix(in srgb, var(--accent-emerald-soft) 60%, var(--surface)); border-color: var(--sage-border); }
.trail-hero__pill { display: inline-block; background: var(--accent-emerald-soft); color: var(--accent-emerald); border: 1px solid var(--sage-border); padding: 7px 20px; border-radius: var(--radius-pill); font-weight: 700; margin-bottom: 18px; }
.trail-hero__number { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.trail-hero__number--emerald { color: var(--accent-emerald); margin-top: 6px; }
.trail-hero__caption { font-size: .84rem; color: var(--text-muted); }
.trail-hero__number-secondary { font-size: .92rem; font-weight: 600; color: var(--text-secondary); margin-top: 2px; }
.trail-hero__sub { font-size: .95rem; color: var(--text-secondary); }

/* Curseur de pente dans la carte "VC théorique sur pente" */
.trail-vcpente-slider-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 16px; }
.trail-vcpente-slider-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent-emerald);
    height: 4px;
    cursor: pointer;
}
.trail-vcpente-slope-value { font-weight: 800; font-size: .88rem; color: var(--accent-emerald); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 13px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: .92rem;
    transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-dark));
    color: #fff;
    box-shadow: var(--shadow-glow-blue);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -6px rgb(54 84 244 / 0.45); }
.btn-primary:active { transform: translateY(0) scale(.98); }
.btn-primary.is-trail { background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-dark)); box-shadow: 0 8px 24px -6px rgb(18 148 107 / 0.35); }
.btn-primary.is-trail:hover { box-shadow: 0 12px 28px -6px rgb(18 148 107 / 0.45); }

.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--accent-blue); }
.btn-ghost:hover { border-color: var(--accent-blue); transform: translateY(-1px); }
.btn-sm { padding: 7px 16px; font-size: .74rem; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Number pop animation ---------- */
[data-anim-number].is-updating { animation: numberPop var(--dur-base) var(--ease-spring); }
@keyframes numberPop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* ---------- Utility ---------- */
.is-hidden { display: none !important; }
.ta-center { text-align: center; }
.print-only { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .sprint-panel__grid { grid-template-columns: 1fr; gap: 24px; }
    .trail-hero { grid-template-columns: 1fr; }
    .fc-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
    .app-header__inner { padding: 12px 16px; }
    .brand__mark, .brand__sub { font-size: 1rem; }
    .tab { padding: 8px 12px; font-size: .74rem; }
    .tab__icon { width: 13px; height: 13px; }
    .app-main { padding: 20px 14px 64px; }
    .card { padding: 18px; border-radius: var(--radius-md); }
    .field-grid--3, .field-grid--4, .field-grid--2 { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .metric-card { padding: 16px; }
    .metric-card__number, .metric-card__number--solo { font-size: 1.7rem; }
    .domain-band__zones { grid-template-columns: 1fr; }
    .fc-grid { grid-template-columns: repeat(2, 1fr); }
    .sprint-panel { padding: 20px; border-radius: 18px; }
    .btn { width: 100%; justify-content: center; }
}

/* ---------- Article SEO (Vitesse Critique vs VMA) ---------- */
.vc-article {
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    padding: 56px 20px 72px;
    scroll-margin-top: 90px;
}
.vc-article__inner { max-width: 760px; margin: 0 auto; }
.vc-article__inner h2 {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 20px;
}
.vc-article__inner h3 {
    font-family: var(--font-display);
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 40px 0 14px;
}
.vc-article__inner h4 {
    font-family: var(--font-display);
    font-size: 1.04rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin: 24px 0 10px;
}
.vc-article__inner p {
    font-size: .96rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.vc-article__inner ul { margin: 0 0 14px; padding-left: 0; list-style: none; }
.vc-article__inner li {
    font-size: .96rem;
    line-height: 1.7;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-yellow);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 10px;
}
.vc-article__inner li strong, .vc-article__inner p strong { color: var(--text-primary); }
.vc-article__closing {
    font-weight: 600;
    color: var(--text-primary);
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 28px;
}

/* ---------- Accordéon FAQ (façon "featured snippet" Google) ---------- */
.vc-faq { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.vc-faq__item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.vc-faq__item:has(.vc-faq__trigger[aria-expanded="true"]) {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-sm);
}
.vc-faq__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
}
.vc-faq__trigger h3 { margin: 0; font-size: 1.06rem; }
.vc-faq__chevron {
    flex-shrink: 0;
    width: 20px; height: 20px;
    color: var(--accent-blue);
    transition: transform var(--dur-base) var(--ease-spring);
}
.vc-faq__trigger[aria-expanded="true"] .vc-faq__chevron { transform: rotate(180deg); }
.vc-faq__panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-slow) var(--ease-out);
}
.vc-faq__panel.is-open { max-height: 2400px; }
.vc-faq__panel-inner { padding: 0 20px 22px; }
.vc-faq__panel-inner h4:first-child { margin-top: 0; }
.vc-faq__panel-inner p:last-child,
.vc-faq__panel-inner ul:last-child { margin-bottom: 0; }

@media (max-width: 680px) {
    .vc-article { padding: 40px 16px 56px; }
    .vc-article__inner h2 { font-size: 1.4rem; }
    .vc-article__inner h3 { font-size: 1.12rem; }
}

/* ---------- Print ---------- */
@media print {
    /* Sans ça, Chrome/Firefox n'impriment AUCUN fond/dégradé par défaut
       (case "Graphismes d'arrière-plan" décochée) : tout ressort blanc,
       cartes colorées comprises. On force l'impression des couleurs telles
       quelles, comme à l'écran. */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .print-hidden { display: none !important; }
    .print-only { display: block !important; }
    .bg-fx, .app-header { display: none !important; }
    body { background: #fff !important; }
    .card, .metric-card, .sprint-panel, .fc-zone, .domain-zone, .domains, .trail-hero__card, .test-block, .card--form {
        box-shadow: none !important;
        break-inside: avoid;
    }
    [data-reveal] { opacity: 1 !important; transform: none !important; animation: none !important; }
    .app-main { padding: 0; max-width: 100%; }
    .print-header { text-align: center; border-bottom: 1px solid #ddd; padding-bottom: 16px; margin-bottom: 24px; }
    .print-header__title { font-family: 'Anton', var(--font-display); font-style: italic; text-transform: uppercase; font-size: 1.7rem; font-weight: 400; }
    .print-header p { text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; color: #666; margin-top: 4px; }

    /* Tableaux entiers à l'impression : les conteneurs de défilement
       (hauteur/largeur limitées à l'écran) doivent laisser tout leur
       contenu s'étaler sur le papier au lieu de le tronquer. */
    .table-scroll, .table-scroll--sticky {
        max-height: none !important;
        overflow: visible !important;
    }
    .table-scroll--sticky thead th,
    .table-scroll--sticky th:first-child,
    .table-scroll--sticky td:first-child {
        position: static !important;
        box-shadow: none !important;
    }
    .data-table { font-size: .78rem; }
    .data-table--dense { min-width: 0; }
    .data-table thead th, .data-table tbody td { padding: 6px 8px; white-space: normal; }

    /* Le titre d'une section (ex. "Domaines physiologiques & zones") ne doit
       jamais se retrouver seul en fin de page, séparé du tableau qui suit. */
    .section-block__title { break-after: avoid; }
    .section-block__header { break-after: avoid; }
    #road-predictions-card .card__title { break-after: avoid; }

    /* "Prédictions" et "Domaines physiologiques & zones" doivent apparaître
       ensemble : si l'ensemble ne tient pas dans le reste de la page en
       cours, on bascule le bloc entier (les deux réunis) en début de page
       suivante plutôt que de laisser les Prédictions seules en bas de page
       pendant que les Domaines partent sur la page d'après. */
    .predictions-domains-group { break-inside: avoid; }

    /* Marges resserrées entre cartes pour aider "Prédictions" et "Domaines
       physiologiques & zones" (qui la suit directement) à tenir sur la même
       page A4. */
    .card { margin-bottom: 14px; }
    .section-block { margin: 18px 0; }

    /* Bloc Domaines physiologiques resserré : à lui seul il dépasse la
       hauteur d'une page A4 une fois combiné aux Prédictions (mesuré ~1100px
       pour un budget d'~1046px). Padding/marges réduits pour repasser sous
       la barre sans perdre la lisibilité. */
    .domain-band { padding: 14px 18px; }
    .domain-band__head { margin-bottom: 10px; }
    .domain-divider { padding: 8px 18px; }
    .domain-zone { padding: 8px 12px; }

    /* Table "Allures par % de Vitesse Critique" : resserrée sur sa largeur
       de contenu réelle au lieu de s'étirer sur toute la page. */
    #road-vctable-card .data-table { width: auto; min-width: 0; }
    #road-vctable-card .table-scroll { display: flex; justify-content: center; }

    /* Table des pentes (Trail) : la colonne "Allure VC" doit garder son
       "/km" sur la même ligne — on lui redonne la place prise en trop par
       la colonne "Pente (%)", et on empêche le retour à la ligne au slash. */
    .data-table--dense th:first-child, .data-table--dense td:first-child { width: 7%; }
    .data-table--dense th:nth-child(2), .data-table--dense td:nth-child(2) { width: 15%; white-space: nowrap !important; }
    .data-table--dense { font-size: .72rem; }
    .data-table--dense th, .data-table--dense td { padding: 5px 6px; }
    #trail-pacetable-card { break-inside: avoid; }

    /* Les cadres de test (saisies) doivent apparaître dans le rapport, avec
       leur thème bleu nuit d'origine (couleurs désormais forcées ci-dessus). */
    .card--form { display: block !important; }
    .card--form .card__hint { display: none; }

    /* Capacités de sprint : absent du rapport si l'option n'est pas cochée. */
    .sprint-panel:not(:has(#road-sprint-active:checked)) { display: none !important; }

    /* Les 4 cartes-métrique sur une seule ligne (au lieu de repasser en 2×2
       comme sur mobile) pour libérer assez de hauteur et faire tenir
       l'Analyse Physiologique sur la même page. */
    .metric-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; margin-bottom: 14px !important; }
    .metric-card { padding: 10px !important; }
    .metric-card__label { font-size: .54rem !important; margin-bottom: 5px !important; }
    .metric-card__number, .metric-card__number--solo { font-size: 1.3rem !important; }
    .metric-card__unit { font-size: .74rem !important; }
    .metric-card__pill { padding: 3px 8px !important; font-size: .64rem !important; margin-top: 5px !important; }
    .metric-card__caption { font-size: .64rem !important; margin-top: 3px !important; }

    /* Carte "Vitesse Ascensionnelle Critique" (Trail) : gardée compacte et
       centrée, sinon elle s'étire sur toute la largeur de la page. */
    .metric-highlight-wrap { margin-bottom: 14px !important; }
    .metric-card--standalone { width: auto !important; max-width: 220px !important; margin: 0 auto; }

    /* Table "Allures par % de VC" : version à plat uniquement (celle en
       liste verticale est masquée), pour libérer de la hauteur et faire
       tenir les zones de FC sur la même page. */
    .data-table--flat th, .data-table--flat td { padding: 5px 4px; font-size: .68rem; }

    /* Zones de FC toujours sur 5 colonnes (au lieu de 3, cf. le point
       ci-dessus sur .metric-grid) pour rester compactes en hauteur. */
    .fc-grid { grid-template-columns: repeat(5, 1fr) !important; gap: 6px !important; }
    .fc-zone { padding: 8px 6px !important; }
    .fc-zone__name { font-size: .56rem !important; }
    .fc-zone__range { font-size: .7rem !important; }
}
