/* Administration de l'engin d'estimation : identité visuelle de BxL / Yvan.
   Les jetons reprennent ceux d'Yvan (frontend/src/index.css, DESIGN.md) : violet de marque
   #5C4AE8, lime #DAFB6E, fond de page froid #f1f0f7, Montserrat, rayons 8 et 12, ombres
   teintées. La police est servie par l'engin (statique/polices, licence OFL) : aucune
   requête vers un tiers, la politique de contenu (font-src 'self') reste inchangée. */

@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 400; src: url("polices/montserrat-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 400; src: url("polices/montserrat-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 500; src: url("polices/montserrat-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 500; src: url("polices/montserrat-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 600; src: url("polices/montserrat-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 600; src: url("polices/montserrat-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 700; src: url("polices/montserrat-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-display: swap; font-weight: 700; src: url("polices/montserrat-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ------------------------------------------------------------------ jetons (vue claire) */
:root {
  /* Marque (Yvan) */
  --primaire: #5C4AE8;          /* APLAT : bouton principal, barre latérale ; blanc dessus 5,8:1 */
  --primaire-encre: #5C4AE8;    /* ENCRE : titres, liens (5,8:1 sur carte, 5,1:1 sur la page) */
  --primaire-fonce: #3f2fb0;    /* survol de l'aplat */
  --primaire-voile: #efedfd;    /* survol doux, élément actif */
  --lime: #DAFB6E;              /* signature ; porte toujours de l'encre foncée (14,9:1) */
  --lime-encre: #1A1A1A;
  --barre: #5C4AE8;             /* barre latérale (--yvan-nav-bg) */

  /* Surfaces */
  --fond: #f1f0f7;
  --surface: #ffffff;
  --surface-douce: #f8f7fd;     /* en-tête de tableau, puits */
  --bordure: color-mix(in srgb, #5C4AE8 12%, #ffffff);
  --bordure-forte: color-mix(in srgb, #5C4AE8 28%, #ffffff);
  --bordure-champ: #8b8898;     /* contour des champs : 3,5:1 sur blanc (WCAG 1.4.11) */

  /* Encres */
  --encre: #1f1f1f;
  --encre-douce: #595959;       /* 7:1 sur blanc, 6,2:1 sur la page */
  --sur-aplat: #ffffff;

  /* Statuts (canon Yvan, contrastes AA mesurés là-bas) */
  --ok-fond: #e7f6ec; --ok-encre: #2d7858;
  --attente-fond: #fdf2e0; --attente-encre: #8A5A00;
  --erreur-fond: color-mix(in srgb, #E5484D 10%, #ffffff); --erreur-encre: #C62828; --erreur: #C62828;
  --neutre-fond: #ECECEA; --neutre-encre: #5b6660;

  /* Échelles (Yvan : TEXT_SIZE, TITLE_SIZE, SPACE, RADIUS) */
  --fs-mention: 13px; --fs-petit: 14px; --fs-base: 15px; --fs-h3: 16px; --fs-lead: 17px; --fs-h2: 20px; --fs-h1: 28px;
  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 24px; --e-6: 32px; --e-7: 40px;
  --rayon: 12px; --rayon-petit: 8px; --rayon-pilule: 999px;

  /* Profondeur et mouvement */
  --ombre-carte: 0 1px 3px rgba(60, 40, 160, 0.05);
  --ombre-douce: 0 1px 2px rgba(60, 40, 160, 0.04), 0 8px 24px rgba(60, 40, 160, 0.06);
  --ombre-fenetre: 0 2px 4px rgba(60, 40, 160, 0.06), 0 16px 40px rgba(60, 40, 160, 0.16);
  --anneau-couleur: #5C4AE8;
  --anneau: 0 0 0 3px color-mix(in srgb, #5C4AE8 28%, transparent);
  --voile: rgba(26, 20, 60, 0.45);
  --courbe: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duree: 150ms;

  --police: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
  --police-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

/* ------------------------------------------------------------------ vue sombre
   Un second jeu de décisions, repris du bloc sombre d'Yvan : surfaces à 248 degrés de
   teinte, ni #000 en fond ni #fff en texte, aplats qui portent le blanc à 4,5:1. */
@media (prefers-color-scheme: dark) {
  :root {
    --primaire: #7163df;
    --primaire-encre: #a59de8;
    --primaire-fonce: #4f3dd7;
    --primaire-voile: color-mix(in srgb, #a59de8 14%, #2a2834);
    --barre: #4f3dd7;
    --fond: #0f0f15;
    --surface: #2a2834;
    --surface-douce: #21202a;
    --bordure: color-mix(in srgb, #ffffff 9%, #2a2834);
    --bordure-forte: color-mix(in srgb, #a59de8 40%, #2a2834);
    --bordure-champ: #7d7a90;
    --encre: #e9e8ed;
    --encre-douce: #adaaba;
    --ok-encre: #73be9d; --ok-fond: color-mix(in srgb, #73be9d 18%, #2a2834);
    --attente-encre: #e69f1a; --attente-fond: color-mix(in srgb, #e69f1a 16%, #2a2834);
    --erreur-encre: #e08587; --erreur-fond: color-mix(in srgb, #e08587 16%, #2a2834); --erreur: #cc4747;
    --neutre-encre: #a5afa9; --neutre-fond: color-mix(in srgb, #ffffff 10%, #2a2834);
    --ombre-carte: 0 0 0 1px rgba(255, 255, 255, 0.04);
    --ombre-douce: 0 0 0 1px rgba(255, 255, 255, 0.05);
    --ombre-fenetre: 0 16px 48px rgba(0, 0, 0, 0.5);
    --anneau-couleur: #a59de8;
    --anneau: 0 0 0 3px color-mix(in srgb, #a59de8 35%, transparent);
    --voile: rgba(5, 4, 12, 0.7);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--police); font-size: var(--fs-base); line-height: 1.5; color: var(--encre); background: var(--fond); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-h1); line-height: 1.2; font-weight: 700; color: var(--primaire-encre); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-lead); line-height: 1.3; font-weight: 600; }
h3 { font-size: var(--fs-h3); font-weight: 600; margin: var(--e-5) 0 var(--e-2); }
code { font-family: var(--police-mono); font-size: 0.9em; }
a { color: var(--primaire-encre); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--anneau-couleur); outline-offset: 2px; }
[hidden] { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -9999px; }
.evitement:focus { left: var(--e-4); top: var(--e-2); z-index: 20; background: var(--surface); color: var(--primaire-encre); padding: var(--e-2) var(--e-3); border-radius: var(--rayon-petit); box-shadow: var(--ombre-fenetre); }

/* ------------------------------------------------------------------ coquille : barre latérale violette */
.coquille { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.barre { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--e-5); padding: var(--e-5) var(--e-4); background: var(--barre); color: var(--sur-aplat); }
.barre :focus-visible { outline-color: var(--lime); }
.marque { display: flex; align-items: center; gap: var(--e-3); color: inherit; text-decoration: none; border-radius: var(--rayon-petit); padding: var(--e-1); }
.marque .logo { flex: none; }
.marque-texte { display: grid; line-height: 1.2; min-width: 0; }
.marque-texte b { font-size: var(--fs-lead); font-weight: 700; white-space: nowrap; }
.marque-texte span { font-size: var(--fs-mention); font-weight: 500; opacity: 0.9; }
.barre .pastille.fictif { align-self: flex-start; white-space: normal; border-radius: var(--rayon-petit); padding: var(--e-1) var(--e-2); }
.nav { display: grid; gap: var(--e-1); align-content: start; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 0 var(--e-3); border-radius: var(--rayon-petit); color: var(--sur-aplat); text-decoration: none; font-size: var(--fs-petit); font-weight: 500; transition: background var(--duree) var(--courbe); }
.nav a:hover { background: rgba(0, 0, 0, 0.16); }
.nav a[aria-current="page"] { background: var(--surface); color: var(--primaire-encre); font-weight: 700; box-shadow: inset 4px 0 0 var(--lime); }
.compte { margin-top: auto; display: grid; gap: var(--e-2); padding-top: var(--e-4); border-top: 1px solid rgba(255, 255, 255, 0.24); }
.qui { font-size: var(--fs-petit); font-weight: 500; overflow-wrap: anywhere; }
main { min-width: 0; }
main:focus { outline: none; }
.contenu { padding: var(--e-6) var(--e-7) var(--e-7); max-width: 1240px; width: 100%; }

/* ------------------------------------------------------------------ en-tête de page, cartes */
.entete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e-4); margin-bottom: var(--e-5); flex-wrap: wrap; }
.sous { color: var(--encre-douce); margin-top: var(--e-2); }
.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: var(--e-5); margin-bottom: var(--e-5); box-shadow: var(--ombre-carte); }
.carte > h2:first-child { margin-bottom: var(--e-3); }
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); margin-bottom: var(--e-3); flex-wrap: wrap; }
.cartes-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--e-5); }
.aide { color: var(--encre-douce); font-size: var(--fs-petit); margin-bottom: var(--e-3); }
.secondaire { color: var(--encre-douce); font-size: var(--fs-petit); }
.vide { color: var(--encre-douce); }
.vide p + p { margin-top: var(--e-1); }
.vide b { color: var(--encre); }
.carte.vide { padding: var(--e-6); text-align: center; }
.ligne-action { display: flex; align-items: center; gap: var(--e-3); flex-wrap: wrap; }
.ligne-action form { display: inline; }
.retour { margin-bottom: var(--e-3); font-size: var(--fs-petit); font-weight: 600; }
.retour a { text-decoration: none; display: inline-flex; align-items: center; gap: var(--e-1); min-height: 32px; }
.retour a::before { content: "\2190"; }
.retour a:hover { text-decoration: underline; }
pre.csv { margin: 0; max-height: 320px; overflow: auto; padding: var(--e-3); border: 1px solid var(--bordure); border-radius: var(--rayon-petit); background: var(--surface-douce); font-family: var(--police-mono); font-size: var(--fs-mention); line-height: 1.45; }
ul.liste { margin: 0; padding-left: 1.1em; }
ul.liste li + li { margin-top: var(--e-1); }

/* Faits (dl) */
.faits { display: grid; margin: 0; }
.faits > div { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--e-3); align-items: center; padding: var(--e-3) 0; border-bottom: 1px solid var(--bordure); }
.faits > div:last-child { border-bottom: none; }
.faits dt { color: var(--encre-douce); font-size: var(--fs-petit); }
.faits dd { margin: 0; }

/* ------------------------------------------------------------------ tableaux */
.defilement { overflow-x: auto; }
.defilement.court { max-height: 320px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-petit); }
th { text-align: left; padding: var(--e-2) var(--e-3); border-bottom: 1px solid var(--bordure-forte); color: var(--encre-douce); font-size: var(--fs-mention); font-weight: 600; background: var(--surface-douce); position: sticky; top: 0; white-space: nowrap; }
td { padding: var(--e-3); border-bottom: 1px solid var(--bordure); vertical-align: top; }
tbody tr { transition: background var(--duree) var(--courbe); }
tbody tr:hover { background: var(--surface-douce); }
tr:last-child td { border-bottom: none; }
tr.pied td { color: var(--encre-douce); }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.action { text-align: right; white-space: nowrap; }
td.action .btn { min-height: 32px; margin: -6px 0; }
td.vide { text-align: center; padding: var(--e-5); }
ul.regles { margin: 0; padding-left: 1.1em; }
ul.regles li + li { margin-top: var(--e-1); }
.jeton { display: inline-block; margin: 0 var(--e-1) var(--e-1) 0; padding: 0 var(--e-2); border-radius: var(--rayon-petit); background: var(--neutre-fond); white-space: nowrap; }

/* ------------------------------------------------------------------ pastilles */
.pastille { display: inline-block; font-size: var(--fs-mention); font-weight: 600; line-height: 1.5; padding: 2px var(--e-2); border-radius: var(--rayon-pilule); white-space: nowrap; }
.pastille.ok { background: var(--ok-fond); color: var(--ok-encre); }
.pastille.attente { background: var(--attente-fond); color: var(--attente-encre); }
.pastille.erreur { background: var(--erreur-fond); color: var(--erreur-encre); }
.pastille.neutre { background: var(--neutre-fond); color: var(--neutre-encre); }
.pastille.fictif { background: var(--lime); color: var(--lime-encre); }

/* ------------------------------------------------------------------ boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2); min-height: 40px; padding: 0 var(--e-4); border-radius: var(--rayon-petit); border: 1px solid var(--bordure-forte); background: var(--surface); color: var(--primaire-encre); font-weight: 600; text-decoration: none; cursor: pointer; transition: background var(--duree) var(--courbe), border-color var(--duree) var(--courbe), color var(--duree) var(--courbe); white-space: nowrap; }
.btn:hover { background: var(--primaire-voile); border-color: var(--primaire-encre); }
.btn:active { transform: translateY(1px); }
.btn.primaire { background: var(--primaire); border-color: var(--primaire); color: var(--sur-aplat); box-shadow: 0 2px 8px color-mix(in srgb, var(--primaire) 28%, transparent); }
.btn.primaire:hover { background: var(--primaire-fonce); border-color: var(--primaire-fonce); }
.btn.lien { border-color: transparent; background: none; padding: 0 var(--e-2); }
.btn.lien:hover { background: var(--primaire-voile); }
.btn.compact { min-height: 36px; padding: 0 var(--e-3); }
.btn.danger { background: var(--erreur); border-color: var(--erreur); color: #ffffff; }
.btn.danger:hover { background: #a61b1b; border-color: #a61b1b; }
.btn.danger-doux { border-color: transparent; background: none; color: var(--erreur-encre); padding: 0 var(--e-2); }
.btn.danger-doux:hover { background: var(--erreur-fond); }
.btn.sur-fonce { background: transparent; color: var(--sur-aplat); border-color: rgba(255, 255, 255, 0.55); width: 100%; }
.btn.sur-fonce:hover { background: rgba(0, 0, 0, 0.16); border-color: var(--sur-aplat); }
.btn.pleine { width: 100%; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.85; }
.btn-icone { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: none; background: none; border-radius: var(--rayon-petit); font-size: 24px; line-height: 1; cursor: pointer; color: var(--encre-douce); }
.btn-icone:hover { background: var(--neutre-fond); color: var(--encre); }

/* ------------------------------------------------------------------ champs */
.champ { display: grid; gap: var(--e-1); margin-bottom: var(--e-4); min-width: 0; align-content: start; }
.champ label { font-weight: 600; font-size: var(--fs-petit); }
.facultatif { font-weight: 400; color: var(--encre-douce); }
.saisie { display: flex; align-items: center; gap: var(--e-2); }
.champ input[type="text"], .champ input[type="password"], .champ select, .champ textarea { width: 100%; min-height: 40px; padding: var(--e-2) var(--e-3); border: 1px solid var(--bordure-champ); border-radius: var(--rayon-petit); background: var(--surface); transition: border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe); }
.champ input:hover, .champ select:hover, .champ textarea:hover { border-color: var(--primaire-encre); }
.champ input[inputmode="decimal"], .champ input[inputmode="numeric"] { max-width: 160px; text-align: right; font-variant-numeric: tabular-nums; }
.champ input:focus-visible, .champ select:focus-visible, .champ textarea:focus-visible { outline: none; border-color: var(--anneau-couleur); box-shadow: var(--anneau); }
.champ input[aria-invalid="true"], .champ select[aria-invalid="true"], .champ textarea[aria-invalid="true"] { border-color: var(--erreur); border-width: 2px; background: var(--erreur-fond); }
.champ input[type="file"] { padding: var(--e-2) 0; }
.suffixe { color: var(--encre-douce); white-space: nowrap; }
.champ.case { display: flex; align-items: center; gap: var(--e-2); }
.champ.case input { width: 20px; height: 20px; accent-color: var(--primaire); }
.champ.case label { font-weight: 500; }
.msg-erreur { color: var(--erreur-encre); font-size: var(--fs-petit); font-weight: 600; }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--e-4); }
.grille-2 .large { grid-column: 1 / -1; }
.actions { display: flex; justify-content: flex-end; }

