/* ViZé Offres : feuille de charte.
 *
 * Toute couleur de l'application s'écrit var(--…). Les valeurs vivent ici,
 * sur :root, et nulle part ailleurs. Le thème sombre redéfinit les mêmes jetons
 * deux fois : une fois pour la préférence du système (sauf si l'utilisateur a
 * choisi « clair »), une fois pour le choix explicite « sombre ».
 *
 * Règle d'or de la charte web : l'application écrit sur un fond teinté
 * (#F5F7FB), jamais sur du blanc pur. L'or d'encre y est #7A6600 ; l'or vif
 * #C9A800 ne sert qu'au décor ; sur marine, l'or d'encre est #E9C93A.
 * L'anneau de focus est bleu #2E75B6, jamais doré. */

:root {
  /* Charte du cabinet (PHASE1.md, « Charte web ») */
  --marine: #1F3864;
  --bleu: #2E75B6;
  --gold: #C9A800;
  --gold-ink: #7A6600;
  --gold-sur-marine: #E9C93A;
  --bg: #F5F7FB;
  --focus: #2E75B6;
  --blanc: #FFFFFF;

  /* Surfaces et encres du thème clair */
  --surface: #FFFFFF;
  --surface-2: #EAEFF7;
  --ink: #1A2233;
  --muted: #4A5568;
  --line: #C6D0E0;
  --bleu-ink: #1F5A8F;
  --btn-bg: #1F3864;
  --btn-bg-hover: #2B4C85;
  --btn-ink: #FFFFFF;
  --btn2-ink: #1F3864;
  --btn2-line: #1F3864;
  --btn2-hover: #E3EAF5;
  --danger-ink: #A3262A;
  --danger-bg: #FBE9E9;
  --ok-ink: #1D6B3A;
  --ok-bg: #E4F3E9;
  --demo-bg: #FFF1B8;
  --demo-ink: #4F4200;
  --info-bg: #E3EEF9;
  --info-ink: #1F5A8F;
  --attention-bg: #FFF1B8;
  --attention-ink: #5C4A00;
  --entete-bg: #1F3864;
  --entete-ink: #FFFFFF;
  --entete-muted: #C9D4E8;
  --entete-hover: #2B4C85;
  --ombre: rgba(31, 56, 100, .10);
  --voile: rgba(13, 21, 38, .55);
  --barre-bg: #1F5A8F;
  --barre-man-bg: #7A6600;
  --barre-ink: #FFFFFF;

  /* Page de garde : valeurs recopiées d'AEIES, identiques dans les deux
     thèmes. Elles sont nommées ici pour qu'aucune ne s'écrive en dur. */
  --g-fond-a: #1c2f57;
  --g-fond-b: #0d1526;
  --g-or-clair: #ffe07a;
  --g-or: #C9A800;
  --g-blanc: #fff;
  --g-slogan1: #eef2f9;
  --g-slogan2: #ffd94d;
  --g-gris: #8b98b3;
  --g-marine: #1F3864;
  --g-ombre-fig: rgba(201, 168, 0, .35);
  --g-halo: rgba(201, 168, 0, .22);
  --g-ombre-btn: rgba(201, 168, 0, .4);
  --g-ombre-btn-h: rgba(201, 168, 0, .55);
  /* Teintes propres à l'illustration de la garde */
  --g-papier: #f4f6fb;
  --g-papier-2: #e2e8f2;
  --g-trait: #aab6cc;
  --g-sol: #000;

  --police: 'Speak Pro', 'Outfit', sans-serif;
  --rayon: 12px;
  --rayon-sm: 9px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --bg: #0B1424;
    --surface: #14213A;
    --surface-2: #1C2C4B;
    --ink: #E8EDF6;
    --muted: #A9B4C8;
    --line: #34476B;
    --gold-ink: #E9C93A;
    --bleu-ink: #8EC0F2;
    --btn-bg: #E9C93A;
    --btn-bg-hover: #F3D865;
    --btn-ink: #14213A;
    --btn2-ink: #E8EDF6;
    --btn2-line: #8EC0F2;
    --btn2-hover: #22355A;
    --danger-ink: #F4A7A7;
    --danger-bg: #3B1B22;
    --ok-ink: #93DBAC;
    --ok-bg: #153424;
    --demo-bg: #3D3300;
    --demo-ink: #F5DD6B;
    --info-bg: #1C2C4B;
    --info-ink: #8EC0F2;
    --attention-bg: #3D3300;
    --attention-ink: #F5DD6B;
    --entete-bg: #0F1A30;
    --entete-ink: #E8EDF6;
    --entete-muted: #A9B4C8;
    --entete-hover: #1C2C4B;
    --ombre: rgba(0, 0, 0, .35);
    --voile: rgba(0, 0, 0, .6);
    --barre-bg: #8EC0F2;
    --barre-man-bg: #E9C93A;
    --barre-ink: #0B1424;
    color-scheme: dark;
  }
}

:root[data-theme="sombre"] {
  --bg: #0B1424;
  --surface: #14213A;
  --surface-2: #1C2C4B;
  --ink: #E8EDF6;
  --muted: #A9B4C8;
  --line: #34476B;
  --gold-ink: #E9C93A;
  --bleu-ink: #8EC0F2;
  --btn-bg: #E9C93A;
  --btn-bg-hover: #F3D865;
  --btn-ink: #14213A;
  --btn2-ink: #E8EDF6;
  --btn2-line: #8EC0F2;
  --btn2-hover: #22355A;
  --danger-ink: #F4A7A7;
  --danger-bg: #3B1B22;
  --ok-ink: #93DBAC;
  --ok-bg: #153424;
  --demo-bg: #3D3300;
  --demo-ink: #F5DD6B;
  --info-bg: #1C2C4B;
  --info-ink: #8EC0F2;
  --attention-bg: #3D3300;
  --attention-ink: #F5DD6B;
  --entete-bg: #0F1A30;
  --entete-ink: #E8EDF6;
  --entete-muted: #A9B4C8;
  --entete-hover: #1C2C4B;
  --ombre: rgba(0, 0, 0, .35);
  --voile: rgba(0, 0, 0, .6);
  --barre-bg: #8EC0F2;
  --barre-man-bg: #E9C93A;
  --barre-ink: #0B1424;
  color-scheme: dark;
}

/* ================= BASE ================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--police);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--police); line-height: 1.2; margin: 0; }
/* Anneau de focus : bleu #2E75B6, doublé d'un liseré blanc de 2 px entre
   l'élément et l'anneau. Sur marine ou sur les fonds sombres, le bleu seul
   tombe sous 3:1 ; le liseré blanc garde l'anneau visible partout, et le bleu
   reste à 4,6:1 contre lui. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--blanc); }
[hidden] { display: none !important; }
/* Le conteneur principal reçoit le focus par programme (après la garde) pour
   que le lecteur d'écran reparte du contenu ; il n'est pas une cible. */
#vue:focus { outline: none; box-shadow: none; }
.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;
}

/* ================= BOUTONS ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 10px 18px;
  border-radius: var(--rayon-sm); border: 2px solid transparent;
  background: var(--btn-bg); color: var(--btn-ink);
  font-weight: 700; cursor: pointer; text-decoration: none;
  transition: background .15s ease;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn-second { background: transparent; color: var(--btn2-ink); border-color: var(--btn2-line); }
.btn-second:hover { background: var(--btn2-hover); }
.btn-danger { background: transparent; color: var(--danger-ink); border-color: var(--danger-ink); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-lien {
  background: transparent; color: var(--bleu-ink); border-color: transparent;
  padding: 10px 6px; font-weight: 700; text-decoration: underline;
}
.btn-lien:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ================= EN-TÊTE ================= */
/* La barre reste en haut au défilement. --entete-h (hauteur mesurée par app.js) sert aux ancres, aux
   éléments collants de la page et à la bulle du mode Formation. */
