/*
 * cotes.css — page /cotes-pmu/ (cotes gagnant du jour). cf. docs/CDC_COTES.md §6.8.
 * Layer : modules. Réutilise course-day.css (chips/panels) + arrivees.css (bandeau
 * date, mini-calendrier, .h-scroll-*) ; ici = spécifique cotes (shell, RaceHeader,
 * cycle de vie, tableau, sidebar). Tokens existants ; BEM ; responsive desktop→mobile.
 *
 * B.1 : nav + course active + tableau (provider par défaut). B.2 onglets · B.3
 * courbe SVG (remplace .cotes-chart-placeholder) · B.4 polling live.
 */
@layer modules {

  /* Colonne unique : le contenu occupe toute la largeur de .main-col ; le rail
     droit (pubs + bookmakers) est fourni par le layout global (right-col.php).
     La page n'a PAS sa propre sidebar (sinon 3 colonnes = doublon du rail). */
  .cotes-shell {
    --cotes-accent: var(--palette-green-600);
    --cotes-accent-soft: var(--palette-green-100d);
    --cotes-down: var(--color-success);
    --cotes-up: var(--color-red);
  }

  .cotes-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
  }

  /* Layout : géométrie JUMELLE de la page arrivées (arrivees.css,
     .layout-arrivees : colonne 1fr + rail 300px, column-gap 10px, container
     mobile 100% - 8px). Sans ça la page suit le layout générique (rail 320px,
     gap 16px) et la carte « saute » de 26px en passant cotes ↔ résultats. */
  .layout.layout-cotes { column-gap: 10px; }
  .layout.layout-cotes.container { width: min(1120px, calc(100% - 24px)); }
  @media (min-width: 1200px) {
    .layout.layout-cotes { grid-template-columns: minmax(0, 1fr) 300px; }
  }
  @media (max-width: 768px) {
    .layout.layout-cotes.container { width: calc(100% - 8px); }
  }

  /* ---- Rayons discrets (retour Xavier, alignés sur la home) -------------------
     Le token --radius global vaut 16px (app.css, legacy) : la home « à peine
     arrondie » obtient ses 6px par surcharges composant par composant dans son
     CSS de thème (hippique.home.css). La page cotes n'a pas de déclinaison
     thème → mêmes 6px, scopés ici : cartes ET composants partagés réutilisés
     (chips course-day, pastilles courses, bandeau date arrivées, flèches de
     défilement). Pills/badges ronds (--radius-full) non concernés ; overlays
     (datepicker, popup VIP) gardent leur rayon propre. */
  .layout-cotes .card { border-radius: 6px; }
  .layout-cotes .course-day-tab-chip { border-radius: 6px; }
  .layout-cotes .course-day-tabs-arrow,
  .layout-cotes .scroll-btn { border-radius: 6px; }
  .layout-cotes .course-hero-pill { --course-hero-pill-radius: 6px; }
  .layout-cotes .arrivees-date-pill,
  .layout-cotes .arrivees-today-pill,
  .layout-cotes .arrivees-date-arrow,
  .layout-cotes .arrivees-cal-icon-btn,
  .layout-cotes .ah-cal-card { border-radius: 6px; }

  /* ---- En-tête + bandeau date ------------------------------------------------ */
  .cotes-page { padding: 14px; }

  .cotes-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
  }

  /* Typo IDENTIQUE à .arrivees-title / .arrivees-intro (thème hippique) :
     même vert, même corps, même interligne → le H1, l'intro et tout ce qui
     suit tombent PILE aux mêmes Y sur les deux pages du duo. */
  .cotes-title {
    margin: 0;
    font-size: var(--font-size-base);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #166b3c; /* vert maquette, aligné .arrivees-title (hippique.arrivees.css) */
  }

  .cotes-intro {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.35;
    color: var(--muted);
  }

  /* Le bandeau date reprend .arrivees-toolbar (arrivees.css) ; ce wrapper ne fait
     qu'aligner en haut à droite. Le thème hippique pousse .arrivees-toolbar de
     12px (margin-top) : on le neutralise ici — l'espace vertical sous l'intro
     est déjà donné par le gap de .cotes-header (12px, aligné sur arrivées).
     Spécificité 0,3,0 > 0,2,0 thème, insensible à l'ordre de chargement. */
  /* width 100% : étire la toolbar (flex-item wrappé) sur toute la ligne pour
     que la grille interne (pavé date / AUJOURD'HUI) tombe PILE comme sur la
     page arrivées — sinon elle se réduit à son contenu (-54px) et les pilules
     ne sont plus au même endroit d'une page à l'autre. */
  .cotes-toolbar { margin: 0; width: 100%; }
  .cotes-header .arrivees-toolbar.cotes-toolbar { margin-top: 0; }
  /* Sous le header sticky (retour Xavier mobile : le bandeau passait DEVANT le
     header en défilant) : .arrivees-toolbar porte z-index 90 pour que son popup
     calendrier couvre le contenu, mais le header est à --z-sticky 80 → 70 ici.
     Le popup (z-index 120 DANS ce contexte) couvre toujours chips et cartes, et
     l'ensemble glisse désormais SOUS le header au scroll. */
  .arrivees-toolbar.cotes-toolbar { z-index: 70; }

  /* ---- Navigation réunion / course — composants PARTAGÉS --------------------
     Réunions = .course-day-tab-chip (course-day.css / arrivees.css) ; courses =
     .course-hero-pill (race-shared.css), comme les autres pages du site. On ne
     garde ici que le strictement spécifique cotes. */
  .cotes-nav--reunions { margin-top: 12px; }
  .cotes-nav--courses { margin-top: 8px; }
  /* Rangée de courses d'une réunion NON active = masquée. [hidden] doit gagner sur
     .h-scroll-wrap{display:grid} (app.css) : OK car @layer modules est déclaré APRÈS
     @layer legacy (l'ordre des layers tranche ; la spécificité 0,2,0 n'est qu'un renfort). */
  [data-cotes-course-row][hidden] { display: none; }
  /* Course sans cotes : pilule atténuée — SAUF la course active (la pilule
     sélectionnée, dorée, ne doit jamais être grisée). */
  .course-hero-pill.cotes-pill--nocotes:not(.is-active) { opacity: 0.5; }

  /* ---- Infobulle nom de course (data-tooltip, CSS dans race-shared.css) -------
     Spécificité cotes : contrairement aux pages courses, la rangée C1…Cn DÉFILE
     (.h-scroll-track, overflow auto) → la bulle au-dessus de la pilule serait
     rognée par le scrollport. On réserve sa hauteur DANS le rail (padding-top)
     compensée par une marge négative (pilules visuellement inchangées) ; la bande
     transparente ainsi créée au-dessus laisse passer les clics vers les chips
     réunion (pointer-events none sur le rail, rétabli sur les pilules — la
     scrollbar est déjà masquée, cf. app.css .h-scroll-track). Même media query
     que l'infobulle (desktop ≥768px). Bulles de la 1re/dernière pilule alignées
     au bord (une bulle centrée déborderait du scrollport au repos → rognée). */
  @media (min-width: 768px) {
    .cotes-courses-row .h-scroll-track {
      padding-top: 34px;
      margin-top: -34px;
      pointer-events: none;
    }
    .cotes-courses-row .h-scroll-track > * { pointer-events: auto; }
    .cotes-courses-row .course-hero-pill[data-tooltip]:first-child::after {
      left: 0;
      transform: none;
    }
    .cotes-courses-row .course-hero-pill[data-tooltip]:last-child::after {
      left: auto;
      right: 0;
      transform: none;
    }
  }

  /* ---- RaceHeader ------------------------------------------------------------ */
  /* Wrapper swappé (switch/polling) : tableau + carte « Les plus joués » — même
     rythme vertical que .cotes-main entre les deux cartes. */
  .cotes-active-wrap { display: flex; flex-direction: column; gap: 16px; }
  .cotes-active-wrap.is-switching { opacity: 0.55; pointer-events: none; transition: opacity 0.12s ease; }
  .cotes-race { padding: 0; overflow: hidden; }

  .cotes-chart-card { padding: 0; overflow: hidden; }
  /* Carte TABLEAU des partants à part (mêmes contraintes : table bord à bord). */
  .cotes-table-card { padding: 0; overflow: hidden; }
  .cotes-table-panel[hidden] { display: none; }
  /* Fil de commentaires : même feedback pendant le rechargement au switch (cotes.js). */
  .cotes-comments.is-switching { opacity: 0.55; pointer-events: none; transition: opacity 0.12s ease; }

  .cotes-race-head {
    display: flex;
    /* nowrap OBLIGATOIRE : avec wrap, un nom de prix long envoyait tout l'encart
       « Cotes en direct » + compte à rebours SOUS le titre au lieu de laisser
       l'ellipsis du nom faire son travail (vu R1C8 Clairefontaine 26/08). */
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
  }

  .cotes-race-ident { min-width: 0; max-width: 100%; flex: 1 1 auto; } /* borné à l'en-tête → le nom tronque dedans */

  .cotes-race-title {
    margin: 0;
    display: flex;
    flex-wrap: nowrap;   /* une seule ligne : le nom tronque au lieu de passer à la ligne */
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    font-size: 15px;
    line-height: 1.25;
  }
  /* Préfixe (R/C, hippodrome, badge) : largeur fixe, ne rétrécit jamais — seul le nom tronque. */
  .cotes-race-rc,
  .cotes-race-hippo,
  .cotes-race-sep,
  .cotes-race-quinte { flex: 0 0 auto; }
  .cotes-race-rc { font-weight: 800; color: var(--cotes-accent); }
  .cotes-race-hippo { font-weight: 800; color: var(--text); }
  .cotes-race-sep { color: var(--muted); font-weight: 400; }  /* séparateur « | » entre R/C, hippodrome, nom */
  .cotes-race-quinte {
    font-size: 0.73em; /* relatif au h2 (11px à 15px) : suit la réduction mobile (cotesFitRaceTitle) */
    font-weight: 800;
    color: #fff;
    background: var(--color-danger); /* Quinté+ = rouge partout (chips nav, pastilles course) */
    border-radius: 6px;
    padding: 1px 6px;
  }
  /* P5 = même jaune vif + texte rouge que la pastille du coin d'onglet (course-hero-pill-corner.is-p5). */
  .cotes-race-pick5 { background: var(--palette-yellow-600); color: var(--palette-red-600i); }
  /* Nom du prix : MÊME taille que R/C + hippodrome (15px), une seule ligne tronquée « … » si trop
     long (jamais de retour ligne). Le texte COMPLET reste dans le DOM (Google) + en title au survol. */
  .cotes-race-name {
    font-weight: 600;
    color: var(--text);
    font-size: inherit;  /* = h2 (15px) ; relatif pour suivre la réduction mobile (cotesFitRaceTitle) */
    flex: 0 1 auto;      /* taille = contenu ; rétrécit + tronque si la ligne déborde */
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  /* Maillage : hippodrome → réunion, nom → fiche course. Iso-visuel au repos,
     souligné au survol (les couleurs restent celles des .cotes-race-* ci-dessus). */
  a.cotes-race-hippo,
  a.cotes-race-name { text-decoration: none; }
  a.cotes-race-hippo:hover,
  a.cotes-race-name:hover { text-decoration: underline; }
  .cotes-race-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

  /* ---- Onglet Cotes de la page course (10/10/2026) ------------------------------
     Le même bloc, version onglet ($cotesEmbed dans cotes-race.php) : l'en-tête de
     course cède la place au titre « COTES PMU » avec « Toutes les cotes du jour › »
     à droite (styles dans course-onglets.css, chargée aussi quand il n'y a aucune
     cote) ; l'état de la course passe dessous, à gauche, à toutes les largeurs. */
  /* La colonne de la page course est une grille : sans ça, la légende et le
     tableau l'élargissaient (676 px de large sur un téléphone de 390). Depuis le
     29/10/2026 l'enfant de la grille est le panneau qui l'entoure : il porte le
     même min-width (race-shared.css). */
  .cotes-onglet { min-width: 0; }
  .cotes-race-head--onglet { flex-direction: column; align-items: stretch; gap: 10px; }
  @media (min-width: 961px) {
    .cotes-race-head--onglet .cotes-lifecycle { align-items: flex-start; text-align: left; }
  }

  /* ---- Encart cycle de vie --------------------------------------------------- */
  .cotes-lifecycle {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
    flex-shrink: 0;
  }
  .cotes-life-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
  }
  .cotes-life-badge.is-live { color: var(--cotes-down); }
  .cotes-life-badge.is-cancelled { color: var(--color-danger); }
  /* LE ROND EST POUR LES COTES EN DIRECT (état `upcoming`), ET POUR ELLES SEULES. L'état
     `finished` — celui dont le libellé est « COURSE TERMINÉE » — posait ici un ✓ : le rond peint
     son fond en currentColor et la coche héritait de la même couleur, elle était donc invisible
     — et trop grande pour 9 px, elle sortait du cercle par le haut. À l'écran, ce n'était plus un
     rond mais une goutte avec un ergot. Cet état porte désormais la coche du jeu d'icônes du site
     (ui_icon('check'), partials/blocks/cotes-race.php).
     ⚠️ NE PAS CONFONDRE avec « Cotes arrêtées à HH:MM » : ça, c'est le préfixe de l'HEURE
     (.cotes-life-sub, la ligne du dessous), et il s'affiche pour les TROIS états figés — course
     terminée, annulée et en cours. Seul `finished` porte la coche ; `cancelled` et `running`
     n'ont aucune marque, et c'était déjà le cas avant. Les libellés sont dans
     app/modules/programme/cotes.php (le match sur $state). */
  .cotes-life-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
  }
  .cotes-life-badge.is-live .cotes-life-dot { animation: cotes-pulse 1.6s ease-in-out infinite; }
  @keyframes cotes-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
  .cotes-lifecycle--finished .cotes-life-badge { color: var(--cotes-accent); }
  .cotes-life-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

  .cotes-life-countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--cotes-accent-soft);
  }
  .cotes-life-countdown-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
  .cotes-life-countdown-value { font-size: 15px; font-weight: 800; color: var(--cotes-accent); font-variant-numeric: tabular-nums; }

  /* ---- Arrivée officielle (état FINISHED) ----------------------------------- */
  .cotes-arrivee {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
  }
  .cotes-arrivee-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
  .cotes-arrivee-value { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: 0.06em; }
  /* Arrivée connue = lien vers la fiche course (onglet résultat/rapports par défaut). */
  a.cotes-arrivee--link { text-decoration: none; color: inherit; cursor: pointer; }
  a.cotes-arrivee--link:hover .cotes-arrivee-value { text-decoration: underline; }
  /* Provisoire (avant officialisation) : libellé rouge, parité /arrivees-rapports-pmu/. */
  .cotes-arrivee--provisional .cotes-arrivee-label { color: var(--color-danger); }

  /* ---- Onglets providers ----------------------------------------------------- */
  /* Barre : onglets (tablist, scroll interne) à gauche + toggle Direct à droite. */
  /* Sélecteur de book en PILULES autonomes (choix Xavier — option A) : depuis la
     séparation des cartes réorganisables, l'effet « classeur » (coins hauts +
     bordure basse) promettait un panneau collé dessous qui n'existe plus. Les
     pilules assument le rôle de filtre GLOBAL des cartes qui suivent, comme le
     Direct (déjà une pilule) sur la même ligne. */
  .cotes-tabsbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 12px;
  }
  .cotes-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1 1 auto;
    min-width: 0;
  }
  .cotes-tabs::-webkit-scrollbar { display: none; }
  .cotes-tabsbar > .cotes-live { flex: 0 0 auto; } /* rangée centrée : plus de bordure à caler */
  .cotes-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-full); /* pilule (option A) — même famille que le Direct à droite */
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  }
  /* :not(.is-active) sur le hover COULEUR : sans lui, le sticky hover mobile
     (l'état :hover persiste après le tap) repeignait le texte de la pilule
     ACTIVE en noir sur vert — illisible (retour Xavier iPhone). */
  .cotes-tab:hover:not(.is-disabled):not(.is-active) { border-color: var(--color-border-strong); }
  .cotes-tab:hover:not(.is-disabled):not(.is-active) { color: var(--text); }
  .cotes-tab.is-active {
    background: var(--cotes-accent);
    border-color: var(--cotes-accent);
    color: #fff;
  }
  .cotes-tab.is-disabled { opacity: 0.55; cursor: not-allowed; }
  /* Libellé jumeau : complet en desktop, court ≤640px (cf. bloc mobile — les 3
     onglets doivent tenir sur la largeur sans déborder, demande Xavier). */
  .cotes-tab-label-short { display: none; }
  .cotes-tab-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 1px 5px;
  }
  .cotes-provider-panel[hidden] { display: none; }

  /* ---- Courbe SVG (B.3) ----------------------------------------------------- */
  .cotes-chart { position: relative; padding: 2px 14px 4px; } /* titre porté par la barre de carte */
  .cotes-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end; /* plus que les plages (titre → .cotes-card-bar) */
    gap: 8px;
    margin-bottom: 8px;
  }
  .cotes-chart-ranges { display: inline-flex; gap: 4px; }
  .cotes-range {
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }
  .cotes-range.is-active { background: var(--cotes-accent); border-color: var(--cotes-accent); color: #fff; }

  .cotes-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-bottom: 8px;
  }
  .cotes-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
  }
  .cotes-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lg, var(--muted));
    flex-shrink: 0;
  }
  .cotes-legend-name { font-weight: 800; color: var(--text); }
  .cotes-legend-val { color: var(--muted); font-variant-numeric: tabular-nums; }
  .cotes-legend-var { font-weight: 700; }
  .cotes-legend-var.is-down { color: var(--cotes-down); }
  .cotes-legend-var.is-up { color: var(--cotes-up); }

  .cotes-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 680 / 260;
    overflow: visible;
  }
  .cotes-chart-grid { stroke: var(--line); stroke-width: 1; }
  .cotes-chart-axis { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
  .cotes-chart-depart { stroke: var(--color-border-strong); stroke-width: 1.5; stroke-dasharray: 3 3; }
  .cotes-chart-depart-label { fill: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.04em; }
  /* Course à venir : zone future (après « maintenant ») grisée + trait « Maintenant ». */
  .cotes-chart-future { fill: var(--muted); opacity: 0.07; }
  .cotes-chart-now { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.7; }
  .cotes-chart-now-label { fill: var(--muted); font-size: 9px; font-weight: 700; }
  .cotes-chart-line { stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
  .cotes-chart-serie[hidden] { display: none; }
  .cotes-chart-pt { opacity: 0.9; transition: r 0.1s ease; }
  .cotes-chart-pt:hover { r: 4; }
  .cotes-chart-empty {
    margin: 0 0 8px;
    padding: 28px 14px;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    border: 1px dashed var(--color-border-strong);
    border-radius: 6px;
    background: var(--surface-soft);
  }
  .cotes-legend-item[hidden],
  .cotes-chart-serie[hidden] { display: none; }

  /* Tooltip courbe (positionné en JS, relatif à .cotes-chart). */
  /* Pastilles « Suivre » : MOBILE only (le bloc ≤640px les affiche) — en desktop
     les étoiles du tableau font le travail, pas de doublon. */
  .cotes-follow-pills { display: none; }

  .cotes-chart-tooltip {
    position: absolute;
    z-index: 5;
    transform: translate(-50%, -120%);
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--text);
    color: var(--surface);
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  }
  .cotes-chart-tooltip[hidden] { display: none; }
  .cotes-chart-tooltip strong { display: block; font-weight: 800; }
  .cotes-chart-tooltip span { opacity: 0.85; font-variant-numeric: tabular-nums; }

  /* ---- Graphe réservé aux abonnés (gate) ------------------------------------
     Décor = les composants de la vraie courbe (chart-head/ranges, legend, svg
     680/260) floutés + voile, overlay centré par-dessus (titre + CTA boutique +
     lien connexion). overflow hidden : le blur ne bave pas hors de la carte.
     rgba en dur = même précédent que .cotes-vip-backdrop. */
  .cotes-gate {
    position: relative;
    padding: 2px 14px 4px; /* géométrie jumelle de .cotes-chart : pas de saut au déverrouillage VIP */
    overflow: hidden;
  }
  .cotes-gate-decor {
    filter: blur(5px) saturate(0.9);
    pointer-events: none;
    user-select: none;
  }
  .cotes-gate-veil {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
  }
  .cotes-gate-ov {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
  }
  .cotes-gate-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
  }
  .cotes-gate-text {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
  }
  .cotes-gate-cta {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 26px;
    border-radius: 10px; /* rayon jumeau du CTA de la popup VIP */
    background: var(--color-danger);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
  }
  .cotes-gate-login {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: var(--muted);
  }
  .cotes-gate-login a {
    color: var(--muted);
    font-weight: 600;
    text-decoration: underline;
  }
  .cotes-gate-cta:focus-visible,
  .cotes-gate-login a:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
  }
  @media (max-width: 640px) {
    .cotes-gate-title { font-size: 15.5px; }
    .cotes-gate-text { font-size: 12px; }
    .cotes-gate-cta { margin-top: 12px; padding: 10px 20px; font-size: 13.5px; }
    .cotes-gate-login { margin-top: 9px; font-size: 11.5px; }
  }

  /* ---- Étoile « suivre » (colonne tableau) ---------------------------------- */
  .cotes-th-star { width: 30px; }
  .cotes-td-star { text-align: center; }
  .cotes-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: none;
    background: none;
    color: var(--color-border-strong);
    cursor: pointer;
    line-height: 0;
  }
  .cotes-star svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
  .cotes-star:hover { color: var(--star, var(--cotes-accent)); }
  .cotes-star.is-active { color: var(--star, var(--cotes-accent)); }
  .cotes-star.is-active svg { fill: currentColor; stroke: currentColor; }
  .cotes-star:disabled { opacity: 0.3; cursor: not-allowed; }

  /* ---- Focus clavier visible (convention site : --color-focus-ring) --------- */
  .cotes-tab:focus-visible,
  .cotes-range:focus-visible,
  .cotes-star:focus-visible,
  .cotes-bet:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
  }

  /* ---- Tableau partants ------------------------------------------------------ */
  .cotes-nodata { margin: 14px; font-size: 13px; color: var(--muted); }

  .cotes-table-wrap { overflow-x: auto; }

  .cotes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .cotes-table thead th {
    background: var(--cotes-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: left;
    padding: 8px 10px;
    white-space: nowrap;
  }
  /* En-têtes triables : le bouton hérite du style du th ; clic = tri, flèche indicatrice. */
  .cotes-sort {
    appearance: none; -webkit-appearance: none;
    background: none; border: 0; padding: 0; margin: 0;
    font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
    cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  }
  .cotes-sort::after { content: "↕"; font-size: 9px; opacity: 0.45; }
  th[aria-sort="ascending"] .cotes-sort::after { content: "↑"; opacity: 1; }
  th[aria-sort="descending"] .cotes-sort::after { content: "↓"; opacity: 1; }
  .cotes-sort:hover { text-decoration: underline; }
  .cotes-th-num { width: 34px; text-align: center !important; }
  .cotes-th-casaque { width: 40px; }
  .cotes-th-cote, .cotes-th-var { text-align: right !important; }
  .cotes-th-trend { width: 120px; }
  .cotes-th-action { width: 84px; }

  .cotes-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
  }
  .cotes-row:nth-child(even) td { background: var(--surface-soft); }
  .cotes-row.is-np td { opacity: 0.6; }

  .cotes-td-num { text-align: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
  .cotes-casaque { display: block; width: 30px; height: 24px; object-fit: contain; }

  .cotes-td-cheval { min-width: 160px; }
  /* Nom du cheval = lien souligné en PERMANENCE, sans effet au survol (demande Xavier). */
  .cotes-horse { font-weight: 700; color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
  .cotes-row.is-np .cotes-horse { text-decoration: line-through; }
  .cotes-driver { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
  .cotes-np-badge {
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    background: var(--color-danger);
    border-radius: 5px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
  }

  .cotes-td-cote {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .cotes-td-matin { color: var(--muted); }
  .cotes-td-actu { color: var(--text); }
  .cotes-td-actu.is-down { color: var(--cotes-down); }
  .cotes-td-actu.is-up { color: var(--cotes-up); }

  .cotes-td-var {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--muted);
  }
  .cotes-td-var.is-down { color: var(--cotes-down); }
  .cotes-td-var.is-up { color: var(--cotes-up); }

  .cotes-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
  }
  .cotes-trend--down { color: var(--cotes-down); }
  .cotes-trend--up { color: var(--cotes-up); }
  .cotes-trend--stable, .cotes-trend--none { color: var(--muted); }
  .cotes-trend-arrow { font-size: 13px; line-height: 1; }

  .cotes-bet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    background: var(--color-red);
    color: #fff;
    border: 1px solid var(--color-red);
    white-space: nowrap;
  }
  .cotes-bet:hover { filter: brightness(0.95); }
  .cotes-bet.is-closed {
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
    font-weight: 700;
    cursor: default;
  }

  .cotes-table-foot { margin: 10px 14px 14px; font-size: 12px; color: var(--muted); }
  .cotes-legend-mobile, .cotes-bet-mobile { display: none; } /* affichés en mobile uniquement */

  /* ---- « Les plus joués » (carte À PART sous le tableau) ----------------------
     Un bloc .cotes-top PAR provider (data-cotes-panel → suit l'onglet du book via
     initCotesTabs), dans le wrapper swappé (switch + polling) sans JS dédié.
     Rangée = grille rang / casaque / n°+nom (lien fiche cheval _blank) / barre /
     part / cote ; barres relatives au favori (bar_pct serveur). Rendu FIN
     (retour Xavier) : rangées basses, casaque 24px, rang en texte, barres 5px ;
     zébrage discret + favori surligné (accent soft). */
  .cotes-top-card { padding: 0; overflow: hidden; } /* titre/sous-titre → barre de carte */
  .cotes-top-card .cotes-card-body { padding: 0 14px 10px; }
  .cotes-top-empty { margin: 0; font-size: 12px; color: var(--muted); }
  .cotes-top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .cotes-top-row {
    display: grid; grid-template-columns: 18px 24px minmax(0, 1fr) 110px 48px 38px;
    gap: 8px; align-items: center; font-size: 13px;
    padding: 3px 8px; border-radius: 6px;
  }
  .cotes-top-row:nth-child(odd) { background: var(--surface-soft); }
  .cotes-top-row.is-fav { background: var(--cotes-accent-soft); }
  .cotes-top-rank { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
  .cotes-top-row.is-fav .cotes-top-rank { color: var(--cotes-accent); }
  .cotes-top-casaque { display: block; width: 24px; height: 19px; object-fit: contain; }
  .cotes-top-horse { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
  .cotes-top-num { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; min-width: 17px; }
  .cotes-top-horse-link {
    font-weight: 700; color: var(--text); text-decoration: underline; text-underline-offset: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  a.cotes-top-horse-link:hover { color: var(--cotes-accent); }
  .cotes-top-bar { height: 5px; border-radius: 3px; background: var(--surface-soft); overflow: hidden; }
  .cotes-top-row:nth-child(odd) .cotes-top-bar, .cotes-top-row.is-fav .cotes-top-bar { background: var(--surface); }
  .cotes-top-bar-fill { display: block; height: 100%; background: var(--cotes-accent); border-radius: 3px; }
  .cotes-top-share { text-align: right; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .cotes-top-cote { text-align: right; color: var(--muted); font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
  /* Rangées 6+ repliées : [hidden] doit gagner sur display:grid (même pattern que
     [data-cotes-course-row][hidden], le style UA seul perdrait à l'ordre). */
  .cotes-top-row[hidden] { display: none; }
  .cotes-top-more {
    display: block; width: 100%; margin-top: 6px; padding: 7px 10px;
    background: none; border: 1px dashed var(--line); border-radius: 6px;
    color: var(--cotes-accent); font-size: 12px; font-weight: 700; cursor: pointer;
  }
  .cotes-top-more:hover { background: var(--surface-soft); }
  .cotes-top-more[hidden] { display: none; }

  .cotes-empty { padding: 18px; }

  /* ---- Bouton « Direct » (live réservé VIP) --------------------------------- */
  .cotes-live {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface-soft); border: 1px solid var(--line);
    border-radius: 999px; padding: 4px 8px 4px 10px; cursor: pointer;
    font: inherit; color: var(--text); font-size: 12px; font-weight: 600;
  }
  .cotes-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
  .cotes-live.is-live .cotes-live-dot { background: var(--color-success, #16a34a); animation: cotesLivePulse 1.1s ease-in-out infinite; }
  @keyframes cotesLivePulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
  .cotes-live-vip {
    display: inline-flex; align-items: center; gap: 2px;
    background: var(--palette-yellow-600); color: var(--palette-red-600i);
    border-radius: 999px; padding: 1px 5px; font-size: 10px; font-weight: 800;
  }
  .cotes-live-sw { position: relative; width: 30px; height: 16px; border-radius: 999px; background: var(--line); flex: 0 0 auto; transition: background .16s; }
  .cotes-live-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .16s; }
  .cotes-live.is-live .cotes-live-sw { background: var(--color-success, #16a34a); }
  .cotes-live.is-live .cotes-live-sw::after { transform: translateX(14px); }

  /* ---- Popup d'abonnement VIP ----------------------------------------------- */
  .cotes-vip-modal[hidden] { display: none; }
  .cotes-vip-modal { position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 16px; } /* = teaser d'accès VIP (au-dessus des overlays front) */
  .cotes-vip-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
  .cotes-vip-card { position: relative; background: var(--surface); border-radius: 14px; padding: 26px 24px; max-width: 360px; text-align: center; border: 1px solid var(--line); }
  .cotes-vip-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--palette-yellow-600); color: var(--palette-red-600i); margin-bottom: 12px; }
  .cotes-vip-title { font-size: 18px; font-weight: 800; margin: 0 0 8px; color: var(--text); }
  .cotes-vip-text { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 20px; }
  .cotes-vip-cta { display: block; background: var(--color-danger); color: #fff; border-radius: 10px; padding: 13px; font-size: 15px; font-weight: 800; text-decoration: none; }
  .cotes-vip-later { display: block; width: 100%; background: none; border: 0; color: var(--muted); padding: 10px; font-size: 14px; cursor: pointer; margin-top: 6px; }

  /* ---- Responsive ----------------------------------------------------------- */
  @media (max-width: 960px) {
    .cotes-lifecycle { align-items: flex-start; text-align: left; }
    .cotes-race-head { flex-direction: column; }
  }

  @media (max-width: 640px) {
    /* colonne : nowrap + stretch → enfants pleine largeur, le texte rewrappe
       (flex-wrap hérité sabote stretch en multi-colonnes → rognage <360px). */
    .cotes-header { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }

    /* Cycle de vie mobile : badge « Cotes en direct » + « Mis à jour » à GAUCHE (empilés), compte
       à rebours aligné à DROITE sur la même ligne (grid 2 col, countdown sur les 2 rangées, centré). */
    .cotes-lifecycle {
      display: grid;
      grid-template-columns: 1fr auto;
      grid-template-areas: "badge countdown" "sub countdown";
      align-items: center;
      column-gap: 10px;
      row-gap: 2px;
      width: 100%;
      text-align: left;
    }
    .cotes-life-badge     { grid-area: badge; }
    .cotes-life-sub       { grid-area: sub; }
    .cotes-life-countdown { grid-area: countdown; justify-self: end; align-self: center; margin-top: 0; }

    /* Tableau mobile : VRAIE table compacte (maquette). Colonnes réduites à N° + casaque,
       Cheval/Jockey, Matin, Actuelle, Écart (pastille colorée + flèche tendance). Les colonnes
       Star / Tendance / Parier-par-ligne sont masquées → Parier = 1 bouton course + légende. */
    .cotes-table-wrap { overflow-x: visible; }
    .cotes-table { font-size: 12.5px; width: 100%; table-layout: fixed; } /* fixed = largeurs maîtrisées, jamais de débordement */
    .cotes-table thead { display: table-header-group; }
    .cotes-th-star, .cotes-td-star,
    .cotes-th-trend, .cotes-td-trend,
    .cotes-th-action, .cotes-td-action { display: none; }
    .cotes-table thead th { padding: 6px 3px; font-size: 9px; letter-spacing: 0; white-space: normal; } /* en-tête peut passer à la ligne */
    .cotes-table tbody td { padding: 7px 3px; vertical-align: middle; border-bottom: 1px solid var(--line); }
    .cotes-th-num { width: 18px; } .cotes-td-num { padding-left: 3px; text-align: center !important; }
    .cotes-th-casaque { width: 28px; } .cotes-td-casaque { padding: 0 2px; }
    .cotes-td-casaque .cotes-casaque { width: 26px; height: 21px; display: block; }
    .cotes-td-cheval { white-space: normal; line-height: 1.15; overflow: hidden; }
    .cotes-horse { font-size: 12px; }
    .cotes-driver { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
    /* Répartition (retour Xavier : MATIN/FINALE/VARIATION se chevauchaient
       pendant que la colonne cheval avait du mou) : colonnes numériques élargies
       — les en-têtes + flèche de tri et la pill « +1991 % » tiennent — la
       colonne cheval absorbe la différence (les noms longs passent sur 2
       lignes, prévu). Tri compacté : gap et glyphe réduits. */
    .cotes-th-cote { width: 50px; } .cotes-th-var { width: 72px; }
    .cotes-sort { gap: 2px; }
    .cotes-sort::after { font-size: 8px; }
    /* Glyphe ↕ passif masqué en mobile : « ACTUELLE ⇅ » débordait encore de sa
       colonne — le tap sur l'en-tête reste l'affordance, ↑/↓ apparaît une fois trié. */
    .cotes-table th[aria-sort="none"] .cotes-sort::after { display: none; }

    /* Pastilles « Afficher la courbe » sous le graphe (design Xavier) : visibles
       en MOBILE seulement — desktop garde les étoiles (.cotes-follow-pills reste
       display:none hors de ce media). Libellé (avec la limite de 5) sur SA
       ligne, puis UNE rangée de pastilles qui défile au doigt (nowrap, scrollbar
       masquée) ; le fondu à droite (.has-more, togglé par cotes.js) laisse la
       dernière pastille « un peu floue » = il y a une suite à swiper. Active =
       fond à la couleur de SA courbe (--star). NP/intraçable = inerte barrée. */
    .cotes-follow-pills { display: block; padding: 8px 2px 2px; }
    .cotes-follow-pills-label {
      display: block; margin-bottom: 6px;
      font-size: 10px; font-weight: 700; color: var(--muted);
      white-space: nowrap; /* tient à 320px en 10px — sinon retirer « simultanément » */
    }
    .cotes-follow-scroll { position: relative; }
    .cotes-follow-scroll::after {
      content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 34px;
      background: linear-gradient(to right, transparent, var(--surface));
      opacity: 0; transition: opacity 0.15s ease; pointer-events: none;
    }
    .cotes-follow-scroll.has-more::after { opacity: 1; }
    .cotes-follow-pills-track {
      display: flex; align-items: center; gap: 6px;
      overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .cotes-follow-pills-track::-webkit-scrollbar { display: none; }
    .cotes-follow-pill {
      flex: none;
      display: inline-flex; align-items: center; justify-content: center;
      min-width: 30px; height: 30px; padding: 0 4px;
      border: 1px solid var(--line); border-radius: var(--radius-full);
      background: var(--surface); color: var(--muted);
      font: inherit; font-size: 12px; font-weight: 800;
      font-variant-numeric: tabular-nums; cursor: pointer;
    }
    .cotes-follow-pill.is-active { background: var(--star); border-color: var(--star); color: #fff; }
    .cotes-follow-pill.is-np { text-decoration: line-through; opacity: 0.4; cursor: default; }
    /* Limite (5) atteinte : applyFollow passe les pastilles non suivies en
       disabled — grisées, le libellé au-dessus donne la règle. */
    .cotes-follow-pill[disabled] { opacity: 0.35; cursor: default; }
    .cotes-td-cote, .cotes-td-var { text-align: right; white-space: nowrap; }
    .cotes-td-cote { font-weight: 700; }
    /* Écart = pastille colorée (hausse=rouge, baisse=vert) + flèche tendance. */
    .cotes-var-pill {
      display: inline-block; padding: 2px 5px; border-radius: 999px;
      font-weight: 700; font-size: 10px; color: #fff; background: var(--muted);
    }
    .cotes-td-var.is-up::after, .cotes-td-var.is-down::after { font-size: 11px; margin-left: 1px; }
    .cotes-td-var.is-up .cotes-var-pill { background: var(--color-danger); }
    .cotes-td-var.is-down .cotes-var-pill { background: var(--color-success, #16a34a); }
    .cotes-td-var.is-up::after { content: " ↗"; color: var(--color-danger); font-weight: 700; }
    .cotes-td-var.is-down::after { content: " ↘"; color: var(--color-success, #16a34a); font-weight: 700; }
    /* Légende des colonnes + Parier course unique (mobile). */
    .cotes-legend-mobile { display: block; margin: 12px 2px 0; font-size: 11px; color: var(--muted); line-height: 1.6; }
    .cotes-bet-mobile {
      display: block; margin: 12px 0 4px; padding: 13px; text-align: center;
      background: var(--color-danger); color: #fff; font-weight: 800; font-size: 15px;
      border-radius: 6px; text-decoration: none;
    }
    /* « Les plus joués » : colonnes resserrées, casaque réduite (OK 320px). */
    .cotes-top-card .cotes-card-body { padding: 0 8px 8px; }
    /* Tableau des partants : MÊME retrait intérieur que « Les plus joués »
       (retour Xavier — les rangées allaient bord à bord de la carte). */
    .cotes-table-card .cotes-card-body { padding: 0 8px 8px; }
    .cotes-card-bar { padding: 8px 10px 6px; gap: 8px; }
    .cotes-card-title { font-size: 13px; }

    /* Onglets books : libellés COURTS (short_label du manifeste odds-providers) +
       compacité → les 3 onglets tiennent sur la largeur sans déborder (demande
       Xavier, vérifié 320/375). Le bouton Personnaliser est masqué en mobile —
       règle en FIN de section « Mode Personnaliser » (après son display:flex,
       même spécificité : l'ordre source tranche). */
    .cotes-tabsbar { padding: 6px 10px 10px; }
    .cotes-tabs { gap: 4px; }
    .cotes-tab { padding: 5px 10px; font-size: 11px; gap: 4px; }
    .cotes-tab-label-full { display: none; }
    .cotes-tab-label-short { display: inline; }
    /* Onglet grisé : le badge « Non disponible » prend trop de place en mobile —
       l'état grisé suffit (demande Xavier). Desktop : badge conservé. */
    .cotes-tab-badge { display: none; }
    /* Les 3 pilules sur UNE ligne sans toucher les bords (demande Xavier) : la
       taille est ajustée par cotesFitTabs (cotes.js) quand la rangée dépasse
       (libellés longs + Direct) ; palier .is-compact ensuite ; l'overflow-x de
       .cotes-tabs reste le filet ultime. */
    .cotes-tab.is-compact { padding-inline: 7px; gap: 3px; }
    /* Direct compacté : pastille « VIP » ET switch visuel masqués (l'état reste
       porté par le point — gris/vert pulsant — et aria-pressed ; l'exigence VIP
       par le title + la popup au clic). Sans ça, les 3 pilules en toutes lettres
       + Direct débordent de 375px. Bordure verte en plus quand le live est actif. */
    .cotes-live { padding: 4px 10px; font-size: 11px; gap: 5px; }
    .cotes-live-vip { display: none; }
    .cotes-live-sw { display: none; }
    .cotes-live.is-live { border-color: var(--color-success, #16a34a); color: var(--color-success, #16a34a); }

    /* H1 de la page : UNE ligne, jamais de retour (demande Xavier) — la taille est
       RÉDUITE par cotesFitPageTitle (cotes.js) pour tenir la largeur d'écran ;
       nowrap + ellipsis = filet sans JS ou sous le plancher de lisibilité. */
    .cotes-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* Bandeau date : pavé au CONTENU + le bouton AUJOURD'HUI prend le reste,
       écart fixe = fini le trou à gauche du bouton (retour Xavier). Le thème à
       jour fait déjà ça en mobile (hippique.arrivees.css:847 auto 1fr) — cette
       règle est la CEINTURE côté page : elle garantit le résultat même si un
       vieux hippique.arrivees.css (sans son bloc mobile) traîne en ligne, où la
       répartition 3fr 2fr (60/40) creusait ~40px de vide après le pavé.
       Même spécificité (0,2,0) que les règles [data-theme] du thème : cotes.css
       chargé en dernier tranche. Mobile seulement. */
    .arrivees-toolbar.cotes-toolbar { grid-template-columns: auto 1fr; gap: 10px; margin-left: 0; margin-right: 0; }

    /* Alignement GAUCHE unifié (retour Xavier) : fil d'Ariane, bandeau date et
       rails de chips calés sur le X du titre (= padding de la carte). Le
       composant breadcrumb apporte sinon son propre padding-inline (16px) et
       la toolbar un margin thème (10px). */
    .cotes-page .c-breadcrumb { padding-inline: 0; }

    /* Rails réunions/courses : au doigt on SWIPE — les flèches ‹ › réservaient
       32px de chaque côté (même désactivées : grid 32px 1fr 32px, app.css) et
       décalaient les chips du bord ; le wrapper réunions ajoutait un margin 8px.
       visibility (PAS display:none) : les flèches doivent GARDER leur cellule —
       sinon l'auto-placement met la piste dans la 1re colonne, large de 0px, et
       la rangée disparaît (bug vu en ligne le 18/07). visibility retire aussi
       les boutons du parcours clavier. Desktop inchangé. */
    .layout-cotes .h-scroll-wrap { grid-template-columns: 0 minmax(0, 1fr) 0; gap: 0; }
    .layout-cotes .scroll-btn { visibility: hidden; }
    .layout-cotes .cotes-nav--reunions { margin-left: 0; margin-right: 0; }

    /* Fil d'Ariane : UNE ligne, jamais de retour (demande Xavier) — le niveau du
       milieu (hippodrome R/C, le plus long) tronque en « … » ; Accueil et la page
       courante ne rétrécissent jamais. Scopé cotes : composant global intact. */
    .cotes-page .c-breadcrumb__list { flex-wrap: nowrap; }
    .cotes-page .c-breadcrumb__item:first-child,
    .cotes-page .c-breadcrumb__item:last-child { flex: none; }
    .cotes-page .c-breadcrumb__link { min-width: 0; }
    .cotes-page .c-breadcrumb__text,
    .cotes-page .c-breadcrumb__current {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }
    .cotes-top-row { grid-template-columns: 14px 20px minmax(0, 1fr) 44px 40px 28px; gap: 5px; font-size: 12px; padding: 3px 5px; }
    .cotes-top-rank { font-size: 10px; }
    .cotes-top-casaque { width: 20px; height: 16px; }
    .cotes-top-horse { gap: 4px; }
    .cotes-top-num { min-width: 14px; }
    .cotes-top-horse-link { font-size: 12px; }
    .cotes-top-bar { height: 4px; }
    .cotes-top-cote { font-size: 11px; }
  }

  /* ---- Mode « Personnaliser » : barres de carte + réorganisation -------------
     Barre commune des cartes réorganisables (courbe/tableau/« plus joués ») :
     poignée + titre + flèches + chevron. Poignée/flèches visibles UNIQUEMENT en
     mode édition (.is-editing sur le wrapper) ; chevron permanent (accordéon).
     L'ordre/repli est appliqué par JS (inline vue + cotes.js), ici que du style.
     Le groupe Personnaliser/Réinitialiser vit SUR la ligne des onglets, à droite
     (après le Direct) — .cotes-tabs (flex: 1) pousse le bloc en bout de ligne. */
  .cotes-tabsbar > .cotes-customize {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
  }
  .cotes-customize-btn,
  .cotes-customize-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }
  .cotes-customize-btn:hover,
  .cotes-customize-reset:hover { color: var(--text); border-color: var(--color-border-strong); }
  .cotes-customize-reset[hidden] { display: none; } /* le display:inline-flex battrait [hidden] */
  .is-editing .cotes-customize-btn {
    color: var(--cotes-accent);
    border-color: var(--cotes-accent);
    background: var(--cotes-accent-soft);
  }

  .cotes-card-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 8px;
    user-select: none;
  }
  .is-collapsed .cotes-card-bar { padding-bottom: 10px; } /* carte réduite à sa barre */
  .cotes-card-heading {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
  }
  .cotes-card-title { margin: 0; font-size: 14px; font-weight: 800; color: var(--text); }
  .cotes-card-sub { font-size: 11px; color: var(--muted); }

  .cotes-card-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    flex: none;
  }
  .cotes-card-chevron:hover { background: var(--surface-soft); color: var(--text); }
  .cotes-card-chevron svg { transition: transform 0.15s ease; }
  .is-collapsed .cotes-card-chevron svg { transform: rotate(-90deg); }

  .cotes-card-grip {
    display: none;
    color: var(--muted);
    cursor: grab;
    touch-action: none; /* le doigt DRAGUE la carte (jamais de scroll depuis la poignée) */
    flex: none;
    padding: 4px 2px;
  }
  .cotes-card-moves { display: none; gap: 4px; flex: none; }
  .cotes-card-move {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    flex: none;
  }
  .cotes-card-move:hover:not([disabled]) { color: var(--text); border-color: var(--color-border-strong); }
  .cotes-card-move[disabled] { opacity: 0.35; cursor: default; }
  .is-editing .cotes-card-grip { display: inline-flex; }
  .is-editing .cotes-card-moves { display: inline-flex; }
  .is-editing [data-cotes-block] { outline: 2px dashed var(--cotes-accent); outline-offset: -2px; }

  [data-cotes-block].is-dragging {
    position: relative;
    z-index: 5;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  }
  [data-cotes-block].is-dragging .cotes-card-grip { cursor: grabbing; }

  /* Personnalisation RETIRÉE en mobile (demande Xavier) : bouton masqué, ordre par
     défaut — l'inline de la vue et cotesLayoutApply ignorent l'ordre stocké sous ce
     MÊME seuil (640px) ; les chevrons replier/afficher restent actifs. APRÈS le
     display:flex de la section (même spécificité : l'ordre source tranche). */
  @media (max-width: 640px) {
    .cotes-tabsbar > .cotes-customize { display: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    .cotes-card-chevron svg { transition: none; }
  }

  /* ---- Cibles tactiles ≥44px (tactile uniquement : desktop souris inchangé) -- */
  @media (pointer: coarse) {
    .cotes-tab { min-height: 44px; }
    /* Plages 1h/3h/Journée : 44px les rendait très hauts — Xavier veut des
       boutons fins (moins de « marge » intérieure haut/bas). 32px reste tapable. */
    .cotes-range { min-height: 32px; padding-inline: 12px; }
    .cotes-star { min-height: 44px; min-width: 44px; padding: 10px; }
    .cotes-th-star { width: 44px; }
    .cotes-card-move, .cotes-card-chevron { min-height: 44px; min-width: 44px; }
    .cotes-card-grip { padding: 12px 8px; }
    .cotes-customize-btn, .cotes-customize-reset { min-height: 44px; padding-inline: 14px; }
  }

  /* ---------- Mobile : bord à bord, comme les pages /outils/ ----------
     Demande de Xavier (20/08/2026) : plus aucune marge EXTÉRIEURE autour des
     blocs sur téléphone. Le haut est déjà collé au header (arrivees.css:7).
     Restait une bande de gris À DROITE — mesurée à 8 px : la règle
     `max-width: 768px` en tête de ce fichier retire 8 px de largeur, et le
     `margin-left/right: 0` d'app.css:3564 (sous 980 px) les fait tous tomber
     du même côté au lieu de les répartir. Elle part ici, et les cartes perdent
     bordures latérales et rayons : sinon le gris reparaît dans les angles.

     Le `padding: 14px` des cartes est conservé — la marge devient intérieure.

     Bloc placé en FIN de fichier à dessein : `.layout-cotes .card` y vaut la
     même spécificité que la règle « rayons discrets » (6 px) plus haut, c'est
     donc l'ordre d'écriture qui tranche.

     ⚠️ /arrivees garde ses 4 px : la géométrie jumelle décrite en tête de
     fichier ne vaut plus sous 640 px.

     POINT DE BASCULE : 979 px — celui d'app.css:3564, la définition de
     « mobile » du site (même choix que outils.css). Il couvre donc aussi la
     bande 769-979 px, où `.layout.layout-cotes.container` (en tête de fichier)
     laissait 24 px de gris à droite. Desktop (≥ 1200 px) inchangé. */
  @media (max-width: 979px) {
    .layout.layout-cotes.container { width: 100%; }
    .layout-cotes .card {
      border-inline: 0;
      border-radius: 0;
    }
  }
}