/* ------------------------------------------------------------------ fenêtres (dialog natif : piège du focus, Échap, fond inerte) */
dialog.fenetre { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre-fenetre); color: var(--encre); }
dialog.fenetre.large { width: min(820px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--voile); }
dialog[open] { animation: apparition 180ms var(--courbe); }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fenetre form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.fenetre-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); padding: var(--e-4) var(--e-4) var(--e-2) var(--e-5); }
.fenetre-tete h2 { font-size: var(--fs-h2); }
.fenetre-corps { padding: var(--e-2) var(--e-5); overflow-y: auto; }
.fenetre-pied { display: flex; align-items: center; gap: var(--e-2); padding: var(--e-3) var(--e-5) var(--e-4); border-top: 1px solid var(--bordure); }
.espace { flex: 1; }
.bandeau-erreur { display: flex; gap: var(--e-2); align-items: flex-start; margin: 0 var(--e-5) var(--e-2); padding: var(--e-3); border-radius: var(--rayon-petit); border: 1px solid color-mix(in srgb, var(--erreur-encre) 30%, transparent); background: var(--erreur-fond); color: var(--erreur-encre); font-weight: 600; font-size: var(--fs-petit); }
.bandeau-erreur.en-ligne { margin: 0; }
.zone-suppression { padding: 0 var(--e-5) var(--e-4); }
.zone-suppression form { display: flex; align-items: center; gap: var(--e-2); flex-wrap: wrap; padding: var(--e-3); border-radius: var(--rayon-petit); background: var(--erreur-fond); }
.zone-suppression form p { flex-basis: 100%; color: var(--erreur-encre); font-weight: 600; }
.zone-suppression.en-ligne { padding: 0; }

