/* ==========================================================================
   Gestion équitation : feuille de style unique.
   Direction visuelle : docs/design-direction.md (version 2, « outil de bureau sobre »).
   Maquettes : docs/maquettes/. Une seule rupture : 900 px (compacte au-delà, tactile en dessous).
   Mode clair uniquement : toutes les couleurs passent par les variables ci-dessous.
   Classes disponibles : voir la section « Classes disponibles » de .agents/tickets/T-001.md.
   ========================================================================== */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-next.4cb8eaa42c20.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  /* Neutres et accent */
  --fond: #F5F5F5; --surface: #FFFFFF; --surface-2: #FAFAFA;
  --trait: #E0E0E0; --trait-fort: #D1D1D1; --trait-champ: #8A8A8A;
  --encre: #242424; --encre-2: #616161;
  --accent: #7A2B3E; --accent-survol: #662434; --accent-presse: #5E2030; --accent-teinte: #F6EDEF;
  --danger: #B3261E; --danger-texte: #9F2119; --danger-teinte: #FDECEA;

  /* États : barre, teinte, texte (voir plus bas les classes .etat-*) */
  --etat-planifiee: #8A8886; --etat-a_facturer: #C9A36B; --etat-facturee: #3D6AA8; --etat-payee: #3E8A5B;
  --etat-annulee: #C8C6C4;

  /* Espacements (base 4 px) */
  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 20px; --e-6: 24px; --e-7: 32px; --e-8: 48px;

  /* Formes et ombres */
  --rayon: 4px; --rayon-panneau: 6px; --rayon-fenetre: 8px;
  --ombre-flotte: 0 2px 4px rgb(0 0 0 / .14), 0 0 2px rgb(0 0 0 / .12);
  --ombre-fenetre: 0 8px 16px rgb(0 0 0 / .14), 0 0 2px rgb(0 0 0 / .12);

  /* Densité compacte (ordinateur) */
  --h-ctrl: 32px;       /* bouton, champ, filtre, élément de menu */
  --h-ligne: 36px;      /* ligne de tableau */
  --h-liste: 56px;      /* ligne de liste */
  --cible: 32px;
  --coche: 18px;

  /* Échelle typographique (ordinateur) */
  --t-legende: 12px; --t-corps: 14px; --t-second: 13px; --t-section: 16px; --t-titre: 20px; --t-valeur: 24px;

  --menu-largeur: 220px;
  --barre-hauteur: 56px;
}
/* Densité tactile (téléphone) : tout ce qui se touche fait 44 px, sans variante « petit ». */
@media (max-width: 899px) {
  :root {
    --h-ctrl: 44px; --h-ligne: 44px; --h-liste: 64px; --cible: 44px; --coche: 22px;
    --t-legende: 13px; --t-corps: 16px; --t-second: 14px; --t-section: 18px; --t-valeur: 22px;
  }
}

/* ---------- États des séances et des pièces : --barre, --teinte, --texte-etat ---------- */
.etat, .etat-planifiee { --barre: #8A8886; --teinte: #F3F2F1; --texte-etat: #484644; }
.etat-a_facturer, .etat-afacturer { --barre: #C9A36B; --teinte: #FBF3E4; --texte-etat: #7A5A1E; }
.etat-facturee, .etat-emise { --barre: #3D6AA8; --teinte: #EAF0F8; --texte-etat: #2D5288; }
.etat-payee { --barre: #3E8A5B; --teinte: #E8F3EC; --texte-etat: #2A6B42; }
.etat-annulee { --barre: #C8C6C4; --teinte: #F5F5F5; --texte-etat: #6E6E6E; }
.etat-retard, .etat-erreur { --barre: #B3261E; --teinte: #FDECEA; --texte-etat: #9F2119; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 400 var(--t-corps)/1.4 "Atkinson Hyperlegible Next", system-ui, -apple-system, sans-serif;
  color: var(--encre); background: var(--fond);
}
a { color: var(--accent); }
a:hover { color: var(--accent-survol); }
h1 { font-size: var(--t-titre); font-weight: 700; line-height: 1.2; margin: 0 0 var(--e-4); }
h2 { font-size: var(--t-section); font-weight: 700; line-height: 1.3; margin: 0 0 var(--e-2); }
h3 { font-size: var(--t-corps); font-weight: 600; margin: 0 0 var(--e-1); }
p { margin: 0 0 var(--e-2); }
.doux { color: var(--encre-2); }
.petit { font-size: var(--t-second); }
.tabulaire, .num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round;
  stroke-linejoin: round; flex: none; }
@media (max-width: 899px) { svg.ic { width: 20px; height: 20px; } }

/* ---------- Coquille : menu à gauche (ordinateur), barre + tiroir (téléphone) ---------- */
.barre {
  position: sticky; top: 0; z-index: 30; height: var(--barre-hauteur);
  display: flex; align-items: center; gap: var(--e-2); padding: 0 var(--e-2);
  background: var(--surface); border-bottom: 1px solid var(--trait);
}
.barre-menu, .menu-fermer {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  background: none; border: 0; border-radius: var(--rayon); color: var(--encre); font-size: 1.4rem; cursor: pointer;
}
.barre-menu:hover, .menu-fermer:hover { background: var(--surface-2); }
.barre-logo { display: inline-flex; align-items: center; margin-right: auto; }
.barre-logo img { display: block; height: 38px; width: auto; }
.barre-actions { display: flex; gap: var(--e-2); }

.menu {
  position: fixed; inset: 0 auto 0 0; width: min(85vw, 300px); z-index: 50;
  background: var(--surface); color: var(--encre); overflow-y: auto; padding: var(--e-3) var(--e-2) var(--e-8);
  transform: translateX(-105%); transition: transform .15s ease; box-shadow: var(--ombre-fenetre);
}
.menu-entete { display: flex; justify-content: space-between; align-items: center; gap: var(--e-2); padding: 0 0 var(--e-3); }
.menu-logo { display: block; flex: 1; padding: 0 var(--e-2); }
.menu-logo img { display: block; width: 150px; max-width: 100%; height: auto; }
.menu-groupe { margin-bottom: var(--e-2); }
.menu-groupe-titre { display: block; font-size: var(--t-legende); font-weight: 600; color: var(--encre-2);
  padding: var(--e-3) var(--e-3) var(--e-1); }
.menu-lien {
  position: relative; display: flex; align-items: center; min-height: var(--h-ctrl); padding: 0 var(--e-3);
  border-radius: var(--rayon); color: var(--encre); text-decoration: none;
}
.menu-lien:hover { background: var(--surface-2); color: var(--encre); }
.menu-lien.actif, .menu-lien[aria-current] { background: var(--accent-teinte); color: var(--accent); font-weight: 600; }
.menu-lien.actif::before, .menu-lien[aria-current]::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 2px; background: var(--accent); }
.menu-lien.inactif { color: var(--encre-2); }
.voile { display: none; }
body.menu-ouvert .menu { transform: none; }
body.menu-ouvert .voile { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .4); z-index: 40; }

.contenu { padding: var(--e-4) var(--e-4) 88px; }
@media (min-width: 900px) {
  .barre { display: none; }
  .menu { transform: none; transition: none; width: var(--menu-largeur); box-shadow: none; border-right: 1px solid var(--trait); }
  .menu-fermer { display: none; }
  .menu-lien { min-height: 32px; }
  .voile, body.menu-ouvert .voile { display: none; }
  .contenu { margin-left: var(--menu-largeur); padding: var(--e-6) var(--e-6) var(--e-7); }
}

/* Barre de commandes (ordinateur) : titre, action principale, commandes, réglages d'affichage à droite. */
.commandes { display: flex; align-items: center; gap: var(--e-2); min-height: 48px; margin: 0 0 var(--e-4); }
.commandes h1 { margin: 0 var(--e-4) 0 0; }
.commandes .droite { margin-left: auto; display: flex; align-items: center; gap: var(--e-2); }
@media (min-width: 900px) {
  .commandes.fixe { margin: calc(-1 * var(--e-6)) calc(-1 * var(--e-6)) var(--e-4); padding: 0 var(--e-6);
    background: var(--surface); border-bottom: 1px solid var(--trait); }
}

/* ---------- Panneaux ---------- */
.carte, .panneau { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-panneau);
  padding: var(--e-4); margin-bottom: var(--e-4); }
.entete-page { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2) var(--e-3); justify-content: space-between;
  margin-bottom: var(--e-4); min-height: 40px; }
.entete-page h1 { margin: 0; }