:root { --entete-h: 64px; }
html { scroll-padding-top: calc(var(--entete-h) + 8px); }
.entete {
  position: sticky; top: 0; z-index: 30;
  background: var(--entete-bg); color: var(--entete-ink);
  padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 16px;
}
.marque {
  display: flex; align-items: baseline; gap: .3em; font-weight: 900;
  font-size: 22px; letter-spacing: -.5px; margin-right: auto;
}
a.marque { align-items: center; min-height: 44px; text-decoration: none; color: inherit; border-radius: var(--rayon-sm); padding: 0 4px; }
a.marque:hover { background: var(--entete-hover); }
.marque .m1 { color: var(--gold-sur-marine); }
.marque .m2 { color: var(--entete-ink); }
.nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nav-btn {
  min-height: 44px; min-width: 44px; padding: 8px 12px; border-radius: var(--rayon-sm);
  border: 1px solid transparent; background: transparent; color: var(--entete-ink);
  font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.nav-btn:hover { background: var(--entete-hover); }
.nav-btn[aria-current="page"] { border-color: var(--gold-sur-marine); color: var(--gold-sur-marine); }
.nav-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.outils-entete { display: flex; gap: 6px; order: 3; }
.nav { order: 2; }
.marque { order: 1; }
/* Grand écran : tout tient sur une ligne, le menu « Plus » se fond dans la barre. */
.nav-plus, .nav-plus-liste { display: contents; }
.nav-plus-btn { display: none; }
/* Sous cette largeur, Performance, Clients, Coffre, Paramètres et la démonstration passent dans « Plus ». */
@media (max-width: 1699px) {
  .nav-plus { display: block; }
  .nav-plus-btn { display: inline-flex; }
  .nav-plus-liste {
    display: none; position: absolute; top: 100%; right: 16px; min-width: 240px; max-width: calc(100vw - 32px);
    flex-direction: column; align-items: stretch; gap: 2px; padding: 6px;
    background: var(--entete-bg); border: 1px solid var(--gold-sur-marine); border-radius: var(--rayon);
    box-shadow: 0 8px 24px var(--ombre);
  }
  .nav-plus-liste.ouvert { display: flex; }
  .nav-plus-liste .nav-btn { justify-content: flex-start; }
  .nav-plus-liste .lib-court { display: inline; }
}
/* Entre 768 et 1199 px, la barre ne garde que les icônes (étiquette accessible et infobulle conservées). */
@media (max-width: 1199px) {
  .nav-btn .lib-court { display: none; }
  .nav-plus-liste .lib-court { display: inline; }
}
/* Petit écran : la marque et les outils sur la première ligne, la navigation sur la seconde. */
@media (max-width: 640px) {
  .entete { padding: 6px 12px; gap: 4px 12px; }
  .marque { font-size: 20px; }
  .outils-entete { order: 2; gap: 4px; }
  .nav { order: 3; flex-basis: 100%; }
  .nav-btn { padding: 8px 10px; }
  .nav-plus-liste { right: 12px; }
}
.entete-qui { color: var(--entete-muted); font-size: 13px; }

/* ================= FIL D'ARIANE ================= */
.ariane { max-width: 1120px; margin: 0 auto; padding: 10px 16px 0; }
.ariane-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.ariane-retour { min-height: 44px; text-decoration: none; padding: 8px 10px; border: 1px solid var(--line); }
.ariane-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; font-size: 14px; color: var(--muted); min-width: 0; }
.ariane-liste li { display: inline-flex; align-items: center; min-width: 0; overflow-wrap: anywhere; }
.ariane-liste li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.ariane-liste a.lien { display: inline-flex; align-items: center; min-height: 44px; padding: 0; margin: 0; }
.ariane-liste [aria-current="page"] { color: var(--ink); font-weight: 700; }

/* ================= BANDEAU DE DÉMONSTRATION ================= */
.bandeau-demo {
  background: var(--demo-bg); color: var(--demo-ink);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: 6px 16px; font-weight: 700; border-bottom: 2px solid var(--gold);
}
.bandeau-demo p { margin: 0; flex: 1 1 220px; }
.bandeau-demo .btn-second { color: var(--demo-ink); border-color: var(--demo-ink); }
.bandeau-demo .btn-second:hover { background: var(--surface); }

/* ================= PAGE ================= */
.page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.page-titre { font-size: 26px; font-weight: 900; color: var(--ink); }
.page-intro { color: var(--muted); margin: 6px 0 22px; max-width: 70ch; }
.surtitre { color: var(--gold-ink); font-weight: 900; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; margin: 0 0 4px; }

.carte {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon);
  padding: 20px; box-shadow: 0 1px 3px var(--ombre);
}
.carte + .carte { margin-top: 18px; }
.carte h2 { font-size: 19px; font-weight: 900; margin-bottom: 4px; }
.carte .aide { color: var(--muted); margin: 0 0 14px; font-size: 14px; }

/* Grille des modules */
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.module {
  text-align: left; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--rayon); padding: 18px;
  cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-height: 44px;
  box-shadow: 0 1px 3px var(--ombre); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.module:hover { transform: translateY(-2px); box-shadow: 0 6px 18px var(--ombre); border-color: var(--bleu); }
.module-tete { display: flex; align-items: center; gap: 12px; }
.module-ico {
  width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2);
  color: var(--bleu-ink); display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.module-ico svg { width: 24px; height: 24px; }
.module-nom { font-size: 18px; font-weight: 900; }
.module-desc { color: var(--muted); font-size: 14px; margin: 0; }
.pastille {
  align-self: flex-start; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}

