/* Optisignal : composants communs à toutes les pages (connexion, espace client, administration).
   Chargé juste après public/assets/osg-jetons.css. Aucune couleur, aucune taille de texte ne s'écrit ici : tout vient des jetons.
   Chaque composant est montré sur la page de référence /app/admin/design (views/admin-design.html) :
   un nouveau composant s'ajoute ici ET sur cette page (test/composants.test.js le vérifie).
   Ce qui n'appartient qu'à une page est dans osg-pages.css ; la barre du haut dans osg-shell.css. */

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--police); font-size: var(--texte-m); line-height: var(--interligne); word-spacing: var(--espace-mots); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Titre qui reçoit le focus par script (aperçu, formulaire ouvert) : pas de cadre autour */
[tabindex="-1"]:focus-visible { outline: none; }
input, select, textarea, button { font: inherit; word-spacing: inherit; color: var(--ink); }
code { font-family: var(--police-mono); font-size: max(.92em, var(--texte-xs)); }
/* Texte lu par les lecteurs d'écran, invisible à l'écran */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Lien « Aller au contenu » : le premier élément de chaque page, hors de l'écran tant que le clavier ne l'a pas atteint.
   Il mène à <main id="page">, après la barre du haut, le fil de retour et les onglets. */
.evitement { position: absolute; z-index: 30; top: calc(env(safe-area-inset-top, 0px) + var(--esp-2)); left: max(var(--esp-2), env(safe-area-inset-left, 0px)); display: inline-flex; align-items: center; min-height: var(--cible); padding: var(--esp-2) var(--esp-4); border-radius: var(--rayon-m); background: var(--bouton); color: var(--sur-bouton); font-weight: var(--gras); text-decoration: none; box-shadow: var(--ombre-2); transform: translateY(-200%); }
.evitement:focus { transform: none; }