/* ---------- Boutons ---------- */
.bouton, button.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e-1);
  min-height: var(--h-ctrl); padding: 0 var(--e-3); border: 1px solid var(--accent); border-radius: var(--rayon);
  cursor: pointer; background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none;
  white-space: nowrap; line-height: 1.2;
}
.bouton:hover { background: var(--accent-survol); border-color: var(--accent-survol); color: #fff; }
.bouton:active { background: var(--accent-presse); border-color: var(--accent-presse); }
.bouton.secondaire { background: var(--surface); color: var(--encre); border-color: var(--trait-fort); }
.bouton.secondaire:hover, .bouton.secondaire:active { background: var(--surface-2); border-color: var(--trait-champ); color: var(--encre); }
.bouton.discret, .bouton.fantome { background: none; border-color: transparent; color: var(--encre); }
.bouton.discret:hover, .bouton.fantome:hover, .bouton.discret:active, .bouton.fantome:active {
  background: var(--surface-2); border-color: transparent; color: var(--encre); }
.bouton.danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.bouton.danger:hover, .bouton.danger:active { background: var(--danger-teinte); border-color: var(--danger); color: var(--danger); }
.bouton.succes { background: #E8F3EC; border-color: #3E8A5B; color: #2A6B42; }
.bouton.succes:hover { background: #DCEDE2; border-color: #3E8A5B; color: #2A6B42; }
.bouton.icone { width: var(--h-ctrl); padding: 0; }
.bouton.large { width: 100%; }
.bouton.petit { min-height: var(--h-ctrl); padding: 0 var(--e-3); font-size: var(--t-second); }
.bouton[disabled], .bouton[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.bouton-flottant { position: fixed; right: var(--e-4); bottom: calc(var(--e-4) + env(safe-area-inset-bottom)); z-index: 20;
  min-height: 56px; padding: 0 var(--e-5); box-shadow: var(--ombre-fenetre); }
@media (min-width: 900px) {
  .bouton-flottant { position: static; box-shadow: none; min-height: var(--h-ctrl); padding: 0 var(--e-3); }
}

/* Boutons simples des écrans de facturation (sans classe) : mêmes rôles que .bouton */
.contenu :not(.segments) > button:not([class]), .contenu button.secondaire, .contenu button.danger {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--h-ctrl); padding: 0 var(--e-3);
  border: 1px solid var(--accent); border-radius: var(--rayon); cursor: pointer; background: var(--accent);
  color: #fff; font: inherit; font-weight: 600; white-space: nowrap;
}
.contenu :not(.segments) > button:not([class]):hover { background: var(--accent-survol); border-color: var(--accent-survol); }
.contenu button.secondaire { background: var(--surface); color: var(--encre); border-color: var(--trait-fort); }
.contenu button.secondaire:hover { background: var(--surface-2); border-color: var(--trait-champ); }
.contenu button.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.contenu button.danger:hover { background: var(--danger-teinte); }

/* Segments (Jour | Semaine | Mois, choix exclusif de 2 à 5 options) */
.segments, .bascule-vue { display: inline-flex; border: 1px solid var(--trait-fort); border-radius: var(--rayon); overflow: hidden;
  background: var(--surface); }
.segments > button, .segments > a, .bascule-vue > a {
  display: inline-flex; align-items: center; justify-content: center; min-height: calc(var(--h-ctrl) - 2px);
  padding: 0 var(--e-3); border: 0; background: var(--surface); color: var(--encre); font: inherit; text-decoration: none; cursor: pointer;
}
.segments > * + *, .bascule-vue > a + a { border-left: 1px solid var(--trait-fort); }
.segments > *:hover, .bascule-vue > a:hover { background: var(--surface-2); }
.segments [aria-pressed="true"], .segments [aria-current], .segments .actif, .bascule-vue a.active {
  background: var(--accent-teinte); color: var(--accent); font-weight: 600; }

/* Pastille de choix / filtre (liens et boutons radio cachés) */
.pastilles { display: flex; flex-wrap: wrap; gap: var(--e-2); margin-bottom: var(--e-3); }
.pastille {
  display: inline-flex; align-items: center; gap: var(--e-1); min-height: var(--h-ctrl); padding: 0 var(--e-3);
  border: 1px solid var(--trait-fort); border-radius: var(--rayon); background: var(--surface); color: var(--encre);
  font: inherit; text-decoration: none; cursor: pointer;
}
.pastille:hover { border-color: var(--trait-champ); color: var(--encre); }
.pastille.active, .pastille[aria-pressed="true"],
input[type=radio].cache:checked + .pastille { background: var(--accent-teinte); border-color: var(--accent); color: var(--accent); font-weight: 600; }
input[type=radio].cache { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; opacity: 0; pointer-events: none; }
input[type=radio].cache:focus-visible + .pastille { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Pastille d'état : teinte + libellé de l'état, précédée du point d'état (.pastille ou .etat, avec .etat-*) */
.etat, .pastille[class*="etat-"] {
  display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 var(--e-2);
  border: 0; border-radius: var(--rayon); background: var(--teinte); color: var(--texte-etat);
  font-size: var(--t-second); font-weight: 600; white-space: nowrap; line-height: 1.2; cursor: default;
}
.etat::before, .pastille[class*="etat-"]::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--barre); }
.etat.etat-annulee, .pastille.etat-annulee { text-decoration: line-through; }
.legende { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-3); margin-top: var(--e-3); }

/* ---------- Formulaires ---------- */
.formulaire { display: grid; gap: var(--e-4); }
.champ { display: flex; flex-direction: column; gap: var(--e-1); min-width: 0; }
.champ > span, .champ > label { font-size: var(--t-corps); color: var(--encre); font-weight: 600; }
.champ .aide, .aide, .champ-aide { font-size: var(--t-legende); color: var(--encre-2); font-weight: 400; }
.erreurs { color: var(--danger); font-size: var(--t-second); margin: 0; padding: 0; list-style: none; }
.erreurs li::before, .champ-erreur::before { content: "Erreur : "; font-weight: 700; }
.champ-erreur { color: var(--danger); font-size: var(--t-second); margin: 0; }
.champ:has(.erreurs) input, .champ:has(.erreurs) select, .champ:has(.erreurs) textarea,
.champ:has(.champ-erreur) input, .champ:has(.champ-erreur) select, .champ:has(.champ-erreur) textarea { border-color: var(--danger); }
input, select, textarea {
  font: inherit; font-size: var(--t-corps); padding: 0 var(--e-3); min-height: var(--h-ctrl); width: 100%;
  border: 1px solid var(--trait-fort); border-radius: var(--rayon); background: var(--surface); color: var(--encre);
}
input:hover, select:hover, textarea:hover { border-color: var(--trait-champ); }
textarea { min-height: 80px; padding: var(--e-2) var(--e-3); }
select { padding-right: var(--e-2); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--trait-fort); border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--encre-2); opacity: 1; }
input[type=number], .l-montant input, input.l-montant, .l-nombre input, input.l-nombre { text-align: right; font-variant-numeric: tabular-nums; }
input[type=date], input[type=time] { font-variant-numeric: tabular-nums; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
input[type=checkbox], input[type=radio]:not(.cache) { width: var(--coche); height: var(--coche); min-height: 0; padding: 0; flex: none; }
.case { display: flex; align-items: center; gap: var(--e-2); min-height: var(--h-ctrl); }
.ligne-champs { display: grid; gap: var(--e-3); grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.section-form { border-top: 1px solid var(--trait); padding-top: var(--e-4); }
.section-form > h3 { font-size: var(--t-section); font-weight: 600; color: var(--encre); }
.actions-form { display: flex; gap: var(--e-2); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--e-4); }
/* Largeur selon le contenu (à poser sur le .champ ou sur le champ) */
.l-date { width: 160px; max-width: 100%; } .l-heure { width: 112px; max-width: 100%; }
.l-montant, .l-nombre { width: 128px; max-width: 100%; } .l-plein { width: 100%; } .l-tel { width: 200px; max-width: 100%; } .l-cp { width: 112px; max-width: 100%; }

/* Messages */
.alerte, .message { padding: var(--e-3) var(--e-4); border-radius: var(--rayon); background: var(--surface-2);
  border: 1px solid var(--trait); color: var(--encre); }
.alerte.erreur::before, .message.error::before { content: "Erreur : "; font-weight: 700; color: var(--danger-texte); }
.alerte.erreur, .message.error { background: var(--danger-teinte); border-color: var(--trait); border-left: 3px solid var(--danger); }
.alerte.avertissement { background: #FBF3E4; border-left: 3px solid #C9A36B; }
.message.success { background: #E8F3EC; border-left: 3px solid #3E8A5B; }
.messages { list-style: none; padding: 0; margin: 0 0 var(--e-4); }
.message { margin-bottom: var(--e-2); }

/* ---------- Fenêtre (dialog) : plein écran sur téléphone, 560 px (720 px avec .large) sur ordinateur ---------- */
.fenetre { --fen-pad: var(--e-4); border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100dvh;
  background: var(--surface); color: var(--encre); box-shadow: var(--ombre-fenetre); overflow-x: hidden; }
.fenetre[open] { display: flex; flex-direction: column; animation: ouvrir .15s ease-out; }
.fenetre::backdrop { background: rgb(0 0 0 / .4); }
@keyframes ouvrir { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fenetre #fenetre-contenu { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fenetre-corps { padding: var(--fen-pad); overflow-x: hidden; overflow-y: auto; flex: 1; min-height: 0; }
.fenetre-corps * { max-width: 100%; }
.fenetre-entete { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  gap: var(--e-2); padding: var(--e-2) var(--fen-pad); background: var(--surface); border-bottom: 1px solid var(--trait);
  min-height: 56px; flex: none; }
.fenetre-corps .fenetre-entete { margin: calc(-1 * var(--fen-pad)) calc(-1 * var(--fen-pad)) var(--e-4); }
.fenetre-entete h2 { margin: 0; font-size: var(--t-titre); }
.fermer { order: -1; display: inline-flex; align-items: center; justify-content: center; width: var(--cible); height: var(--cible);
  min-height: var(--cible); padding: 0; background: none; border: 0; border-radius: var(--rayon); color: var(--encre);
  font-size: 1.1rem; cursor: pointer; flex: none; }
.fermer:hover { background: var(--surface-2); }
/* Pied : action principale en premier, puis « Annuler », alignés à droite (téléphone : pleine largeur, empilés) */
.fenetre-pied, .fenetre .actions-form { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: var(--e-2);
  justify-content: flex-end; padding: var(--e-3) var(--fen-pad) calc(var(--e-3) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--trait); flex: none; }
.fenetre-corps .fenetre-pied, .fenetre-corps .actions-form { margin: var(--e-4) calc(-1 * var(--fen-pad)) calc(-1 * var(--fen-pad)); }
@media (max-width: 899px) {
  .fenetre-pied, .fenetre .actions-form { flex-direction: column; }
  .fenetre-pied .bouton, .fenetre .actions-form .bouton { width: 100%; }
  .fenetre-pied .bouton.secondaire, .fenetre-pied .bouton.discret, .fenetre .actions-form .bouton.secondaire { background: none; border-color: transparent; }
}
@media (min-width: 900px) {
  .fenetre { --fen-pad: var(--e-5); margin: auto; width: 560px; max-width: calc(100vw - 32px); height: auto; max-height: 90vh;
    border-radius: var(--rayon-fenetre); }
  .fenetre.large, .fenetre:has(#form-placer) { width: 720px; }
  .fermer { order: 0; }
}

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: var(--e-4); right: var(--e-4); bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 100;
  display: grid; gap: var(--e-2); }
.toast { background: var(--encre); color: #fff; padding: var(--e-3) var(--e-4); border-radius: var(--rayon);
  box-shadow: var(--ombre-flotte); transition: opacity .4s, transform .4s; }
.toast.erreur { background: var(--danger-teinte); color: var(--encre); border-left: 3px solid var(--danger); }
.toast.erreur::before { content: "Erreur : "; font-weight: 700; color: var(--danger-texte); }
.toast.sortie { opacity: 0; transform: translateY(8px); }
@media (min-width: 900px) { .toasts { left: calc(var(--menu-largeur) + var(--e-4)); right: auto; bottom: var(--e-6); width: 400px; } }

/* ---------- Requêtes HTMX en cours ---------- */
.htmx-request { opacity: .6; cursor: progress; }

/* ---------- Liste + fiche ---------- */
.liste-fiche { display: grid; gap: var(--e-4); grid-template-columns: minmax(0, 1fr); }
.liste-fiche > section, .colonne-fiche .carte { min-width: 0; }
.liste-outils { display: flex; gap: var(--e-2); margin-bottom: var(--e-3); }
.liste-outils input { flex: 1; }
.liste { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-panneau);
  overflow: hidden; }
.ligne-liste { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: var(--h-liste);
  padding: var(--e-2) var(--e-4); background: var(--surface); border: 0; border-bottom: 1px solid var(--trait);
  text-decoration: none; color: var(--encre); }
.liste > :last-child { border-bottom: 0; }
.ligne-liste:hover { background: var(--surface-2); color: var(--encre); }
.ligne-liste.active, .ligne-liste[aria-current="true"] { background: var(--accent-teinte); box-shadow: inset 3px 0 0 var(--accent); }
.ligne-liste strong { display: block; font-weight: 600; font-size: var(--t-corps); }
.ligne-liste .doux { font-size: var(--t-second); }
.ligne-liste.archivee { opacity: .6; }
.fiche-vide { color: var(--encre-2); padding: var(--e-8) var(--e-4) 0; }
.fiche-entete { display: flex; flex-direction: column; gap: var(--e-3); }
.fiche-entete h2 { font-size: var(--t-section); font-weight: 700; margin: 0; }
.fiche-infos { list-style: none; display: flex; flex-wrap: wrap; gap: var(--e-2); padding: 0; margin: var(--e-3) 0; }
.fiche-infos li { background: var(--surface-2); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 2px var(--e-2); color: var(--encre-2); font-size: var(--t-second); }
.sous-ligne { background: var(--surface-2); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: var(--e-2) var(--e-3); margin-bottom: var(--e-1); min-height: var(--h-ctrl);
  display: flex; justify-content: space-between; align-items: center; gap: var(--e-2); flex-wrap: wrap; }
.sous-ligne > * { min-width: 0; overflow-wrap: anywhere; }
.retour-liste { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: var(--e-1); }

/* Liste de définitions (libellé à gauche, valeur à droite) */
dl.def { display: grid; grid-template-columns: minmax(96px, 128px) 1fr; gap: var(--e-2) var(--e-3); margin: 0; }
dl.def dt { color: var(--encre-2); }
dl.def dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 899px) { dl.def { grid-template-columns: 1fr; gap: 0; } dl.def dd { margin-bottom: var(--e-2); } }

/* Actions de la fiche : une action principale, le reste dans « Plus ». */
.actions-fiche { display: flex; flex-direction: column; gap: var(--e-2); width: 100%; }
.actions-fiche > .bouton { width: 100%; }
.menu-plus { margin: 0; position: relative; }
.menu-plus > summary { display: flex; width: 100%; cursor: pointer; }
.menu-plus > summary::after { content: "▾"; font-size: .8em; }
.menu-plus-liste { display: grid; border: 1px solid var(--trait); border-radius: var(--rayon-fenetre); background: var(--surface);
  padding: var(--e-1); overflow: auto; position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; box-shadow: var(--ombre-flotte);
  min-width: 12rem; max-width: calc(100vw - 2 * var(--e-3)); max-height: 70vh; }
/* Le menu flotte au-dessus du contenu : jamais de poussée de la mise en page.
   menu-plus.js le passe en position fixe, calée sur le summary et bornée à l'écran, pour échapper aux conteneurs défilants. */
.menu-plus[open] > summary { margin-bottom: 0; }
.menu-plus-liste form { margin: 0; }
.item-menu { display: flex; align-items: center; width: 100%; min-height: var(--h-ctrl); padding: 0 var(--e-3); border: 0;
  border-radius: var(--rayon); background: var(--surface); color: var(--encre); font: inherit; text-align: left;
  text-decoration: none; cursor: pointer; }
.item-menu:hover { background: var(--surface-2); color: var(--encre); }
.item-menu.item-danger { color: var(--danger); }
@media (min-width: 900px) {
  .fiche-entete { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .actions-fiche { flex-direction: row; width: auto; align-items: flex-start; }
  .actions-fiche > .bouton { width: auto; }
  .menu-plus > summary { width: auto; }
}

/* Onglets (filtres d'une fiche, sections) */
.onglets { display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--trait); margin: var(--e-2) 0 var(--e-3); }
.onglet { display: inline-flex; align-items: center; flex-shrink: 0; min-height: var(--h-ctrl); padding: 0 var(--e-3); border: 0;
  background: none; font: inherit; color: var(--encre); cursor: pointer; text-decoration: none; white-space: nowrap;
  border-radius: var(--rayon) var(--rayon) 0 0; }
.onglet:hover { background: var(--surface-2); color: var(--encre); }
.onglet.actif, .onglet[aria-selected="true"], .onglet[aria-current] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* Tuiles de chiffres (valeur 24 px, libellé et détail en --encre-2, jamais en couleur) */
.chiffres, .compteurs, .tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--e-3); margin: var(--e-3) 0; }
.compteurs, .tuiles { margin-top: 0; margin-bottom: var(--e-4); }
.chiffre, .compteur, .tuile { display: block; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-panneau);
  padding: var(--e-4); color: var(--encre); text-decoration: none; }