/* Règles et nuances */
fieldset.regle { border: 1px solid var(--bordure-forte); border-radius: var(--rayon-petit); padding: var(--e-3) var(--e-4) var(--e-2); margin: 0 0 var(--e-3); }
fieldset.regle legend { font-weight: 700; padding: 0 var(--e-1); color: var(--primaire-encre); }
.regle-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e-3); }
.condition, .nuance { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.6fr) auto; gap: var(--e-3); align-items: end; }
.nuance { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.condition .btn, .nuance .btn { margin-bottom: var(--e-4); }

/* Avis de réussite */
.avis-ok { margin-bottom: var(--e-4); padding: var(--e-3) var(--e-4); border-radius: var(--rayon-petit); border: 1px solid color-mix(in srgb, var(--ok-encre) 30%, transparent); background: var(--ok-fond); color: var(--ok-encre); font-weight: 600; }

/* ------------------------------------------------------------------ pages seules : connexion, erreurs */
.seul { min-height: 100vh; display: grid; place-items: center; padding: var(--e-6) var(--e-4); background: radial-gradient(1100px 520px at 50% -12%, color-mix(in srgb, var(--primaire) 16%, transparent), transparent 70%), var(--fond); }
.boite { width: 100%; max-width: 420px; }
.boite-carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); box-shadow: var(--ombre-douce); padding: var(--e-7) var(--e-6) var(--e-6); }
.boite-tete { display: grid; justify-items: center; text-align: center; gap: var(--e-3); margin-bottom: var(--e-5); }
.boite-tete h1 { font-size: 26px; white-space: nowrap; }
.accroche { color: var(--encre-douce); max-width: 32ch; }
.boite-pied { margin-top: var(--e-4); text-align: center; color: var(--encre-douce); font-size: var(--fs-mention); }
.boite .bandeau-erreur { margin: 0 0 var(--e-4); }
.boite .actions { justify-content: stretch; }
.boite .actions .btn { width: 100%; }
.boite-erreur .boite-tete h1 { white-space: normal; }
.boite-erreur .code { font-size: var(--fs-mention); font-weight: 600; color: var(--encre-douce); letter-spacing: 0.06em; text-transform: uppercase; }