/* ---------- Mise en page ---------- */
.wrap { max-width: var(--largeur-page); margin: 0 auto; padding-left: max(var(--esp-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--esp-4), env(safe-area-inset-right, 0px)); padding-bottom: var(--esp-7); }
/* Page de lecture (formulaire, liste de textes) : même bord gauche que les autres pages, contenu limité à la largeur de lecture */
.wrap.lecture > * { max-width: var(--largeur-lecture); }
.wrap.lecture > .onglets, .wrap.lecture > .fil { max-width: none; }
/* En-tête de page : le titre, la phrase qui dit à quoi sert la page, et l'action principale s'il y en a une (.page-actions) */
.page-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; row-gap: var(--esp-2); padding-block: var(--esp-6) var(--esp-4); }
.page-tete > * { grid-column: 1; }
.page-tete > .page-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: var(--esp-2); margin-left: var(--esp-4); }
.onglets + main > .page-tete { padding-top: var(--esp-3); }
/* Fil de retour : où se trouve la page, et le chemin pour remonter. Au-dessus de la sous-navigation. */
.fil { min-width: 0; padding-top: var(--esp-2); }
.fil ol { display: flex; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--texte-s); line-height: var(--cible); white-space: nowrap; }
.fil li { flex: none; min-height: var(--cible); }
/* Sur une ligne, toujours : si la place manque, le nom de la page en cours est coupé par « … » (le titre est juste dessous) */
.fil li:last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fil li + li::before { content: "›"; margin-inline: var(--esp-2); color: var(--muted); font-weight: 400; }
.fil a { display: inline-block; min-height: var(--cible); color: var(--muted); text-decoration: none; }
.fil a:hover { color: var(--accent); text-decoration: underline; }
.fil [aria-current="page"] { color: var(--ink); font-weight: var(--gras); }
h1, .titre-page { font-weight: var(--gras-fort); font-size: var(--titre-1); line-height: var(--interligne-titre); margin: 0; text-wrap: balance; letter-spacing: -.02em; }
.lede { margin: 0; color: var(--muted); max-width: 70ch; }
h2.section { font-size: var(--titre-5); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: var(--esp-6) 0 var(--esp-3); font-weight: var(--gras); }
.section-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--esp-3); }
.outils { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-2) var(--esp-4); margin-bottom: var(--esp-3); }
.compte { margin-left: auto; font-size: var(--texte-s); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Boutons ----------
   .btn seul : secondaire. Variantes : .principal, .discret, .danger (et .danger.plein pour confirmer), .large (action unique d'un écran).
   Chargement : aria-busy="true" sur le bouton (le script le pose pendant l'envoi). */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--esp-2); min-height: var(--cible); padding: var(--esp-2) var(--esp-4); border: 1px solid var(--line); border-radius: var(--rayon-m); background: var(--panel); color: var(--ink); font-weight: var(--gras); line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer; transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition); }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.principal { background: var(--bouton); border-color: var(--bouton); color: var(--sur-bouton); }
.btn.principal:hover { background: var(--bouton-survol); border-color: var(--bouton-survol); color: var(--sur-bouton); }
.btn.discret { background: none; border-color: transparent; color: var(--accent); }
.btn.discret:hover { background: var(--accent-soft); border-color: transparent; }
.btn.danger { color: var(--late); border-color: var(--late); }
.btn.danger:hover { background: var(--late-soft); color: var(--late); border-color: var(--late); }
.btn.danger.plein, .btn.danger.plein:hover { background: var(--late); color: var(--panel); }
.btn.large { width: 100%; min-height: var(--esp-7); font-weight: var(--gras-fort); box-shadow: var(--ombre-bouton); }
.btn.large:hover { box-shadow: var(--ombre-bouton-survol); }
.btn:disabled, .btn:disabled:hover { opacity: .55; cursor: default; border-color: var(--line); color: var(--muted); box-shadow: none; }
.btn.discret:disabled, .btn.discret:disabled:hover { background: none; border-color: transparent; }
.btn.principal:disabled, .btn.principal:disabled:hover { background: var(--wait-soft); border-color: var(--line); color: var(--muted); opacity: 1; }
.btn.danger:disabled, .btn.danger:disabled:hover { background: var(--panel); border-color: var(--line); color: var(--muted); }
/* Chargement : le bouton garde sa couleur, un anneau tourne devant le texte, on ne peut pas cliquer deux fois */
.btn[aria-busy="true"] { cursor: progress; pointer-events: none; }
.btn[aria-busy="true"]::before { content: ""; flex: none; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: osg-tour .7s linear infinite; }
.btn.principal[aria-busy="true"] { background: var(--bouton); border-color: var(--bouton); color: var(--sur-bouton); }
@keyframes osg-tour { to { transform: rotate(1turn); } }

/* Lien d'action : un bouton qui se lit comme un lien, seul ou dans une rangée d'actions. Sa zone de clic fait 44 px de haut. */
.lien { all: unset; cursor: pointer; display: inline-flex; align-items: center; min-height: var(--cible); color: var(--accent); font-size: var(--texte-s); font-weight: var(--gras); justify-self: start; }
.lien:hover { text-decoration: underline; }
.lien:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--rayon-s); }
.lien:disabled { color: var(--muted); opacity: .6; cursor: default; text-decoration: none; }
/* Pendant l'envoi (aria-busy posé par le script), le lien reste en place et garde le focus */
.lien[aria-busy="true"] { color: var(--muted); cursor: progress; text-decoration: none; }

/* ---------- Champs et erreurs ----------
   Un champ : <div class="champ"> avec son libellé, sa saisie, une aide (.aide) et un message d'erreur (.erreur, id="erreur-<champ>"). */
.champ { display: grid; gap: var(--esp-2); align-content: start; min-width: 0; margin: 0; padding: 0; border: 0; }
.champ > label, .champ > legend { font-size: var(--texte-s); font-weight: var(--gras); padding: 0; }
.champ > legend { margin-bottom: var(--esp-2); }
.champ :where(input:not([type="checkbox"], [type="radio"]), select, textarea) { width: 100%; min-height: var(--cible); padding: var(--esp-2) var(--esp-3); border: 1px solid var(--bord-champ); border-radius: var(--rayon-m); background: var(--bg); transition: border-color var(--transition), box-shadow var(--transition); }
/* Texte d'exemple d'un champ : la couleur du texte secondaire (le gris du navigateur est sous le contraste AA) */
::placeholder { color: var(--muted); opacity: 1; }
.champ textarea { min-height: 120px; resize: vertical; line-height: var(--interligne); }
.champ textarea.court { min-height: 64px; }
.champ :where(input:not([type="checkbox"], [type="radio"]), select, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); box-shadow: 0 0 0 4px var(--halo); }
/* Champ d'heure : sur l'icône d'horloge, le navigateur ne dit plus :focus pour le champ, seulement :focus-within */
.champ input[type="time"]:focus-within { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); box-shadow: 0 0 0 4px var(--halo); }
.champ [aria-invalid="true"]:not(fieldset) { border-color: var(--late); }
.champ.court { max-width: 420px; }
.champ input.mono, .champ textarea.mono { font-family: var(--police-mono); font-size: var(--texte-s); }
.champ input.nombre { width: 96px; flex: none; font-variant-numeric: tabular-nums; }
.avec-unite { display: flex; align-items: center; gap: var(--esp-3); }
.unite { font-size: var(--texte-s); color: var(--muted); }
.discret { font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.aide { margin: 0; font-size: var(--texte-s); color: var(--muted); }
.aide.intro { margin: calc(-1 * var(--esp-1)) 0 var(--esp-3); }
.erreur { margin: 0; font-size: var(--texte-s); font-weight: var(--gras); color: var(--late); overflow-wrap: anywhere; }
.erreur::before { content: "! "; }
.sous-champ { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--esp-1) var(--esp-4); }
.compteur { margin-left: auto; font-size: var(--texte-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.compteur.trop { color: var(--late); font-weight: var(--gras); }
.rangee { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--esp-4); }
.choix { display: flex; flex-wrap: wrap; gap: var(--esp-2); }
/* Champ suivi de son bouton (ajouter une adresse, envoyer un test) */
.ajout { display: flex; gap: var(--esp-2); }
.ajout input, .ajout select { flex: 1; min-width: 0; }
.ajout .btn { flex: none; }
/* Pied de formulaire : bouton principal, action secondaire, état de l'enregistrement */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--esp-3) var(--esp-4); padding-top: var(--esp-4); border-top: 1px solid var(--line); }
/* Lien d'action à côté du bouton (« Annuler les modifications ») : une cible de la hauteur du bouton */
.etat { margin: 0; font-size: var(--texte-s); color: var(--muted); }
.etat.ok { color: var(--ok); font-weight: var(--gras); }
.etat.alerte { color: var(--late); font-weight: var(--gras); }
/* Barre d'enregistrement d'un long formulaire : elle reste au bas de l'écran */
.barre-fixe { position: sticky; bottom: 0; z-index: 2; background: var(--bg); padding-block: var(--esp-3); border-top: 1px solid var(--line); }