a.compteur:hover, a.tuile:hover { border-color: var(--trait-champ); }
.chiffre span, .compteur span, .tuile .libelle { display: block; font-size: var(--t-corps); color: var(--encre-2); font-weight: 400; }
.chiffre b, .compteur b, .tuile b { display: block; font-size: var(--t-valeur); font-weight: 700; color: var(--encre);
  font-variant-numeric: tabular-nums; line-height: 1.2; }
.tuile .detail { display: block; font-size: var(--t-second); color: var(--encre-2); }
@media (min-width: 900px) {
  .compteurs, .tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .liste-fiche { grid-template-columns: 360px minmax(0, 1fr); align-items: start; }
  .liste-fiche .colonne-liste { position: sticky; top: var(--e-4); max-height: calc(100vh - 2 * var(--e-4)); overflow-y: auto; }
  .colonne-fiche > .carte { max-width: 760px; }
  .retour-liste { display: none; }
}
@media (max-width: 899px) {
  .compteurs, .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .liste-fiche.fiche-ouverte .colonne-liste { display: none; }
  .liste-fiche:not(.fiche-ouverte) .colonne-fiche { display: none; }
}

/* Liste mobile (pas de tableau sur téléphone) : nom + chiffre clé, puis référence + pastille */
.groupe-periode { position: sticky; top: var(--barre-hauteur); z-index: 2; margin: 0; padding: var(--e-2) var(--e-4);
  font-size: var(--t-corps); font-weight: 600; color: var(--encre-2); background: var(--fond); border-bottom: 1px solid var(--trait); }
.liste-mobile { list-style: none; margin: 0; padding: 0; background: var(--surface); }
.liste-mobile > li > a, .liste-mobile > a { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--e-3); min-height: 64px;
  align-content: center; padding: var(--e-2) var(--e-4); color: inherit; text-decoration: none; border-bottom: 1px solid var(--trait); }
.liste-mobile .nom { font-weight: 600; font-size: var(--t-section); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste-mobile .montant { font-weight: 600; font-size: var(--t-section); font-variant-numeric: tabular-nums; text-align: right; }
.liste-mobile .ref { font-size: var(--t-second); color: var(--encre-2); font-variant-numeric: tabular-nums; }
.liste-mobile .etat, .liste-mobile .pastille { justify-self: end; }

/* État vide */
.etat-vide { padding: var(--e-8) var(--e-4) 0; color: var(--encre-2); max-width: 560px; }

/* ---------- Tableaux façon tableur ---------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 0 var(--e-3); height: var(--h-ligne); border-bottom: 1px solid var(--trait); vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: var(--t-second); font-weight: 600;
  color: var(--encre-2); white-space: nowrap; }
td { padding-top: var(--e-1); padding-bottom: var(--e-1); line-height: 1.2; }
td.num, th.num { text-align: right; white-space: nowrap; }
td a { text-decoration: none; font-weight: 600; }
td a:hover { text-decoration: underline; }
tbody tr:hover { background: var(--surface-2); }
tbody tr[aria-selected="true"], tbody tr.selectionnee { background: var(--accent-teinte); box-shadow: inset 3px 0 0 var(--accent); }
tfoot td, tr.total td { font-weight: 600; border-top: 2px solid var(--trait-fort); border-bottom: 0; }
td.client { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tableau { overflow: auto; }
@media (max-width: 899px) { th { top: var(--barre-hauteur); } }
@media (max-width: 699px) {
  th { position: static; }
  table.adaptatif thead, table.adaptatif tr:first-child:has(th) { display: none; }
  table.adaptatif tr { display: block; border-bottom: 1px solid var(--trait); padding: var(--e-1) 0; }
  table.adaptatif td { display: flex; justify-content: space-between; align-items: center; border: 0; height: auto; min-height: 36px;
    padding: var(--e-1) var(--e-3); }
  table.adaptatif td::before { content: attr(data-label); color: var(--encre-2); font-size: var(--t-second); margin-right: var(--e-4); }
  table.adaptatif td.num { text-align: right; }
  table.adaptatif td a { display: inline-flex; align-items: center; min-height: 44px; }
}
form.ligne, p.ligne { display: flex; flex-wrap: wrap; gap: var(--e-2); align-items: flex-end; margin: var(--e-2) 0 var(--e-4); }
form.ligne label { display: flex; flex-direction: column; gap: var(--e-1); font-size: var(--t-corps); font-weight: 600; color: var(--encre); }
.modifier-ligne { margin-top: var(--e-1); }

/* ---------- Agenda : jour (cartes, téléphone) ---------- */
.jour-entete { display: flex; align-items: center; justify-content: space-between; gap: var(--e-2); margin-bottom: var(--e-3); }
.jour-entete h2 { margin: 0; font-size: var(--t-section); text-align: center; flex: 1; }
.jour-entete h2::first-letter, .jour-semaine h3 a::first-letter { text-transform: uppercase; }
.fleche { display: inline-flex; align-items: center; justify-content: center; width: var(--cible); height: var(--cible);
  min-height: var(--cible); border-radius: var(--rayon); border: 1px solid var(--trait-fort); background: var(--surface);
  text-decoration: none; color: var(--encre); font-size: 1.2rem; }
.fleche:hover { background: var(--surface-2); color: var(--encre); }
.cartes-jour { display: grid; gap: var(--e-2); }
.carte-seance { --barre: #8A8886; display: grid; grid-template-columns: 64px 1fr; gap: var(--e-3); align-items: start; width: 100%;
  text-align: left; font: inherit; color: var(--encre); cursor: pointer; position: relative;
  background: var(--surface); border: 1px solid var(--trait); border-left: 3px solid var(--barre);
  border-radius: var(--rayon); padding: var(--e-3) var(--e-3) var(--e-3) var(--e-3); }
.carte-seance:hover { border-color: var(--trait-champ); border-left-color: var(--barre); }
.carte-seance .heures { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; line-height: 1.15; }
.carte-seance .heure-debut { font-size: 22px; font-weight: 700; }
.carte-seance .heure-fin { font-size: 14px; color: var(--encre-2); margin-top: 2px; }
.carte-seance .seance-corps { display: flex; flex-direction: column; gap: var(--e-1); min-width: 0; }
.carte-seance .eleves { font-weight: 700; font-size: var(--t-section); line-height: 1.25; overflow-wrap: anywhere; }
.carte-seance .seance-pastilles { display: flex; flex-wrap: wrap; gap: var(--e-1); }
.carte-seance .mini { background: var(--surface-2); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 0 var(--e-2); font-size: var(--t-second); color: var(--encre-2); }
.carte-seance .seance-etat { font-size: var(--t-second); font-weight: 600; color: var(--texte-etat, var(--encre-2)); }
.carte-seance.etat-annulee .eleves, .carte-seance.etat-annulee .heure-debut { text-decoration: line-through; color: var(--encre-2); }
.creneau-libre { display: flex; align-items: center; justify-content: flex-start; gap: var(--e-1); width: 100%;
  min-height: var(--cible); font: inherit; font-size: var(--t-second); cursor: pointer; text-align: left; color: var(--encre-2);
  border: 0; border-bottom: 1px solid var(--trait); background: none; border-radius: 0; padding: 0 var(--e-3); }
.creneau-libre:hover { color: var(--accent); background: var(--accent-teinte); }
.jour-semaine { margin-bottom: var(--e-4); }
.jour-semaine h3 a { display: inline-block; color: var(--encre); text-decoration: none; }

/* ---------- Agenda : semaine (ordinateur, FullCalendar) ----------
   Structure : .vue-ordinateur > .agenda-ordinateur > (section.agenda-semaine + aside.panneau-detail).
   Rendu de référence : docs/maquettes/agenda-semaine.html. Une heure = 48 px (deux créneaux de 24 px). */
.vue-ordinateur { display: none; }
@media (min-width: 900px) {
  .vue-mobile { display: none; }
  .vue-ordinateur { display: block; }
  /* Pleine largeur de l'écran : la barre de commandes touche la grille, qui défile dans son cadre. */
  .agenda-ordinateur {
    display: grid; grid-template-columns: minmax(0, 1fr) calc(440px + var(--pile-bandes, 0) * 48px); grid-template-rows: minmax(0, 1fr); gap: 0; align-items: stretch;
    height: calc(100vh - 48px); min-height: 480px;
    margin: calc(-1 * var(--e-5)) calc(-1 * var(--e-6)) calc(-1 * var(--e-7));
  }
  /* T-035 : la section a exactement la hauteur de la rangée (1fr) et ne défile pas ; la grille FullCalendar (height: 100%) remplit
     l'espace au-dessus de la légende et défile seule (heures). Ni la pile ni son contenu ne peuvent la faire grandir. */
  .agenda-semaine { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--trait); }
  #agenda { flex: 1 1 0; min-height: 0; }
  .agenda-semaine .legende { flex: none; }
  .panneau-detail { min-width: 0; min-height: 0; overflow-y: auto; background: var(--surface); padding: var(--e-4); position: static; }
}
.agenda-periode { font-size: var(--t-section); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Panneau de détail : la séance choisie (ou le résumé de la semaine) */
.panneau-detail h2 { font-size: var(--t-section); font-weight: 700; margin: 0 0 var(--e-1); }
.panneau-detail h3 { font-size: var(--t-corps); font-weight: 600; margin: var(--e-5) 0 var(--e-2); }
.panneau-detail .fenetre-corps { padding: 0; overflow: visible; flex: none; }
.panneau-detail .fenetre-entete { position: static; margin: 0 0 var(--e-3); padding: 0; min-height: 0; border: 0; background: none; align-items: flex-start; }
.panneau-detail .fenetre-entete h2 { font-size: var(--t-section); margin: 0; }
.panneau-detail .fermer { order: 0; }
.panneau-detail .sous-ligne { background: var(--surface); }
.panneau-detail .actions-form { position: static; padding: var(--e-3) 0 0; border: 0; margin: var(--e-3) 0 0; }
.panneau-detail dl.definitions { grid-template-columns: 96px 1fr; }
.panneau-detail button.ligne-tel { display: grid; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0;
  border-bottom: 1px solid var(--trait); cursor: pointer; }
.panneau-detail button.ligne-tel:hover { background: var(--surface-2); }
.panneau-detail ul.liste-tel { background: none; }
.resume { margin-top: var(--e-7); padding-top: var(--e-4); border-top: 1px solid var(--trait); }
.resume:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.resume .ligne { display: flex; justify-content: space-between; padding: var(--e-1) 0; }
.resume .ligne .num { font-weight: 600; }

/* FullCalendar : variables de base (bordures fines, aujourd'hui neutre, heure actuelle bordeaux) */
.fc {
  --fc-border-color: var(--trait); --fc-today-bg-color: #FCFAFA; --fc-now-indicator-color: var(--accent);
  --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--surface-2); --fc-neutral-text-color: var(--encre-2);
  --fc-event-text-color: var(--encre); --fc-highlight-color: transparent;
  --fc-button-text-color: var(--encre); --fc-button-bg-color: var(--surface); --fc-button-border-color: var(--trait-fort);
  --fc-button-hover-bg-color: var(--surface-2); --fc-button-hover-border-color: var(--trait-champ);
  --fc-button-active-bg-color: var(--accent-teinte); --fc-button-active-border-color: var(--accent);
  font-size: var(--t-corps); font-family: inherit; color: var(--encre);
}
.fc .fc-toolbar-title { font-size: var(--t-section); font-weight: 600; }
.fc .fc-button-primary { font-weight: 600; border-radius: var(--rayon); min-height: var(--h-ctrl); padding: 0 var(--e-3); box-shadow: none; }
.fc .fc-button-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { color: var(--accent); }
.fc .fc-button-primary:disabled { opacity: .5; }
.fc .fc-scrollgrid, .fc .fc-scrollgrid td, .fc .fc-scrollgrid th { border-color: var(--trait); }
.fc .fc-scrollgrid { border-width: 0; }
.fc table { background: none; font-variant-numeric: normal; }
/* Les règles de tableau de l'application (marges, hauteur, sticky, survol) ne s'appliquent pas aux tableaux de FullCalendar. */
.fc th, .fc td { height: auto; padding: 0; position: static; background: none; font-size: inherit; font-weight: inherit; color: inherit;
  white-space: normal; border-bottom-color: var(--trait); }
