/*
 * fiche-cheval.css — Fiche cheval publique (/fiche-cheval/{slug}-{id})
 * Layer : modules
 * Design : maquettes Xavier 2026-08-10 (desktop + mobile responsive).
 * Préfixe BEM : fc-. Consomme les tokens (thème hippique via tokens re-teintés).
 * Chargé via extraCssFiles (app/modules/cheval/module.php).
 */

@layer modules {

  /* ==================================================================
   * Utilitaires responsive partagés (libellés desktop/mobile)
   * ================================================================== */
  .fc-lbl-mobile { display: none; }
  .fc-lbl-desktop { display: inline; }

  /* ==================================================================
   * En-tête fiche : identité, tuiles stats, musique
   * ================================================================== */
  .fc-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .fc-head .c-breadcrumb { margin: 0; }

  /* Respiration entre les grands blocs de la fiche (demande Xavier). */
  .fc-next,
  .fc-filters,
  .fc-races { margin-top: var(--space-3); }

  .fc-head-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
  }
  .fc-head-id {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    min-width: 0;
  }
  .fc-name {
    margin: 0;
    font-size: var(--font-size-2xl);
    line-height: var(--text-tight-height);
    font-weight: var(--font-weight-900);
    letter-spacing: 0.01em;
    color: var(--color-text);
  }
  /* Suffixe pays en exposant — mêmes valeurs que .partants-horse-suffix
     (race-shared.css, non chargé ici). */
  .fc-name-suffix {
    font-size: 0.62em;
    line-height: var(--text-tight-height);
    font-weight: var(--text-semibold-weight);
    color: var(--palette-green-800l);
    vertical-align: super;
    position: relative;
    top: -0.2em;
  }
  .fc-sex-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--color-danger-soft);
    color: var(--color-danger);
    font-size: var(--font-size-13);
    font-weight: var(--text-semibold-weight);
    white-space: nowrap;
  }
  .fc-sex-symbol { font-weight: var(--text-bold-weight); }

  .fc-stats {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .fc-stat {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas: "icon value" "label label";
    align-items: center;
    justify-items: center;
    column-gap: 8px;
    padding: 0 var(--space-5);
  }
  .fc-stat + .fc-stat { border-left: 1px solid var(--color-border); }
  .fc-stat:first-child { padding-left: 0; }
  .fc-stat:last-child { padding-right: 0; }
  .fc-stat-icon { grid-area: icon; display: inline-flex; }
  .fc-stat-icon svg { width: 22px; height: 22px; }
  .fc-stat-icon-courses { color: var(--color-text-muted); }
  .fc-stat-icon-wins { color: var(--color-brand); }
  .fc-stat-icon-places { color: var(--palette-orange-600); }
  .fc-stat-value {
    grid-area: value;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-800);
    color: var(--color-text);
    line-height: var(--text-tight-height);
  }
  .fc-stat-label {
    grid-area: label;
    font-size: var(--font-size-13);
    color: var(--color-text-muted);
  }

  .fc-head-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-6);
    margin: 0;
  }
  .fc-info-item { display: flex; gap: var(--space-2); min-width: 0; }
  .fc-info-item dt {
    font-weight: var(--text-bold-weight);
    color: var(--color-text);
    white-space: nowrap;
  }
  .fc-info-item dd {
    margin: 0;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
  }

  /* --- Musique en pastilles --- */
  .fc-music {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
  }
  .fc-music-label {
    font-weight: var(--text-bold-weight);
    color: var(--color-text);
  }
  .fc-music-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
  }
  /* Pastilles musique : mêmes tons que « Forme récente » du tableau des
     partants (.partants-form-badge, race-shared.css) — demande Xavier. */
  .fc-music-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 4px 8px;
    border-radius: 7px;
    background: var(--palette-blue-150l);
    border: 1px solid transparent;
    color: var(--palette-blue-600j);
    font-size: var(--font-size-11);
    font-weight: var(--text-bold-weight);
    line-height: var(--text-tight-height);
    text-transform: uppercase;
  }
  .fc-mp-win {
    background: var(--palette-green-700p);
    color: var(--color-text-inverse);
  }
  .fc-mp-place {
    background: var(--palette-blue-500f);
    color: var(--color-text-inverse);
  }
  .fc-mp-year {
    background: var(--color-surface);
    border: 1px dashed var(--palette-orange-500f);
    color: var(--palette-orange-700);
  }
  .fc-music-check {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }
  .fc-music-check:focus-visible ~ .fc-music-toggle {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }
  .fc-music-extra { display: none; }
  .fc-music-check:checked ~ .fc-music-pills .fc-music-extra { display: inline-flex; }
  .fc-music-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-brand);
    font-size: var(--font-size-sm);
    font-weight: var(--text-semibold-weight);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    margin-left: auto;
  }
  .fc-music-toggle:hover { color: var(--color-brand-hover); text-decoration: underline; }
  .fc-music-toggle:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }
  .fc-music-toggle-chevron { width: 15px; height: 15px; transition: transform var(--transition-interaction); }
  .fc-music-toggle-close { display: none; }
  .fc-music-check:checked ~ .fc-music-toggle .fc-music-toggle-open { display: none; }
  .fc-music-check:checked ~ .fc-music-toggle .fc-music-toggle-close { display: inline; }
  .fc-music-check:checked ~ .fc-music-toggle .fc-music-toggle-chevron { transform: rotate(90deg); }
  .fc-music-filtered { padding-top: var(--space-2); border-top: 1px dashed var(--color-border); }

  /* ==================================================================
   * Prochain départ
   * ================================================================== */
  /* Plus de barre verte à gauche (Xavier, 21/10/2026 : « la marque de
     fabrique de Claude Code ») — la carte garde son cadre normal. */
  .fc-next-inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
  }
  .fc-next-date {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface);
  }
  .fc-next-day {
    align-self: stretch;
    text-align: center;
    background: var(--color-brand);
    color: var(--color-text-inverse);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-800);
    padding: 2px 10px;
    line-height: var(--line-height-140);
  }
  .fc-next-month {
    font-size: var(--font-size-13);
    font-weight: var(--text-bold-weight);
    color: var(--color-text);
    padding-top: 4px;
  }
  .fc-next-year {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding-bottom: 5px;
  }
  .fc-next-main { flex: 1 1 260px; min-width: 0; display: grid; gap: var(--space-2); }
  /* h2 sémantique (SEO), rendu eyebrow inchangé (neutralise .card h2). */
  .fc-next-eyebrow {
    margin: 0;
    color: var(--color-brand);
    font-weight: var(--text-bold-weight);
    font-size: var(--font-size-sm);
    line-height: var(--text-ui-height);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .fc-next-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    font-size: var(--font-size-18);
    font-weight: var(--text-bold-weight);
    color: var(--color-text);
  }
  /* Nom de course trop long : « … » plutôt qu'un retour à la ligne
     (demande Xavier — l'intitulé complet reste dans le title). */
  .fc-next-title-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .fc-next-title .fc-quinte { margin-left: 0; flex: 0 0 auto; }
  /* Infobulle CSS au survol — même pattern que les chips C1/C2/C3 de la
     page partants (.course-hero-pill[data-tooltip], race-shared.css). */
  @media (min-width: 769px) {
    .fc-next-title[data-tooltip] { position: relative; }
    .fc-next-title[data-tooltip]::after {
      content: attr(data-tooltip);
      position: absolute;
      bottom: calc(100% + 6px);
      left: 0;
      background: var(--palette-gray-900f);
      color: var(--color-text-inverse);
      font-size: var(--font-size-11);
      font-weight: var(--text-regular-weight);
      width: max-content;
      max-width: min(480px, 70vw);
      white-space: normal;
      padding: 4px 8px;
      border-radius: 4px;
      pointer-events: none;
      opacity: 0;
      transition: opacity var(--transition-interaction);
      z-index: 10;
    }
    .fc-next-title[data-tooltip]:hover::after { opacity: 1; }
  }

  /* Rechargement AJAX (fiche-cheval.js) : sections estompées pendant le fetch */
  #fc-races[aria-busy="true"],
  #fc-filters[aria-busy="true"],
  #fc-musiques[aria-busy="true"] {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity var(--transition-interaction);
  }
  .fc-next-cta { flex: 0 0 auto; margin-left: auto; }

  .fc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--color-brand);
    color: var(--color-text-inverse);
    font-weight: var(--text-bold-weight);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: background var(--transition-interaction);
  }
  .fc-btn-primary:hover { background: var(--color-brand-hover); color: var(--color-text-inverse); }

  /* --- Chips (prochain départ + bandeaux courses mobile) --- */
  .fc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .fc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-13);
    font-weight: var(--text-semibold-weight);
    white-space: nowrap;
  }
  .fc-chip svg { width: 14px; height: 14px; color: var(--color-text-muted); }

  /* Quinté+ = ROUGE (le jaune est réservé au Pick 5 — demande Xavier). */
  .fc-quinte {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    background: var(--color-danger);
    color: var(--color-text-inverse);
    font-size: var(--font-size-xs);
    font-weight: var(--text-bold-weight);
    vertical-align: middle;
    white-space: nowrap;
  }

  /* ==================================================================
   * Filtres
   * ================================================================== */
  .fc-filters details > summary {
    list-style: none;
    cursor: pointer;
  }
  .fc-filters details > summary::-webkit-details-marker { display: none; }
  .fc-filters-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
  }
  .fc-filters-title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--text-bold-weight);
    font-size: var(--font-size-base);
    color: var(--color-text);
  }
  .fc-title-icon { display: inline-flex; color: var(--color-brand); }
  .fc-title-icon svg { width: 18px; height: 18px; }
  .fc-filters-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--color-brand);
    color: var(--color-text-inverse);
    font-size: var(--font-size-xs);
    font-weight: var(--text-bold-weight);
  }
  .fc-filters-hint {
    display: inline-flex;
    align-items: center;
    color: var(--color-brand);
    font-weight: var(--text-semibold-weight);
    font-size: var(--font-size-sm);
  }
  .fc-filters-chevron {
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    transition: transform var(--transition-interaction);
  }
  .fc-filters details[open] > .fc-filters-summary .fc-filters-chevron { transform: rotate(180deg); }

  .fc-filter-form { display: grid; gap: var(--space-4); padding-top: var(--space-4); }
  .fc-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3);
  }
  .fc-filter-field { display: grid; gap: 6px; min-width: 0; }
  .fc-filter-field > span {
    font-size: var(--font-size-13);
    font-weight: var(--text-semibold-weight);
    color: var(--color-text);
  }
  .fc-filter-field select {
    width: 100%;
    min-height: var(--form-control-min-height);
    padding: var(--form-padding-y) var(--form-padding-x);
    border: 1px solid var(--form-border-color);
    border-radius: var(--form-radius);
    background: var(--form-bg);
    color: var(--form-text-color);
    font-size: var(--font-size-sm);
  }
  .fc-filter-field select:hover { border-color: var(--form-border-hover-color); }
  .fc-filter-field select:focus-visible {
    outline: none;
    border-color: var(--form-border-focus-color);
    box-shadow: var(--form-focus-ring-shadow);
  }
  .fc-filter-field select:disabled {
    background: var(--form-bg-disabled);
    color: var(--form-text-disabled);
  }

  /* « Plus de filtres » : bascule mobile uniquement — en desktop tous les
     filtres sont visibles (demande Xavier) et le bouton est masqué. */
  .fc-adv-check {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }
  .fc-adv-btn { display: none; }
  .fc-adv-btn svg { width: 15px; height: 15px; color: var(--color-text-muted); }
  .fc-adv-less { display: none; }

  .fc-filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-4);
  }
  .fc-switches {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
  }
  .fc-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
  }
  .fc-switch.is-disabled { opacity: 0.45; cursor: default; }
  .fc-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }
  .fc-switch-track {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: var(--radius-full);
    background: var(--palette-slate-300);
    transition: background var(--transition-interaction);
    flex: 0 0 auto;
  }
  .fc-switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-interaction);
  }
  .fc-switch input:checked + .fc-switch-track { background: var(--color-brand); }
  .fc-switch input:checked + .fc-switch-track::after { transform: translateX(16px); }
  .fc-switch input:focus-visible + .fc-switch-track {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
  }
  .fc-switch-label {
    font-size: var(--font-size-sm);
    font-weight: var(--text-semibold-weight);
    color: var(--color-text);
  }
  .fc-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--text-semibold-weight);
    text-decoration: none;
  }
  .fc-filter-reset:hover { color: var(--color-text); text-decoration: underline; }
  .fc-filter-reset svg { width: 14px; height: 14px; }

  /* ==================================================================
   * Dernières courses — entête + onglets
   * ================================================================== */
  /* « Dernières courses » : un bloc blanc — titre + onglets en tête, puis
     une carte par course (Liste : bande verte ; Tableau : en-tête vert plein,
     Xavier 21/10/2026). */
  .card.fc-races {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
  .fc-races-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
  }
  /* h2 sémantique (SEO) au rendu identique au div d'origine : on neutralise
     les styles .card h2 d'app.css (32px, letter-spacing). */
  .fc-races-title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
    font-weight: var(--text-bold-weight);
    font-size: var(--font-size-base);
    line-height: var(--text-ui-height);
    letter-spacing: normal;
    color: var(--color-text);
  }
  .fc-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-md);
    background: var(--color-surface-canvas);
    border: 1px solid var(--color-border);
  }
  .fc-tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--text-semibold-weight);
    text-decoration: none;
    white-space: nowrap;
  }
  .fc-tab:hover { color: var(--color-text); }
  .fc-tab.is-active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    padding: 5px 15px;
  }
  .fc-empty { margin: 0; color: var(--color-text-muted); }

  /* ==================================================================
   * Place du cheval (Xavier, 21/10/2026) : rond de couleur en mode Liste,
   * étiquette blanche dans l'en-tête vert en mode Tableau.
   * ================================================================== */
  .fc-place-win { color: var(--color-brand); }
  .fc-place-place { color: var(--palette-orange-700); }
  .fc-place-lost { color: var(--color-danger); }
  .fc-place-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 3px solid currentColor;
    border-radius: 50%;
    background: var(--color-surface);
    font-size: 19px;
    font-weight: var(--font-weight-800);
    line-height: 1;
  }
  .fc-place-ring b, .fc-place-pill b { font-weight: inherit; }
  .fc-place-ring sup { font-size: 10px; }
  .fc-place-ring-txt { font-size: var(--font-size-13); }
  .fc-place-total {
    font-size: 11px;
    font-weight: var(--text-semibold-weight);
    color: var(--color-text-muted);
  }
  .fc-place-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-size: 18px;
    font-weight: var(--font-weight-800);
    line-height: 1;
    white-space: nowrap;
  }
  .fc-place-pill sup { font-size: 10px; }
  .fc-place-pill small {
    font-size: var(--font-size-xs);
    font-weight: var(--text-bold-weight);
    color: var(--color-text-muted);
  }

  /* ==================================================================
   * Mode Liste : carte blanche, bande verte en haut (date, hippodrome,
   * Quinté+), place dans un rond à droite — plus de barre verte à gauche.
   * ================================================================== */
  .fc-summary-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .fc-summary-card {
    border: 1px solid var(--palette-blue-200d);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }
  .fc-summary-card > summary { list-style: none; cursor: pointer; }
  .fc-summary-card > summary::-webkit-details-marker { display: none; }
  .fc-summary-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    color: inherit;
    text-decoration: none;
  }
  .fc-summary-title {
    grid-column: 1 / -1;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px var(--space-4);
    background: var(--color-brand);
    color: var(--color-text-inverse);
    font-size: var(--font-size-xs);
    font-weight: var(--text-bold-weight);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .fc-summary-card > summary:hover .fc-summary-title,
  .fc-summary-card[open] .fc-summary-title { background: var(--color-brand-hover); }
  .fc-summary-title img { flex: 0 0 auto; filter: brightness(0) invert(1); }
  .fc-summary-title .fc-quinte { margin-left: 6px; text-transform: none; letter-spacing: 0; }
  .fc-summary-sep { color: currentColor; opacity: 0.6; margin: 0 6px; }
  .fc-summary-title .fc-summary-sep { margin: 0; }
  .fc-summary-main { display: grid; gap: 6px; min-width: 0; padding: var(--space-3) var(--space-4); }
  .fc-summary-name {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-800);
    color: var(--color-text);
  }
  .fc-summary-runner {
    margin: 0;
    font-size: var(--font-size-13);
    color: var(--color-text-muted);
  }
  .fc-summary-runner strong { color: var(--color-text); font-weight: var(--text-bold-weight); }
  .fc-summary-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; }
  .fc-summary-chip {
    padding: 3px 9px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    font-size: var(--font-size-xs);
    color: var(--color-text);
  }
  .fc-summary-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-3) 18px;
  }
  .fc-summary-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4) var(--space-4);
    border-top: 1px solid var(--color-border);
  }

  /* ==================================================================
   * Mode Tableau : une carte par course, en-tête vert plein (date et
   * hippodrome en petit, nom en blanc, pastilles), tableau clair dessous.
   * ================================================================== */
  .fc-race-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .fc-race {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    overflow: hidden;
  }
  .fc-race-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 14px var(--space-4) 10px;
    background: var(--color-brand);
  }
  .fc-race-headline {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1 1 0;
    min-width: 0;
  }
  .fc-race-icon { flex: 0 0 auto; width: 26px; height: 26px; filter: brightness(0) invert(1); }
  .fc-race-title {
    margin: 0;
    display: grid;
    gap: 3px;
    min-width: 0;
    color: var(--color-text-inverse);
    overflow-wrap: anywhere;
  }
  .fc-race-kicker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: var(--font-size-xs);
    font-weight: var(--text-bold-weight);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
  }
  .fc-race-kicker .fc-quinte { margin-left: 4px; text-transform: none; letter-spacing: 0; }
  .fc-race-name { font-size: 18px; font-weight: var(--font-weight-800); }
  .fc-race-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0 var(--space-4) 14px 54px;
    list-style: none;
    background: var(--color-brand);
  }
  .fc-race-chips .fc-chip {
    padding: 4px 10px;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.14);
    color: var(--color-text-inverse);
    font-size: var(--font-size-xs);
    font-weight: var(--text-semibold-weight);
  }
  .fc-race-meta {
    margin: var(--space-3) var(--space-4) 0;
    font-size: var(--font-size-13);
    color: var(--color-text-muted);
  }
  .fc-race-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-soft);
  }
  .fc-race-note svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--color-brand);
    margin-top: 1px;
  }
  .fc-race-note p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text);
  }
  .fc-race-note strong { color: var(--color-brand); }
  .fc-race-more { margin: 0; text-align: right; }
  .fc-race-more a {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--color-brand);
    font-size: var(--font-size-sm);
    font-weight: var(--text-semibold-weight);
    text-decoration: none;
  }
  .fc-race-more a:hover { color: var(--color-brand-hover); text-decoration: underline; }
  .fc-race-more svg { width: 15px; height: 15px; }
  /* Dans la carte du mode Tableau : retraits de la carte, lien sous un filet. */
  .fc-race > .fc-race-note { margin: var(--space-3) var(--space-4) 0; }
  .fc-race > .fc-race-table-wrap { margin-top: var(--space-3); border: 0; border-radius: 0; }
  .fc-race > .fc-race-more { padding: 10px var(--space-4); border-top: 1px solid var(--color-border); }

  /* --- Tableau des partants --- */
  .fc-race-table-wrap { overflow-x: auto; }
  .fc-race-table { width: 100%; border-collapse: collapse; }
  .fc-race-table th {
    text-align: left;
    padding: 9px 10px;
    font-size: 11px;
    font-weight: var(--text-bold-weight);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    background: var(--palette-blue-100c);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
  }
  /* Police compacte, zéro scroll horizontal : jockey/entraîneur tronqués
     avec « … » plutôt qu'un retour à la ligne (demande Xavier — le nom
     complet reste dans le title). Le nom du cheval, lui, peut se replier. */
  .fc-race-table td {
    padding: 10px;
    font-size: var(--font-size-13);
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
  }
  .fc-race-table td.fc-col-name { white-space: normal; overflow-wrap: break-word; }
  .fc-race-table td.fc-col-trainer,
  .fc-race-table td.fc-col-pilot {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 168px;
  }
  .fc-race-table td.fc-col-pilot { max-width: 148px; }
  .fc-race-table tbody tr:last-child td { border-bottom: 0; }
  /* Lignes toutes blanches (le style commun .race-table les grise une sur deux). */
  .fc-race-table tbody tr:nth-child(even) { background: var(--color-surface); }
  .fc-col-cl { width: 44px; font-weight: var(--text-bold-weight); white-space: nowrap; }
  .fc-col-num,
  .fc-col-gap,
  .fc-col-corde,
  .fc-col-cote { white-space: nowrap; }
  .fc-col-cote { text-align: right; font-weight: var(--text-semibold-weight); }
  th.fc-col-cote { text-align: right; }
  .fc-runner-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .fc-runner-name a {
    color: var(--color-text);
    font-weight: var(--text-semibold-weight);
    text-decoration: none;
  }
  .fc-runner-name a:hover { color: var(--color-brand); text-decoration: underline; }

  /* Ligne du cheval de la fiche : fond teinté selon le classement, sans
     barre à gauche (Xavier, 21/10/2026). */
  .fc-race-table tbody tr.fc-row-win { background: var(--color-success-soft); }
  .fc-race-table tbody tr.fc-row-win td { font-weight: var(--text-bold-weight); color: var(--color-brand); }
  .fc-race-table tbody tr.fc-row-place { background: var(--palette-orange-100); }
  .fc-race-table tbody tr.fc-row-place td { font-weight: var(--text-bold-weight); color: var(--palette-orange-700); }
  .fc-race-table tbody tr.fc-row-lost,
  .fc-race-table tbody tr.fc-row-none { background: var(--color-danger-soft); }
  .fc-race-table tbody tr.fc-row-lost td,
  .fc-race-table tbody tr.fc-row-none td { font-weight: var(--text-bold-weight); color: var(--color-danger); }
  .fc-race-table tbody tr.fc-row-win .fc-runner-name a { color: var(--color-brand); }
  .fc-race-table tbody tr.fc-row-place .fc-runner-name a { color: var(--palette-orange-700); }
  .fc-race-table tbody tr.fc-row-lost .fc-runner-name a,
  .fc-race-table tbody tr.fc-row-none .fc-runner-name a { color: var(--color-danger); }

  /* Colonne corde : cachée partout (la corde est dans les pastilles de la course). */
  .fc-col-corde { display: none; }

  /* ==================================================================
   * Légende, pagination, note cache
   * ================================================================== */
  .fc-legend {
    display: grid;
    gap: var(--space-2);
    border-top: 1px dashed var(--color-border);
    padding-top: var(--space-3);
  }
  .fc-legend-title {
    margin: 0;
    font-size: var(--font-size-13);
    font-weight: var(--text-bold-weight);
    color: var(--color-text);
  }
  .fc-legend-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
  }
  .fc-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-13);
    color: var(--color-text-muted);
  }

  .fc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .fc-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-weight: var(--text-semibold-weight);
    text-decoration: none;
  }
  .fc-page:hover { border-color: var(--color-brand); color: var(--color-brand); }
  .fc-page.is-active {
    background: var(--color-brand);
    border-color: var(--color-brand);
    color: var(--color-text-inverse);
  }
  .fc-cache-hint {
    margin: 0;
    text-align: left;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
  }

  /* ==================================================================
   * Responsive mobile (≤ 768px)
   * ================================================================== */
  @media (max-width: 768px) {
    .fc-lbl-mobile { display: inline; }
    .fc-lbl-desktop { display: none; }

    /* --- En-tête fiche --- */
    .fc-head-top { flex-direction: column; align-items: stretch; gap: var(--space-3); }
    .fc-name { font-size: var(--font-size-xl); }
    .fc-stats { justify-content: space-between; flex-wrap: wrap; }
    .fc-stat { padding: 0 var(--space-2); }
    .fc-stat-icon svg { width: 18px; height: 18px; }
    .fc-stat-value { font-size: var(--font-size-lg); }
    .fc-stat-label { font-size: var(--font-size-xs); }
    .fc-head-info { flex-direction: column; gap: var(--space-2); }
    .fc-music-toggle { margin-left: 0; }

    /* --- Prochain départ : bloc date à gauche du titre, CTA pleine largeur --- */
    .fc-next-main { flex-basis: 180px; }
    .fc-next-cta { margin-left: 0; width: 100%; }
    .fc-next-cta .fc-btn-primary { width: 100%; justify-content: center; }

    /* --- Filtres --- */
    /* Libellé du volet filtres : « Afficher » fermé / « Masquer » ouvert. */
    .fc-filters details:not([open]) .fc-filters-hint-close { display: none; }
    .fc-filters details[open] .fc-filters-hint-open { display: none; }
    .fc-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fc-filter-advanced { display: none; }
    .fc-adv-check:checked ~ .fc-filter-grid .fc-filter-advanced { display: grid; }
    .fc-adv-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      background: var(--color-surface);
      color: var(--color-text);
      font-size: var(--font-size-sm);
      font-weight: var(--text-semibold-weight);
      width: fit-content;
      cursor: pointer;
      user-select: none;
    }
    .fc-adv-check:focus-visible ~ .fc-adv-btn {
      outline: 2px solid var(--color-focus-ring);
      outline-offset: 2px;
    }
    .fc-adv-check:checked ~ .fc-adv-btn {
      border-color: var(--color-brand);
      color: var(--color-brand);
    }
    .fc-adv-check:checked ~ .fc-adv-btn svg { color: var(--color-brand); }
    .fc-adv-check:checked ~ .fc-adv-btn .fc-adv-more { display: none; }
    .fc-adv-check:checked ~ .fc-adv-btn .fc-adv-less { display: inline; }
    .fc-switches { gap: var(--space-3); }

    /* --- Onglets --- */
    .fc-races-head { align-items: center; }

    /* --- Intégration « app iOS » : AUCUN bloc visible — fond blanc
       continu pleine largeur, sections collées séparées par un simple
       filet 1px (demande Xavier : pas de fond gris entre les blocs). --- */
    .layout.layout-fiche-cheval.container { width: 100%; }
    .layout.layout-fiche-cheval { gap: 0; margin-top: 0; }
    .fc-next,
    .fc-filters,
    .fc-races { margin-top: 0; }
    .layout-fiche-cheval .card {
      padding: var(--space-3);
      border: 0;
      border-radius: 0;
      box-shadow: none;
    }
    .layout-fiche-cheval .card.fc-races { padding: var(--space-3) 0; }
    .layout-fiche-cheval .fc-filters,
    .layout-fiche-cheval .fc-races { border-top: 1px solid var(--color-border); }
    /* Hiérarchie mobile (demande Xavier) : le prochain départ en encadré
       fin ROUGE inséré dans le fond blanc… */
    .layout-fiche-cheval .fc-next {
      margin: var(--space-2) var(--space-3) var(--space-3);
      border: 1px solid var(--color-danger);
      border-radius: var(--radius-md);
    }
    /* …et la barre de filtres sur fond jaune doux (jaune Pick 5 pastel). */
    .layout-fiche-cheval .fc-filters { background: var(--color-warning-soft); }
    .fc-legend,
    .fc-pagination,
    .fc-cache-hint,
    .fc-races > .fc-empty { margin-left: var(--space-3); margin-right: var(--space-3); }
    .fc-summary-list { padding: 0 var(--space-2); gap: 10px; }

    /* --- Liste : mêmes cartes, retraits serrés --- */
    .fc-summary-title { padding: 7px var(--space-3); }
    .fc-summary-main { padding: 10px var(--space-3); }
    .fc-summary-name { font-size: var(--font-size-15); }
    .fc-summary-side { padding: 10px var(--space-3) 10px 4px; }
    .fc-place-ring { width: 46px; height: 46px; font-size: 17px; }

    /* --- Tableau : en-tête vert plein bord à bord, pastilles dessous --- */
    .fc-races-head { padding: 0 var(--space-3); }
    .fc-race-list { gap: 0; }
    .fc-race { border: 0; border-radius: 0; }
    .fc-race + .fc-race { border-top: 8px solid var(--palette-blue-100z); }
    .fc-race-head {
      order: 1;
      padding: var(--space-3);
    }
    .fc-race-icon { display: none; }
    .fc-race-name { font-size: var(--font-size-15); }
    .fc-place-pill { font-size: 16px; padding: 6px 9px; }
    .fc-race-chips {
      order: 2;
      padding: 0 var(--space-3) var(--space-3);
    }
    .fc-race-meta { display: none; }
    .fc-race-table-wrap { order: 3; }
    .fc-race > .fc-race-table-wrap { margin-top: 0; }
    .fc-race-note { order: 4; margin: var(--space-2) var(--space-3) var(--space-3); }
    .fc-race > .fc-race-note { margin: 10px var(--space-3); }
    .fc-race-more { order: 5; padding: 0 var(--space-3) var(--space-3); }
    .fc-race > .fc-race-more { padding: 10px var(--space-3); }

    /* --- Colonnes tableaux : galop = # Cheval Poids Jockey Écart Cote ;
           trot = # Cheval Dist. Driver R/K Cote --- */
    .fc-race-table th {
      text-transform: none;
      letter-spacing: 0;
      font-size: var(--font-size-13);
    }
    /* Galop mobile : # Cheval Poids Jockey Écart Cote — la corde reste
       masquée (demande Xavier 2026-08-11, remplace le choix Corde initial).
       Entraîneur masqué dans les DEUX modes : déplié en Liste, le tableau
       débordait (25 px à 390, 55 px à 360 — vu le 21/10/2026). */
    .fc-race-table .fc-col-trainer { display: none; }
    /* Police un cran plus bas dans les tableaux mobile (demande Xavier). */
    .fc-race-table th, .fc-race-table td { padding: 8px 4px; }
    .fc-race-table th { font-size: var(--font-size-10); }
    .fc-race-table td { font-size: var(--font-size-11); }
    .fc-race-table .fc-col-name { overflow-wrap: break-word; }
    .fc-race-table td.fc-col-name,
    .fc-race-table td.fc-col-pilot { white-space: normal; }
    .fc-race-table td.fc-col-pilot { max-width: none; overflow: visible; text-overflow: clip; }
    .fc-race-table td.fc-col-name { font-size: var(--font-size-11); }
    /* Colonne Écart un cran plus bas que le reste (demande Xavier). */
    .fc-race-galop td.fc-col-gap { font-size: var(--font-size-10); }
    .fc-col-cl { width: 30px; }
    .fc-race-table th:first-child, .fc-race-table td:first-child { padding-left: var(--space-3); }
    .fc-race-table th:last-child, .fc-race-table td:last-child { padding-right: var(--space-3); }

    /* --- Liste (cartes dépliables) : le tableau déplié va d'un bord à l'autre --- */
    .fc-summary-body { padding: var(--space-3) 0; }
    .fc-summary-body > .fc-race-table-wrap { border-left: 0; border-right: 0; border-radius: 0; }

    .fc-pagination { justify-content: center; }
  }

  @media (min-width: 769px) {
    /* Dans la carte du mode Tableau, le tableau va d'un bord à l'autre :
       mêmes retraits que l'en-tête vert. */
    .fc-race .fc-race-table th:first-child, .fc-race .fc-race-table td:first-child { padding-left: var(--space-4); }
    .fc-race .fc-race-table th:last-child, .fc-race .fc-race-table td:last-child { padding-right: var(--space-4); }
  }

  /* ==================================================================
   * Gating par niveau (visiteur / inscrit / abonné)
   * Contrôles verrouillés (grisés + cadenas) et bannières CTA.
   * ================================================================== */
  /* UN CHAMP FERMÉ EST UN BOUTON : il ouvre le mur. Le contrôle désactivé
     dessous n'a pas à avaler le clic — sans `pointer-events: none`, un clic sur
     la liste déroulante elle-même ne remonte nulle part et le champ redevient
     muet, ce qui est exactement le défaut qu'on vient de supprimer. */
  .fc-filter-locked { cursor: pointer; }
  .fc-filter-locked > select,
  .fc-filter-locked > input { pointer-events: none; }
  .fc-filter-locked:hover .fc-lock-ico { color: var(--color-brand); }
  .fc-filter-locked > span,
  .fc-filter-locked .fc-switch-label { color: var(--color-text-muted); }
  /* LE CADENAS EST UN VRAI BOUTON depuis le 22/08/2026 : c'est lui qui porte
     l'accès clavier du champ fermé. On lui retire l'habillage de bouton du
     navigateur, on garde ses fonctions. Le <label> qui l'entoure, lui, reste un
     label — s'il prenait le rôle de bouton, la liste déroulante qu'il étiquette
     serait annoncée sans nom. */
  .fc-lock-ico {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 5px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: var(--color-text-muted);
  }
  .fc-lock-ico svg { width: 12px; height: 12px; }
  .fc-lock-ico:hover { color: var(--color-brand); }
  .fc-lock-ico:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
  }

  /* La bannière du panneau filtres a été retirée le 22/08/2026 : elle annonçait
     une porte fermée avant qu'on ait essayé d'ouvrir, et répétait ce que disent
     déjà les cadenas des champs. C'est le clic sur un champ fermé qui explique,
     au moment où la question se pose. Ses règles .fc-filters-gate* sont parties
     avec elle. Celles de .fc-gate-* restent : le bandeau du BAS de page, lui,
     n'a pas bougé. */
  .fc-gate-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
  }
  .fc-gate-link {
    font-size: var(--font-size-13);
    font-weight: var(--text-semibold-weight);
    color: var(--color-brand);
    text-decoration: none;
    white-space: nowrap;
  }
  .fc-gate-link:hover { text-decoration: underline; }

  /* Bandeau CTA sous le tableau des performances tronquées */
  .fc-gate-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-top: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-soft);
  }
  .fc-gate-banner-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--color-brand);
    color: var(--color-text-inverse);
    flex: 0 0 auto;
  }
  .fc-gate-banner-ico svg { width: 20px; height: 20px; }
  .fc-gate-banner-body {
    flex: 1 1 260px;
    display: grid;
    gap: 2px;
    min-width: 0;
  }
  .fc-gate-banner-title {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--text-bold-weight);
    color: var(--color-text);
  }
  .fc-gate-banner-text {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
  }
  /* Le bloc du VISITEUR en rouge, pour attirer l'œil sur ce qui est réservé aux inscrits (Xavier, 03/11/2026 :
     « mettre le bloc en rouge plutôt que vert pour attirer l'oeil », puis « A, visiteur seul ») : le cadenas, le
     bouton et le lien prennent le rouge du mur d'inscription du site (mur-inscription.css : #c8102e, #a30d26 au
     survol du bouton) ; le fond et le cadre ne changent pas. Le membre non abonné (« Découvrir les offres ») garde
     le vert. */
  .fc-gate-banner--visiteur .fc-gate-banner-ico { background: #c8102e; }
  .fc-gate-banner--visiteur .fc-gate-cta { background: #c8102e; }
  .fc-gate-banner--visiteur .fc-gate-cta:hover { background: #a30d26; }
  .fc-gate-banner--visiteur .fc-gate-link { color: #c8102e; }

  @media (max-width: 768px) {
    .fc-gate-banner { flex-direction: column; align-items: flex-start; }
    /* En colonne, la base de 260 px du texte devenait sa HAUTEUR : un grand vide entre le texte et « Créer un
       compte gratuit » (Xavier, 03/11/2026 : « beaucoup d'espace entre le texte et le bouton »). */
    .fc-gate-banner-body { flex: 0 0 auto; }
    .fc-gate-actions { width: 100%; }
    .fc-gate-cta { flex: 1 1 auto; justify-content: center; }
  }
}