/* Case ou bouton radio dans une pastille */
.coche { display: inline-flex; align-items: center; gap: var(--esp-2); min-height: var(--cible); padding: 0 var(--esp-4) 0 var(--esp-3); border: 1px solid var(--line); border-radius: var(--rayon-rond); background: var(--panel); cursor: pointer; transition: background var(--transition), border-color var(--transition), color var(--transition); }
.coche input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.coche:hover { border-color: var(--accent); }
.coche:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* Interrupteur (case à cocher role="switch") */
.bascule { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--esp-3); align-items: start; cursor: pointer; position: relative; }
.bascule input { position: absolute; opacity: 0; width: 46px; height: 26px; margin: 0; cursor: pointer; }
.bascule-piste { width: 46px; height: 26px; border-radius: var(--rayon-rond); background: var(--wait); position: relative; transition: background var(--transition); margin-top: 1px; }
.bascule-piste::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); transition: transform var(--transition); }
.bascule input:checked + .bascule-piste { background: var(--ok); }
.bascule input:checked + .bascule-piste::after { transform: translateX(20px); }
.bascule input:focus-visible + .bascule-piste { outline: 2px solid var(--focus); outline-offset: 2px; }
.bascule-texte { display: grid; gap: 2px; }
.bascule-texte b { font-weight: var(--gras); }
.bascule-texte span { font-size: var(--texte-s); font-weight: 400; color: var(--muted); }