/* Écran « module à venir » et écrans d'état */
.etat { max-width: 640px; margin: 8vh auto 0; text-align: center; }
.etat .carte { text-align: left; }
.etat-ico {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--surface-2); color: var(--bleu-ink); display: flex; align-items: center; justify-content: center;
}
.etat-ico svg { width: 32px; height: 32px; }
.etat h1 { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.etat p { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ================= FORMULAIRES ================= */
.auth { max-width: 440px; margin: 6vh auto 0; }
.auth .page-titre { margin-bottom: 4px; }
.champ { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.champ label { font-weight: 700; font-size: 14px; color: var(--ink); }
.note { font-size: 13px; color: var(--muted); }
.champ input, .champ select, .champ textarea {
  min-height: 44px; padding: 9px 12px; border-radius: var(--rayon-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.champ textarea { min-height: 80px; resize: vertical; }
.champ input:focus-visible, .champ select:focus-visible, .champ textarea:focus-visible { border-color: var(--focus); }
.grille-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 18px; }
.grille-form .large { grid-column: 1 / -1; }
.champ .btn { align-self: flex-start; }
.message { border-radius: var(--rayon-sm); padding: 10px 14px; margin: 0 0 14px; font-weight: 700; }
.message:empty { display: none; }
.message-erreur { background: var(--danger-bg); color: var(--danger-ink); }
.message-ok { background: var(--ok-bg); color: var(--ok-ink); }
.liens-auth { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; margin-top: 8px; }

/* ================= PARAMÈTRES ================= */
.onglets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.onglet {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer;
}
.onglet:hover { background: var(--surface-2); }
.onglet[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }

.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th {
  text-align: left; background: var(--surface-2); color: var(--ink); font-weight: 700;
  padding: 8px 10px; border-bottom: 2px solid var(--gold);
}
.tableau td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tableau .vigueur td { font-weight: 700; color: var(--ok-ink); }
.vide { color: var(--muted); font-style: italic; margin: 6px 0 12px; }
.taux-actuel { font-size: 15px; margin: 0 0 12px; }
.taux-actuel strong { color: var(--gold-ink); font-size: 20px; }

.membres { display: flex; flex-direction: column; gap: 12px; }
.membre {
  border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 14px;
  display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) minmax(150px, 1fr) 290px; gap: 10px 14px; align-items: end;
  background: var(--bg);
}
.membre .champ { margin: 0; }
.membre-qui strong { display: block; }
.membre-qui span { display: block; color: var(--muted); font-size: 13.5px; word-break: break-all; }
.membre-qui .membre-statut { display: inline-block; margin-top: 4px; font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.statut-attente { background: var(--demo-bg); color: var(--demo-ink); }
.statut-actif { background: var(--ok-bg); color: var(--ok-ink); }
.statut-echu { background: var(--danger-bg); color: var(--danger-ink); }
.membre-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 900px) {
  .membre { grid-template-columns: 1fr; }
}

/* ================= PHASE 2 : DEVIS, PROFORMA ET FACTURES ================= */
.pastille-ouverte { background: var(--ok-bg); color: var(--ok-ink); }
.barre-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.actions-centre { justify-content: center; }
.chargement-court { color: var(--muted); margin: 8px 0; }
.lien { color: var(--bleu-ink); font-weight: 700; text-decoration: underline; display: inline-block; padding: 14px 0; margin: -14px 0; }
.lien:hover { color: var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.texte-erreur { color: var(--danger-ink); font-weight: 700; }
.texte-attention { color: var(--attention-ink); font-weight: 700; }
.message-attention { background: var(--attention-bg); color: var(--attention-ink); }
.code-client {
  display: inline-block; font-weight: 900; font-size: 12.5px; letter-spacing: .6px; padding: 1px 8px;
  border-radius: 6px; background: var(--surface-2); color: var(--bleu-ink); font-variant-numeric: tabular-nums;
}

/* Pastilles de statut */
.statut { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.statut-neutre { background: var(--surface-2); color: var(--muted); }
.statut-info { background: var(--info-bg); color: var(--info-ink); }
.statut-attention { background: var(--attention-bg); color: var(--attention-ink); }
.statut-ok { background: var(--ok-bg); color: var(--ok-ink); }
.statut-refus { background: var(--danger-bg); color: var(--danger-ink); }

/* Synthèse cliquable */
.synthese { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 18px; }
.tuile {
  text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 14px 16px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--rayon); box-shadow: 0 1px 3px var(--ombre); transition: border-color .15s ease, box-shadow .15s ease;
}
.tuile:hover { border-color: var(--bleu); box-shadow: 0 4px 14px var(--ombre); }
.tuile-chiffre { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tuile-lib { font-weight: 700; }
.tuile-sous { color: var(--muted); font-size: 13px; }

/* Registre des documents (phase 6) : un vrai tableau, qui défile seul en largeur. */
.filtres { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; }
.filtres-registre { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.champ-recherche { grid-column: 1 / -1; }
@media (min-width: 900px) { .champ-recherche { grid-column: span 2; } }
.registre-defile { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--rayon-sm); background: var(--surface); margin-top: 6px; }
.registre { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.registre-docs { min-width: 1240px; }
.registre-offres { min-width: 1000px; }
.registre-relances { min-width: 960px; }
.registre caption { text-align: left; font-weight: 700; padding: 8px 10px; color: var(--ink); }
.registre th, .registre td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.registre thead th { background: var(--surface-2); color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--gold); padding: 0; white-space: nowrap; }
.registre thead th .tri { padding: 8px 10px; }
.registre th.num, .registre td.num { text-align: right; }
.registre tbody tr:last-child th, .registre tbody tr:last-child td { border-bottom: 0; }
.registre tbody tr:hover th, .registre tbody tr:hover td { background: var(--surface-2); }
.registre tbody th { font-weight: 400; background: var(--surface); }
.tri { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 44px; border: 0; background: transparent; color: var(--ink); font-weight: 700; text-align: left; cursor: pointer; }
.registre th.num .tri { justify-content: flex-end; }
.tri:hover { background: var(--btn2-hover); }
.doc-ligne, .offre-ligne, .rel-ligne { cursor: pointer; }
.doc-num-cel, .offre-num-cel { position: sticky; left: 0; z-index: 1; white-space: nowrap; }
.doc-num, .offre-num { display: inline-flex; align-items: center; min-height: 44px; font-weight: 900; color: var(--bleu-ink); text-decoration: underline; }
.doc-type, .doc-secteur, .doc-date, .doc-echeance, .doc-statut, .doc-relances { white-space: nowrap; }
.doc-client, .offre-client { min-width: 190px; }
.doc-objet { display: block; color: var(--muted); font-size: 12.5px; max-width: 280px; }
.doc-montant { font-weight: 700; }
.doc-reste { font-variant-numeric: tabular-nums; }
.retard { display: block; color: var(--danger-ink); font-weight: 700; font-size: 12.5px; }
.pastille-importe { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--attention-bg); color: var(--attention-ink); white-space: nowrap; }
.barre-export { margin: 4px 0 14px; align-items: center; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.puces:empty { display: none; }
.puce { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 12px; border-radius: 999px; background: var(--info-bg); color: var(--info-ink); font-weight: 700; font-size: 13.5px; }
.puce-retire { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--info-ink); font-size: 20px; font-weight: 900; cursor: pointer; border-radius: 999px; }
.puce-retire:hover { background: var(--surface); }

/* Carnet de clients */
.liste-clients { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.client-ligne {
  width: 100%; min-height: 44px; display: grid; grid-template-columns: 110px 1.4fr 1fr; gap: 4px 14px; align-items: center;
  text-align: left; padding: 10px 12px; cursor: pointer; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--rayon-sm);
}
.client-ligne:hover { background: var(--surface-2); }
.client-ligne[aria-current="true"] { border-color: var(--bleu); box-shadow: inset 4px 0 0 var(--bleu); }
.client-ligne .code-client { justify-self: start; }
.client-nom { font-weight: 700; }
.client-contact { color: var(--muted); font-size: 13.5px; word-break: break-word; }
@media (max-width: 640px) { .client-ligne { grid-template-columns: 1fr; } }

/* Éditeur */
.editeur { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.editeur-corps .carte + .carte { margin-top: 18px; }
.editeur .carte h2 { margin-bottom: 12px; }
.editeur-totaux { position: sticky; top: calc(var(--entete-h) + 12px); }
@media (max-width: 960px) { .editeur { grid-template-columns: 1fr; } .editeur-totaux { position: static; } }
.champ-bouton { justify-content: flex-start; padding-top: 26px; }
.champ-bouton .btn { align-self: flex-start; }
.champ input[readonly], .champ input:disabled { background: var(--surface-2); color: var(--muted); }
form.carte h2 { margin-bottom: 12px; }
.lignes-edit { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.ligne-edit {
  border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 10px 14px 4px; margin: 0; min-width: 0;
  display: grid; grid-template-columns: 2.4fr .8fr 1fr 1.2fr .8fr; gap: 0 12px; background: var(--bg); align-items: end;
}
.ligne-edit legend { font-weight: 900; font-size: 13px; color: var(--gold-ink); padding: 0 6px; }
.ligne-edit .champ { margin-bottom: 10px; min-width: 0; }
.ligne-fin { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ligne-montant { font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .ligne-edit { grid-template-columns: 1fr 1fr; } .ligne-desig { grid-column: 1 / -1; } }

/* Totaux et note de calcul */
.totaux { margin: 14px 0 0; display: flex; flex-direction: column; }
.totaux div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.totaux dt { color: var(--muted); }
.totaux dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.totaux .fort dt, .totaux .fort dd { color: var(--ink); font-weight: 900; font-size: 16px; }
.totaux .fort { border-bottom: 2px solid var(--gold); }
.note-calcul { font-size: 13px; color: var(--muted); margin: 12px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: var(--rayon-sm); }

/* Fiche */
.fiche-titre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.fiche-titre .page-titre { word-break: break-word; }
.lien-origine { margin: 8px 0 0; color: var(--muted); }
.fiche-titre + .barre-actions, .lien-origine + .barre-actions { margin-top: 16px; }
.fiche-grille { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.fiche-cote .carte + .carte { margin-top: 18px; }
@media (max-width: 960px) { .fiche-grille { grid-template-columns: 1fr; } }
#fEmission .carte { margin-bottom: 18px; }
.apercu { min-width: 0; }
.apercu-tete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-bottom: 14px; border-bottom: 3px solid var(--marine); }
.apercu-type { margin: 0; font-size: 22px; font-weight: 900; color: var(--ink); text-transform: uppercase; letter-spacing: .5px; }
.apercu-num { margin: 2px 0 0; font-weight: 700; color: var(--gold-ink); word-break: break-word; }
.apercu-dates { margin: 0; display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: 14px; }
.apercu-dates div { display: contents; }
.apercu-dates dt { color: var(--muted); }
.apercu-dates dd { margin: 0; font-weight: 700; }
.apercu-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; padding: 14px 0; }
.apercu-parties p { margin: 0 0 2px; }
.carte .apercu-h { font-size: 12.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--gold-ink); margin: 0 0 4px; }
.apercu-note { margin-top: 14px; }
.apercu-note p { margin: 0; white-space: pre-line; }
.tableau-lignes td { vertical-align: top; }
.tableau .num { text-align: right; }
@media (max-width: 640px) {
  .tableau-lignes thead { display: none; }
  .tableau-lignes, .tableau-lignes tbody, .tableau-lignes tr, .tableau-lignes td { display: block; width: 100%; }
  .tableau-lignes tr { border: 1px solid var(--line); border-radius: var(--rayon-sm); margin-bottom: 8px; padding: 6px 10px; }
  .tableau-lignes td { border: none; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tableau-lignes td::before { content: attr(data-lib); color: var(--muted); text-align: left; font-weight: 700; }
}
.paiements { list-style: none; margin: 0 0 12px; padding: 0; }
.paiements li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.form-paiement { border-top: 1px solid var(--line); padding-top: 12px; }
.empreinte { display: flex; flex-direction: column; gap: 2px; }
.empreinte code { font-size: 12px; word-break: break-all; background: var(--surface-2); color: var(--ink); padding: 6px 8px; border-radius: 6px; }
.lies { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lies li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.depot { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.champ input[type="file"] { padding: 8px; }

/* Étapes de l'émission */
.etapes { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.etape { padding: 6px 10px; border-radius: var(--rayon-sm); word-break: break-word; }
.etape-cours { color: var(--muted); }
.etape-ok { background: var(--ok-bg); color: var(--ok-ink); }
.etape-erreur { background: var(--danger-bg); color: var(--danger-ink); font-weight: 700; }
.etape-attention, .etape-attente { background: var(--attention-bg); color: var(--attention-ink); }

/* Paramètres : tampon, signature, stockage */
.grille-deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 18px; }
.grille-deux .carte + .carte { margin-top: 0; }
.apercu-image { display: block; max-width: 100%; max-height: 160px; margin: 0 0 12px; padding: 8px; background: var(--blanc); border: 1px solid var(--line); border-radius: var(--rayon-sm); }
.jauge { height: 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.jauge-plein { height: 100%; background: var(--bleu); border-radius: 999px; min-width: 2px; }
.jauge-alerte .jauge-plein { background: var(--danger-ink); }
.jauge-texte { margin: 8px 0 12px; }

/* ================= OFFRES (phase 3) ================= */
.statut-evaluation { background: var(--attention-bg); color: var(--attention-ink); }
.offres { display: block; }
.offre-titre { font-weight: 900; min-width: 220px; }
.offre-titre small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.offre-montant { font-weight: 700; white-space: nowrap; }
.offre-sec, .offre-limite, .offre-statut { white-space: nowrap; }
.offre-sec, .offre-limite { color: var(--muted); }
.offre-motif { min-width: 200px; color: var(--muted); }
.choix { display: flex; flex-wrap: wrap; gap: 8px; }
.choix .btn { min-width: 44px; }
.btn[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.mini-form { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }

.parcours { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.parcours li { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.parcours .parcours-fait { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.parcours .parcours-actuel { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); font-weight: 700; }
.fiche-offre { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .fiche-offre { grid-template-columns: minmax(0, 1fr); } }
.fiche-offre > *, .editeur-corps { min-width: 0; }
@media (max-width: 960px) { .editeur { grid-template-columns: minmax(0, 1fr); } }
.infos { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.infos dt { color: var(--muted); }
.infos dd { margin: 0; font-weight: 700; word-break: break-word; }
.bandeau-lecture { margin: 0 0 14px; }

/* Contrôles de l'offre */
.controles { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ctrl { padding: 8px 12px; border-radius: var(--rayon-sm); font-size: 14px; }
.ctrl b { font-weight: 900; margin-right: 6px; }
.ctrl-erreur { background: var(--danger-bg); color: var(--danger-ink); }
.ctrl-attention { background: var(--attention-bg); color: var(--attention-ink); }
.ctrl-ok { background: var(--ok-bg); color: var(--ok-ink); }

/* Éditeur de la partie financière */
.groupe { border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 10px 14px 10px; margin: 0 0 14px; background: var(--bg); min-width: 0; }
.groupe legend { font-weight: 900; font-size: 13px; color: var(--gold-ink); padding: 0 6px; }
.groupe-tete { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 12px; }
.l-offre {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.5fr); gap: 0 12px; align-items: end;
  border: 0; border-top: 1px dashed var(--line); padding: 10px 0 0; margin: 0; min-width: 0;
}
.l-offre legend { padding: 0; }
.l-offre .champ { margin-bottom: 10px; min-width: 0; }
.l-offre .champ label { font-size: 12.5px; }
.l-pm { grid-column: 1; margin-bottom: 10px; }
.l-pm .btn { text-align: left; }
.l-montant { grid-column: 2 / 4; margin-bottom: 10px; min-height: 44px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; }
.l-montant small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.l-fin { grid-column: 4; display: flex; justify-content: flex-end; margin-bottom: 10px; }
.groupe-pied { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.groupe-total { margin-left: auto; font-weight: 900; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .l-offre { grid-template-columns: 1fr 1fr; }
  .l-offre .l-desig, .l-pm { grid-column: 1 / -1; }
  .l-montant { grid-column: 1; align-items: flex-start; }
  .l-fin { grid-column: 2; }
  .groupe-tete { grid-template-columns: 1fr; }
}
.ech-ligne { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, .7fr) minmax(0, 1.4fr) minmax(0, 1.2fr) auto; gap: 0 10px; align-items: end; margin: 0 0 4px; padding: 10px 0 0; border: 0; border-top: 1px dashed var(--line); min-width: 0; }
.ech-ligne legend { padding: 0; }
.ech-ligne .champ { margin-bottom: 10px; min-width: 0; }
.ech-ligne .champ label { font-size: 12.5px; }
.ech-montant { margin-bottom: 10px; min-height: 44px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; }
.ech-montant small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
@media (max-width: 900px) { .ech-ligne { grid-template-columns: 1fr 1fr; } .ech-ligne .e-etape { grid-column: 1 / -1; } }
.ech-somme { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0; font-weight: 700; }
.etat-note { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; }
.motif { border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 10px 14px 4px; margin: 0 0 12px; background: var(--bg); min-width: 0; }
.motif legend { font-weight: 900; font-size: 13px; color: var(--gold-ink); padding: 0 6px; }
.enreg { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.totaux .pm dt, .totaux .pm dd { font-style: italic; }
.totaux .detail dt { padding-left: 14px; }

/* Chronogramme */
.chrono-defile { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--rayon-sm); background: var(--surface); }
.chrono { --w: 34px; --lib: 170px; min-width: calc(var(--lib) + var(--n) * var(--w)); }
@media (max-width: 640px) { .chrono { --lib: 118px; } }
.chrono-ligne { display: grid; grid-template-columns: var(--lib) 1fr; align-items: stretch; border-bottom: 1px solid var(--line); }
.chrono-ligne:last-child { border-bottom: 0; }
.chrono-lib { position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 8px 10px; font-size: 13.5px; font-weight: 700; border-right: 1px solid var(--line); word-break: break-word; }
.chrono-lib small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.chrono-cases { display: grid; grid-template-columns: repeat(var(--n), minmax(var(--w), 1fr)); grid-auto-rows: minmax(44px, auto); align-items: center; }
.chrono-tete .chrono-cases { grid-auto-rows: 28px; }
.sem { grid-row: 1; height: 100%; border-right: 1px solid var(--line); font-size: 11.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; }
.chrono-tete .sem { border-right: 0; }
.barre {
  grid-row: 1; z-index: 1; margin: 8px 2px; min-height: 28px; border-radius: 6px; background: var(--barre-bg); color: var(--barre-ink);
  font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden;
}
.barre-manuel { background: var(--barre-man-bg); }
.jalon {
  grid-row: 1; z-index: 1; justify-self: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 999px;
  background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.chrono-legende { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.phases-ctrl { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.phase-ctrl { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, .8fr) minmax(0, .8fr) auto; gap: 0 10px; align-items: end; border: 0; border-top: 1px dashed var(--line); padding: 10px 0 0; margin: 0; min-width: 0; }
.phase-ctrl legend { padding: 0; }
.phase-ctrl .champ { margin-bottom: 10px; min-width: 0; }
.phase-ctrl .champ label { font-size: 12.5px; }
.phase-nom { margin-bottom: 10px; min-height: 44px; display: flex; flex-direction: column; justify-content: center; font-weight: 700; word-break: break-word; }
.phase-nom small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.phase-ctrl .btn { margin-bottom: 10px; }
@media (max-width: 640px) { .phase-ctrl { grid-template-columns: 1fr 1fr; } .phase-nom { grid-column: 1 / -1; min-height: 0; } }

/* ================= CADRAGE ET COFFRE (phase 4) ================= */
.onglets-offre { margin: 0 0 18px; }
.onglet[aria-current="page"] { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }

.echeance {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 18px; padding: 14px 18px;
  border-radius: var(--rayon); border: 1px solid var(--line); border-left: 6px solid var(--gold); background: var(--surface-2); color: var(--ink);
}
.echeance-chiffre { font-size: 32px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.echeance-texte { display: flex; flex-direction: column; gap: 2px; }
.echeance-info { background: var(--info-bg); color: var(--info-ink); }
.echeance-attention { background: var(--attention-bg); color: var(--attention-ink); }
.echeance-refus { background: var(--danger-bg); color: var(--danger-ink); }
.echeance-neutre { background: var(--surface-2); color: var(--muted); }
.echeance .btn { margin-left: auto; }

.cases { display: flex; flex-direction: column; gap: 10px; }
.case {
  position: relative; display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--rayon-sm); background: var(--bg); color: var(--ink); cursor: pointer;
}
.case input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.case input:disabled { cursor: not-allowed; }
.case-boite {
  flex: 0 0 24px; width: 24px; height: 24px; margin-top: 1px; border: 2px solid var(--btn2-line); border-radius: 6px; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.case input:checked + .case-boite { background: var(--btn-bg); border-color: var(--btn-bg); }
.case input:checked + .case-boite::after {
  content: ""; width: 6px; height: 12px; margin-bottom: 2px; border: solid var(--btn-ink); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.case input:disabled + .case-boite { border-color: var(--line); background: var(--surface-2); }
.case-texte { min-width: 0; word-break: break-word; }
.noms { font-weight: 700; }

.jauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 0 0 14px; }
.jauge-bloc .jauge-texte { margin: 0 0 6px; }

.pieces { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.piece { border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 12px 14px; background: var(--bg); min-width: 0; }
.piece-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.piece-nom { font-weight: 900; word-break: break-word; }
.piece-meta { margin: 4px 0 0; }
.piece-actions { margin-top: 10px; }
.piece code, .coffre-ligne code, #cPieceForm code {
  font-size: 12.5px; word-break: break-all; background: var(--surface-2); color: var(--ink); padding: 2px 6px; border-radius: 6px;
}
.apercu {
  white-space: pre-wrap; word-break: break-word; min-height: 44px; max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 10px 12px;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--rayon-sm); font-family: var(--police); font-size: 13px;
}
.avertissements { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.avertissements .message { margin: 0; }
.champ input[type="file"] { padding: 6px 8px; }
input[type="file"]::file-selector-button {
  min-height: 32px; margin-right: 12px; padding: 4px 14px; border: 1px solid var(--btn2-line); border-radius: var(--rayon-sm);
  background: transparent; color: var(--btn2-ink); font-family: inherit; font-weight: 700; cursor: pointer;
}

.synthese-etroite { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tuile[aria-pressed="true"] { border-color: var(--bleu-ink); background: var(--surface-2); box-shadow: 0 0 0 1px var(--bleu-ink); }

.matrice-defile { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--rayon-sm); background: var(--surface); margin: 0 0 14px; }
.matrice { width: 100%; border-collapse: collapse; font-size: 14px; }
.matrice th { text-align: left; background: var(--surface-2); color: var(--ink); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--gold); white-space: nowrap; }
.matrice td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.matrice tr:last-child td { border-bottom: 0; }
.matrice textarea, .matrice select {
  width: 100%; min-height: 44px; padding: 8px 10px; border-radius: var(--rayon-sm); border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.matrice textarea { min-height: 88px; resize: vertical; }
.matrice td p { margin: 0 0 6px; }
.matrice-alerte td:first-child { box-shadow: inset 4px 0 0 var(--danger-ink); }
.m-num { width: 44px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-texte { min-width: 210px; }
.m-classe { min-width: 150px; }
.champ-mini { display: block; margin: 0 0 2px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.m-classe select + .champ-mini { margin-top: 8px; }
.m-extrait { min-width: 200px; }
.m-reponse { min-width: 170px; }
.m-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; }
.extrait { margin: 0 0 6px; padding: 6px 10px; border-left: 3px solid var(--gold); background: var(--bg); color: var(--ink); font-style: italic; word-break: break-word; }
.extrait-ref { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); }
.verif { margin-top: 2px; }
.alerte-extrait { margin: 6px 0 0; color: var(--danger-ink); font-weight: 700; font-size: 13px; }
@media (max-width: 900px) {
  .matrice-defile { border: 0; background: transparent; overflow: visible; }
  .matrice thead { display: none; }
  .matrice, .matrice tbody, .matrice tr, .matrice td { display: block; width: 100%; }
  .matrice tr { border: 1px solid var(--line); border-radius: var(--rayon-sm); background: var(--surface); padding: 6px 12px; margin: 0 0 12px; }
  .matrice td { border: 0; padding: 6px 0; }
  .matrice td::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); }
  .m-num { width: 100%; }
  .m-texte, .m-classe, .m-extrait, .m-reponse { min-width: 0; }
  .m-actions { flex-direction: row; flex-wrap: wrap; }
  .matrice-alerte td:first-child { box-shadow: none; }
  .matrice-alerte { border-left: 4px solid var(--danger-ink); }
}

.requises, .coffre { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; }
.requise { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1.6fr) auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.requise-type { font-weight: 700; word-break: break-word; }
.requise-piece { margin: 0; }
@media (max-width: 700px) { .requise { grid-template-columns: minmax(0, 1fr); justify-items: start; } }
.coffre { gap: 12px; }
.coffre-ligne { border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 12px 14px; background: var(--bg); min-width: 0; }
.coffre-ligne p { margin: 2px 0; }
.coffre-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.coffre-nom { font-weight: 900; }
.coffre-lib { word-break: break-word; }
.alerte-coffre-bloc { margin: 0 0 18px; }
.alerte-coffre-bloc p { margin: 0; }
.alerte-coffre-bloc ul { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }
.alerte-coffre {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; margin: 0 0 18px; padding: 12px 16px; cursor: pointer; text-align: left;
  background: var(--attention-bg); color: var(--attention-ink); border: 1px solid var(--line); border-left: 6px solid var(--gold); border-radius: var(--rayon);
}
.alerte-coffre:hover { border-color: var(--bleu); }
.alerte-coffre .module-ico { background: var(--surface); color: var(--attention-ink); }
.alerte-coffre-texte { display: flex; flex-direction: column; gap: 2px; }

/* ================= DIALOGUE ET ANNONCES ================= */
.dialogue {
  border: none; border-radius: var(--rayon); padding: 22px; max-width: min(460px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px var(--ombre);
}
.dialogue::backdrop { background: var(--voile); }
.dialogue h2 { font-size: 19px; font-weight: 900; margin-bottom: 8px; }
.dialogue p { color: var(--muted); margin: 0 0 6px; }
.annonce {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  background: var(--btn-bg); color: var(--btn-ink); padding: 12px 18px; border-radius: var(--rayon-sm);
  font-weight: 700; box-shadow: 0 8px 24px var(--ombre); max-width: calc(100vw - 32px);
}
.annonce:empty { display: none; }

.chargement { text-align: center; color: var(--muted); margin-top: 20vh; }

/* ================= PAGE DE GARDE =================
 * Grammaire d'AEIES recopiée à l'identique (valeurs, clamp(), rayons, ombres,
 * durées). Seul écart : les polices de la charte. Les couleurs passent par les
 * jetons --g-* déclarés plus haut, aux mêmes valeurs.
 * Deux ajouts de la grammaire commune des gardes ViZé : la garde défile
 * (overflow-y:auto, barre masquée) et la scène se centre par margin:auto, pour
 * qu'à 320 px le bouton d'entrée reste atteignable. */
#vzSplash { position: fixed; inset: 0; z-index: 99999; cursor: pointer;
  background: radial-gradient(58% 55% at 30% 42%, var(--g-fond-a) 0%, var(--g-fond-b) 72%);
  display: flex; align-items: center; justify-content: center; padding: 5vw; transition: opacity .6s ease;
  overflow-y: auto; scrollbar-width: none; }
#vzSplash::-webkit-scrollbar { display: none; }
#vzSplash.vz-hide { opacity: 0; visibility: hidden; pointer-events: none; }
html.vz-lock, html.vz-lock body { overflow: hidden; }
.vz-stage { display: flex; align-items: center; gap: clamp(18px, 5vw, 72px); max-width: 1080px; width: 100%; flex-wrap: wrap; justify-content: center; margin: auto; }
.vz-fig { position: relative; flex: 0 0 auto; width: min(44vw, 330px); }
.vzscene { position: relative; z-index: 1; width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 30px var(--g-ombre-fig)); }
.vz-halo { position: absolute; inset: 0; margin: auto; width: 78%; height: 80%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--g-halo), transparent); animation: vzPulse 4s ease-in-out infinite; z-index: 0; }
@keyframes vzPulse { 0%, 100% { opacity: .5; transform: scale(1) } 50% { opacity: .88; transform: scale(1.07) } }
.vz-text { flex: 1 1 340px; min-width: 300px; font-family: var(--police); }
.vz-title { font-family: var(--police); font-weight: 800; line-height: 1; letter-spacing: -2px; margin: 0;
  display: flex; align-items: baseline; gap: .16em; flex-wrap: wrap; }
.vz-title .l1 { font-size: clamp(44px, 7.6vw, 92px); background: linear-gradient(180deg, var(--g-or-clair), var(--g-or));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.vz-title .l2 { font-size: clamp(44px, 7.6vw, 92px); color: var(--g-blanc); }
.vz-slogan1 { font-weight: 700; color: var(--g-slogan1); font-size: clamp(17px, 2.5vw, 23px); margin: 20px 0 4px; }
.vz-slogan2 { font-weight: 700; color: var(--g-slogan2); font-size: clamp(13px, 1.8vw, 17px); margin: 0; }
.vz-enter { font-family: var(--police); font-weight: 800; font-size: 17px; color: var(--g-marine); cursor: pointer; margin-top: 26px;
  padding: 15px 26px; border: none; border-radius: 13px; background: linear-gradient(135deg, var(--g-or-clair), var(--g-or));
  box-shadow: 0 10px 26px var(--g-ombre-btn); transition: transform .15s ease, box-shadow .15s ease; }
.vz-enter:hover { transform: translateY(-2px); box-shadow: 0 14px 32px var(--g-ombre-btn-h); }
.vz-subhint { margin-top: 10px; font-size: 12px; color: var(--g-gris); }
.vz-copy { margin-top: 24px; font-weight: 700; font-size: 12.5px; color: var(--g-gris); letter-spacing: .3px; }
@media (prefers-reduced-motion: reduce) { .vz-halo { animation: none } }
@media (max-width: 640px) { .vz-fig { width: min(56vw, 200px) } .vz-text { text-align: center } .vz-title { justify-content: center } }

/* Illustration de la garde : une offre, une facture, un tampon */
.g-sol-a { stop-color: var(--g-sol); stop-opacity: .5; }
.g-sol-b { stop-color: var(--g-sol); stop-opacity: 0; }
.g-papier { fill: var(--g-papier); }
.g-papier-2 { fill: var(--g-papier-2); }
.g-trait { fill: var(--g-trait); }
.g-marine { fill: var(--g-marine); }
.g-or { fill: var(--g-or); }
.g-or-clair { fill: var(--g-or-clair); }
.g-encre-or { fill: var(--g-or); font-family: var(--police); font-weight: 900; }
.g-encre-blanc { fill: var(--g-blanc); font-family: var(--police); font-weight: 900; }
.g-encre-marine { fill: var(--g-marine); font-family: var(--police); font-weight: 900; }
.g-tampon { fill: none; stroke: var(--g-or); }
.g-tampon-txt { fill: var(--g-or); font-family: var(--police); font-weight: 900; letter-spacing: 1px; }

/* ================= OFFRE TECHNIQUE (phase 5) ================= */
.plan { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-ligne {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; align-items: start;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--rayon-sm); background: var(--bg); min-width: 0;
}
.plan-niv-2 { margin-left: 28px; border-left: 4px solid var(--gold); }
.plan-num { font-weight: 900; font-variant-numeric: tabular-nums; color: var(--bleu-ink); padding-top: 11px; }
.plan-corps { min-width: 0; }
.plan-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.plan-titre { font-weight: 900; color: var(--ink); text-decoration: underline; display: inline-block; padding: 10px 0; min-height: 44px; word-break: break-word; }
.plan-titre:hover { color: var(--bleu-ink); }
.plan-meta { margin: 0 0 4px; }
.plan-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.plan-renomme { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.plan-renomme input { flex: 1 1 220px; min-height: 44px; padding: 9px 12px; border-radius: var(--rayon-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.liste-liens { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lien-section { margin-left: 10px; }
.groupe-cases { border: 1px solid var(--line); border-radius: var(--rayon-sm); margin: 0 0 14px; padding: 8px 14px 12px; min-width: 0; }
.groupe-cases legend { font-weight: 900; font-size: 13px; color: var(--gold-ink); padding: 0 6px; }
.case-sous { display: block; font-weight: 400; }
.cases-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }

.intercalaires { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.inter { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--rayon-sm); background: var(--bg); min-width: 0; }
.inter-lettre {
  width: 44px; height: 44px; border-radius: 10px; background: var(--btn-bg); color: var(--btn-ink);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900;
}
.inter-champs { min-width: 0; }
.inter-champs .champ { margin-bottom: 10px; }
.inter-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; }
.inter-texte { white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; padding: 10px 12px; background: var(--surface-2); color: var(--ink); border-radius: var(--rayon-sm); font-family: var(--police); font-size: 13px; }
.ajout-inter { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.ajout-inter .champ { margin: 0; flex: 1 1 240px; }

.editeur-section { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.editeur-section > * { min-width: 0; }
.section-principale .carte + .carte, .section-cote .carte + .carte { margin-top: 18px; }
@media (max-width: 960px) { .editeur-section { grid-template-columns: minmax(0, 1fr); } }
.champ textarea.grand-texte { min-height: 320px; line-height: 1.55; resize: vertical; }
.syntaxe { margin: 0 0 8px; }
.syntaxe p { margin: 0 0 4px; }
.liste-syntaxe { margin: 0 0 8px; padding-left: 20px; }
.liste-syntaxe code, .syntaxe code, .source code { font-size: 12.5px; background: var(--surface-2); color: var(--ink); padding: 2px 6px; border-radius: 6px; }
.a-confirmer { margin: 0 0 12px; }
.a-confirmer p { margin: 0 0 4px; }
.a-confirmer ul { margin: 4px 0 0; padding-left: 20px; font-weight: 400; }
.sources { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.source { border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 10px 12px; background: var(--bg); min-width: 0; }
.source p { margin: 0 0 4px; }
.source-tete { font-weight: 700; word-break: break-all; }
.lien-source { padding: 12px 0; margin: -12px 0; word-break: break-all; }
.source-url { word-break: break-all; }
.comparaison { margin-top: 18px; padding-top: 14px; border-top: 3px solid var(--gold); }
.comparaison h3 { font-size: 17px; font-weight: 900; margin: 0 0 10px; }
.comparaison h3:focus { outline: none; box-shadow: none; }
.comparaison h4 { font-size: 13.5px; font-weight: 900; margin: 0 0 6px; color: var(--muted); }
.compar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 12px; }
@media (max-width: 760px) { .compar { grid-template-columns: minmax(0, 1fr); } }
.compar-texte {
  white-space: pre-wrap; word-break: break-word; min-height: 120px; max-height: 360px; overflow: auto; margin: 0; padding: 10px 12px;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--rayon-sm); font-family: var(--police); font-size: 14px;
}
.sources-proposees { margin: 12px 0; }

.biblio { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.biblio-ligne { border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 12px 14px; background: var(--bg); min-width: 0; }
.biblio-ligne p { margin: 2px 0; }
.biblio-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.biblio-nom { font-weight: 900; word-break: break-word; }
.biblio-extra { font-weight: 700; }
.biblio-contenu { color: var(--muted); word-break: break-word; }
.biblio-actions { margin-top: 8px; }

@media (max-width: 640px) {
  .plan-ligne, .inter { grid-template-columns: minmax(0, 1fr); }
  .plan-num { padding-top: 0; }
  .plan-actions, .inter-actions { grid-column: 1; }
  .plan-niv-2 { margin-left: 14px; }
  .inter-lettre { width: 44px; }
}

/* ================= REGISTRES, RELANCES, PERFORMANCE, SIGNATURE (phases 6 et 7) =================
 * Aucune couleur en dur : les barres prennent les jetons de la charte, résolus par le
 * navigateur selon le thème. Le tableau des valeurs suit chaque graphique. */
.docs, .offres { min-width: 0; }

/* Relances */
.historique { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; font-size: 14px; }
.historique li { padding: 8px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.form-relance { max-width: 680px; padding: 8px 0 4px; }
.form-relance h3 { font-size: 16px; font-weight: 900; margin: 0 0 10px; }
.rel-detail > td { background: var(--bg); }
.rel-actions .btn { margin: 0 8px 6px 0; }
.rel-retard strong { font-size: 16px; }
.rel-reste { font-weight: 700; white-space: nowrap; }
.rel-derniere { min-width: 190px; }

/* Tableau de bord */
.indicateurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 14px; margin: 0 0 18px; }
.tuile-indic { gap: 6px; height: 100%; }
.tuile-indic .tuile-lib { font-size: 15px; }
.tuile-indic .tuile-chiffre { font-size: 28px; line-height: 1.1; }
.tuile-indic .non-defini { color: var(--muted); font-size: 22px; }
.tuile-effectifs { font-weight: 700; font-size: 13.5px; }
.tuile-formule, .tuile-periode, .tuile-compar { color: var(--muted); font-size: 13px; }
.tuile-compar { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; }
.contexte-perf { margin: 0 0 16px; max-width: 90ch; }
.titre-section { font-size: 20px; font-weight: 900; margin: 26px 0 12px; }
.bloc-graph { margin-top: 18px; min-width: 0; }
.bloc-graph h2, .bloc-graph h3 { font-weight: 900; margin-bottom: 8px; }
.bloc-graph h3 { font-size: 17px; }
.grille-ventilations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 18px; }
.grille-ventilations .bloc-graph { margin-top: 0; }
.graphique { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 14px; }
.barre-ligne { display: grid; grid-template-columns: minmax(96px, 160px) minmax(0, 1fr) minmax(96px, auto); gap: 4px 12px; align-items: center; min-height: 44px; padding: 4px 6px; border-radius: var(--rayon-sm); color: var(--ink); text-decoration: none; }
a.barre-lien:hover { background: var(--surface-2); }
.barre-lib { font-weight: 700; font-size: 13.5px; word-break: break-word; }
.barre-piste { display: flex; flex-direction: column; gap: 3px; padding: 3px; border-radius: 8px; background: var(--surface-2); min-width: 0; }
.grande-barre { display: block; height: 12px; border-radius: 6px; }
.barre-val { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 640px) {
  .barre-ligne { grid-template-columns: minmax(0, 1fr) auto; }
  .barre-piste { grid-column: 1 / -1; grid-row: 2; }
}
.serie-facture { background: var(--barre-bg); }
.serie-encaisse { background: var(--ok-ink); }
.serie-retard { background: var(--danger-ink); }
.serie-encours { background: var(--muted); }
.serie-offres { background: var(--gold-ink); }
.legende-serie { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13.5px; margin: 0 0 8px; }
.puce-serie { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-left: 10px; }
.puce-serie:first-child { margin-left: 0; }
.tableau-valeurs { font-size: 13.5px; }
.tableau-valeurs caption { font-weight: 700; color: var(--muted); }

/* Import */
.propositions { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.proposition { border: 1px solid var(--line); border-radius: var(--rayon-sm); padding: 10px 14px; background: var(--bg); min-width: 0; }
.proposition-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.proposition-val { word-break: break-word; }
.proposition-groupe { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--gold-ink); margin: 16px 0 8px; }
.proposition-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.extrait-import { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--gold); background: var(--surface); color: var(--ink); font-style: italic; word-break: break-word; font-size: 13.5px; }
.champ-propose { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.champ-propose-actif { color: var(--attention-ink); font-weight: 700; }
.champ [data-propose] { box-shadow: inset 4px 0 0 var(--gold-ink); }
.zone-facture { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 18px; }
.apercu-texte summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--bleu-ink); }
.code-empreinte { display: block; font-size: 12px; word-break: break-all; background: var(--surface-2); color: var(--ink); padding: 6px 8px; border-radius: 6px; }

/* Signature (phase 7) */
.sg-etat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; font-weight: 700; }
.sg-etapes { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: sg; }
.sg-etape { position: relative; padding: 8px 12px 8px 44px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--rayon-sm); background: var(--bg); counter-increment: sg; display: flex; flex-direction: column; gap: 2px; }
.sg-etape::before { content: counter(sg); position: absolute; left: 10px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-weight: 900; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.sg-fait { border-left-color: var(--ok-ink); }
.sg-fait::before { background: var(--ok-bg); color: var(--ok-ink); }
.sg-attente { border-left-color: var(--gold); }
.sg-pastille { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); margin-left: 6px; }
.sg-empreintes { grid-template-columns: minmax(0, 1fr); gap: 2px 0; margin: 0 0 12px; }
.sg-empreintes dd { margin-bottom: 8px; }
.sg-signataires { margin: 10px 0 0; }
.sg-parties { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sg-partie { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--rayon-sm); background: var(--bg); }
.sg-partie-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 8px; }
.sg-partie .sg-empreintes { margin-bottom: 8px; }
.sg-partie .note { margin: 0; }

/* Listes des dossiers des modules Cadrage et Offre technique : lignes en grille (la liste des offres financières est le registre). */
div.offres > .offre-ligne {
  display: grid; grid-template-columns: 1.7fr 1.3fr 1.3fr .8fr 1fr .9fr; gap: 4px 12px; align-items: center;
  padding: 10px 8px; min-height: 44px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 14px;
}
div.offres > a.offre-ligne:hover { background: var(--surface-2); }
div.offres > .offre-entete { font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid var(--gold); min-height: 0; }
@media (max-width: 800px) {
  div.offres > .offre-entete { display: none; }
  div.offres > .offre-ligne { grid-template-columns: 1fr auto; padding: 12px 4px; }
  div.offres > .offre-ligne .offre-titre { grid-column: 1 / -1; }
  div.offres > .offre-ligne .offre-client, div.offres > .offre-ligne .offre-sec { grid-column: 1 / -1; }
  div.offres > .offre-ligne .offre-limite { grid-column: 1; }
  div.offres > .offre-ligne .offre-montant { grid-column: 2; }
}

/* ================= AIDE : GUIDE D'UTILISATION ================= */
.aide .page-intro { max-width: 75ch; }
.aide-recherche { margin-bottom: 18px; }
.aide-recherche .champ { margin-bottom: 8px; }
.aide-sommaire { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.aide-sommaire-lien {
  display: flex; align-items: flex-start; gap: 14px; min-height: 44px; padding: 14px 16px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--rayon);
  box-shadow: 0 1px 3px var(--ombre); transition: border-color .15s ease, box-shadow .15s ease;
}
.aide-sommaire-lien:hover { border-color: var(--bleu); box-shadow: 0 4px 14px var(--ombre); }
.aide-sommaire-num, .aide-nav-num {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--bleu-ink);
  font-weight: 900; font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center;
}
.aide-sommaire-corps { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.aide-sommaire-titre { font-weight: 900; font-size: 16px; }
.aide-sommaire-resume { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

.aide-grille { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.aide-nav { position: sticky; top: calc(var(--entete-h) + 12px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); padding: 12px; box-shadow: 0 1px 3px var(--ombre); }
.aide-nav-titre { margin: 0 0 6px; padding: 0 6px; font-weight: 900; color: var(--gold-ink); font-size: 13px; letter-spacing: .6px; text-transform: uppercase; }
.aide-nav ol { list-style: none; margin: 0; padding: 0; }
.aide-nav-lien {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: var(--rayon-sm);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px; line-height: 1.25;
}
.aide-nav-lien:hover { background: var(--surface-2); }
.aide-nav-lien[aria-current="page"] { background: var(--btn-bg); color: var(--btn-ink); }
.aide-nav-lien[aria-current="page"] .aide-nav-num { background: var(--btn-ink); color: var(--btn-bg); }

.aide-corps { padding: 24px; min-width: 0; }
.aide-corps > :first-child { margin-top: 0; }
.aide-sous { font-size: 19px; font-weight: 900; margin: 28px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--gold); }
.aide-p { margin: 0 0 12px; max-width: 75ch; overflow-wrap: anywhere; }
.aide-liste { margin: 0 0 14px; padding-left: 22px; max-width: 75ch; }
.aide-liste li { margin: 6px 0; overflow-wrap: anywhere; }
.aide-etapes { list-style: none; counter-reset: aide-etape; margin: 0 0 14px; padding: 0; max-width: 75ch; }
.aide-etapes li { counter-increment: aide-etape; display: flex; align-items: flex-start; gap: 12px; margin: 10px 0; }
.aide-etapes li::before {
  content: counter(aide-etape); flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: var(--btn-bg); color: var(--btn-ink); font-weight: 900; font-size: 14px;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.aide-etape-texte { min-width: 0; overflow-wrap: anywhere; }
.aide-attention {
  margin: 16px 0; padding: 12px 16px; max-width: 75ch; border-left: 5px solid var(--gold); border-radius: var(--rayon-sm);
  background: var(--attention-bg); color: var(--attention-ink);
}
.aide-attention-titre { margin: 0 0 4px; font-weight: 900; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; }
.aide-attention-texte { margin: 0; overflow-wrap: anywhere; }
.aide-formule {
  margin: 8px 0 12px; padding: 10px 14px; max-width: 75ch; background: var(--surface-2); color: var(--ink);
  border-left: 4px solid var(--bleu); border-radius: var(--rayon-sm); font-weight: 700; overflow-wrap: anywhere;
}
.aide-defs { margin: 0 0 14px; max-width: 75ch; }
.aide-defs dt { font-weight: 700; margin-top: 12px; }
.aide-defs dd { margin: 2px 0 0; color: var(--ink); overflow-wrap: anywhere; }
.aide-defile { overflow-x: auto; max-width: 100%; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: var(--rayon-sm); }
.aide-tableau { min-width: 640px; }
.aide-tableau th[scope="row"] { background: transparent; font-weight: 400; border-bottom: 1px solid var(--line); text-align: left; }
.aide-tableau td { text-align: center; }
.aide-messages { list-style: none; margin: 0 0 14px; padding: 0; }
.aide-messages li { margin: 8px 0; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--rayon-sm); }
.aide-message { display: block; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.aide-sens { display: block; margin-top: 2px; color: var(--muted); overflow-wrap: anywhere; }
.aide-voir { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 0; }
.aide-voir-lien {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--btn2-line);
  border-radius: var(--rayon-sm); color: var(--btn2-ink); font-weight: 700; text-decoration: none;
}
.aide-voir-lien:hover { background: var(--btn2-hover); }
.aide-bas { margin: 18px 0 0; }
@media (max-width: 900px) {
  .aide-grille { grid-template-columns: minmax(0, 1fr); }
  .aide-nav { display: none; }
  .aide-corps { padding: 16px; }
}

/* ====================== Formation (visite guidée) ======================
 * Écran des parcours et bulle posée près de l'élément désigné. Toutes les couleurs sont
 * des jetons : l'anneau de l'élément et le bord de la bulle prennent --bleu-ink, qui
 * reste lisible sur le fond clair (bleu foncé) comme sur le fond sombre (bleu clair). */
.formation-liste { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.formation-liste > .formation-carte { display: flex; flex-direction: column; gap: 6px; margin: 0; }
#tFormation:focus { outline: none; box-shadow: none; }
.formation-carte-titre { margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.formation-meta { margin: 0; }
.formation-resume { margin: 0; overflow-wrap: anywhere; }
.formation-statut { font-weight: 700; color: var(--muted); }
.formation-statut-en-cours { color: var(--bleu-ink); }
.formation-statut-termine { color: var(--ok-ink); }
.formation-carte .actions { margin-top: auto; padding-top: 6px; }
.formation-grise { background: var(--surface-2); border-style: dashed; }
.formation-reserve { margin: 8px 0; padding: 8px 12px; background: var(--attention-bg); color: var(--attention-ink); border-radius: var(--rayon-sm); font-weight: 700; overflow-wrap: anywhere; }
.formation-reserve-note { margin: 0; }

.formation-bulle {
  position: fixed; z-index: 9000; top: 0; left: 0; box-sizing: border-box;
  width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
  padding: 14px 16px 16px; background: var(--surface); color: var(--ink);
  border: 2px solid var(--bleu-ink); border-radius: var(--rayon);
  box-shadow: 0 12px 32px var(--ombre), 0 2px 8px var(--ombre);
}
.formation-bulle[data-mode="bas-ecran"] {
  top: auto; left: 8px; right: 8px; width: auto; max-height: 46vh;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.formation-compteur { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.formation-titre { margin: 0 0 6px; font-size: 18px; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.formation-texte { margin: 0 0 8px; line-height: 1.5; overflow-wrap: anywhere; }
.formation-note { margin: 6px 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.formation-retour { margin-top: 6px; }
.formation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.formation-cible {
  outline: 3px solid var(--bleu-ink) !important; outline-offset: 4px;
  box-shadow: 0 0 0 8px var(--info-bg) !important; scroll-margin: calc(var(--entete-h) + 32px) 0 48px;
}