/* Boutons SSO : neutres, pleine largeur, logo officiel à gauche */
.sso { display: grid; gap: var(--e-3); }
.btn-sso { display: flex; align-items: center; justify-content: center; gap: var(--e-3); width: 100%; min-height: 48px; padding: 0 var(--e-4); border: 1px solid var(--bordure-champ); border-radius: var(--rayon-petit); background: var(--surface); color: var(--encre); font-weight: 600; text-decoration: none; transition: background var(--duree) var(--courbe), border-color var(--duree) var(--courbe), box-shadow var(--duree) var(--courbe); }
.btn-sso:hover { background: var(--surface-douce); border-color: var(--primaire-encre); box-shadow: var(--ombre-douce); }
.btn-sso:active { transform: translateY(1px); }
.btn-sso svg { flex: none; width: 20px; height: 20px; }
.btn-sso .tourne { display: none; width: 18px; height: 18px; border: 2px solid var(--bordure-forte); border-top-color: var(--primaire-encre); border-radius: 50%; animation: tourner 700ms linear infinite; }
.btn-sso[aria-busy="true"] { cursor: progress; background: var(--surface-douce); }
.btn-sso[aria-busy="true"] svg { display: none; }
.btn-sso[aria-busy="true"] .tourne { display: inline-block; }
.btn-sso[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
@keyframes tourner { to { transform: rotate(360deg); } }

/* Accès de secours : un lien discret qui déplie le champ du jeton */
.secours { margin-top: var(--e-5); padding-top: var(--e-4); border-top: 1px solid var(--bordure); }
.secours summary { display: flex; align-items: center; justify-content: center; gap: var(--e-2); width: fit-content; min-height: 32px; margin: 0 auto; padding: 0 var(--e-2); border-radius: var(--rayon-petit); list-style: none; cursor: pointer; color: var(--encre-douce); font-size: var(--fs-petit); font-weight: 500; }
.secours summary::-webkit-details-marker { display: none; }
.secours summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform var(--duree) var(--courbe); }
.secours[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.secours summary:hover { color: var(--primaire-encre); text-decoration: underline; }
.secours[open] summary { margin-bottom: var(--e-4); }

/* ------------------------------------------------------------------ 1366 et moins, mobile */
@media (max-width: 1100px) {
  .contenu { padding: var(--e-5); }
}
@media (max-width: 900px) {
  .coquille { grid-template-columns: minmax(0, 1fr); }
  .barre { position: static; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--e-2) var(--e-3); padding: var(--e-3) var(--e-4) var(--e-2); }
  .barre .pastille.fictif { display: none; }
  .nav { grid-column: 1 / -1; display: flex; gap: var(--e-1); overflow-x: auto; margin: 0 calc(-1 * var(--e-4)); padding: var(--e-1) var(--e-4); scrollbar-width: none; }
  .nav a { white-space: nowrap; min-height: 40px; }
  .nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--lime); }
  .compte { grid-column: 2; grid-row: 1; margin: 0; padding: 0; border: none; display: flex; align-items: center; }
  .compte .qui { display: none; }
  .btn.sur-fonce { width: auto; min-height: 36px; padding: 0 var(--e-3); font-size: var(--fs-petit); }
  .marque .logo { width: 32px; height: 32px; }
  .marque { min-width: 0; }
  .marque-texte span { display: none; }
  .marque-texte b { font-size: var(--fs-base); overflow: hidden; text-overflow: ellipsis; }
  .contenu { padding: var(--e-4); }
  h1 { font-size: 24px; }
  .cartes-2, .grille-2 { grid-template-columns: minmax(0, 1fr); }
  .condition, .nuance { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .faits > div { grid-template-columns: minmax(0, 1fr); gap: var(--e-1); }
  .carte { padding: var(--e-4); }
}
@media (max-width: 600px) {
  /* Liste des demandes : une carte par ligne, l'étiquette de chaque valeur devant elle. */
  .tableau-cartes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau-cartes, .tableau-cartes tbody { display: block; }
  .tableau-cartes tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e-2) var(--e-4); padding: var(--e-3) 0; border-bottom: 1px solid var(--bordure); }
  .tableau-cartes tr:last-child { border-bottom: none; }
  .tableau-cartes td { display: block; padding: 0; border: none; text-align: left; white-space: normal; }
  .tableau-cartes td.titre-carte, .tableau-cartes td.large-carte { grid-column: 1 / -1; }
  .tableau-cartes td.titre-carte { font-size: var(--fs-base); }
  .tableau-cartes td.action { grid-column: 1 / -1; text-align: left; }
  .tableau-cartes td.action .btn { margin: 0; padding: 0; }
  .tableau-cartes td[data-col]::before { content: attr(data-col); display: block; color: var(--encre-douce); font-size: var(--fs-mention); font-weight: 500; }
}
@media (max-width: 480px) {
  .boite-carte { padding: var(--e-6) var(--e-5) var(--e-5); }
  .boite-tete h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  dialog[open] { animation: none; }
  .btn, .btn-sso, .nav a, tbody tr, .champ input, .secours summary::after { transition: none; }
  .btn-sso .tourne { animation: none; border-top-color: var(--bordure-forte); }
}