/* Étiquettes retirables (destinataires) */
.pastilles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--esp-3) var(--esp-2); }
.pastille { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; background: var(--accent-soft); color: var(--accent); border-radius: var(--rayon-rond); padding: 2px var(--esp-1) 2px var(--esp-3); font-size: var(--texte-s); font-weight: 500; }
.pastille span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* La croix : un rond de 28 px à l'écran, une zone de clic de 44 px (bord transparent de 8 px, qui dépasse de l'étiquette) */
.pastille button { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: var(--cible); height: var(--cible); margin: -8px -8px -8px -6px; border: 8px solid transparent; background-clip: padding-box; border-radius: 50%; display: grid; place-items: center; font-size: var(--texte-l); line-height: 1; }
.pastille button:hover { background-color: var(--accent); color: var(--panel); }
.pastille button:focus-visible { outline: 2px solid var(--focus); outline-offset: -7px; }
.pastilles-vide { font-size: var(--texte-s); color: var(--muted); font-style: italic; padding: var(--esp-1) 0; }

/* ---------- Cartes, fiches et listes ---------- */
.carte { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rayon-l); box-shadow: var(--ombre-1); padding: var(--esp-5); display: grid; gap: var(--esp-5); margin: 0 0 var(--esp-4); }
.carte-titre { font-weight: var(--gras-fort); font-size: var(--titre-3); line-height: 1.2; margin: 0; }
.carte-tete { display: grid; gap: var(--esp-1); }
/* Carte en cours de modification */
.carte.edition { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
/* Fiche : des paires « nom, valeur » */
.fiche { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: var(--esp-3) var(--esp-4); margin: 0; font-size: var(--texte-s); }
.fiche dt { color: var(--muted); }
.fiche dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.fiche dd .discret { display: block; }
/* Liste dans un cadre : une ligne par élément, séparées par un trait */
.liste { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--rayon-l); box-shadow: var(--ombre-1); }
.liste > li { padding: var(--esp-3) var(--esp-4); min-width: 0; }
.liste > li + li { border-top: 1px solid var(--line); }

/* ---------- Tableaux ----------
   <div class="tableau-cadre"><table class="tableau">… : le cadre défile de côté sur un petit écran. */
.tableau-cadre { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--rayon-l); box-shadow: var(--ombre-1); }
.tableau { width: 100%; border-collapse: collapse; font-size: var(--texte-s); }
.tableau caption { caption-side: top; text-align: left; padding: var(--esp-3) var(--esp-4); font-weight: var(--gras); }
.tableau th, .tableau td { padding: var(--esp-3) var(--esp-4); text-align: left; vertical-align: top; }
.tableau thead th { color: var(--muted); font-weight: var(--gras); white-space: nowrap; border-bottom: 1px solid var(--line); }
.tableau tbody th { font-weight: var(--gras); }
.tableau tbody tr + tr > * { border-top: 1px solid var(--line); }
.tableau .chiffre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Pastilles d'état ----------
   .chip seule : grise (attente). Teintes : .info, .appel, .fait, .retard, .violet ; .contour pour un test. */