.fc tbody tr:hover { background: none; }
.fc a { font-weight: inherit; text-decoration: none; white-space: normal; }
.fc .fc-timegrid-axis, .fc .fc-timegrid-slot-label { border-right-color: var(--trait); }

/* En-têtes de jours : jour abrégé 13 px, date 16 px 600, aujourd'hui dans un carré bordeaux */
.fc .fc-col-header-cell { background: var(--surface); text-align: left; vertical-align: top; }
.fc .fc-col-header-cell-cushion { display: block; padding: var(--e-2); color: var(--encre); font-weight: 400; text-decoration: none; }
.sb-jour small { display: block; font-size: var(--t-second); color: var(--encre-2); }
.sb-jour b { font-size: var(--t-section); font-weight: 600; font-variant-numeric: tabular-nums; }
.fc .fc-day-today .sb-jour b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px;
  border-radius: var(--rayon); background: var(--accent); color: #fff; }

/* Grille des heures : colonne de 56 px, trait plein à l'heure, pointillé à la demi-heure */
.fc .fc-timegrid-slot { height: 28px; }
.fc .fc-timegrid-axis, .fc .fc-timegrid-slot-label { width: 56px; min-width: 56px; }
.fc .fc-timegrid-slot-label { border-color: var(--trait); }
.fc .fc-timegrid-slot-label-cushion { display: block; min-width: 56px; white-space: nowrap; font-size: var(--t-legende); color: var(--encre-2); font-variant-numeric: tabular-nums;
  text-align: right; padding: 0 var(--e-2) 0 0; }
.fc .fc-timegrid-slot-minor { border-top-style: dashed; border-top-color: var(--trait); }
.fc .fc-timegrid-now-indicator-line { border-width: 2px 0 0; border-color: var(--accent); }
.fc .fc-timegrid-now-indicator-arrow { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--accent); margin: -4px 0 0 -4px; }

/* Bloc de séance : teinte de l'état, barre de 3 px, texte encre, rayon 4 px.
   Le JS retire les couleurs posées en ligne ; la classe etat-* de l'événement fixe --barre, --teinte, --texte-etat.
   Le sélecteur #agenda passe devant les règles de FullCalendar sans !important. */
#agenda .fc-event {
  --barre: #8A8886; --teinte: #F3F2F1; --texte-etat: #484644;
  overflow: hidden; min-width: 56px; margin: 0 1px;
  background: var(--teinte); color: var(--encre); border: 0; border-radius: var(--rayon); box-shadow: none;
  font-size: var(--t-second); line-height: 1.2; cursor: pointer;
}
#agenda .fc-event:not(.fc-timegrid-event) { position: relative; }  /* les blocs de grille horaire restent en absolu (FullCalendar) */
#agenda .fc-event.etat-a_facturer, #agenda .fc-event.etat-afacturer { --barre: #C9A36B; --teinte: #FBF3E4; --texte-etat: #7A5A1E; }
#agenda .fc-event.etat-facturee, #agenda .fc-event.etat-emise { --barre: #3D6AA8; --teinte: #EAF0F8; --texte-etat: #2D5288; }
#agenda .fc-event.etat-payee { --barre: #3E8A5B; --teinte: #E8F3EC; --texte-etat: #2A6B42; }
#agenda .fc-event.etat-annulee, #agenda .fc-event.seance-annulee { --barre: #C8C6C4; --teinte: #F5F5F5; --texte-etat: #6E6E6E; }
#agenda .fc-event.etat-retard, #agenda .fc-event.etat-erreur { --barre: #B3261E; --teinte: #FDECEA; --texte-etat: #9F2119; }
#agenda .fc-event::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--barre); }
#agenda .fc-event .fc-event-main { padding: 3px 6px 3px 8px; color: var(--encre); overflow: hidden; }
#agenda .fc-event:hover { background: var(--teinte); filter: brightness(.97); text-decoration: none; }
#agenda .fc-event:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#agenda .fc-event[aria-selected="true"], #agenda .fc-event.fc-event-selected { outline: 2px solid var(--accent); outline-offset: 0; z-index: 5; }
#agenda .fc-event:focus::after, #agenda .fc-event-selected::after { display: none; }
#agenda .fc-timegrid-event-harness-inset .fc-timegrid-event, #agenda .fc-timegrid-event { box-shadow: none; }
#agenda .fc-event-title, #agenda .fc-event-time { font-size: var(--t-second); font-weight: 600; color: var(--encre); }
#agenda .fc-daygrid-event { white-space: normal; }

/* Contenu du bloc : heure, cavaliers, cheval, état (ce qui ne tient pas est coupé par le bloc) */
.sb-contenu { min-width: 0; }
.sb-heure { font-size: var(--t-second); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.sb-qui { font-size: var(--t-second); font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-cheval { font-size: var(--t-legende); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-etat { font-size: var(--t-legende); font-weight: 600; color: var(--texte-etat); line-height: 1.2; white-space: nowrap; }
.seance-annulee .sb-qui, .etat-annulee .sb-qui { text-decoration: line-through; }

/* Bloc de groupe (3 séances simultanées ou plus) : surface blanche, bordure, pas de barre d'état */
#agenda .fc-event.seance-groupe { background: var(--surface); border: 1px solid var(--trait-fort); }
#agenda .fc-event.seance-groupe::before { display: none; }
#agenda .fc-event.seance-groupe .fc-event-main { padding-left: 6px; }
#agenda .fc-event.seance-groupe .sb-cheval { font-variant-numeric: tabular-nums; }
#agenda .fc-event.seance-groupe .sb-cheval + .sb-cheval { margin-top: 2px; }

/* Glisser-déposer et sélection d'un créneau : repère pointillé bordeaux */
#agenda .fc-event-mirror, #agenda .fc-event-dragging { opacity: .85; }
.fc .fc-highlight { background: transparent; outline: 2px dashed var(--accent); outline-offset: -2px; }

/* Légende : une ligne sous la grille, collée en bas de la zone défilante */
.legende { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-3); margin-top: var(--e-3); }
.agenda-semaine .legende { margin-top: 0; padding: var(--e-3) var(--e-4) var(--e-3) 64px; border-top: 1px solid var(--trait);
  background: var(--surface); position: sticky; bottom: 0; z-index: 3; }
.legende .pastille { cursor: default; }

/* ---------- Placer un cours ---------- */
.pastilles-eleves { display: grid; gap: var(--e-2); }
.pastille-eleve { display: grid; grid-template-columns: 1fr auto; gap: var(--e-1) var(--e-3); align-items: center;
  background: var(--accent-teinte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: var(--e-2) var(--e-3); }
.pastille-eleve strong { font-size: var(--t-corps); font-weight: 600; }
.pastille-eleve select { grid-column: 1 / -1; }
.pastille-eleve .retirer { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0;
  font-size: 1.1rem; cursor: pointer; width: var(--cible); height: var(--cible); min-height: var(--cible); color: var(--encre);
  border-radius: var(--rayon); }
.pastille-eleve .retirer:hover { background: var(--surface); }
.suggestions { display: grid; gap: var(--e-1); margin-top: var(--e-1); }
.suggestion { text-align: left; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 0 var(--e-3); font: inherit; min-height: var(--h-ctrl); cursor: pointer; color: var(--encre); }
.suggestion:hover { border-color: var(--accent); background: var(--accent-teinte); }

/* ---------- Connexion ---------- */
.connexion { min-height: 80vh; display: grid; place-items: center; text-align: center; }
.connexion-carte { width: min(100%, 400px); background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon-panneau); padding: var(--e-6); text-align: left; }
.connexion-logo { display: block; width: min(240px, 80%); height: auto; margin: 0 auto var(--e-3); }
.menu-logo img, .barre-logo img, img.connexion-logo { object-fit: contain; }
@media (min-width: 900px) { body:not(:has(.menu)) .contenu { margin-left: auto; margin-right: auto; max-width: 560px; } }

/* ---------- Sections dépliables ---------- */
details { margin: var(--e-2) 0; }
details > summary { list-style: none; display: inline-flex; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: var(--e-2); }
details:not(.menu-plus) > form { background: var(--surface-2); border: 1px solid var(--trait); border-radius: var(--rayon); padding: var(--e-3); }
.modifier-eleve { margin: 0; }
.modifier-eleve[open] { flex-basis: 100%; }

/* ---------- Champ de recherche (static/js/recherche.js) ---------- */
.recherche { position: relative; width: 100%; }
.recherche > select { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; opacity: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); pointer-events: none; border: 0; }
.recherche-liste { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: var(--e-1);
  list-style: none; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon-fenetre); box-shadow: var(--ombre-flotte); }
.recherche-option { display: flex; align-items: center; min-height: var(--h-ctrl); padding: 0 var(--e-3);
  border-radius: var(--rayon); cursor: pointer; color: var(--encre); }
