/* Lièvre (lievre.app) — la feuille de styles commune de toutes les pages de pages.php (lievre_page_open), servie
   statique et gardée en cache par le navigateur (?v= : la date du fichier). Les couleurs sont des jetons (--bg, --ink,
   --accent…) : leurs valeurs, pour chaque palette en clair et en sombre, sont dans palettes.css (généré par
   bin/build-css.php, ou par pages.php s'il manque). Aucune couleur en dur ici, hors --err / --ok.
   Deux sections sont aussi servies en ligne à la simulation (view.php), qui a ses propres styles : l'en-tête commun
   (@header) et l'attente animée (@simwait) — lues ici par lievre_css_section(). */

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* même sur une grille ou un flex */
.lv-icons { position: absolute; } /* le jeu de symboles (lievre_icons) : rien à l'écran */
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.4; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.wrap { max-width: calc(1024px + 2rem); margin: 0 auto; padding: .9rem 1rem 3rem; /* .9rem : l’écart sous l’en-tête commun */ padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
.kicker { font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink2); }
.muted { color: var(--ink2); }

.brand { display: inline-flex; align-items: center; text-decoration: none; border-radius: .4rem; }
/* Le logo prend ses couleurs dans la palette : elles suivent donc aussi le mode clair / sombre */
.logo { display: block; height: 2.5rem; width: auto; --lv-picto: var(--second); --lv-texte: var(--accent-text); }
.btn {
    display: inline-flex; align-items: center; gap: .4em; padding: .5em .85em; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: .875rem; font-weight: 600; line-height: 1.1;
}
.btn:hover { border-color: var(--accent); }
.btn-ico { padding: .5em .62em; } /* icône seule (administration, mode clair / sombre) */
.btn-ico .js-theme-label { display: none; }
.btn-main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:focus-visible, .brand:focus-visible, a.race:focus-visible, .ask-field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Accroche ---------- */
.intro { padding: 1.4rem 0 1.7rem; max-width: 42rem; }
.intro h1 { margin: .12em 0 .3em; font-size: clamp(2.1rem, 7vw, 3.3rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.03; }
.intro h1 em { font-style: normal; color: var(--accent-text); }
.lead { margin: 0; font-size: 1.06rem; color: var(--ink2); }

/* ---------- L'accueil par événements : bascule, cartes, liste ---------- */
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; max-width: none; }
.intro > div { min-width: 0; max-width: 42rem; }
.seg { display: inline-flex; padding: .25rem; border-radius: 999px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.seg a { padding: .5em 1.05em; border-radius: 999px; text-decoration: none; font-size: .9rem; font-weight: 700; color: var(--ink2); }
.seg a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.maps { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto auto; gap: 1rem; }
.map-france { grid-row: span 2; }
.mapcard { position: relative; min-width: 0; padding: 1rem 1.1rem 1rem; border-radius: 1.4rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.mapcard h2 { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .15rem; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
.mapcard h2 small { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); }
.mapcard .sub { margin: 0 0 .5rem; font-size: .82rem; color: var(--ink2); }
.mapcard .also { margin: .5rem 0 0; }
.mapcard .also a { font-weight: 700; text-decoration: none; }
.mapcard .also a:hover { text-decoration: underline; }
.mapcard .mm-box { position: relative; }
.geo { display: block; width: 100%; height: auto; max-width: 100%; }
.geo .land { fill: color-mix(in srgb, var(--ink) 9%, var(--card)); stroke: color-mix(in srgb, var(--ink) 38%, transparent); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pin { cursor: pointer; }
.pin .dot { fill: var(--accent); stroke: var(--card); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pin.multi .dot { fill: var(--second); }
.pin.grp .dot { fill: var(--third); }
.pin:hover .dot, .pin:focus-visible .dot { stroke: var(--accent-text); }
.pin:focus-visible { outline: none; }
.pin text { font-family: inherit; font-weight: 800; pointer-events: none; }
.pin .n { fill: var(--second-ink); text-anchor: middle; dominant-baseline: central; }
.pin.grp .n { fill: var(--third-ink); }
.pin .lab { fill: var(--accent-text); paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.pin.grp .lab { fill: var(--ink); }
.pin .pulse { fill: var(--second); opacity: .35; transform-box: fill-box; transform-origin: center; animation: pin-pulse 2.4s ease-out infinite; }
.pin.grp .pulse { fill: var(--third); }
@media (prefers-reduced-motion: reduce) { .pin .pulse { animation: none; } }
@keyframes pin-pulse { 0% { transform: scale(.6); opacity: .5; } 80%, 100% { transform: scale(2.2); opacity: 0; } }
.tip { position: absolute; z-index: 5; width: max-content; max-width: 18rem; padding: .55rem .75rem; border-radius: .8rem; background: var(--ink); color: var(--bg); font-size: .82rem; line-height: 1.3; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }
.tip b { display: block; font-size: .9rem; white-space: nowrap; }
.pop { position: absolute; z-index: 6; width: max-content; min-width: 13rem; max-width: 20rem; padding: .7rem .8rem; border-radius: 1rem; background: var(--card); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 16px 34px -16px rgba(0, 0, 0, .6); transform: translate(-50%, 12px); }
.pop h3 { margin: 0 1.4rem .4rem 0; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); }
.pop a { display: block; padding: .4rem .5rem; border-radius: .6rem; text-decoration: none; font-weight: 700; }
.pop a:hover { background: var(--tint); }
.pop a small { display: block; font-weight: 500; color: var(--ink2); }
.pop .x { position: absolute; top: .45rem; right: .45rem; border: 0; background: transparent; cursor: pointer; color: var(--ink2); font-size: 1rem; line-height: 1; }
.regions { display: grid; gap: 1rem; }
.region { padding: 1.1rem 1.2rem 1rem; border-radius: 1.4rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.region h2 { display: flex; align-items: baseline; gap: .6rem; margin: 0 0 .6rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.region h2 small { font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); }
.rows { display: grid; }
.row { display: grid; gap: .45rem; padding: 1rem 0 1.05rem; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .name { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; line-height: 1.15; }
.row .name a { text-decoration: none; }
.row .name a:hover { color: var(--accent-text); text-decoration: underline; }
.row .where { font-size: .88rem; color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .15rem; }
.chip { display: inline-flex; align-items: baseline; gap: .5em; padding: .5em 1em; border-radius: 999px; background: var(--tint); font-size: .95rem; font-weight: 800; text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); }
.chip:hover { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.chip small { font-size: .82em; font-weight: 600; opacity: .8; }
.tag { padding: .25em .65em; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; } /* accent + accent-ink : lisible dans toutes les palettes */
.tag-major { background: var(--ink); color: var(--bg); margin-left: .5em; vertical-align: middle; } /* course Majeure (TDM) : encre sur fond, lisible partout */
.chip .tag-major { font-size: .68rem; padding: .2em .55em; margin-left: .2em; }
.race-top .tag-major { display: inline-block; margin: .3rem 0 0; }
.crumbs { margin: 0 0 .8rem; font-size: .84rem; color: var(--ink2); }
.crumbs a { text-decoration: none; font-weight: 700; }
.evhero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; align-items: center; padding: 1.3rem 1.5rem; margin-bottom: 1rem; border-radius: 1.4rem; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.evhero h1 { margin: .1em 0 .2em; font-size: clamp(1.7rem, 5vw, 2.5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.evhero .evmap { width: 9rem; margin: 0; --hero-ink: var(--ink); --hero-accent: var(--accent-text); --mm-dot: var(--second); }
@media (max-width: 760px) {
    .maps { grid-template-columns: minmax(0, 1fr); }
    .map-france { grid-row: auto; }
    .evhero { grid-template-columns: minmax(0, 1fr); }
    .evhero .evmap { width: 7rem; }
}

/* ---------- La carte d'une course ---------- */
.races { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.race {
    position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 1.6rem; min-height: 15.5rem;
    padding: 1.35rem 1.45rem 1.3rem; border-radius: 1.4rem; text-decoration: none;
    background: var(--hero-a); color: var(--hero-ink);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hero-ink) 14%, transparent); /* détache une carte sombre d'un fond sombre */
    transition: transform .18s ease, box-shadow .18s ease;
}
a.race:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hero-ink) 30%, transparent), 0 18px 30px -20px rgba(0, 0, 0, .6); }
/* Le profil du parcours, en filigrane au pied de la carte */
.race-wm { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 64%; pointer-events: none; }
.race-wm .wm-area { fill: var(--hero-ink); opacity: .085; }
.race-wm .wm-line { fill: none; stroke: var(--hero-ink); stroke-width: 1.25; opacity: .2; vector-effect: non-scaling-stroke; }
.race-top, .race-foot { position: relative; display: flex; justify-content: space-between; gap: 1rem; }
.race-top { align-items: flex-start; }
.race-foot { align-items: flex-end; flex-wrap: wrap; margin-top: auto; }
.race .kicker { color: inherit; opacity: .82; }
.race h2, .race h1 { margin: .18em 0 0; font-size: clamp(1.55rem, 3.4vw, 2.05rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; text-wrap: balance; }
/* La mini-carte : la région, et un point à l'endroit du départ */
.race-map { flex: none; width: 7rem; margin: -.3rem -.4rem 0 0; }
/* sur l'accueil, une carte plus grande, qui descend sur le profil en filigrane sans agrandir le bloc */
a.race .race-map { position: relative; z-index: 1; width: 10.5rem; margin: -.4rem -.5rem -4.2rem 0; }
/* deux colonnes étroites (tablette) : un peu moins grande, pour ne pas toucher les chiffres */
@media (min-width: 720px) and (max-width: 1099px) { a.race .race-map { width: 8.4rem; margin-bottom: -1.6rem; } }
.minimap { display: block; width: 100%; height: auto; overflow: hidden; } /* zoomée : ce qui sort du cadre est coupé (bords adoucis par un masque) */
.minimap.whole { overflow: visible; } /* la région entière : rien à couper, le halo du point peut déborder */
.race-region { margin-bottom: .25rem; text-align: center; font-size: .64rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .82; }
.mm-box { position: relative; }
.mm-lead { stroke: var(--mm-dot, var(--hero-ink)); stroke-width: 1.2; opacity: .85; vector-effect: non-scaling-stroke; }
/* le nom de la ville : du HTML posé sur la carte, pour garder une taille de texte fixe quel que soit le
   zoom ; dans la couleur de l'estimation (celle des chiffres du bloc), le point dans celle des pastilles */
.mm-city { position: absolute; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; font-weight: 800; line-height: 1.1; color: var(--hero-accent); text-shadow: 0 0 3px var(--hero-a), 0 0 3px var(--hero-a), 0 0 6px var(--hero-a); pointer-events: none; }
.mm-city.l { transform: translate(-100%, -50%); padding-right: .25em; }
.mm-city.r { transform: translate(0, -50%); padding-left: .25em; }
.mm-land { fill: color-mix(in srgb, var(--hero-ink) 17%, transparent); stroke: color-mix(in srgb, var(--hero-ink) 50%, transparent); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mm-dot { fill: var(--mm-dot, var(--third)); stroke: var(--hero-ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.mm-halo { fill: var(--mm-dot, var(--third)); opacity: .4; transform-box: fill-box; transform-origin: center; animation: mm-pulse 2.6s ease-out infinite; }
@keyframes mm-pulse { 0% { transform: scale(.55); opacity: .55; } 80%, 100% { transform: scale(1.7); opacity: 0; } }
/* Les points de passage, en tout petit : une illustration du parcours, pas un tableau à lire */
.race-cps { position: relative; list-style: none; margin: 0; padding: 0; columns: 4 8.2em; column-gap: 1.1em; font-size: .68rem; line-height: 1.55; opacity: .8; }
.race-cps li { display: flex; gap: .55em; white-space: nowrap; overflow: hidden; break-inside: avoid; }
.race-cps i { flex: none; width: 2em; text-align: right; font-style: normal; font-variant-numeric: tabular-nums; opacity: .65; }
.race-cps span { overflow: hidden; text-overflow: ellipsis; }
.facts { display: flex; gap: 1.5rem; }
.fact b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--hero-accent); white-space: nowrap; }
.fact b small { font-size: .55em; font-weight: 700; letter-spacing: 0; margin-left: .12em; }
.fact span { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .82; }
.cta { display: inline-flex; align-items: center; gap: .45em; padding: .62em 1.05em; border-radius: 999px; background: var(--hero-accent); color: var(--hero-a); font-size: .95rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.cta .ico { transition: transform .18s ease; }
a.race:hover .cta .ico { transform: translateX(3px); }
a.race[aria-busy="true"] { cursor: progress; }
a.race[aria-busy="true"] .cta { opacity: .8; } /* la simulation se calcule (quelques secondes) */

/* ---------- La saisie de l'indice, après le choix de la course ---------- */
.back { padding: .3rem 0 1rem; }
.step { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: stretch; }
.step .race { min-height: 0; }
/* La fiche d'une course (visiteur non connecté) : un bandeau court. La mini-carte (la région entière,
   sans fondu), grande et en légère transparence, en haut à droite hors du flux ; le nom sur toute la
   largeur et sur une seule ligne (course.php réduit sa taille s'il le faut), les points de passage en
   trois colonnes, tous deux par-dessus la carte ; le profil en filigrane, bas, reste sous les points.
   Le panneau d'à côté se resserre aussi (la rangée prend la hauteur du plus haut des deux). */
.race-sheet { gap: .85rem; padding-bottom: 1.15rem; }
.race-sheet .race-top { padding-right: 0; }
.race-sheet .race-top > div:first-child { position: relative; z-index: 2; flex: 1; min-width: 0; }
.race-sheet h1 { white-space: nowrap; overflow: hidden; text-wrap: nowrap; }
.race-sheet .race-map { position: absolute; top: .95rem; right: 1.15rem; z-index: 1; width: 11.6rem; margin: 0; opacity: .5; }
/* la carte n'est plus qu'un fond : ni le nom de la région ni celui de la ville (le premier point de
   passage le donne), qui se mêleraient au nom de la course et aux points ; le point de départ reste */
.race-sheet .race-region, .race-sheet .mm-city, .race-sheet .mm-lead { display: none; }
.race-sheet .race-cps { z-index: 2; margin-right: 0; columns: 3; }
.race-sheet .race-wm { height: 30%; }
.step .ask { gap: .8rem; padding: 1.3rem 1.4rem 1.25rem; }
.step .ask h2 { font-size: 1.35rem; }
.ask { display: flex; flex-direction: column; gap: 1.1rem; padding: 1.5rem 1.5rem 1.4rem; border-radius: 1.4rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.ask h2 { margin: .1em 0 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.ask p { margin: .35em 0 0; }
.ask-fields { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.ask-field { display: block; padding: .7rem .9rem .6rem; border-radius: 1rem; background: var(--tint); border: 1px solid var(--line); cursor: text; }
.ask-field span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink2); }
.ask-field input { width: 100%; padding: 0; border: 0; background: transparent; font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; -moz-appearance: textfield; }
.ask-field input::placeholder { color: var(--ink2); opacity: .45; }
.ask-field input:focus { outline: none; }
.ask-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.ask-field input::-webkit-outer-spin-button, .ask-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ask .btn-main { margin-top: auto; justify-content: center; padding: .95em 1.2em; font-size: 1.05rem; font-weight: 800; }
.ask .btn-main[aria-busy="true"] { opacity: .75; cursor: progress; }

/* ---------- Les palettes de l'écran : leurs quatre couleurs, sans nom (profil des administrateurs, lievre_palette_picker) ---------- */
.pals { display: flex; flex-wrap: wrap; gap: .3rem; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; }
.pal-card { position: relative; display: grid; gap: .45rem; padding: .55rem .55rem .65rem; border: 0; border-radius: 1rem; background: var(--tint); color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line); font: inherit; text-align: left; cursor: pointer; }
.pal-card:hover { box-shadow: inset 0 0 0 2px var(--line); }
.pal-card[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.pal-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pal-band { display: flex; height: 2.4rem; border-radius: .65rem; overflow: hidden; box-shadow: 0 0 0 1px rgba(128, 128, 128, .3); }
.pal-band i { flex: 1; }
.pal-name { font-size: .88rem; font-weight: 800; line-height: 1.2; padding-right: 1.4rem; }
.pal-site { justify-self: start; padding: .15em .55em; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: .68rem; font-weight: 700; color: var(--ink2); }
.pal-ok { position: absolute; right: .55rem; bottom: .6rem; width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.pal-card[aria-pressed="true"] .pal-ok { opacity: 1; }
.pal-sw { display: inline-flex; padding: 3px; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; }
.pal-sw:hover { border-color: var(--line); }
.pal-sw[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pal-sw:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pal-sw .sw { width: 2.3em; height: 1.25em; font-size: .9rem; }
.sw { display: inline-flex; flex: none; width: 2.6em; height: 1.5em; border-radius: 999px; overflow: hidden; box-shadow: 0 0 0 1px rgba(128, 128, 128, .35); }
.sw i { flex: 1; }

/* ---------- Comptes : inscription, connexion, mot de passe, profil ---------- */
html { --err: #b3261e; --ok: #1d7a46; }
html[data-theme="dark"] { --err: #ff8a80; --ok: #7ad69c; }
.panel { max-width: 34rem; margin: .4rem auto 0; padding: 1.5rem 1.5rem 1.4rem; border-radius: 1.4rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.panel.wide { max-width: 56rem; }
.panel h1 { margin: .12em 0 .35em; font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.panel h2 { margin: 1.6rem 0 .6rem; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.panel h2:first-child { margin-top: .2rem; }
.panel p { margin: 0 0 .8rem; }
.fld { display: block; margin: 0 0 .9rem; }
.fld > span { display: block; margin-bottom: .3rem; font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); }
.fld input { width: 100%; padding: .7rem .85rem; border-radius: .8rem; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 16px; }
.fld input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.fld input[type="number"] { font-weight: 800; -moz-appearance: textfield; }
.fld input::-webkit-outer-spin-button, .fld input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fld-err { display: block; margin: -.5rem 0 .9rem; font-size: .86rem; font-weight: 600; color: var(--err); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .8rem; }
.chk { display: flex; gap: .6rem; align-items: flex-start; margin: .2rem 0 1rem; font-size: .92rem; cursor: pointer; }
.chk input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: none; }
.notice { margin: 0 0 1rem; padding: .8rem 1rem; border-radius: .9rem; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.notice.err { color: var(--err); font-weight: 600; }
.notice.ok { color: var(--ok); font-weight: 600; }
.notice p:last-child { margin-bottom: 0; }
.panel .btn-main, .panel .btn-wide { justify-content: center; padding: .85em 1.2em; font-size: 1rem; font-weight: 800; }
.panel .btn-wide { width: 100%; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.3rem; margin-top: 1.1rem; font-size: .92rem; }
.links a, .panel a.inline { color: var(--accent-text); font-weight: 700; }
.plans { width: 100%; border-collapse: collapse; font-size: .95rem; }
.plans th { text-align: left; padding: .4rem .5rem .4rem 0; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); border-bottom: 1px solid var(--line); }
.plans td { padding: .6rem .5rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.plans td b { color: var(--accent-text); font-size: 1.1em; }
.plans .act { text-align: right; white-space: nowrap; }
.plans form { display: inline; }
.icon-btn { border: 0; background: none; color: var(--ink2); cursor: pointer; padding: .3rem; font-size: 1rem; }
.icon-btn:hover { color: var(--err); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; margin-top: 1.4rem; }
.grid2 > div + div h2:first-child { margin-top: .2rem; }
@media (max-width: 719px) { .grid2 > div + div h2:first-child { margin-top: 1.6rem; } }
.danger { color: var(--err); }

.oops { padding: 1.2rem 1.4rem; border-radius: 1.1rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.oops p { margin: 0 0 .4em; }
footer { margin-top: 2.6rem; font-size: .85rem; color: var(--ink2); text-align: center; }

@media (max-width: 719px) {
    .races, .step, .grid2 { grid-template-columns: minmax(0, 1fr); }
    .panel { padding: 1.2rem 1.1rem 1.15rem; }
    .plans .hide-sm { display: none; }
    .intro { padding: .8rem 0 1.3rem; }
    .race { min-height: 13.5rem; padding: 1.15rem 1.15rem 1.1rem; gap: 1.2rem; }
    /* la fiche (non connecté) : un bandeau plus court, profil plus bas, points de passage resserrés */
    .step .race { min-height: 0; gap: .8rem; padding: 1rem 1.1rem .95rem; }
    .step .race-map { width: 7.6rem; margin: 0; top: .8rem; right: .9rem; }
    .race-sheet .race-cps { columns: 3; column-gap: .8em; }
    .step .race-region { font-size: .56rem; margin-bottom: .1rem; }
    .step .race-wm { height: 24%; }
    .step .race-cps { font-size: .64rem; line-height: 1.38; }
    .step .fact b { font-size: 1.3rem; }
    .race-map { width: 5.8rem; }
    a.race .race-map { width: 8rem; margin-bottom: -2.2rem; }
    .logo { height: 2.15rem; }
    .fact b { font-size: 1.45rem; }
    .facts { gap: 1.1rem; }
    .ask { padding: 1.2rem 1.15rem 1.15rem; }
}
/* très petit téléphone : la carte un peu moins grande, pour ne pas toucher les chiffres */
@media (max-width: 379px) {
    a.race .race-map { width: 7rem; margin-bottom: -1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
    .mm-halo { animation: none; }
    .race, .cta .ico { transition: none; }
}

/* @header ---------- En-tête commun (lievre_site_header) ---------- */
.lv-hd { background: var(--card); color: var(--ink); border-bottom: 1px solid var(--line); }
.lv-hd-in { display: flex; align-items: center; gap: .5rem; max-width: 1024px; margin: 0 auto; padding: .5rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); box-sizing: content-box; }
.lv-hd-brand { display: inline-flex; align-items: center; margin-right: auto; border-radius: .4rem; line-height: 0; text-decoration: none; }
.lv-hd-brand:focus-visible, .lv-hd-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lv-hd-logo { display: block; height: 2.5rem; width: auto; --lv-picto: var(--second); --lv-texte: var(--accent-text); }
.lv-hd-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-width: 2.35rem; height: 2.35rem; padding: 0 .8em; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 600 .875rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    text-decoration: none; cursor: pointer; }
.lv-hd-btn:hover { border-color: var(--accent); }
.lv-hd-btn.lv-hd-sq { width: 2.35rem; padding: 0; } /* pas « ico » : déjà la classe des pictos du site */
.lv-hd-btn.on { background: var(--tint); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.lv-hd-btn svg { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lv-hd .js-theme-label { display: none; }
@media (max-width: 719px) {
    .lv-hd-logo { height: 2.15rem; }
    .lv-hd .lbl { display: none; }
    .lv-hd-btn { width: 2.35rem; padding: 0; }
}
@media print { .lv-hd { display: none; } }
/* @end */

/* ---------- Composants communs (lv-*, partiels de pages.php) ----------
   lv-bar     la barre d'outils d'une page, collée sous l'en-tête (lievre_toolbar)
   lv-title   le titre d'une page (lievre_page_title) ; .center : titre centré des outils (traces)
   lv-back    le retour « ‹ Mon profil » (lievre_back)
   lv-nav     la barre du bas sur téléphone, onglets sur ordinateur (lievre_bottom_nav)
   lv-sec     une rubrique : titre (lv-sec-h), puis une carte
   lv-card    une carte (lv-pad : avec marge intérieure) ; lv-row : une ligne de carte (lievre_row) ; lv-empty, lv-note, lv-help
   lv-cta     le grand bouton sous une carte (.main plein, .dash en pointillé)
   lv-tag, lv-ok, lv-stats, lv-head, lv-sub : petite pastille, pastille « Relié », chiffres en tuiles, ligne titre + pastille, texte sous un titre */
.lv-bar { position: sticky; top: 0; z-index: 1100; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .45rem 0; margin: -.9rem 0 .5rem; /* collée à l’en-tête commun */
    font-size: 14px; color: var(--ink); background: var(--card); box-shadow: 0 0 0 100vmax var(--card), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax -1px -100vmax); }
.lv-bar .btn { min-height: 2.45em; padding: .4em .95em; font-weight: 700; }
.lv-bar .lbl-s { display: none; }
.lv-bar-tools { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
@media (max-width: 640px) {
    .lv-bar { gap: .4rem; }
    .lv-bar .lbl { display: none; }
    .lv-bar .lbl-s { display: inline; }
    .lv-bar .btn { padding: .5em .8em; }
}

.lv-title { margin: .2rem 0 1.2rem; }
.lv-title h1 { margin: .1em 0 .1em; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.lv-title p { margin: 0; color: var(--ink2); font-size: .92rem; }
.lv-title p a { color: var(--accent-text); font-weight: 700; }
.lv-title.center { text-align: center; margin: .8rem 0 1.4rem; }
.lv-title.center h1 { margin: .35rem 0 .2rem; font-size: clamp(1.8rem, 4.4vw, 2.6rem); font-weight: 900; line-height: 1.4; color: var(--accent-text); }
.lv-title.center p { margin: 0 auto; max-width: 34rem; font-size: 1rem; }
.lv-sub { margin: -.6rem 0 1rem; color: var(--ink2); }
.panel .lv-sub { margin-top: -.4rem; }

.lv-back { display: inline-flex; align-items: center; gap: .15rem; min-height: 2.75rem; margin: 0 0 .2rem -.3rem; padding: 0 .3rem; color: var(--accent-text); font-weight: 700; text-decoration: none; }
.lv-back svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lv-back:hover { text-decoration: underline; }

.lv-nav { display: flex; gap: .3rem; margin: 0 0 1.2rem; padding: .3rem; border-radius: 999px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.lv-nav a { flex: 1; display: flex; align-items: center; justify-content: center; gap: .5em; min-height: 2.9rem; padding: 0 1rem; border-radius: 999px;
    color: var(--ink2); font-weight: 700; text-decoration: none; }
.lv-nav a:hover { color: var(--ink); }
.lv-nav a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 4px 12px -8px rgba(0, 0, 0, .4); }
.lv-nav svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lv-nav .ic { position: relative; display: inline-flex; align-items: center; padding-right: .55rem; }
.lv-nav .n { position: absolute; top: -.5rem; right: -.35rem; min-width: 1.15rem; padding: 0 .4em; box-sizing: border-box; border-radius: 999px; background: var(--line); color: var(--ink);
    font-size: .68rem; font-weight: 800; line-height: 1.5; text-align: center; } /* le nombre, en pastille sur l'icône */
.lv-nav a[aria-current="page"] .n { background: var(--accent); color: var(--accent-ink); }
.wrap.lv-has-nav { padding-bottom: 5rem; }

.lv-sec { margin: 0 0 1.6rem; }
.lv-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; margin: 0 0 .55rem; }
.lv-sec-h h2 { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.lv-sec-h h2 small { margin-left: .3em; color: var(--ink2); font-size: .8em; font-weight: 700; }
.lv-sec-h a { color: var(--accent-text); font-weight: 700; font-size: .92rem; }
.lv-card { border-radius: 1.1rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.lv-pad { padding: 1rem 1.05rem 1.05rem; }
.lv-card + .lv-card { margin-top: .9rem; }
.lv-card > p:first-child, .lv-card > form > p:first-child { margin-top: 0; }
.lv-card > p:last-child { margin-bottom: 0; }
.lv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; }
.lv-head h2 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.lv-head b { font-size: 1.1rem; }
.lv-head .muted { font-size: .88rem; }
.lv-row { display: flex; align-items: center; gap: .8rem; min-height: 3.6rem; padding: .7rem 1rem; color: var(--ink); text-decoration: none; }
.lv-row + .lv-row, .lv-row + form, form + .lv-row { border-top: 1px solid var(--line); }
a.lv-row:hover { background: var(--tint); }
.lv-row .t { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.lv-row .t b { display: block; font-size: 1rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-row .t > span { display: block; font-size: .84rem; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-row .v { flex: none; font-size: 1.15rem; font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.lv-row .acts { flex: none; display: flex; gap: .4rem; }
.lv-row .acts a { display: inline-flex; align-items: center; min-height: 2.2rem; padding: 0 .8rem; border-radius: 999px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line);
    color: var(--ink); font-size: .84rem; font-weight: 700; text-decoration: none; }
.lv-row .acts a.main { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.lv-row form { display: inline; }
.lv-chev { flex: none; width: 1.05rem; height: 1.05rem; fill: none; stroke: var(--ink2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lv-cta { display: flex; justify-content: center; align-items: center; gap: .4rem; margin-top: .65rem; min-height: 3rem; border-radius: 999px; font-weight: 800; text-decoration: none; }
.lv-cta.main { background: var(--accent); color: var(--accent-ink); }
.lv-cta.dash { color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.lv-empty { padding: 1rem 1.05rem; color: var(--ink2); font-size: .95rem; }
.lv-note { margin: .8rem 0 0; font-size: .8rem; color: var(--ink2); }
.lv-help { margin-top: .8rem; padding: .7rem .85rem; border-radius: .8rem; background: var(--tint); font-size: .86rem; line-height: 1.45; }
.lv-tag { padding: .12em .55em; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; vertical-align: .15em; }
.lv-ok { display: inline-flex; align-items: center; gap: .3rem; padding: .2em .65em; border-radius: 999px; background: var(--third); color: var(--third-ink); font-size: .78rem; font-weight: 800; }
.lv-ok svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; }
.lv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: .9rem; }
.lv-stats div { padding: .7rem .5rem; border-radius: .9rem; background: var(--tint); text-align: center; }
.lv-stats b { display: block; font-size: 1.3rem; font-weight: 800; color: var(--accent-text); }
.lv-stats span { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink2); }
/* petits réglages d'espacement, à la place des style="…" des gabarits */
.lv-gap { margin-bottom: 1.4rem; }
.lv-mt { margin-top: .7rem; }
.lv-mt-s { margin-top: .5rem; }
.lv-center { text-align: center; }
.lv-inline-acts { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; margin-top: .7rem; }
.lv-inline-acts .muted, .lv-inline-acts > span { font-size: .86rem; color: var(--ink2); }
.btn.btn-link { border: 0; background: none; padding-left: 0; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
.fld-hint { display: block; margin: -.5rem 0 .9rem; font-size: .86rem; font-weight: 500; color: var(--ink2); }
.btn-center { justify-content: center; }
.home-oops { margin-top: 1.6rem; }
.adm-plans-del { margin: .6rem 0 1.2rem; }
@media (max-width: 719px) {
    /* la barre en bas de l'écran, sous le pouce */
    .lv-nav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; margin: 0; padding: .2rem .5rem calc(.25rem + env(safe-area-inset-bottom)); gap: .2rem; border-radius: 0;
        background: var(--card); box-shadow: 0 -1px 0 var(--line), 0 -8px 20px -14px rgba(0, 0, 0, .45); }
    .lv-nav a { flex-direction: column; gap: .05rem; min-height: 2.8rem; padding: 0 .5rem; border-radius: .8rem; font-size: .74rem; line-height: 1.15; }
    .lv-nav svg { width: 1.15rem; height: 1.15rem; }
    .lv-nav a[aria-current="page"] { background: var(--tint); box-shadow: none; color: var(--accent-text); }
    .lv-nav .ic { padding: 0 .9rem; }
    .lv-nav .n { top: -.35rem; right: -.1rem; }
    .lv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lv-row .acts a.sec { display: none; }
}

/* @pictos ---------- Pictogrammes de course (lievre_picto, jeu de TDM : _pictos.json) ---------- */
.pc { display: inline-block; flex: none; width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; overflow: visible; }
/* taille optique : le dessin grandit, le trait s'affine, pour garder la même graisse à l'œil */
.pc.o1 { stroke-width: 1.75; }
.pc.o2 { stroke-width: 1.5; }
.pc.o3 { stroke-width: 1.25; }
.pc.o4 { stroke-width: 1; }
/* un seul ton : en-tête (palette neutre), pastilles colorées, filigranes */
.pc.mono, .lv-hd { --pc2: currentColor; }
@media (forced-colors: active) { .pc { --pc2: currentColor; } }
/* @end */

/* @simwait ---------- L'attente de la simulation (lievre_simwait, js/simwait.js) ---------- */
/* la page disparaît derrière un fond opaque (fondu de .75 s à l'ouverture), et revient en fondu de .75 s une fois le parcours terminé */
.simwait { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 1.5rem; opacity: 0; visibility: hidden; transition: opacity .75s ease, visibility 0s linear .75s;
    background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.simwait.show, html.sw-hold .simwait { opacity: 1; visibility: visible; transition: opacity .75s ease; }
html.sw-hold .simwait { transition: none; } /* la page du résultat : là dès le premier affichage */
.sw-box { width: min(34rem, 100%); display: flex; flex-direction: column; align-items: center; gap: 1.1rem; text-align: center; }
.sw-logo { display: block; height: 2.9rem; width: auto; margin-bottom: -.2rem; --lv-picto: var(--second); --lv-texte: var(--accent-text); }
.sw-name { max-width: 100%; font-size: clamp(1.6rem, 5vw, 2.5rem); font-weight: 900; line-height: 1.08; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; overflow-wrap: anywhere; }
.sw-name:empty { display: none; }
.sw-map { position: relative; width: min(100%, calc(40vh * var(--sw-r, 1))); max-width: 100%; aspect-ratio: var(--sw-r, 1); }
@media (max-height: 640px) { .sw-logo { height: 2.2rem; } .sw-map { width: min(100%, calc(34vh * var(--sw-r, 1))); } }
.sw-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sw-map path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sw-base { stroke: var(--ink); stroke-width: 3; opacity: .22; }
.sw-done { stroke: var(--accent); stroke-width: 4.5; }
.sw-runner { position: absolute; width: 1.05rem; height: 1.05rem; margin: -.525rem 0 0 -.525rem; border-radius: 50%; background: var(--second-fill, var(--accent)); box-shadow: 0 0 0 3px var(--card), 0 2px 8px rgba(0, 0, 0, .25); }
.sw-runner::after { content: ""; position: absolute; inset: -.55rem; border-radius: 50%; background: var(--second-fill, var(--accent)); opacity: .35; animation: sw-pulse 1.2s ease-out infinite; }
@keyframes sw-pulse { from { transform: scale(.4); opacity: .5; } to { transform: scale(1.5); opacity: 0; } }
.sw-flag { position: absolute; width: .6rem; height: .6rem; margin: -.3rem 0 0 -.3rem; border-radius: 50%; background: var(--ink); opacity: .5; }
.sw-say { display: flex; align-items: center; gap: .65rem; font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.sw-spin { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--ink) 18%, transparent); border-top-color: var(--accent); animation: sw-turn .8s linear infinite; }
.simwait.arrived .sw-spin { animation: none; border-color: var(--accent); background: var(--accent); }
@keyframes sw-turn { to { transform: rotate(360deg); } }
.sw-idx { margin-top: -.45rem; font-size: clamp(1.5rem, 4.6vw, 2.1rem); font-weight: 900; letter-spacing: -.01em; line-height: 1.1; color: var(--sw-idx, var(--mk-lab, var(--accent-text))); font-variant-numeric: tabular-nums; }
.sw-idx:empty { display: none; }
.sw-sub { margin-top: -.5rem; font-size: 1.05rem; font-weight: 700; color: var(--ink2, var(--ink)); font-variant-numeric: tabular-nums; min-height: 1.3em; }
/* la pré-landing de la page du résultat : le bandeau de la course au-dessus du tracé parcouru */
.simwait.with-hero { overflow-y: auto; align-items: safe center; }
.simwait.with-hero .sw-name { display: none; }
.simwait.with-hero .sw-box { gap: .9rem; width: min(38rem, 100%); }
.simwait.with-hero .sw-map { width: min(100%, calc(26vh * var(--sw-r, 1))); }
.sw-hero { width: 100%; padding: 1rem 1.2rem 1rem; border-radius: 1.2rem; background: var(--hero-a); color: var(--hero-ink); text-align: left; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hero-ink) 14%, transparent); }
.sw-hero-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.sw-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .82; }
.sw-hero-name { margin-top: .1em; font-size: clamp(1.35rem, 4vw, 1.9rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; text-wrap: balance; }
.sw-facts { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; margin-top: .9rem; }
.sw-fact b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--hero-accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sw-fact b small { font-size: .55em; font-weight: 700; margin-left: .12em; }
.sw-fact span { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; opacity: .82; }
@media (max-height: 640px) { .simwait.with-hero .sw-map { width: min(100%, calc(20vh * var(--sw-r, 1))); } .sw-hero { padding: .7rem .9rem; } }
@media (prefers-reduced-motion: reduce) { .sw-runner::after { animation: none; } .sw-spin { animation-duration: 2s; } }
@media print { .simwait { display: none !important; } }
/* @end */

/* ---------- Accueil : la recherche seule (home.php) ---------- */
.home { display: flex; flex-direction: column; align-items: center; min-height: calc(100vh - 13rem); padding: clamp(1.5rem, 9vh, 6rem) 0 3rem; text-align: center; }
.home .intro { display: block; padding: 0; max-width: 40rem; }
.home .intro h1 { margin-bottom: .25em; }
.home .lead { margin: 0 auto; max-width: 34rem; }
.find { width: 100%; max-width: 42rem; margin-top: 1.9rem; text-align: left; }
.find-box { position: relative; }
.find-field { display: flex; align-items: center; gap: .7rem; padding: 0 .6rem 0 1.2rem; border-radius: 999px; background: var(--card);
    box-shadow: inset 0 0 0 1.5px var(--line), 0 10px 30px -16px rgba(0, 0, 0, .4); transition: box-shadow .15s; }
.find-field:focus-within { box-shadow: inset 0 0 0 2px var(--accent), 0 12px 34px -16px rgba(0, 0, 0, .5); }
.find-field .ico { width: 1.35rem; height: 1.35rem; color: var(--ink2); }
.find-field input { flex: 1; min-width: 0; height: 3.8rem; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 1.15rem; font-weight: 600; }
.find-field input:focus { outline: none; }
.find-field input::placeholder { color: var(--ink2); font-weight: 500; opacity: .85; }
.find-field input::-webkit-search-cancel-button { display: none; }
.find-x { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%; background: transparent; color: var(--ink2); cursor: pointer; }
.find-x:hover { background: var(--tint); color: var(--ink); }
.find-key { padding: .15rem .45rem; border-radius: .35rem; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink2); font-size: .75rem; font-weight: 700; }
.find-field:focus-within .find-key, .find-field.has-q .find-key { display: none; }
@media (hover: none) { .find-key { display: none; } }
/* exemples sous le champ */
.find-eg { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .45rem; margin-top: 1rem; font-size: .9rem; color: var(--ink2); }
.find-eg button { padding: .42em .9em; border: 0; border-radius: 999px; background: var(--tint); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--line); }
.find-eg button:hover { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.find-eg button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.find-count { margin-top: 1.4rem; font-size: .82rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink2); }
/* les suggestions */
.sg { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + .5rem); margin: 0; padding: .4rem; list-style: none; max-height: min(28rem, 60vh); overflow-y: auto;
    border-radius: 1.2rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line), 0 18px 44px -18px rgba(0, 0, 0, .5); }
.sg li { margin: 0; }
.sg a { display: grid; grid-template-columns: 2.1rem minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; padding: .6rem .7rem; border-radius: .85rem; color: var(--ink); text-decoration: none; }
.sg [aria-selected="true"] a, .sg a:hover { background: var(--tint); }
.sg [aria-selected="true"] a { box-shadow: inset 3px 0 0 var(--accent); }
.sg-ic { grid-row: 1 / 3; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--tint); color: var(--accent-text); }
.sg [aria-selected="true"] .sg-ic, .sg a:hover .sg-ic { background: var(--accent); color: var(--accent-ink); }
.sg-ic .ico { width: 1.05rem; height: 1.05rem; }
.sg-t { min-width: 0; font-weight: 800; font-size: 1rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-t .tag-major { font-size: .66rem; padding: .18em .5em; }
.sg-s { grid-column: 2; min-width: 0; font-size: .82rem; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-f { grid-row: 1 / 3; grid-column: 3; font-size: .8rem; font-weight: 700; color: var(--ink2); white-space: nowrap; text-align: right; }
.sg mark { background: none; color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sg-h { padding: .5rem .8rem .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.sg-none { padding: .9rem 1rem; color: var(--ink2); font-size: .95rem; }
.sg-more { padding: .45rem .8rem .3rem; font-size: .78rem; color: var(--ink2); }
@media (max-width: 640px) {
    .home { padding-top: 1.2rem; min-height: calc(100vh - 11rem); }
    .find-field input { height: 3.3rem; font-size: 16px; }
    .sg a { grid-template-columns: 1.9rem minmax(0, 1fr); }
    .sg-ic { width: 1.9rem; height: 1.9rem; }
    .sg-f { grid-row: auto; grid-column: 2; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .find-field { transition: none; } }

/* ---------- Profil : une page, des rubriques (composants lv-*), des sous-pages ---------- */
/* ordinateur : deux colonnes — plans et traces à gauche, indices et réglages à droite ; téléphone : l'ordre de la page */
@media (min-width: 900px) {
    .pf-cols { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: 1.6rem; align-items: start;
        grid-template-areas: "plans idx" "plans reg" "traces reg"; grid-template-rows: auto auto 1fr; }
    .pf-cols > .pf-a-idx { grid-area: idx; } .pf-cols > .pf-a-plans { grid-area: plans; }
    .pf-cols > .pf-a-traces { grid-area: traces; } .pf-cols > .pf-a-reg { grid-area: reg; }
}
.pf-idx { display: flex; align-items: center; gap: 1.4rem; }
.pf-idx div span { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.pf-idx div b { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: var(--accent-text); }
.pf-idx details { margin-left: auto; }
.pf-idx summary { list-style: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 999px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.pf-idx summary::-webkit-details-marker { display: none; }
.pf-idx summary svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-edit { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.pf-id { margin-top: .4rem; font-size: 1.5rem; font-weight: 800; color: var(--accent-text); letter-spacing: -.01em; }
.pf-year { margin: 1.2rem 0 .45rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: var(--ink2); }
details.pf-old { margin-top: .6rem; }
details.pf-old > summary { display: flex; align-items: center; justify-content: space-between; min-height: 3rem; padding: 0 1rem; border-radius: 1.1rem;
    background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-weight: 800; cursor: pointer; list-style: none; }
details.pf-old > summary::-webkit-details-marker { display: none; }
details.pf-old > summary span { color: var(--ink2); font-weight: 700; font-size: .88rem; }
details.pf-old[open] > summary { margin-bottom: .45rem; }
.pf-res .rk { flex: none; text-align: right; }
.pf-res .rk b { display: block; font-size: 1.05rem; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.pf-res .rk span { font-size: .78rem; color: var(--ink2); }
.pf-res .dnf b { color: var(--ink2); }
.pf-pals { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: .9rem; font-size: .88rem; color: var(--ink2); }
.pf-del { margin-top: 1rem; }
.pf-forget { margin-top: 1rem; text-align: center; }
.pf-del form { margin-top: .8rem; max-width: 22rem; }
.pf-del p { font-size: .9rem; }

/* ---------- Traces : l'éditeur (ma-trace.php, le même rendu que la simulation) et « Nouvelle trace » (trace-new.php) ---------- */
.te-saved { font-size: .85rem; color: var(--ink2); }
.te-saved.err { color: var(--err); font-weight: 700; }
.te-save[disabled] { opacity: .45; cursor: default; }
.te-save[disabled]:hover { border-color: var(--line); }
/* En-tête : le nom (modifiable), la date */
.te-top { text-align: center; margin: .8rem 0 1.1rem; }
.te-name { display: block; width: min(100%, 46rem); margin: .35rem auto 0; padding: .1rem .5rem; border: 1px dashed transparent; border-radius: .7rem; background: transparent;
    color: var(--accent-text); font-size: clamp(1.7rem, 4.4vw, 2.6rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.15; text-align: center; }
.te-name:hover { border-color: var(--line); }
.te-name:focus { outline: none; border-style: solid; border-color: var(--accent); background: var(--card); }
.te-when { margin-top: .2rem; color: var(--ink2); font-size: .95rem; }
/* La feuille : bandeau et carte côte à côte, puis profil, puis points */
.te-sheet { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-areas: "hero map" "prof prof" "pts pts"; }
.te-card { background: var(--card); border-radius: 1.1rem; padding: 1.1rem 1.2rem; }
.te-hero { grid-area: hero; position: relative; overflow: hidden; display: flex; flex-direction: column; border-radius: 1.4rem; padding: 1.4rem 1.5rem 1.3rem;
    background: var(--hero-a); color: var(--hero-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hero-ink) 14%, transparent); }
.te-hero .kicker { color: inherit; opacity: .85; }
.te-hero-k { display: flex; flex-wrap: wrap; gap: .45rem .6rem; align-items: center; }
.te-pill { display: inline-flex; align-items: center; gap: .4em; padding: .25em .75em; border-radius: 999px; background: var(--third); color: var(--third-ink); font-size: .78rem; font-weight: 800; }
.te-pill .dot { width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.te-pill.wait { background: color-mix(in srgb, var(--hero-ink) 16%, transparent); color: var(--hero-ink); }
.te-pill.wait .dot { animation: te-pulse 1.2s ease-in-out infinite; }
.te-pill.raw { background: color-mix(in srgb, var(--hero-ink) 16%, transparent); color: var(--hero-ink); }
@keyframes te-pulse { 50% { opacity: .2; } }
.te-hero-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .2rem 1.8rem; }
.te-big { font-size: clamp(3.4rem, 8vw, 5.2rem); font-weight: 800; letter-spacing: -.035em; line-height: 1; margin: .12em 0 .06em; }
.te-big small { font-size: .5em; font-weight: 700; opacity: .8; margin-left: .08em; }
.te-hero-dz { padding-bottom: .7rem; }
.te-hero-dz .kicker { display: block; }
.te-hero-dz b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--hero-accent); }
.te-hero-dz small { display: block; font-size: .85rem; font-weight: 600; opacity: .92; margin-top: .15em; }
.te-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem 1.3rem; margin-top: 1.2rem; }
.te-facts .kicker { display: block; font-size: .66rem; }
.te-facts b { display: block; font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; color: var(--hero-accent); }
.te-facts small { display: block; font-size: .78rem; opacity: .9; }
.te-start { display: block; margin-top: 1.1rem; }
.te-start .kicker { display: block; font-size: .66rem; margin-bottom: .3rem; }
.te-start input { width: 100%; max-width: 17rem; padding: .5rem .7rem; border: 1px solid color-mix(in srgb, var(--hero-ink) 30%, transparent); border-radius: .7rem;
    background: color-mix(in srgb, var(--hero-ink) 10%, transparent); color: var(--hero-ink); font-size: 1rem; font-weight: 700; color-scheme: dark; }
html[data-theme="dark"] .te-start input { color-scheme: dark; }
.te-start input:focus { outline: 2px solid var(--hero-accent); outline-offset: 1px; }
.te-start small { display: block; margin-top: .3rem; font-size: .76rem; opacity: .85; }
.te-plan { margin-top: auto; padding-top: 1.2rem; display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; justify-content: space-between; }
.te-plan-last .kicker { display: block; font-size: .66rem; }
.te-plan-last b { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.te-plan-last span { font-size: .85rem; opacity: .9; margin-left: .4em; }
.te-plan-last span.first { margin: 0; }
.te-go { display: inline-flex; align-items: center; gap: .5em; padding: .75em 1.2em; border: 0; border-radius: 999px; background: var(--hero-accent); color: var(--hero-a);
    font-size: 1rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.te-go:hover { filter: brightness(1.06); }
.te-go:focus-visible { outline: 3px solid var(--hero-ink); outline-offset: 2px; }
.te-mapcard { grid-area: map; position: relative; overflow: hidden; padding: 0; border-radius: 1.4rem; background: var(--tint); min-height: 27rem; }
#te-map { position: absolute; inset: 0; background: var(--tint); }
/* Profil */
.te-prof { grid-area: prof; position: relative; padding: .8rem 1rem .5rem; }
.te-card-h { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .3rem; }
.te-card-h h2 { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--accent-text); }
.te-card-h .muted { font-size: .82rem; color: var(--ink2); }
.te-switch { display: inline-flex; align-items: center; gap: .45em; padding: .35em .8em; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
    font-size: .82rem; font-weight: 700; cursor: pointer; }
.te-switch[aria-pressed="true"] { background: var(--third); border-color: var(--third); color: var(--third-ink); }
.te-switch i { width: 1.6em; height: .55em; border-radius: .3em; background: linear-gradient(90deg, var(--second), var(--ink2), var(--accent)); }
.te-prof canvas { display: block; width: 100%; height: 210px; touch-action: pan-y; cursor: crosshair; }
.te-prof canvas.drag { cursor: ew-resize; }
.te-tip { position: absolute; top: 3.2rem; pointer-events: none; padding: .3rem .55rem; border-radius: .6rem; background: var(--ink); color: var(--card);
    font-size: .78rem; font-weight: 700; white-space: nowrap; transform: translateX(-50%); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.te-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; padding: .2rem .2rem 0; font-size: .76rem; color: var(--ink2); }
.te-legend i { display: inline-block; width: 1.2rem; height: .5rem; margin-right: .3rem; border-radius: .2rem; vertical-align: .05rem; }
.te-credit { padding: .3rem .2rem 0; font-size: .7rem; color: var(--ink2); }
/* Les points de passage : le tableau de la simulation, sans les temps */
.te-pts { grid-area: pts; --cols: 3em minmax(10em, 1fr) 14.5em 15.5em 2.4em; --segbg: color-mix(in srgb, var(--ink) 6%, transparent); }
.te-pts .te-card-h { margin-bottom: .6rem; }
.te-thead, .te-row { display: grid; grid-template-columns: var(--cols); column-gap: .9em; align-items: center; }
.te-thead { align-items: end; border-bottom: 2px solid var(--accent); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.te-thead > div { padding-bottom: .55rem; font-size: .7rem; }
.te-thead .th-seg { padding-top: .55rem; text-align: center; background: var(--segbg); border-radius: .5em .5em 0 0; align-self: stretch; }
.te-row { min-height: 3.6em; border-top: 1px solid var(--line); }
.te-thead + .te-rows > .te-row:first-child { border-top: 0; }
.te-row.hl { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.te-badge { display: grid; justify-items: center; gap: .15em; padding: .4em 0; }
.bdg { width: 2.2em; height: 2.2em; border-radius: 50%; display: grid; place-items: center; font-size: .82em; font-weight: 800; background: var(--third); color: var(--third-ink);
    border: 1.5px solid color-mix(in srgb, var(--ink) 28%, transparent); }
.te-row.aid .bdg { background: var(--second); border-color: var(--second); color: var(--second-ink, var(--card)); }
.te-row.fixed .bdg { background: var(--hero-a); border-color: var(--hero-a); color: var(--hero-ink); }
.te-row.hl .bdg { box-shadow: 0 0 0 3px var(--accent); }
.te-badge small { font-size: .72em; font-weight: 700; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.te-nm input { width: 100%; min-width: 0; padding: .35em .5em; margin-left: -.5em; border: 1px solid transparent; border-radius: .55em; background: transparent; color: var(--ink);
    font-size: 1rem; font-weight: 700; }
.te-nm input:hover { border-color: var(--line); }
.te-nm input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.te-seg { align-self: stretch; display: grid; grid-template-columns: 4.3em 4.6em 4.6em; column-gap: .5em; justify-content: end; align-items: center; padding: 0 .7em;
    background: var(--segbg); text-align: right; font-size: .9em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.te-seg small { font-size: .82em; color: var(--ink2); }
.te-rows > .te-row:last-child .te-seg { border-radius: 0 0 .5em .5em; }
.te-seg.lab > span { font-size: .8em; font-weight: 800; color: var(--ink); }
.te-type { display: inline-flex; padding: .18em; border-radius: 999px; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.te-type button { padding: .35em .75em; border: 0; border-radius: 999px; background: transparent; color: var(--ink2); font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.te-type button[aria-pressed="true"] { background: var(--third); color: var(--third-ink); }
.te-type button[data-type="ravito"][aria-pressed="true"], .te-type button[data-type="bdv"][aria-pressed="true"] { background: var(--second); color: var(--second-ink, var(--card)); }
.te-type button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.te-del { width: 2.2em; height: 2.2em; border: 0; border-radius: 50%; background: transparent; color: var(--ink2); cursor: pointer; font-size: .95rem; }
.te-del:hover { background: var(--tint); color: var(--err); }
.te-pts-foot { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-top: .9rem; }
.te-pts-foot .muted { font-size: .8rem; color: var(--ink2); }
.te-end { display: flex; flex-direction: column; align-items: center; gap: .9rem; margin: 1.6rem 0 .5rem; }
.te-end .btn-main { padding: .8em 1.4em; font-size: 1.05rem; font-weight: 800; }
.te-del-trace button { padding: 0; border: 0; background: none; color: var(--ink2); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; }
.te-del-trace button:hover { color: var(--err); }
/* Carte : marqueurs, infobulles, commandes (couleurs de la palette) */
.te-wp { display: grid !important; place-items: center; border-radius: 50%; background: var(--third); color: var(--third-ink); font: 800 12px/1 system-ui, sans-serif;
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ink) 35%, transparent), 0 0 0 3.5px var(--card), 0 2px 6px rgba(0, 0, 0, .35); cursor: grab; }
.te-wp.aid { background: var(--second); color: var(--second-ink, var(--card)); }
.te-wp.fixed { background: var(--hero-a); color: var(--hero-ink); cursor: default; }
.te-wp.hl { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--accent); }
.te-hover { border-radius: 50%; background: var(--card); box-shadow: 0 0 0 3px var(--ink), 0 1px 4px rgba(0, 0, 0, .4); }
.te-km { color: var(--ink); font: 700 10px/1 system-ui, sans-serif; text-shadow: 0 0 2px var(--card), 0 0 2px var(--card), 0 0 3px var(--card); white-space: nowrap; }
.leaflet-tooltip.te-tt { padding: .25rem .5rem; border: 0; border-radius: .5rem; background: var(--ink); color: var(--card); font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.leaflet-tooltip.te-tt::before { display: none; }
.te-coords { padding: .2rem .5rem; border-radius: .4rem; background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--ink); font: 600 11px/1.3 system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.leaflet-bar a.te-ctl { display: grid; place-items: center; font-size: 15px; }
.leaflet-container { font-family: inherit; }
.leaflet-container:fullscreen { height: 100% !important; }
.leaflet-top, .leaflet-bottom { z-index: 500; }
/* Écran moyen : bandeau au-dessus de la carte */
@media (max-width: 980px) {
    .te-sheet { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "map" "prof" "pts"; }
    .te-mapcard { min-height: 0; height: 60vh; max-height: 560px; }
    .te-pts { --cols: 3em minmax(8em, 1fr) 14.5em 2.4em; }
    .te-thead .th-type { display: none; }
    .te-row .te-type-c { grid-column: 2 / 4; padding-bottom: .55em; }
    .te-row .te-del-c { grid-row: 1; grid-column: 4; }
}
/* Téléphone : barre en icônes, tableau en deux lignes par point */
@media (max-width: 640px) {
    .te-saved { display: none; }
    .te-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .te-hero { padding: 1.2rem 1.15rem 1.1rem; }
    .te-pts { --cols: 2.6em minmax(0, 1fr) 2.2em; }
    .te-thead .th-seg, .te-thead .th-seg-l { display: none; }
    .te-row .te-seg { grid-column: 2 / 3; grid-row: 2; justify-content: start; background: none; padding: 0 0 .2em; font-size: .82em; text-align: left; grid-template-columns: auto auto auto; column-gap: .9em; }
    .te-row .te-type-c { grid-column: 2 / 4; grid-row: 3; }
    .te-row .te-del-c { grid-row: 1; grid-column: 3; }
    .te-row .te-badge { grid-row: 1 / 4; align-self: start; }
    .te-row .te-seg.lab { display: none; }
}
@media (max-width: 400px) {
    .te-prof canvas { height: 170px; }
    .te-card { padding: .9rem .9rem; }
}
/* « Nouvelle trace » */
.nt { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; max-width: 62rem; margin: 0 auto; }
.nt-card { padding: 1.3rem 1.4rem 1.4rem; border-radius: 1.4rem; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.nt-drop { position: relative; display: grid; place-items: center; gap: .35rem; min-height: 11.5rem; padding: 1.4rem 1rem; margin-bottom: 1rem; border: 2px dashed var(--line);
    border-radius: 1.1rem; background: var(--tint); text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.nt-drop:hover, .nt-drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--tint)); }
.nt-drop:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.nt-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.nt-drop .ico { width: 2.4rem; height: 2.4rem; color: var(--accent-text); }
.nt-drop b { font-size: 1.1rem; }
.nt-drop small { color: var(--ink2); }
.nt-drop.has { border-style: solid; border-color: var(--accent); }
.nt-drop .nt-file { font-weight: 800; color: var(--ink); word-break: break-all; }
.nt-prog { height: .55rem; margin: .2rem 0 .8rem; border-radius: 1rem; background: var(--tint); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.nt-prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.nt-state { min-height: 1.3em; margin: 0 0 .8rem; font-size: .9rem; color: var(--ink2); }
.nt-go { width: 100%; justify-content: center; padding: .9em 1.2em !important; font-size: 1.05rem !important; font-weight: 800 !important; }
.nt-go[disabled] { opacity: .6; cursor: progress; }
.nt-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: .95rem; }
.nt-steps li { position: relative; padding-left: 2.6rem; counter-increment: s; }
.nt-steps li::before { content: counter(s); position: absolute; left: 0; top: -.1rem; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
    background: var(--third); color: var(--third-ink); font-weight: 800; font-size: .9rem; }
.nt-steps b { display: block; }
.nt-steps span { font-size: .88rem; color: var(--ink2); }
.nt-note { margin: 1.2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink2); }
@media (max-width: 760px) { .nt { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Plan pour la montre (plan.php) ---------- */
.pl-watches { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr)); gap: .6rem; margin: .2rem 0 1.1rem; }
.pl-w { position: relative; display: block; cursor: pointer; }
.pl-w input { position: absolute; opacity: 0; width: 0; height: 0; }
.pl-w span { display: block; padding: .85em .5em; border-radius: 1rem; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); text-align: center; font-weight: 800; }
.pl-w:hover span { box-shadow: inset 0 0 0 2px var(--accent); }
.pl-w input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.pl-w input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.pl-info { display: none; margin: 0 0 1rem; padding: 1rem 1.1rem .9rem; border-radius: 1rem; background: var(--tint); }
.pl-info.on { display: block; }
.pl-info p { margin: 0 0 .6rem; }
.pl-acts { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 .3rem; }
.pl-opt { display: flex; gap: .55rem; align-items: flex-start; margin: 0 0 1.1rem; }
.pl-opt input { margin-top: .3em; }
.pl-hint { font-size: .88rem; }

/* ---------- Story animée (story-video.php) ---------- */
.sv { display: flex; gap: 1.6rem 2rem; align-items: flex-start; }
.sv > div:last-child { flex: 1; min-width: 0; }
.sv-stage { flex: none; position: relative; width: min(100%, calc(72vh * 9 / 16)); aspect-ratio: 9 / 16; border-radius: 1.2rem; overflow: hidden; background: var(--hero-a); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .6); }
.sv-stage canvas, .sv-stage video { display: block; width: 100%; height: 100%; }
.sv-stage [hidden] { display: none; }
.sv-bar { position: absolute; left: 8%; right: 8%; bottom: 1.1%; height: .4rem; /* sous la pastille « lievre.app » */ border-radius: 1rem; background: color-mix(in srgb, var(--hero-ink) 25%, transparent); overflow: hidden; }
.sv-bar::after { content: ""; display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--hero-ink); }
.sv-acts { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 .4rem; }
.sv-acts [hidden] { display: none; }
.sv-acts { margin-top: 0; justify-content: center; }
.sv-side { text-align: center; } /* les boutons centrés, le message et le retour avec eux */
/* l'indicateur d'attente du bouton, pendant que la vidéo se fabrique */
.sv-spin { display: none; flex: none; width: 1em; height: 1em; border: .18em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sv-spin .8s linear infinite; }
.js-sv-make[aria-busy="true"] .sv-spin { display: inline-block; }
.js-sv-make[aria-busy="true"] { cursor: progress; opacity: 1; }
@keyframes sv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sv-spin { animation-duration: 2.4s; } }
.sv-note { min-height: 1.5em; }
/* le libellé du bouton selon l'appareil : partager (téléphone, tablette), télécharger (ordinateur, souris) —
   la même règle que le script (story-video.js, DESKTOP) */
.sv-lbl-dl { display: none; }
@media (hover: hover) and (pointer: fine) { .sv-lbl-share { display: none; } .sv-lbl-dl { display: inline; } }
@media (max-width: 760px) { .sv { flex-direction: column; align-items: center; } .sv > div:last-child { width: 100%; } .sv-stage { width: min(100%, calc(64vh * 9 / 16)); } }

/* ---------- Administration : admin.php, courses.php ---------- */
.adm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin: .6rem 0 1.2rem; }
.adm-stats > div { padding: .8rem 1rem; border-radius: 1rem; background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.adm-stats b { display: block; font-size: 1.7rem; font-weight: 800; color: var(--accent-text); line-height: 1.1; }
.adm-stats span { font-size: .8rem; color: var(--ink2); }
.adm-scroll { overflow-x: auto; }
.adm-table { min-width: 44rem; }
.adm-table.adm-wide { min-width: 50rem; }
.adm-table.adm-narrow { min-width: 34rem; }
.adm-table td { font-size: .92rem; }
.adm-table .act { white-space: nowrap; }
.adm-table .act .btn + .btn, .adm-table .act .btn + form { margin-left: .4rem; }
.adm-table .adm-org th { text-align: left; background: var(--tint); font-size: 1rem; padding-top: .9rem; }
.adm-cur td { background: var(--tint); }
.adm-tag { display: inline-block; padding: .05em .5em; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; vertical-align: .1em; }
.adm-pal { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.4rem; }
.adm-pal > div:last-child { width: 100%; margin-top: .4rem; }
.adm-pal-it { display: inline-flex; align-items: center; gap: .5em; padding: .3em .7em .3em .5em; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-size: .85rem; font-weight: 600; }
.adm-pal-it.off { opacity: .45; }
.adm-pal-it input { margin: 0; accent-color: var(--accent); }
.adm-pal-it label { display: inline-flex; align-items: center; gap: .3em; cursor: pointer; }
.adm-pal-def { font-weight: 500; color: var(--ink2); font-size: .8rem; }
.adm-pal-it:has(input[type=radio]:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.adm-pal-it .sw { width: 2.3em; height: 1.25em; }
.adm-user { max-width: 36rem; margin-bottom: 1.4rem; }
.adm-checks { display: grid; gap: .4rem; margin: 0 0 1rem; font-size: .92rem; }
.adm-checks input { margin-right: .4em; accent-color: var(--accent); }
.adm-ok { color: var(--ok); font-weight: 700; }
.adm-wait { color: var(--err); font-weight: 700; }
@media (max-width: 719px) { .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adm-vis { text-align: center; }
.adm-vis input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); cursor: pointer; }
.adm-off td { opacity: .55; }
.adm-off .adm-vis { opacity: 1; }
.adm .adm-note { margin: .8rem 0 0; font-size: .88rem; }
.adm .adm-save { margin: .8rem 0 0; }

/* ---------- Atelier des palettes (atelier.php, js/atelier.js) : l'outil, sous l'en-tête commun, dans les 1024 px ----------
   Tout est rangé sous .atl (ses noms de classes sont courts : .col, .var, .tokens…) ; ses couleurs sont celles de la
   palette de l'écran, comme le reste du site. */
.wrap.atl-wrap { padding-bottom: 1rem; }
.atl { display: grid; grid-template-columns: 400px minmax(0, 1fr); height: calc(100vh - 6.5rem); min-height: 34rem; border-radius: 1.1rem; overflow: hidden;
    background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.atl .side { overflow-y: auto; border-right: 1px solid var(--line); padding: 18px 18px 40px; }
.atl .view { display: flex; flex-direction: column; min-width: 0; }
.atl h1 { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.atl h2 { margin: 22px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.atl p { margin: 0 0 8px; }
.atl .small { font-size: 12px; }
.atl-row { display: flex; gap: 8px; align-items: center; }
.atl-row.mt { margin-top: 6px; }
.atl-row select { flex: 1; }
.atl .btn { font-size: 14px; }
.atl .btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.atl-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.atl-seg button { border: 0; background: none; padding: 6px 11px; cursor: pointer; font-weight: 600; }
.atl-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.atl select, .atl input[type="text"] { padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.atl .field { display: grid; gap: 4px; margin: 8px 0; }
.atl .field > span { font-size: 12px; font-weight: 600; color: var(--ink2); }
.atl .alert { padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--err) 12%, var(--card)); color: var(--err); font-weight: 600; margin: 8px 0; }
.atl .note { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--third) 28%, var(--card)); color: var(--ink); font-size: 12.5px; margin: 0 0 8px; }
/* Les quatre couleurs */
.atl .colors { display: grid; gap: 8px; }
.atl .col { display: grid; grid-template-columns: 42px 92px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 10px; }
.atl .col input[type="color"] { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.atl .col input[type="text"] { width: 92px; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.atl .role b { display: block; font-size: 13px; }
.atl .role span { display: block; font-size: 12px; color: var(--ink2); line-height: 1.3; }
/* Nuances et variantes */
.atl .shades { display: grid; grid-template-columns: 92px repeat(7, minmax(0, 1fr)); gap: 4px; align-items: center; margin-bottom: 6px; }
.atl .shades > span { font-size: 12px; font-weight: 600; }
.atl-chip { height: 30px; border-radius: 6px; border: 1px solid rgba(128, 128, 128, .3); cursor: pointer; padding: 0; }
.atl-chip.cur { outline: 2px solid var(--ink); outline-offset: 1px; }
.atl-chip:hover { transform: translateY(-1px); }
.atl .variants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.atl .var { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); cursor: pointer; text-align: left; }
.atl .var:hover { border-color: var(--accent); }
.atl .var-mock { position: relative; height: 74px; padding: 8px; }
.atl .var-hero { height: 40px; border-radius: 7px; padding: 5px 8px; display: flex; align-items: baseline; gap: 6px; }
.atl .var-hero b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.atl .var-hero i { font-style: normal; font-weight: 800; font-size: 12px; }
.atl .var-foot { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.atl .var-foot .bd { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.atl .var-foot .bar { flex: 1; height: 5px; border-radius: 3px; }
.atl .var-foot .tx { font-size: 11px; font-weight: 800; }
.atl .var-name { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; font-size: 12px; font-weight: 700; border-top: 1px solid var(--line); }
.atl .var-name span { display: inline-flex; width: 52px; height: 12px; border-radius: 3px; overflow: hidden; }
.atl .var-name span i { flex: 1; }
/* Les variables */
.atl .tokens { width: 100%; border-collapse: collapse; }
.atl .tokens th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); padding: 12px 0 4px; }
.atl .tokens td { padding: 4px 4px 4px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.atl .tokens td.atl-swc { width: 36px; }
.atl .tokens tr.tk:hover td { background: var(--tint); }
.atl-sw { position: relative; display: block; width: 30px; height: 26px; border-radius: 6px; border: 1px solid rgba(128, 128, 128, .35); overflow: hidden; }
.atl-sw input { position: absolute; inset: -6px; width: 44px; height: 40px; opacity: 0; cursor: pointer; }
.atl .tk code { font-size: 12px; }
.atl .tk .use { display: block; font-size: 11.5px; color: var(--ink2); line-height: 1.25; }
.atl .tk .val { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; white-space: nowrap; }
.atl .ov { color: var(--accent-text); font-weight: 700; }
.atl .reset { border: 0; background: none; color: var(--ink2); cursor: pointer; padding: 0 2px; font-size: 13px; }
.atl .ck { display: inline-block; min-width: 46px; text-align: center; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.atl .ck.ok { background: color-mix(in srgb, var(--ok) 14%, var(--card)); color: var(--ok); }
.atl .ck.bad { background: color-mix(in srgb, var(--err) 12%, var(--card)); color: var(--err); }
.atl textarea { width: 100%; min-height: 150px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: 12px/1.45 ui-monospace, Consolas, monospace; background: var(--bg); color: var(--ink); }
/* L'aperçu */
.atl .tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.atl .tools label { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.atl .stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: color-mix(in srgb, var(--ink) 12%, var(--bg)); }
.atl .device { position: absolute; left: 50%; top: 14px; transform-origin: 50% 0; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); background: var(--card); }
.atl .device iframe { display: block; width: 100%; height: 100%; border: 0; }
.atl .wait { position: absolute; inset: 0; display: none; place-items: center; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--bg) 70%, transparent); }
.atl .wait.on { display: grid; }
@media (max-width: 1000px) { .atl { grid-template-columns: minmax(0, 1fr); height: auto; } .atl .side { border-right: 0; border-bottom: 1px solid var(--line); } .atl .view { height: 92vh; } }