.chip { display: inline-block; font-size: var(--texte-xs); font-weight: var(--gras); padding: 3px 10px; border-radius: var(--rayon-rond); white-space: nowrap; background: var(--wait-soft); color: var(--wait); }
.chip.info { background: var(--accent-soft); color: var(--accent); }
.chip.appel { background: var(--call-soft); color: var(--call); }
.chip.fait { background: var(--ok-soft); color: var(--ok); }
.chip.retard { background: var(--late-soft); color: var(--late); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.contour { background: none; border: 1px dashed var(--muted); color: var(--muted); padding: 2px 9px; }
/* État d'un passage ou d'un envoi : un point et un mot */
.statut { display: inline-flex; align-items: center; gap: var(--esp-2); font-weight: var(--gras); }
.statut::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.statut.s-success { color: var(--ok); }
.statut.s-error { color: var(--late); }
.statut.s-running { color: var(--accent); }
.statut.s-running::before { animation: osg-pouls 1.4s ease-in-out infinite; }
.statut.s-simule { color: var(--wait); }
@keyframes osg-pouls { 50% { opacity: .25; } }

/* ---------- Onglets ---------- */
/* Une rangée plus large que l'écran défile sans se couper : pas de barre de défilement, et un fondu du côté où il reste
   des onglets (data-suite : « debut », « fin » ou « deux », posé par osg.onglets de osg-runtime.js). */
.onglets { display: flex; gap: var(--esp-1); overflow-x: auto; scrollbar-width: none; margin: 0 0 var(--esp-4); border-bottom: 1px solid var(--line); }
.onglets::-webkit-scrollbar { display: none; }
.onglets[data-suite="fin"] { -webkit-mask-image: linear-gradient(to left, transparent, currentColor var(--esp-7)); mask-image: linear-gradient(to left, transparent, currentColor var(--esp-7)); }
.onglets[data-suite="debut"] { -webkit-mask-image: linear-gradient(to right, transparent, currentColor var(--esp-7)); mask-image: linear-gradient(to right, transparent, currentColor var(--esp-7)); }
.onglets[data-suite="deux"] { -webkit-mask-image: linear-gradient(to right, transparent, currentColor var(--esp-7), currentColor calc(100% - var(--esp-7)), transparent); mask-image: linear-gradient(to right, transparent, currentColor var(--esp-7), currentColor calc(100% - var(--esp-7)), transparent); }
.onglets a { display: inline-flex; align-items: center; min-height: var(--cible); padding: 0 var(--esp-3); text-decoration: none; color: var(--muted); font-weight: var(--gras); font-size: var(--texte-s); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.onglets a:hover { color: var(--ink); }
.onglets a:focus-visible { outline-offset: -2px; }
.onglets a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Messages ----------
   .message seul : neutre. .info, .succes, .attention, .echec. .bandeau : message en tête de page, suivi d'une marge. */
.message { margin: 0; padding: var(--esp-3) var(--esp-4); border-radius: var(--rayon-m); background: var(--wait-soft); color: var(--ink); overflow-wrap: anywhere; }
.message.info { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.message.succes { background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.message.attention { background: var(--call-soft); color: var(--call); font-weight: 500; }
.message.echec { background: var(--late-soft); color: var(--late); font-weight: 500; }
.message.bandeau { margin-bottom: var(--esp-4); }

/* ---------- Boîte de confirmation ----------
   Elle s'ouvre sous l'action à confirmer : une phrase, puis le bouton qui confirme et « Annuler ». */
.confirme { display: grid; gap: var(--esp-3); padding: var(--esp-3) var(--esp-4); border-radius: var(--rayon-m); background: var(--call-soft); color: var(--ink); }
.confirme p { margin: 0; font-weight: 500; }

/* ---------- Bloc repliable ----------
   <details class="repli"> : un <summary> (le titre, puis au besoin .repli-info, une ligne qui dit ce qu'il y a dedans,
   et .repli-etat, des pastilles au bord droit), puis .repli-corps. Le navigateur l'ouvre et le ferme (souris, Entrée, Espace).
   Ouvert, il ne montre plus .repli-info : le contenu est juste dessous. */
.repli { background: var(--panel); border: 1px solid var(--line); border-radius: var(--rayon-l); box-shadow: var(--ombre-1); margin: 0 0 var(--esp-3); min-width: 0; }
.repli > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px var(--esp-3); min-height: var(--cible); padding: var(--esp-3) var(--esp-5) var(--esp-3) var(--esp-4); border-radius: var(--rayon-l); cursor: pointer; list-style: none; }
.repli > summary::-webkit-details-marker { display: none; }
/* Le chevron : vers la droite quand le bloc est fermé, vers le bas quand il est ouvert */
.repli > summary::before { content: ""; grid-row: 1 / span 2; width: 8px; height: 8px; margin: 0 var(--esp-1) 0 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform var(--transition); }
.repli[open] > summary::before { transform: rotate(45deg); }
.repli > summary:hover::before { border-color: var(--accent); }
.repli > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.repli > summary > * { grid-column: 2; min-width: 0; }
.repli-titre { font-weight: var(--gras); }
.repli-info { font-size: var(--texte-s); color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.repli[open] > summary > .repli-info { display: none; }
.repli > summary > .repli-etat { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--esp-1); }
.repli-corps { display: grid; gap: var(--esp-5); padding: var(--esp-2) var(--esp-5) var(--esp-5); min-width: 0; }

/* ---------- États vides ---------- */
.vide { margin: 0; padding: var(--esp-7) var(--esp-5); text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--rayon-l); display: grid; gap: var(--esp-2); justify-items: center; }
.vide img { width: 56px; height: 56px; opacity: .9; margin-bottom: var(--esp-2); }
.vide b { font-size: var(--titre-3); font-weight: var(--gras); color: var(--ink); line-height: 1.2; }
.vide span { max-width: 46ch; }
.vide .btn { margin-top: var(--esp-2); }
.vide.compact { padding: var(--esp-5) var(--esp-4); font-size: var(--texte-s); }

/* ---------- Chargement ----------
   .attente : une phrase. .chargement : la forme de ce qui arrive, en squelettes, avec la phrase en .sr pour les lecteurs d'écran. */
.attente { color: var(--muted); padding: var(--esp-5) 0; margin: 0; }
.chargement { display: grid; gap: var(--esp-4); }
.chargement .carte { gap: var(--esp-3); }
.squelette { display: block; height: 14px; border-radius: var(--rayon-s); background: var(--line); animation: osg-pouls 1.4s ease-in-out infinite; }
.squelette.titre { height: 22px; width: min(260px, 60%); }
.squelette.moyen { width: 82%; }
.squelette.court { width: 55%; }
.squelette.bloc { height: 96px; border-radius: var(--rayon-m); }

@media (max-width: 620px) {
  .rangee.souple { grid-template-columns: 1fr; }
  .page-tete { grid-template-columns: minmax(0, 1fr); }
  .page-tete > .page-actions { grid-column: 1; grid-row: auto; margin: var(--esp-2) 0 0; }
}
@media (max-width: 520px) {
  .carte { padding: var(--esp-4); }
  .repli > summary { padding-inline: var(--esp-3) var(--esp-4); }
  .repli-corps { padding: var(--esp-2) var(--esp-4) var(--esp-4); }
  .fiche { grid-template-columns: 1fr; gap: 2px; }
  .fiche dd { margin-bottom: var(--esp-3); }
  .fiche dd:last-child { margin-bottom: 0; }
  .fil li + li::before { margin-inline: var(--esp-1); }
  .ajout { flex-wrap: wrap; }
  .ajout input, .ajout select { flex-basis: 100%; }
  .ajout .btn { flex: 1; }
  .actions .btn.principal { flex: 1 1 100%; }
}
/* Moins de mouvement : plus d'animation ni de transition, pseudo-éléments compris (anneau d'un bouton, point d'un passage en cours) */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Chasse fixe ---------- */
/* L'espace reste celui de la police, pour garder les colonnes. En fin de feuille : après les « all: unset ». */
code, .champ input.mono, .champ textarea.mono { word-spacing: normal; }