.recherche-option:hover, .recherche-option.actif { background: var(--accent-teinte); }
.recherche-option[aria-selected="true"] { font-weight: 600; }
.recherche-vide { padding: var(--e-3); color: var(--encre-2); }

/* ---------- Ajustements tactiles (44 px minimum partout sous 900 px, sans exception) ---------- */
@media (max-width: 899px) {
  .bouton, button.bouton, .bouton.petit, .pastille, .menu-lien, .onglet, .item-menu, .suggestion, .creneau-libre,
  .segments > *, .bascule-vue a, summary.bouton, .case, .recherche-option, .contenu :not(.segments) > button:not([class]) {
    min-height: 44px;
  }
  .fermer, .retirer, .fleche, .barre-menu, .menu-fermer, .bouton.icone { min-width: 44px; min-height: 44px; }
  .bouton.petit { padding: 0 var(--e-3); }
  .bascule-vue a { min-width: 44px; justify-content: center; }
  /* Onglets : défilement horizontal visible (dégradé à droite), aucun libellé coupé */
  .onglets { scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent); padding-right: var(--e-6); }
  .onglet { scroll-snap-align: start; }
  .avec-fiche .bouton-flottant { display: none; }
  .entete-page.avec-fiche h1 { display: none; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Contrat commun (.agents/decisions.md) : noms de classes partagés par les gabarits v2
   ========================================================================== */
/* Pas de « display: revert » : il écraserait le display des boutons et des segments. On masque seulement du mauvais côté. */
@media (min-width: 900px) { .seulement-tel { display: none !important; } }
@media (max-width: 899px) { .seulement-ordi { display: none !important; } }

/* Barre de commandes : ordinateur = une ligne de 48 px ; téléphone = titre puis rangée défilante */
header.commandes { display: flex; align-items: center; gap: var(--e-2); min-height: 48px; margin: 0 0 var(--e-4); }
header.commandes h1 { margin: 0 var(--e-2) 0 0; font-size: var(--t-titre); font-weight: 700; white-space: nowrap; }
.commandes-droite { margin-left: auto; display: flex; align-items: center; gap: var(--e-2); }
@media (min-width: 900px) {
  .contenu > header.commandes { position: sticky; top: var(--rg-hauteur, 0px); z-index: 10; padding: 0 var(--e-6); background: var(--surface);
    border-bottom: 1px solid var(--trait); margin: calc(-1 * var(--e-6)) calc(-1 * var(--e-6)) var(--e-5); }
}
@media (max-width: 899px) {
  header.commandes { overflow-x: auto; scrollbar-width: none; margin-bottom: var(--e-3); }
  header.commandes > * { flex: none; }
  header.commandes h1 { margin-right: var(--e-3); }
}

/* Liste + fiche */
a.ligne-liste { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--e-3); align-content: center; }
.ligne-liste-titre { grid-column: 1; font-weight: 600; font-size: var(--t-corps); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-liste-info { grid-column: 1; font-size: var(--t-second); color: var(--encre-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-liste-fin { grid-column: 2; grid-row: 1 / span 2; align-self: center; justify-self: end; font-variant-numeric: tabular-nums; }
.liste-outils { flex-wrap: wrap; align-items: center; }
.fiche { min-width: 0; max-width: 760px; }
.fiche-section { margin-top: var(--e-7); }
.fiche-section:first-child { margin-top: 0; }
.fiche-section > h3 { font-size: var(--t-section); font-weight: 600; margin: 0 0 var(--e-2); }
dl.definitions { display: grid; grid-template-columns: minmax(96px, 128px) 1fr; gap: var(--e-2) var(--e-3); margin: 0; }
dl.definitions dt { color: var(--encre-2); }
dl.definitions dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 899px) { dl.definitions { grid-template-columns: 1fr; gap: 0; } dl.definitions dd { margin-bottom: var(--e-2); } }

/* Tableaux : zone défilante, table, tableau + panneau de fiche (440 px) */
.tableau-zone { overflow: auto; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-panneau); }
table.tableau { width: 100%; }

/* Listes téléphone */
h2.groupe-liste, .groupe-liste { position: sticky; top: var(--barre-hauteur); z-index: 2; margin: 0; padding: var(--e-2) var(--e-4);
  font-size: var(--t-corps); font-weight: 600; color: var(--encre-2); background: var(--fond); border-bottom: 1px solid var(--trait); }
ul.liste-tel { list-style: none; margin: 0; padding: 0; background: var(--surface); }
a.ligne-tel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--e-3); min-height: 64px; align-content: center;
  padding: var(--e-2) var(--e-4); color: var(--encre); text-decoration: none; border-bottom: 1px solid var(--trait); }
a.ligne-tel:hover { background: var(--surface-2); color: var(--encre); }
.ligne-tel-nom { font-weight: 600; font-size: var(--t-section); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-tel-montant { font-weight: 600; font-size: var(--t-section); font-variant-numeric: tabular-nums; text-align: right; }
.ligne-tel-ref { font-size: var(--t-second); color: var(--encre-2); font-variant-numeric: tabular-nums; }
a.ligne-tel .pastille { justify-self: end; }

/* Tuiles du tableau de bord */
.tuile-libelle { display: block; font-size: var(--t-corps); color: var(--encre-2); }
.tuile-valeur { display: block; font-size: var(--t-valeur); font-weight: 700; color: var(--encre); font-variant-numeric: tabular-nums; line-height: 1.2; }
.tuile-detail { display: block; font-size: var(--t-second); color: var(--encre-2); }

/* Formulaires : groupes */
fieldset.section-form { border: 0; border-top: 1px solid var(--trait); margin: 0; padding: var(--e-4) 0 0; min-width: 0; }
fieldset.section-form > legend { font-size: var(--t-section); font-weight: 600; padding: 0; float: left; width: 100%; margin-bottom: var(--e-3); }
fieldset.section-form > legend + * { clear: both; }

/* Gabarit de base (T-002) : structure main.contenu > header.commandes.fixe > h1.titre-ecran, commandes, div.droite */
.commandes .droite { margin-left: auto; display: flex; align-items: center; gap: var(--e-2); }
h1.titre-ecran { font-size: var(--t-titre); font-weight: 700; margin: 0 var(--e-2) 0 0; white-space: nowrap; }
.titre-ecran:empty { display: none; }
.toast.erreur { cursor: pointer; }
.menu[inert] { opacity: 1; }

/* ---- Ajouts du chef d'équipe (relecture T-001/T-002/T-005) ---- */
/* Le bouton flottant n'existe que sur téléphone : sur ordinateur, l'action principale est dans la barre de commandes. */
@media (min-width: 900px) { .bouton-flottant, .bouton.bouton-flottant, a.bouton.bouton-flottant, button.bouton.bouton-flottant { display: none; } }
/* Les liens de tableau (numéros de pièce) ne se coupent pas. */
td a { white-space: nowrap; }
/* Recherche et bouton « Chercher » sur la même ligne ; les onglets passent dessous. */
.liste-outils input, .liste-outils .recherche { flex: 1 1 160px; min-width: 0; width: auto; }
.liste-outils .onglets { flex: 1 0 100%; }

/* ==========================================================================
   Intégration des besoins CSS des tickets T-002 à T-008 (ticket T-010)
   ========================================================================== */

/* ---------- Liste + fiche (T-005) ---------- */
.liste-outils { position: sticky; top: 0; z-index: 2; padding-bottom: var(--e-2); background: var(--fond); }
.liste-outils form { display: flex; gap: var(--e-2); flex: 1 1 100%; min-width: 0; margin: 0; }
.liste-outils form input[type=search] { flex: 1 1 auto; min-width: 0; width: auto; }
.liste-outils .onglets { margin: 0; }
.liste-vide { margin: var(--e-4); }
.ligne-liste.archivee { opacity: 1; }
.ligne-liste.archivee .ligne-liste-titre { color: var(--encre-2); font-weight: 400; }
.ligne-liste-fin { display: flex; align-items: center; gap: var(--e-2); }
.ligne-liste-fin .num { color: var(--encre-2); font-size: var(--t-second); }
.fiche-vide { max-width: 760px; }
.fiche-vide h2 { font-size: var(--t-section); font-weight: 700; margin: 0 0 var(--e-2); }
.fiche-vide .bouton { margin-top: var(--e-3); }
.fiche-section + .fiche-section { margin-top: var(--e-7); }
.fiche .tuiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.fiche-entete { align-items: flex-start; gap: var(--e-2) var(--e-3); }
.fiche-entete h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.fiche-entete > .pastille { flex: none; }
.fiche-entete > .fermer, .fiche-entete .actions-fiche { margin-left: auto; }
@media (min-width: 900px) {
  .fiche-entete { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; align-items: center; }
}
/* Onglets de filtre : une seule ligne, le menu « Plus » à la fin et déroulé en menu flottant */
.onglets { align-items: center; }
@media (min-width: 900px) { .onglets { overflow: visible; } }
.onglets > .menu-plus { margin: 0 0 0 auto; }
.onglets > .menu-plus > summary.onglet { width: auto; display: inline-flex; }
.onglets > .menu-plus > summary.onglet::after { margin-left: var(--e-1); }
.onglets .item-menu[aria-current] { color: var(--accent); font-weight: 600; }
.retour-liste.seulement-tel { display: inline-flex; }
/* Définitions : libellé gris sur 160 px, valeur à droite (une colonne sur téléphone, voir plus haut) */
@media (min-width: 900px) { dl.definitions { grid-template-columns: minmax(96px, 160px) 1fr; } }

/* ---------- Écrans tableau (T-006) : tableau pleine largeur + fiche de 440 px à droite ----------
   Rendu de référence : docs/maquettes/factures.html (en-tête de filtres, tableau, fiche, sans marge). */
.liste-outils.filtres-tableau { position: static; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between;
  gap: var(--e-2); margin: 0 0 var(--e-2); padding: var(--e-2) var(--e-3); background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-panneau); }
.filtres-tableau .onglets { flex: 0 1 auto; min-width: 0; margin: 0; border-bottom: 0; }
.filtres-tableau .onglet { border-radius: var(--rayon); }
.filtres-tableau .onglet[aria-current] { border-radius: 0; }
.compte { margin-left: auto; color: var(--encre-2); white-space: nowrap; }
.liste-outils p { margin: 0; }
.formulaire-facturation .liste-outils { position: static; justify-content: space-between; background: none; padding-bottom: 0; }
.fiche-actions { display: flex; flex-wrap: wrap; gap: var(--e-2); padding: var(--e-3) 0 var(--e-4); border-bottom: 1px solid var(--trait); margin-bottom: var(--e-5); }
.fiche-reste { display: flex; justify-content: space-between; align-items: baseline; margin: var(--e-3) 0 0; padding: var(--e-3);
  border: 1px solid var(--trait); border-radius: var(--rayon-panneau); background: var(--surface-2); }
.fiche-reste strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.fiche .tableau-zone, .fenetre .tableau-zone { overflow-x: auto; max-height: none; }
.fiche .tableau th, .fenetre .tableau th { top: 0; }
.fiche-section details.menu-plus .menu-plus-liste { position: static; box-shadow: none; padding: var(--e-3); }
.fiche-section details.menu-plus > summary { display: inline-flex; width: auto; }
/* Ligne entière cliquable : le lien porte un calque, le numéro reste le seul lien visible */
.tableau tbody tr { cursor: pointer; position: relative; }
.tableau td { white-space: nowrap; }
.tableau td[colspan] { white-space: normal; }
.tableau a.lien-ligne { color: var(--accent); font-weight: 600; text-decoration: none; }
.tableau a.lien-ligne:hover { text-decoration: underline; }
.tableau a.lien-ligne::after { content: ""; position: absolute; inset: 0; }
.tableau .pastille { vertical-align: middle; }
.messages ~ .vue-ordinateur .agenda-ordinateur { margin-top: 0; height: calc(100vh - 48px - 60px); }
@media (max-width: 899px) {
  .filtres-tableau { padding: 0; background: none; border: 0; }
}

/* Cases à cocher de la facturation par client : une ligne par séance (T-006) */
.formulaire-facturation { display: grid; gap: var(--e-3); }
.liste-cases { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-panneau); }
.liste-cases li { border-bottom: 1px solid var(--trait); }
.liste-cases li:last-child { border-bottom: 0; }
.liste-cases .case { display: grid; grid-template-columns: auto 56px minmax(0, 1fr) auto; align-items: center; gap: var(--e-3);
  min-height: var(--h-ligne); padding: 0 var(--e-3); font-weight: 400; cursor: pointer; }
.liste-cases .case:hover { background: var(--surface-2); }
.case-date { color: var(--encre-2); font-variant-numeric: tabular-nums; }
.case-libelle { min-width: 0; overflow-wrap: anywhere; }
.case-montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ligne-deplacement { background: var(--surface-2); }
@media (max-width: 899px) {
  .liste-cases .case { padding: var(--e-2) var(--e-3); }
  .case-libelle { overflow: visible; }
}
.tableau-total-tel { display: flex; justify-content: space-between; padding: var(--e-3) var(--e-4); font-weight: 600;
  border-top: 2px solid var(--trait-fort); background: var(--surface); font-variant-numeric: tabular-nums; }
div.ligne-tel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--e-3); min-height: 64px; align-content: center;
  padding: var(--e-2) var(--e-4); color: var(--encre); border-bottom: 1px solid var(--trait); }
button.ligne-tel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--e-3); width: 100%; min-height: 64px; align-content: center;
  padding: var(--e-2) var(--e-4); text-align: left; font: inherit; color: var(--encre); background: none; border: 0; border-bottom: 1px solid var(--trait); cursor: pointer; }
button.ligne-tel:hover { background: var(--surface-2); }
.ligne-tel .pastille { justify-self: end; }

/* ---------- Formulaires et fenêtres (T-004, T-005) ---------- */
#fenetre-contenu > form { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 0; }
#fenetre-contenu > form.formulaire { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 0; }
.formulaire .fenetre-corps { display: grid; gap: var(--e-5); align-content: start; }
.formulaire .fenetre-corps > .alerte { margin: 0; }
.groupe-champs, fieldset.section-form { display: block; min-width: 0; }
.groupe-champs > div + div, fieldset.section-form > div + div, fieldset.section-form > legend + div + div { margin-top: var(--e-4); }
/* Largeur selon le contenu : posée sur le contrôle, pas sur le .champ, pour que libellé et aide gardent toute la largeur. */
.champ.l-date, .champ.l-heure, .champ.l-nombre, .champ.l-montant, .champ.l-tel, .champ.l-cp { width: auto; max-width: 100%; }
.champ.l-date input { width: 160px; } .champ.l-heure input { width: 112px; } .champ.l-nombre input, .champ.l-montant input { width: 128px; }
.champ.l-tel input { width: 200px; } .champ.l-cp input { width: 112px; }
.champ.l-date input, .champ.l-heure input, .champ.l-nombre input, .champ.l-montant input, .champ.l-tel input, .champ.l-cp input { max-width: 100%; }
.champ.l-plein, .champ.l-plein input, .champ.l-plein select { width: 100%; }
.champ-case { flex-direction: column; align-items: flex-start; }
.champ > label.case, .champ-case .case { font-weight: 400; font-size: var(--t-corps); }
.champ .champ-aide, .champ.l-nombre .champ-aide, .champ.l-date .champ-aide, .champ.l-heure .champ-aide { max-width: none; white-space: normal; }
.champ > .champ-erreur, .champ > .erreurs { margin: 0; }
.bouton.alignee-gauche { align-self: flex-start; margin-left: 0; }
.ligne-debut-fin { display: flex; flex-wrap: nowrap; gap: var(--e-3); }
.ligne-debut-fin > .champ { flex: 0 0 auto; }
.ligne-champs.ligne-debut-fin { grid-template-columns: none; }
/* Hors fenêtre (page de formulaire dans une carte) : pas de défilement interne, pied non collant */
.carte .fenetre-corps { padding: 0; overflow: visible; flex: none; }
.carte .fenetre-pied, .carte .actions-form { position: static; padding: var(--e-4) 0 0; border-top: 0; justify-content: flex-start; }
.carte .formulaire { max-width: 560px; }
.carte > h2 { margin-bottom: var(--e-4); }
.carte > .champ + .champ { margin-top: var(--e-4); }
.formulaire > .carte { max-width: 560px; margin-bottom: 0; }
.carte .fenetre-corps * { max-width: none; }
/* Pied de fenêtre : ordinateur = principal puis « Annuler » à droite ; téléphone = pleine largeur, « Annuler » au-dessus */
@media (min-width: 900px) {
  .fenetre-pied, .fenetre .actions-form { flex-direction: row; flex-wrap: nowrap; justify-content: flex-end; }
}
@media (max-width: 899px) {
  .fenetre-pied, .fenetre .actions-form { flex-direction: column-reverse; align-items: stretch; }
  .fenetre-pied .bouton, .fenetre .actions-form .bouton { width: 100%; }
  .carte .fenetre-pied, .carte .actions-form { flex-direction: column; }
}
.fenetre-entete .bouton.icone { flex: none; }
.fenetre-entete .fermer.bouton { background: none; border-color: transparent; color: var(--encre); }

/* ---------- Connexion (T-008) ---------- */
.formulaire > .bouton.l-plein, .bouton.l-plein { width: 100%; }
.formulaire > .bouton.discret.l-plein { text-align: center; min-height: var(--h-ctrl); }
.connexion h1 { font-size: var(--t-titre); margin: 0 0 var(--e-2); }
.connexion .doux { color: var(--encre-2); margin-bottom: var(--e-4); }
.connexion .formulaire { gap: var(--e-4); }
.connexion-carte > .champ-erreur, .formulaire > .champ-erreur { margin: 0; }

/* ---------- Tableau de bord (T-007) ---------- */
.tuiles, .compteurs { gap: var(--e-4); }
.tuile, .compteur { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
a.tuile:hover { color: inherit; }
.contenu > section { margin-top: var(--e-6); }
.contenu > section > h2 { margin: 0 0 var(--e-2); }
.contenu > section > .tableau-zone + p.champ-aide { margin-top: var(--e-2); }
p.champ-aide { font-size: var(--t-corps); }   /* notes sous un tableau : 14 px minimum */

/* ---- Ajouts du chef d'équipe (relecture 2, téléphone) ---- */
@media (max-width: 899px) {
  /* Fiche ouverte : son action principale est déjà dans l'en-tête, pas de bouton flottant « Nouveau » par-dessus. */
  body:has(.fiche-entete) .bouton-flottant { display: none; }
  /* Onglets de filtre : défilent sur une ligne ; le compte passe dessous. */
  .contenu .liste-outils { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  .liste-outils .onglets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%; }
  .liste-outils .compte { flex: 1 0 100%; margin: 0; }
  /* Cibles de 44 px : logo de la barre, segments de l'agenda. */
  .barre-logo { min-height: 44px; }
  .segments a, .segments button { min-height: 44px; }
}

/* ---------- Squelettes de chargement (T-018) ---------- */
.squelette { display: grid; gap: 12px; padding: 16px; }
.squelette-ligne, .squelette-bloc { background: var(--trait); border-radius: 4px; opacity: .6; }
.squelette-ligne { height: 16px; }
.squelette-ligne:nth-child(odd) { width: 85%; }
.squelette-bloc { height: 72px; }
.squelette-titre { height: 24px; width: 50%; }
.squelette-liste .squelette-ligne { height: 48px; width: 100%; }
[aria-busy="true"] > .squelette ~ * { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) { .squelette { animation: squelette-fondu 1.6s ease-in-out infinite alternate; } }
@keyframes squelette-fondu { from { opacity: .6 } to { opacity: 1 } }

/* ---- Panneaux empilés (T-014), ajoutés par le chef d'équipe ---- */
.pile { display: flex; min-width: 0; max-width: 100%; align-items: flex-start; background: var(--fond); overflow: hidden; border: 1px solid var(--trait); border-radius: var(--rayon-panneau); }
.pile-fil { display: none; }
.pile-panneau { flex: none; width: 440px; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--trait); max-height: calc(100vh - 96px); overflow-y: auto; }
.pile-panneau:last-child { border-right: 0; }
.pile-depart { flex: 1 1 0; width: auto; min-width: 440px; display: block; border-right: 1px solid var(--trait); }
.pile-panneau.pile-dernier:not(.pile-depart) { flex: 1 1 440px; max-width: 760px; min-width: 0; }
.pile-replie { flex: none; width: 48px; min-width: 48px; max-width: 48px; overflow: hidden; background: var(--surface-2); }
.pile-replie > :not(.pile-bande) { display: none; }
.pile-bande { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--e-3); width: 100%; padding: var(--e-3) 0; border: 0; background: var(--surface-2); font: inherit; color: var(--encre); cursor: pointer; }
.pile-bande[hidden] { display: none; }
.pile-bande:hover { background: var(--surface); }
.pile-bande span { writing-mode: vertical-rl; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 260px; }
.pile-bande small { writing-mode: vertical-rl; color: var(--encre-2); font-size: 13px; }
.pile-tete { padding: var(--e-4); border-bottom: 1px solid var(--trait); }
.pile-tete-ligne { display: flex; align-items: center; gap: var(--e-2); }
.pile-tete h2 { margin: 0; font-size: 16px; font-weight: 700; }
.pile-tete h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pile-panneau:not(.pile-dernier) .pile-tete h2 { cursor: pointer; }
.pile-tete .fermer { margin-left: auto; }
.pile-actions { display: flex; flex-wrap: wrap; gap: var(--e-2); margin-top: var(--e-3); }
.pile-corps { padding: var(--e-4); min-width: 0; }
.pile-corps .sous-ligne { flex-wrap: wrap; }
/* Animation d'apparition, de fermeture et de repli : voir la section T-025 en fin de fichier. */
@media (max-width: 899px) {
  .pile { display: block; overflow: visible; border: 0; background: none; scroll-margin-top: var(--barre-hauteur); }
  .pile-fil { display: flex; align-items: center; height: 44px; gap: 2px; padding: 0 var(--e-2); border-bottom: 1px solid var(--trait); font-size: 14px; color: var(--encre-2); white-space: nowrap; overflow: hidden; background: var(--surface); }
  .pile-fil a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--encre-2); text-decoration: none; }
  .pile-fil .pile-retour { min-width: 44px; justify-content: center; font-size: 18px; color: var(--encre); }
  .pile-fil .pile-courant { color: var(--encre); font-weight: 600; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
  .pile > .pile-panneau:not(.pile-dernier) { display: none; }
  .pile-panneau, .pile-panneau.pile-dernier:not(.pile-depart) { width: auto; min-width: 0; max-width: none; max-height: none; border: 0; overflow: visible; overflow-x: clip; }
  .pile-bande, .pile-panneau [data-pile-fermer] { display: none; }
  .pile-tete h2 { font-size: 18px; }
}
/* Tuiles dans un panneau de pile (440 px) : deux par rangée, valeur sur une ligne. */
.pile-panneau .tuiles, .pile-panneau .compteurs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pile-panneau .tuile-valeur, .pile-panneau .tuile b { white-space: nowrap; font-size: 20px; }

/* ---- Page hors connexion (T-015), ajoutée par le chef d'équipe ---- */
.hors-connexion { max-width: 28rem; margin: 0 auto; padding: var(--e-6) var(--e-4); text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--e-3); min-height: 100vh; }
.hors-connexion-logo { max-width: 100%; height: auto; }

/* ---- Palette de commandes Ctrl+K (T-016), ajoutée par le chef d'équipe ---- */
dialog.palette { width: min(560px, calc(100vw - 24px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--trait);
  border-radius: 8px; background: var(--surface); box-shadow: var(--ombre-fenetre); max-height: 70vh; overflow: hidden; flex-direction: column; }
dialog.palette[open] { display: flex; }
dialog.palette::backdrop { background: rgb(36 36 36 / .32); }
.palette-entete { padding: var(--e-3); border-bottom: 1px solid var(--trait); }
.palette-champ { width: 100%; font-size: 16px; }
.palette-liste { overflow-y: auto; padding: var(--e-1); }
.palette-groupe-titre { font-size: 13px; font-weight: 600; color: var(--encre-2); margin: var(--e-2) var(--e-3) var(--e-1); }
.palette-option { display: flex; justify-content: space-between; align-items: center; gap: var(--e-3); min-height: 36px;
  padding: var(--e-2) var(--e-3); color: var(--encre); text-decoration: none; border-radius: 4px; }
.palette-option[aria-selected="true"], .palette-option:hover { background: var(--accent-teinte); }
.palette-option-info { font-size: 13px; color: var(--encre-2); }
.palette-vide { padding: var(--e-4); color: var(--encre-2); }
.palette-aide { font-size: 12px; color: var(--encre-2); padding: var(--e-2) var(--e-3); border-top: 1px solid var(--trait); margin: 0; }
@media (max-width: 899px) { .palette-option { min-height: 44px; } .palette-aide { display: none; } }

/* ---- Toast « Annuler » (T-017), ajouté par le chef d'équipe ---- */
.toast.annulable { display: flex; align-items: center; gap: var(--e-4); }
.toast.annulable .toast-texte { flex: 1 1 auto; }
.toast-annuler { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0 var(--e-2);
  min-height: 24px; text-decoration: underline; cursor: pointer; border-radius: 4px; }
.toast-annuler:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
@media (max-width: 899.98px) { .toast-annuler { min-height: 44px; min-width: 44px; } }

/* ---- Hauteur de la pile de panneaux (T-014, complément) ---- */
@media (min-width: 900px) {
  .pile { align-items: stretch; height: calc(100dvh - 68px - var(--e-7)); }
  .pile-panneau { max-height: none; height: 100%; }
}

/* ---- Liste des raccourcis clavier (T-019) ---- */
.raccourcis-liste { display: grid; grid-template-columns: 120px 1fr; gap: var(--e-2) var(--e-3); margin: 0; }
.raccourcis-liste dt { margin: 0; } .raccourcis-liste dd { margin: 0; color: var(--encre-2); }
kbd { font: inherit; font-size: 13px; font-weight: 600; padding: 0 6px; border: 1px solid var(--trait-fort); border-radius: 4px;
  background: var(--surface-2); }
/* Téléphone : panneau de pile ouvert, pas de bouton flottant par-dessus (comme une fiche ouverte). */
@media (max-width: 899px) { body:has(.pile-panneau:not(.pile-depart)) .bouton-flottant { display: none; } }

/* ---- Pile partout (T-020) : lignes cliquables, onglets et séance dans un panneau ---- */
tr[data-pile], tr:has(a[data-pile]) { cursor: pointer; }
tr[data-pile]:hover, tr:has(a[data-pile]):hover { background: var(--surface-2); }
.pile-panneau .fiche-section > .onglets { flex-wrap: wrap; margin-bottom: var(--e-3); }
.pile-panneau .detail-seance { padding: 0; min-width: 0; }
.pile-panneau .detail-seance > .fenetre-entete { display: none; }
.pile-corps form[hx-post] { min-width: 0; }
.pile-depart.pile-replie > :not(.pile-bande) { display: none; }

/* Besoins CSS de T-021 : liste seule, la fiche s'ouvre en panneau. */
.liste-resume { margin: 0 0 var(--e-3); font-size: 14px; }
.liste-seule .colonne-liste { position: static; max-height: none; }
@media (min-width: 900px) { .liste-seule { grid-template-columns: minmax(0, 1fr); } }

/* Besoins CSS de T-023 : agenda dans la pile. */
@media (min-width: 900px) {
  .pile-depart .agenda-ordinateur { margin: 0; height: calc(100dvh - 68px - var(--e-7)); min-height: 0; }
}
.carte-seance { text-decoration: none; color: inherit; }
.menu-seances { min-width: 16rem; max-width: 22rem; }

/* Besoins CSS de T-022 : liens et boutons d'une ligne cliquable au-dessus du recouvrement de la ligne. */
.tableau a:not(.lien-ligne), .tableau .bouton { position: relative; z-index: 1; }
.tableau td:last-child .bouton.petit { white-space: nowrap; }
.ligne-tel-action { margin: 0 var(--e-4) var(--e-3) auto; display: flex; width: fit-content; }
a.tuile { text-decoration: none; color: inherit; }

/* Place insuffisante : l'écran de départ replié ne se déplie pas, donc le dernier panneau prend toute la place restante
   (au lieu de s'arrêter à 760 px et de laisser un vide à droite). */
@media (min-width: 900px) { .pile:has(> .pile-depart.pile-replie) > .pile-panneau.pile-dernier { max-width: none; } }

/* ---- T-025 : formulaires en panneau et animation des panneaux ---- */
.pile { position: relative; }
.pile-formulaire { --fen-pad: var(--e-4); }
.pile-formulaire > .pile-tete { display: flex; align-items: center; min-height: 56px; padding: var(--e-2) var(--e-4); flex: none; }
.pile-formulaire > .pile-tete .pile-tete-ligne { flex: 1; min-width: 0; }
.pile-formulaire > .pile-tete h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pile-form-contenu { padding: 0; min-width: 0; }
.pile-form-contenu .fenetre-entete { display: none; } /* le titre et la fermeture sont dans l'en-tête du panneau */
.pile-form-contenu > form { display: flex; flex-direction: column; gap: 0; }
.pile-form-contenu .formulaire .fenetre-corps { overflow-x: hidden; }
.pile-form-contenu > .fenetre-corps, .pile-form-contenu > :not(form):not(.fenetre-entete) { padding: var(--fen-pad); }
@media (min-width: 900px) {
  .pile-formulaire { overflow: hidden; }
  .pile-formulaire > .pile-form-contenu { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
  .pile-form-contenu > form { flex: 1; min-height: 0; }
  .pile-form-contenu .fenetre-corps { flex: 1; min-height: 0; overflow-y: auto; }
}
/* Pied collant du panneau : « Enregistrer » puis « Annuler » ; le panneau fait 440 px, les boutons restent à droite. */
.pile-formulaire .fenetre-pied, .pile-formulaire .actions-form { position: sticky; bottom: 0; z-index: 2; margin: 0; flex: none;
  display: flex; gap: var(--e-2); justify-content: flex-end; padding: var(--e-3) var(--fen-pad) calc(var(--e-3) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--trait); }
@media (min-width: 900px) { .pile-formulaire .fenetre-pied, .pile-formulaire .actions-form { flex-direction: row; flex-wrap: nowrap; } }

/* Animations des panneaux : voir static/css/animations.css */
.pile-depart.pile-replie { flex: 0 0 48px; }

/* ---- T-029 : tableaux qui rentrent à toute largeur (container queries) ----
   Chaque .tableau-zone mesure sa propre largeur (écran de départ replié à 440 px, panneau, téléphone).
   Colonnes prioritaires toujours visibles ; .col-sec2 disparaît sous 720 px, .col-sec sous 560 px.
   Le nom (td.client) prend le reste et se coupe avec « … » ; jamais plus d'une ligne par cellule. */
.tableau-zone { container-type: inline-size; }
@container (max-width: 719px) { .col-sec2 { display: none; } }
@container (max-width: 559px) { .col-sec { display: none; } }
.tableau-zone table.tableau { min-width: 0; }
.tableau td.client { min-width: 0; }
@container (max-width: 399px) { .tableau th { white-space: normal; line-height: 1.2; } }

/* ---- T-034 : agenda, la colonne de droite est l'emplacement de la pile (440 px fixes) ----
   Pile vide : le résumé « Cette semaine » y est affiché comme un panneau. Un panneau l'y remplace (même place, même largeur) ;
   les panneaux précédents se replient en bandes de 48 px dans l'emplacement (--pile-bandes), la semaine rétrécit alors de 48 px
   par bande. La pile prend exactement la place de l'agenda sans pile (mêmes marges négatives, même hauteur) : à l'ouverture et à
   la fermeture, rien ne bouge dans la semaine. Le départ (semaine + résumé) remplit la pile ; les panneaux sont alignés à droite. */
@media (min-width: 900px) {
  .pile.pile-agenda { max-width: none; display: flex; justify-content: flex-end; align-items: stretch; background: none; border: 0; border-radius: 0; overflow: hidden;
    margin: calc(-1 * var(--e-5)) calc(-1 * var(--e-6)) calc(-1 * var(--e-7)); }
  .pile-agenda > .pile-depart { position: absolute; inset: 0; width: auto; min-width: 0; max-width: none; height: auto; max-height: none; border: 0; overflow: hidden; }
  /* T-035 : dans la pile, .vue-ordinateur (parent de la grille) doit avoir la hauteur du départ, sinon le pourcentage de
     .agenda-ordinateur n'est pas résolu et la section s'effondre à l'ouverture du premier panneau (la grille changeait de hauteur). */
  .pile-agenda > .pile-depart .vue-ordinateur { height: 100%; }
  .pile-agenda > .pile-depart .agenda-ordinateur { height: 100%; margin: 0; }
  .pile-agenda > .pile-panneau:not(.pile-depart) { position: relative; z-index: 2; height: 100%; max-height: none; border-left: 1px solid var(--trait); }
  .pile-agenda > .pile-panneau.pile-dernier:not(.pile-depart) { flex: 0 0 440px; width: 440px; min-width: 440px; max-width: 440px; }
  .pile-agenda > .pile-replie { flex: 0 0 48px; width: 48px; min-width: 48px; max-width: 48px; }
  /* Résumé « Cette semaine » : même cadre qu'un panneau (fond, bordure, en-tête). */
  .agenda-resume { padding: 0; border-left: 1px solid var(--trait); }
  /* Le résumé ne s'affiche que si la pile est vide de façon stable (pile.js, `pile-vide`) : jamais entre deux panneaux. */
  .pile-agenda:not(.pile-vide) .agenda-resume { visibility: hidden; }
  .agenda-resume .resume h2 { margin: 0; padding: var(--e-4); border-bottom: 1px solid var(--trait); font-size: 16px; font-weight: 700; }
  .agenda-resume .resume > :not(h2) { margin-left: var(--e-4); margin-right: var(--e-4); }
  .agenda-resume .resume > h2 + * { margin-top: var(--e-4); }
  .agenda-resume > p { padding: var(--e-4); margin: 0; }
}
/* Date et heures du créneau choisi, en clair sous le titre du formulaire « Placer un cours ». */
.pile-formulaire > .pile-tete:has(.pile-creneau) { flex-direction: column; align-items: stretch; justify-content: center; }
.pile-creneau { margin: 2px 0 0; font-size: 14px; font-weight: 600; color: var(--accent); }
.pile-creneau:empty { display: none; }

/* T-034 : l'agenda ne déborde ni en largeur ni en hauteur. La recherche globale (recherche.css) ajoute --rg-decalage en haut
   du contenu : on le retire de la hauteur de l'agenda (avec ou sans tiroir, même formule). Entre 900 et 1099 px la barre de
   commandes de l'agenda passe sur deux rangées (elle mesure 1082 px sur une rangée) : on réserve la rangée en plus. */
@media (min-width: 900px) {
  .vue-ordinateur .agenda-ordinateur, .pile.pile-agenda { height: calc(100vh - 48px - var(--rg-decalage, 0px)); }
  .messages ~ .vue-ordinateur .agenda-ordinateur, .messages ~ .pile.pile-agenda { height: calc(100vh - 48px - 60px - var(--rg-decalage, 0px)); }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .contenu > .commandes.fixe:has(~ .vue-ordinateur #agenda), .contenu > .commandes.fixe:has(~ .pile.pile-agenda) { flex-wrap: wrap; row-gap: 0; padding-top: 0; }
  .vue-ordinateur .agenda-ordinateur, .pile.pile-agenda { height: calc(100vh - 65px - var(--rg-decalage, 0px)); }
  .messages ~ .vue-ordinateur .agenda-ordinateur, .messages ~ .pile.pile-agenda { height: calc(100vh - 65px - 60px - var(--rg-decalage, 0px)); }
}

/* ---- T-039 : panneaux, tableaux, téléphone, clavier, finitions ---- */

/* S-4, S-6, S-21 : dans un panneau ou une fenêtre, la désignation passe à la ligne (jamais coupée par « … ») ; les montants gardent
   leur ligne unique et leur colonne entière. Le tableau de l'écran de départ (liste) garde son comportement. */
.pile-corps .tableau td, .fenetre .tableau td, .fiche .tableau td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.pile-corps .tableau td.num, .fenetre .tableau td.num, .fiche .tableau td.num, .pile-corps .tableau th.num, .fenetre .tableau th.num, .fiche .tableau th.num { white-space: nowrap; overflow-wrap: normal; }
.pile-corps .tableau td.client, .fenetre .tableau td.client, .fiche .tableau td.client { max-width: none; width: auto; overflow: visible; text-overflow: clip; }
.pile-corps .tableau th, .fenetre .tableau th, .fiche .tableau th { white-space: nowrap; }
.pile-corps .tableau-zone, .fenetre .tableau-zone { max-width: 100%; }

/* S-48 : liens des fiches, des panneaux et des onglets : en accent, soulignés au survol et au focus seulement. */
.pile-corps a:not(.bouton):not(.item-menu), .fiche a:not(.bouton):not(.item-menu), dl.definitions a, .sous-ligne a, .tuiles a:not(.tuile),
.fenetre-corps a:not(.bouton) { text-decoration: none; font-weight: 600; }
.pile-corps a:not(.bouton):not(.item-menu):hover, .fiche a:not(.bouton):not(.item-menu):hover, dl.definitions a:hover, .sous-ligne a:hover,
.fenetre-corps a:not(.bouton):hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

/* S-42 : lien « Aller au contenu » : caché jusqu'au focus clavier. */
.aller-contenu { position: absolute; left: var(--e-3); top: -100px; z-index: 200; padding: var(--e-2) var(--e-4); border-radius: var(--rayon);
  background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
.aller-contenu:focus { top: var(--e-3); outline: 2px solid #fff; outline-offset: -4px; box-shadow: 0 0 0 2px var(--accent); color: #fff; }
.contenu:focus { outline: none; }

/* Téléphone */
@media (max-width: 899px) {
  /* S-38 : un panneau ouvert (adresse rechargée ou ouvert depuis une liste) prend tout l'écran sous la barre, sans le grand titre
     de l'écran au-dessus : le fil « ‹ Paiements » le remplace, comme sur Clients et Factures. */
  .contenu:has(.pile-panneau:not(.pile-depart)) { padding-top: 0; }
  .contenu:has(.pile-panneau:not(.pile-depart)) > header.commandes, .contenu:has(.pile-panneau:not(.pile-depart)) > .messages ~ header.commandes { display: none; }
  /* S-39 : tout lien en ligne a une cible de 44 px de haut. */
  .pile-corps a:not(.bouton):not(.item-menu):not(.onglet), .fiche a:not(.bouton):not(.item-menu):not(.onglet), dl.definitions dd a,
  .sous-ligne a, .tuiles a:not(.tuile), .fenetre-corps a:not(.bouton), .tableau a.lien-ligne, .tableau td a:not(.bouton):not(.lien-ligne),
  .jour-semaine h3 a, .resume a:not(.bouton) { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  .sous-ligne { align-items: center; }
  /* S-6 : pièce en pleine page : la fiche porte déjà son titre, le grand titre de l'écran ne le double pas et le bouton reste entier. */
  .contenu:has(> .fiche) > header.commandes { flex-wrap: wrap; overflow: visible; }
  .contenu:has(> .fiche) > header.commandes h1.titre-ecran { display: none; }
  /* S-51 : fil d'Ariane : les premiers éléments se raccourcissent avec « … », les deux derniers restent entiers. */
  .pile-fil a:not(.pile-retour) { flex: none; white-space: nowrap; }
  .pile-fil .pile-retour + a { flex: 0 1 auto; min-width: 2.5em; overflow: hidden; text-overflow: ellipsis; }
  .pile-fil .pile-courant { flex: none; max-width: 70%; }
  .pile-fil .pile-sep { flex: none; }
}
/* S-52 : clavier ouvert (écran bas) : le pied d'un formulaire en panneau ne cache plus le champ, il défile avec lui. */
@media (max-width: 899px) and (max-height: 600px) {
  .pile-formulaire .fenetre-pied, .pile-formulaire .actions-form { position: static; }
}
/* Aide des raccourcis (panneau) */
.aide-raccourcis kbd, .raccourcis-liste kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--trait-fort); border-bottom-width: 2px;
  border-radius: 4px; background: var(--surface); font: inherit; font-size: var(--t-second); text-align: center; }
.aide-raccourcis dl.definitions { grid-template-columns: minmax(64px, auto) 1fr; }
.aide-raccourcis .champ-aide { margin-top: var(--e-4); }
/* S-39 : le bouton flottant du téléphone fait 56 px de haut (la règle .bouton le ramenait à 44 px). */
@media (max-width: 899px) { .bouton.bouton-flottant, a.bouton.bouton-flottant, button.bouton.bouton-flottant { min-height: 56px; } }
/* Panneau d'une séance (T-040, styles sortis des gabarits) */
.fait-seance { margin-block: var(--e-3); }
.retirer-eleve { margin-top: var(--e-6); padding-top: var(--e-4); border-top: 1px solid var(--trait); }
.bouton.agenda-aujourdhui { padding-inline: 8px; }

/* ---- T-044 : corrections de la revue T-009 (n° 5, 8, 9, 12, 13, 14, 25) ---- */

/* n° 5 : À facturer avec un panneau ouvert : le nom du client prend le reste ; le nombre de séances et le montant ont une largeur
   courte (en-tête sur deux lignes, détail des déplacements qui passe à la ligne) au lieu de 135 et 252 px. */
.tableau .col-nb { width: 1%; }
.tableau th.col-nb { white-space: normal; min-width: 5.5em; line-height: 1.2; }
.tableau .detail-depl { display: block; white-space: normal; min-width: 11em; max-width: 15em; margin-left: auto; font-weight: 400; }

/* n° 8 : filtres du Livre des recettes : une rangée de contrôles de 32 px (44 px au téléphone), le bouton garde sa largeur. */
.filtres-livre { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--e-3); margin: 0 0 var(--e-4); }
.filtres-livre > .champ { flex: 0 0 auto; }
.filtres-livre > .champ select { min-width: 160px; }
.filtres-livre > .bouton, .filtres-livre > button { flex: none; width: auto; align-self: flex-end; }

/* n° 9 : l'aide sous un champ n'est pas un libellé : 12 px (13 px au téléphone), --encre-2, normal. La règle `.champ > span`
   (libellé) la dépassait en spécificité. */
.champ > .champ-aide, .champ > .aide, .champ > span.champ-aide { font-size: var(--t-legende); font-weight: 400; color: var(--encre-2); line-height: 1.35; }

/* n° 13 : tuiles : jamais centrées (le lien en ligne du téléphone les centrait) ; une tuile seule sur sa rangée prend toute la largeur. */
.tuile, a.tuile { align-items: stretch; text-align: left; font-weight: 400; }
@media (max-width: 899px) {
  .tuiles > .tuile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  a.tuile { display: flex; min-height: 0; }
  /* n° 12 : mots courts (nom d'un cheval, année) : zone cliquable d'au moins 44 x 44 sans grossir le texte. */
  .contenu p a:not(.bouton):not(.item-menu), .contenu td a:not(.bouton):not(.item-menu),
  .pile-corps p a:not(.bouton):not(.item-menu) { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  /* Tableau de bord : listes en place des tableaux (pas de tableau au téléphone) ; l'écran n'a pas de bouton flottant. */
  .liste-tel-bloc { margin-bottom: var(--e-4); }
  /* n° 25 : un seul panneau, plein écran : pas de marge de 16 px autour d'un panneau de pile. */
  .contenu:has(.pile-panneau:not(.pile-depart)) { padding-left: 0; padding-right: 0; }
  .contenu:has(.pile-panneau:not(.pile-depart)) > .messages { margin-left: var(--e-4); margin-right: var(--e-4); }
  .pile > .pile-panneau, .pile-panneau.pile-dernier { border-radius: 0; }
}

/* n° 14 : une liste sans panneau ouvert garde une largeur de lecture (nom et pastille restent proches). */
@media (min-width: 900px) {
  .liste-seule { max-width: 680px; }
  .pile-depart .liste-seule { max-width: none; }
}

/* ---- T-044 : besoins CSS de T-042 (agenda, panneau d'une séance) et de T-043 (avoir, listes du téléphone) ---- */
/* Mois : un bloc ne dépasse jamais sa case ; repère de glisser-déposer pointillé bordeaux (en plus du style posé par agenda.js). */
#agenda .fc-event.fc-daygrid-event { min-width: 0; overflow: hidden; }
#agenda .fc-event-mirror { border: 2px dashed var(--accent); background: var(--accent-teinte); box-sizing: border-box; }
/* Segments « Cours | Dépense » en tête d'un corps de formulaire : jamais écrasés par la grille du corps. */
.fenetre-corps > .segments { flex: none; min-height: var(--h-ctrl); align-self: start; justify-self: start; }
/* Dépliant « Émettre un avoir » du panneau facture : dans le flux, sans triangle natif. */
details.avoir > summary { list-style: none; }
details.avoir > summary::-webkit-details-marker { display: none; }
.avoir-corps { margin-top: var(--e-3); }
/* Téléphone : le nom prend toute la largeur de la ligne 1 ; le chiffre ou la pastille de fin passe sur la ligne 2, à droite. */
@media (max-width: 899px) {
  a.ligne-liste .ligne-liste-titre { grid-column: 1 / -1; }
  a.ligne-liste .ligne-liste-info { grid-column: 1; grid-row: 2; }
  a.ligne-liste .ligne-liste-fin { grid-column: 2; grid-row: 2; align-self: center; }
}

/* ---- Besoins CSS de T-042 (agenda), ajoutés par le chef d'équipe ---- */
#agenda .fc-event.fc-daygrid-event { min-width: 0; overflow: hidden; }
#agenda .fc-event-mirror { border: 2px dashed var(--accent); background: var(--accent-teinte); box-sizing: border-box; }
.fenetre-corps > .segments { flex: none; min-height: var(--h-ctrl); align-self: start; justify-self: start; }
.sb-contenu > [hidden] { display: none !important; }

/* Panneau séance : formulaires Annuler, Reporter, Modifier ouverts depuis le menu « Plus » de l'en-tête (audit UI 25/11/2026).
   Fermés, ils n'occupent aucune place ; ouverts, leur titre n'est qu'un intitulé (on ferme avec « Fermer »). */
.action-seance:not([open]) { display: none; }
.action-seance > summary { list-style: none; pointer-events: none; font-size: var(--t-section); font-weight: 600; margin: var(--e-4) 0 var(--e-2); }
.action-seance > summary::-webkit-details-marker { display: none; }
.pile-actions .fait-seance { margin: 0; }
