/*
 * apps/_shared/static/css/page.css
 * --------------------------------
 * LE SYSTÈME DE PAGE COMMUN À TOUTES LES MARQUES : les BLOCS d'une page,
 * au-dessus des pièces de `composants.css` (bouton, carte, tableau, tuile).
 *
 *   m-page        la page elle-même : sa marge sous l'en-tête, son rythme
 *   m-flux        la colonne de contenu à côté d'un sommaire, au même rythme
 *   m-tete        le haut de page : surtitre, titre, chapeau, repères, états
 *   m-etat        une pastille d'état (« En liquidation », « Vacant »)
 *   m-section     une section : son titre, son intro, son contenu
 *   m-chiffres    la rangée de chiffres clés (tuiles `m-stat` du socle)
 *   m-encadre     un encadré dans la page : alerte, attention, information
 *   m-graph       les graphiques (barres, courbes, répartition, annotations)
 *   m-grille      une grille de cartes ou d'encadrés, à colonnes égales
 *   m-actions     une rangée de boutons (`m-bouton` du socle)
 *   m-lecture     la colonne de lecture d'un texte
 *   m-note        un texte secondaire (source, date, précision)
 *
 * 🚨 POURQUOI (10/11/2026, Benjamin : « y'a pas deux pages ou modules qui
 * sont faits de la même façon, c'est zéro système graphique »). MESURÉ sur
 * les gabarits Zero Bullshit ce jour-là : 6 styles de titre de page, 9 de
 * titre de section, 5 gris de texte secondaire, 80 couleurs et 63 tailles de
 * texte écrites à la main, 3 rangées de chiffres et 3 graphiques en barres
 * construits chacun autrement, 4 navigations de rubrique différentes. Le
 * cadre unique (11/10/2026) avait rendu commun l'en-tête et le pied, le lot 5
 * (12/10/2026) les pièces ; rien ne disait à quoi ressemble une PAGE.
 *
 * LES RÈGLES QUE CETTE FEUILLE PORTE, et qu'aucune page ne réécrit :
 * - un seul titre de page, un seul titre de section, un seul intertitre ;
 * - un seul gris de texte secondaire, `--marque-gris` ;
 * - deux largeurs : la colonne de lecture pour le texte (`--m-lecture`),
 *   toute la largeur de la page pour les données. On ne centre qu'un bloc qui
 *   se suffit à lui-même (bandeau, page de service, état vide) ;
 * - un seul rythme vertical : l'écart entre deux sections est le même partout.
 *
 * UN BLOC, DES VALEURS PAR MARQUE, comme `composants.css` : chaque détail
 * visible se lit dans une variable que la marque peut poser dans son
 * `valeurs_marque`, avec un repli lisible pour toutes. Les macros qui écrivent
 * le HTML de ces blocs sont dans `apps/_shared/templates/_page.html` ; la
 * planche qui les montre tous, `/planche-graphique/` (admin seul). Doctrine
 * et règles d'usage : `MD Manuels/SYSTEME_GRAPHIQUE.md`.
 *
 * LA NAVIGATION N'EST PAS ICI : le menu du site dit la rubrique, le fil
 * d'Ariane et le sommaire d'une page longue sont dans `composants.css` et
 * `apps/_shared/templates/_navigation.html` (même jour, autre session). Une
 * seule navigation, jamais une seconde.
 *
 * PRÉFIXE `m-`, celui du socle. Aucune collision mesurée le 10/11/2026.
 */

/* ── La page ── La marge sous l'en-tête et l'écart entre les blocs. */
.m-page {
  padding-top: var(--m-page-haut, 28px);
  color: var(--marque-encre, #1a1a1a);
}
/* `m-flux` : la colonne de contenu à côté d'un sommaire (`m-avec-sommaire`)
   prend le même rythme que la page. */
.m-page > * + *,
.m-flux > * + * { margin-top: var(--m-page-rythme, 56px); }
/* Le fil d'Ariane (`composants.css`) porte sa propre marge : le haut de page
   le suit sans l'écart d'une section. */
.m-page > .m-fil + * { margin-top: 0; }

/* ── La colonne de lecture ── Un texte ne court jamais sur toute la largeur. */
.m-lecture { max-width: var(--m-lecture, 68ch); }

/* ── Le texte secondaire ── UN gris, une taille. */
.m-note {
  font-size: 0.875rem; line-height: 1.55;
  color: var(--marque-gris, #666);
  max-width: var(--m-lecture, 68ch);
  margin: 12px 0 0;
}

/* ── Le haut de page ── */
.m-tete__surtitre {
  font-family: var(--m-label-police, inherit);
  font-size: var(--m-label-taille, 0.8rem);
  text-transform: var(--m-label-casse, uppercase);
  letter-spacing: var(--m-label-espacement, 0.08em);
  color: var(--marque-gris, #666);
  margin: 0 0 10px;
}
.m-tete__titre {
  font-family: var(--font-heading, inherit);
  font-size: var(--m-titre-taille, clamp(2rem, 1.35rem + 2.6vw, 3.25rem));
  font-weight: var(--m-titre-graisse, 800);
  line-height: 1.08;
  letter-spacing: var(--m-titre-espacement, -0.02em);
  color: var(--marque-encre, #1a1a1a);
  margin: 0;
  text-wrap: balance;
}
.m-tete__chapeau {
  font-size: 1.15rem; line-height: 1.6;
  color: var(--marque-encre, #1a1a1a);
  max-width: var(--m-lecture, 68ch);
  margin: 16px 0 0;
}
/* Les types de haut de page : la même échelle, une composition par type. */
.m-tete--article { max-width: var(--m-lecture, 68ch); }
.m-tete--rubrique .m-tete__chapeau { margin-top: 12px; }
.m-tete__signature { font-size: var(--m-t-note, 0.8125rem); color: var(--m-texte-2, #666); margin: 16px 0 0; }
/* Les repères du sujet (adresse, date, taille), séparés par un point. */
.m-tete__reperes {
  display: flex; flex-wrap: wrap; gap: 4px 0;
  list-style: none; padding: 0; margin: 14px 0 0;
  font-size: 0.9375rem; color: var(--marque-gris, #666);
}
/* Le point FINIT un repère au lieu d'ouvrir le suivant : sur téléphone, une
   ligne ne commence jamais par « · ». */
.m-tete__reperes li:not(:last-child)::after { content: "·"; margin: 0 10px; }
.m-tete__etats { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.m-tete__actions { margin-top: 20px; }

/* ── La pastille d'état ── Un état dit un FAIT sur le sujet. Quatre niveaux,
   les couleurs d'usage (vert, ambre, rouge) : elles disent un état, pas une
   marque, et ne servent à rien d'autre. */
.m-etat {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px; padding: 4px 12px;
  font-size: 0.8125rem; font-weight: 500; line-height: 1.4; white-space: nowrap;
  background: var(--neutre-surface-2, #f0f0f0); color: var(--marque-encre, #1a1a1a);
}
.m-etat::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--marque-gris, #666);
}
.m-etat--ok { background: var(--etat-ok-fond, #eaf4ee); color: var(--etat-ok-texte, #1f5c3f); }
.m-etat--ok::before { background: var(--etat-ok-texte, #1f5c3f); }
.m-etat--attention { background: var(--etat-alerte-fond, #fbf3e2); color: var(--etat-alerte-texte, #7a5408); }
.m-etat--attention::before { background: var(--etat-alerte-texte, #7a5408); }
.m-etat--alerte { background: var(--etat-erreur-fond, #fbe9e7); color: var(--etat-erreur-texte, #a1201a); }
.m-etat--alerte::before { background: var(--etat-erreur-texte, #a1201a); }

/* ── La section ── Un titre, une intro facultative, le contenu. */
.m-section__titre {
  font-family: var(--font-heading, inherit);
  font-size: var(--m-section-taille, var(--m-t-section, 1.625rem));
  font-weight: var(--m-section-graisse, 700);
  line-height: 1.2;
  letter-spacing: var(--m-titre-espacement, -0.01em);
  color: var(--marque-encre, #1a1a1a);
  margin: 0;
}
.m-section__intro {
  font-size: 0.9375rem; line-height: 1.6;
  color: var(--marque-gris, #666);
  max-width: var(--m-lecture, 68ch);
  margin: 8px 0 0;
}
.m-section__corps { margin-top: 24px; }
/* Dans une section, deux éléments qui se suivent ont 16 px entre eux par
   défaut ; un élément qui porte sa propre marge (sous-titre) la garde
   (`:where`, spécificité nulle). */
:where(.m-section__corps > * + *) { margin-top: var(--m-esp-4, 16px); }
/* Une section qui ouvre une nouvelle partie de la page : un filet au-dessus. */
.m-section--partie { border-top: 1px solid var(--marque-filet, #e3e3e3); padding-top: 40px; }
/* L'intertitre, à l'intérieur d'une section ou d'une carte : le titre de carte
   du socle, pour qu'une page n'ait qu'un seul style de troisième niveau. */
.m-intertitre {
  font-family: var(--m-carte-titre-police, var(--font-heading));
  font-size: var(--m-carte-titre-taille, 1.15rem);
  font-weight: var(--m-carte-titre-graisse, 700);
  text-transform: var(--m-carte-titre-casse, none);
  letter-spacing: var(--m-carte-titre-espacement, normal);
  line-height: var(--m-carte-titre-interligne, 1.3);
  color: var(--m-carte-titre-couleur, var(--color-primary));
  margin: 0 0 var(--m-carte-titre-marge, 1rem);
}

/* ── La rangée de chiffres clés ── Les tuiles `m-stat` du socle, en grille
   alignée à gauche : chaque tuile a la même largeur, la rangée suit la page. */
.m-chiffres {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(var(--m-chiffres-min, 190px), 1fr));
}
.m-chiffres .m-stat { min-width: 0; }
.m-chiffres .m-stat__num { font-size: var(--m-chiffres-taille, 1.875rem); }
.m-stat--alerte .m-stat__num { color: var(--etat-erreur-texte, #a1201a); }

/* ── L'encadré ── Une information DANS la page, à lire avant la suite.
   Ce n'est PAS `m-alerte`, qui répond à un geste (formulaire envoyé, erreur
   de saisie). Trois niveaux, un filet à gauche, le fond doux de l'état. */
.m-encadre {
  border-left: 3px solid var(--marque-accent, var(--color-primary));
  background: var(--m-carte-plate-fond, var(--neutre-surface-2, #f5f5f5));
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
  font-size: 0.9375rem; line-height: 1.6;
  color: var(--marque-encre, #1a1a1a);
  max-width: var(--m-lecture, 68ch);
}
.m-encadre__titre { font-weight: 700; }
.m-encadre p { margin: 0; }
.m-encadre p + p { margin-top: 8px; }
.m-encadre--attention { border-left-color: var(--etat-alerte-trait, #8a6410); background: var(--etat-alerte-fond, #fbf3e2); }
.m-encadre--alerte { border-left-color: var(--etat-erreur-trait, #b42318); background: var(--etat-erreur-fond, #fbe9e7); }

/* ── Les graphiques ──
   Le calcul est dans `apps/_shared/graphiques.py`, le dessin dans
   `apps/_shared/templates/_graphiques.html`. Chaque marque reçoit sa couleur
   par une classe : `m-s1` à `m-s8` (la palette, par rang), `m-e-*` (un état).
   Les positions arrivent en variables (`--x`, `--y`, `--l`, `--h`, en % de
   la zone de tracé) ; le texte reste du HTML, lisible sur téléphone. */
.m-s1 { --c: var(--m-serie-1); } .m-s2 { --c: var(--m-serie-2); }
.m-s3 { --c: var(--m-serie-3); } .m-s4 { --c: var(--m-serie-4); }
.m-s5 { --c: var(--m-serie-5); } .m-s6 { --c: var(--m-serie-6); }
.m-s7 { --c: var(--m-serie-7); } .m-s8 { --c: var(--m-serie-8); }
.m-e-ok { --c: var(--etat-ok-trait); }
.m-e-attention { --c: var(--etat-alerte-trait); }
.m-e-alerte { --c: var(--etat-erreur-trait); }
.m-e-neutre { --c: var(--m-gris-500); }
.m-e-inconnu { --c: var(--m-gris-300); }

.m-graph { margin: 0; }
/* La légende : au-dessus du tracé, dès deux séries. Le texte reste dans
   l'encre du texte, la pastille porte la couleur. */
.m-graph__legende {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  list-style: none; padding: 0; margin: 0 0 var(--m-esp-4);
  font-size: var(--m-t-note); color: var(--m-texte-2);
}
.m-graph__legende li { display: inline-flex; align-items: center; gap: 7px; }
.m-graph__pastille { width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }
.m-graph__pastille--trait { height: 0; border-radius: 0; background: none; border-top: 2px solid var(--c); }
.m-graph__pastille--tirets { border-top-style: dashed; }

.m-graph__corps { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--m-esp-2); }
.m-graph__axe-y { position: relative; height: var(--hauteur, 240px); min-width: 2.5rem; }
.m-graph__axe-y span {
  position: absolute; right: 0; bottom: calc(var(--y) * 1%); transform: translateY(50%);
  font-size: 0.75rem; line-height: 1; color: var(--m-texte-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.m-graph__trace { position: relative; height: var(--hauteur, 240px); border-bottom: 1px solid var(--m-gris-400); }
.m-graph__grille { position: absolute; left: 0; right: 0; bottom: calc(var(--y) * 1%); border-top: 1px solid var(--m-gris-200); }
.m-graph__zero { position: absolute; left: 0; right: 0; bottom: calc(var(--y) * 1%); border-top: 1px solid var(--m-gris-500); }

/* Barres : bouts arrondis côté valeur, 2 px de fond entre deux segments
   empilés pour qu'on les compte. */
.m-graph__barre {
  position: absolute; left: calc(var(--x) * 1%); width: calc(var(--l) * 1%);
  bottom: calc(var(--y) * 1%); height: calc(var(--h) * 1%);
  background: var(--c); border-radius: 3px 3px 0 0; min-height: 1px;
}
.m-graph--empile .m-graph__barre { border-radius: 0; box-shadow: inset 0 2px 0 var(--marque-fond, #fff); }
.m-graph__valeur {
  position: absolute; left: calc((var(--x) + var(--l) / 2) * 1%); bottom: calc((var(--y) + var(--h)) * 1%);
  transform: translate(-50%, -4px);
  font-size: 0.75rem; color: var(--m-texte-2); font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Courbes : un trait de 2 px qui ne s'épaissit pas quand le tracé s'étire ;
   une série de référence (promesse, objectif) en tirets. */
.m-graph__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.m-graph__ligne { fill: none; stroke: var(--c); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.m-graph__ligne--tirets { stroke-dasharray: 6 4; }
.m-graph__fin {
  position: absolute; left: calc(var(--x) * 1%); bottom: calc(var(--y) * 1%);
  width: 8px; height: 8px; margin: 0 0 -4px -4px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 2px var(--marque-fond, #fff);
}

/* Les annotations. UNE forme par sorte, sur tous les graphiques :
   - repère daté : un trait vertical en tirets, son libellé en haut ;
   - bande : une période grisée, son libellé en haut à gauche ;
   - seuil : un trait horizontal en tirets, son libellé au-dessus, à droite ;
   - note : un point cerclé et sa phrase. */
.m-graph__repere { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); border-left: 1px dashed var(--m-gris-600); }
.m-graph__bande { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); width: calc(var(--l) * 1%); background: var(--m-gris-100); }
.m-graph__seuil { position: absolute; left: 0; right: 0; bottom: calc(var(--y) * 1%); border-top: 1px dashed var(--m-gris-600); }
.m-graph__repere--alerte { border-left-color: var(--etat-erreur-trait); }
.m-graph__repere--attention { border-left-color: var(--etat-alerte-trait); }
.m-graph__seuil--alerte { border-top-color: var(--etat-erreur-trait); }
.m-graph__seuil--attention { border-top-color: var(--etat-alerte-trait); }
.m-graph__annot {
  position: absolute; z-index: 1;
  font-size: 0.75rem; line-height: 1.3; color: var(--m-texte);
  background: var(--marque-fond, #fff); padding: 1px 4px; white-space: nowrap;
}
.m-graph__repere .m-graph__annot { top: 0; left: 4px; }
.m-graph__repere--fin .m-graph__annot { left: auto; right: 4px; }
.m-graph__bande .m-graph__annot { top: 0; left: 0; background: none; color: var(--m-texte-2); }
.m-graph__seuil .m-graph__annot { right: 0; bottom: 2px; }
.m-graph__note {
  position: absolute; left: calc(var(--x) * 1%); bottom: calc(var(--y) * 1%);
  width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%;
  border: 2px solid var(--m-texte); background: var(--marque-fond, #fff); z-index: 1;
}
.m-graph__note .m-graph__annot { left: 12px; bottom: 6px; white-space: normal; width: max-content; max-width: 14rem; }

.m-graph__axe-x { position: relative; height: 1.5rem; grid-column: 2; }
/* Des barres : chaque nom de catégorie tient dans la largeur de sa barre et
   passe à la ligne au lieu de chevaucher le voisin (mesuré à 390 px). */
.m-graph__axe-x--cat { height: 2.6rem; }
.m-graph__axe-x--cat span { width: calc(var(--l) * 1%); white-space: normal; text-align: center; line-height: 1.2; overflow: hidden; max-height: 2.4em; }
.m-graph__axe-x span {
  position: absolute; top: 6px; left: calc(var(--x) * 1%); transform: translateX(-50%);
  font-size: 0.75rem; line-height: 1; color: var(--m-texte-2); white-space: nowrap;
}

/* La barre de répartition : une barre de 100 %, puis chaque part nommée
   dessous, avec sa pastille (lisible sans distinguer les couleurs). */
.m-repartition { display: flex; gap: 2px; height: 28px; }
.m-repartition__part { width: calc(var(--l) * 1%); background: var(--c); min-width: 2px; }
.m-repartition__part:first-child { border-radius: var(--m-rayon-petit) 0 0 var(--m-rayon-petit); }
.m-repartition__part:last-child { border-radius: 0 var(--m-rayon-petit) var(--m-rayon-petit) 0; }
.m-repartition__parts {
  display: grid; grid-template-columns: var(--colonnes); gap: 2px;
  list-style: none; padding: 0; margin: 0;
}
.m-repartition__parts li {
  min-width: 0; padding: 10px 8px 0 0; border-top: 3px solid var(--c);
  display: flex; flex-direction: column; gap: 2px;
}
.m-repartition__pct { font-family: var(--font-heading, inherit); font-weight: 800; font-size: 1.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.m-repartition__nom { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.m-repartition__detail { font-size: var(--m-t-note); color: var(--m-texte-2); }

.m-graph__note--fin .m-graph__annot { left: auto; right: 12px; text-align: right; }

/* Le classement : une barre horizontale par ligne, le nom à gauche, la
   valeur à droite. Une seule couleur ; une ligne mise en avant (le sujet de
   la fiche) la garde, les autres passent en gris. */
.m-classement { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.m-classement li {
  display: grid; grid-template-columns: minmax(7rem, 14rem) minmax(0, 1fr) 5.5rem;
  align-items: center; column-gap: var(--m-esp-3);
  font-size: var(--m-t-petit);
}
.m-classement__nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-classement__piste { height: 14px; }
.m-classement__barre { display: block; height: 100%; width: calc(var(--l) * 1%); min-width: 2px; background: var(--c); border-radius: 0 3px 3px 0; }
.m-classement__valeur { text-align: right; font-variant-numeric: tabular-nums; color: var(--m-texte-2); }
.m-classement--avant .m-classement__nom, .m-classement--avant .m-classement__valeur { font-weight: 700; color: var(--m-texte); }

/* Avant / après : deux points reliés par un trait, sur une échelle commune. */
.m-halteres { display: grid; gap: 10px; }
.m-halteres__ligne, .m-halteres__axe {
  display: grid; grid-template-columns: minmax(7rem, 14rem) minmax(0, 1fr);
  align-items: center; column-gap: var(--m-esp-3); font-size: var(--m-t-petit);
}
.m-halteres__piste { position: relative; height: 16px; }
.m-halteres__axe .m-halteres__piste { height: 1rem; border-bottom: 1px solid var(--m-gris-200); }
.m-halteres__axe .m-halteres__piste span {
  position: absolute; left: calc(var(--x) * 1%); transform: translateX(-50%);
  font-size: 0.75rem; color: var(--m-texte-2); white-space: nowrap;
}
.m-halteres__trait { position: absolute; top: 7px; height: 2px; left: calc(var(--a) * 1%); width: calc((var(--b) - var(--a)) * 1%); background: var(--m-gris-300); }
.m-halteres__point {
  position: absolute; top: 2px; left: calc(var(--x) * 1%); width: 12px; height: 12px; margin-left: -6px;
  border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--marque-fond, #fff);
}

/* Le nuage de points : un point de 10 px, cerclé du fond pour qu'on
   compte deux points qui se chevauchent ; le nom des points désignés. */
.m-graph__point {
  position: absolute; left: calc(var(--x) * 1%); bottom: calc(var(--y) * 1%);
  width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 2px var(--marque-fond, #fff);
}
.m-graph__point .m-graph__annot { left: 10px; bottom: 6px; background: none; }
.m-graph__nom-axe { font-size: 0.75rem; color: var(--m-texte-2); margin: 0 0 var(--m-esp-2); }
.m-graph__nom-axe--x { text-align: right; margin: var(--m-esp-1) 0 0; }

/* Les petits graphiques côte à côte, sur la même échelle (`courbes(...,
   bornes=...)`) : un titre de carte au-dessus de chacun. */
.m-multiples { display: grid; gap: var(--m-esp-6) var(--m-esp-5); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* La petite courbe de tendance, dans le fil du texte. */
.m-tendance { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; white-space: nowrap; }
.m-tendance__trace { width: 64px; height: 18px; overflow: visible; }
.m-tendance__trace polyline { fill: none; stroke: var(--m-texte-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.m-tendance__variation { font-size: var(--m-t-note); font-weight: 600; font-variant-numeric: tabular-nums; }
.m-tendance--ok { color: var(--etat-ok-texte); }
.m-tendance--alerte { color: var(--etat-erreur-texte); }
.m-tendance--neutre { color: var(--m-texte-2); }
@media (max-width: 640px) {
  .m-classement li, .m-halteres__ligne, .m-halteres__axe { grid-template-columns: minmax(5.5rem, 8rem) minmax(0, 1fr) auto; }
  .m-halteres__ligne, .m-halteres__axe { grid-template-columns: minmax(5.5rem, 8rem) minmax(0, 1fr); }
}

/* Les données du graphique, en tableau, sous lui : lisibles sans les
   couleurs, par un lecteur d'écran, et copiables. */
.m-graph__donnees { margin-top: var(--m-esp-3); font-size: var(--m-t-note); color: var(--m-texte-2); }
.m-graph__donnees > summary { cursor: pointer; width: max-content; }
.m-graph__donnees > summary:hover { color: var(--m-lien); }
.m-graph__donnees .m-tableau { margin-top: var(--m-esp-3); font-size: var(--m-t-note); }

/* ── La grille ── Des cartes ou des encadrés côte à côte, à largeur égale,
   qui passent l'un sous l'autre quand la place manque. */
.m-grille {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(var(--m-grille-min, 280px), 1fr));
}
.m-grille > .m-encadre { max-width: none; }

/* ── La rangée de boutons ── */
.m-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ── Téléphone ── */
@media (max-width: 640px) {
  .m-page > * + *,
  .m-flux > * + * { margin-top: var(--m-page-rythme-mobile, 40px); }
  .m-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  /* Deux tuiles par ligne : un montant à sept chiffres (« 1 576 960 $ ») se
     coupait en deux lignes à la taille d'écran large (mesuré à 390 px). */
  .m-chiffres .m-stat { padding: 14px; }
  .m-chiffres .m-stat__num { font-size: var(--m-chiffres-taille-mobile, clamp(1.05rem, 5vw, 1.5rem)); white-space: nowrap; }
  .m-graph__trace, .m-graph__axe-y { height: min(var(--hauteur, 240px), 200px); }
}

/* ── Nuancier ── La planche montre chaque jeton de couleur : une case par
   degré, la couleur passée en variable (`--c`), son nom dessous. Réservé à
   la documentation (`/planche-graphique/`). */
.m-nuancier { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.m-nuancier__case { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; color: var(--m-texte-2, #666); }
.m-nuancier__case::before {
  content: ""; height: 44px; border-radius: var(--m-rayon-petit, 4px);
  background: var(--c); box-shadow: inset 0 0 0 1px var(--m-filet, #e3e3e3);
}
.m-nuancier__case b { color: var(--m-texte, #1a1a1a); font-weight: 600; }
.m-echelle { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 14px 24px; align-items: baseline; }
.m-echelle > dt { font-size: 0.75rem; color: var(--m-texte-2, #666); }
.m-echelle > dd { margin: 0; }
.m-espace { display: flex; align-items: center; gap: 12px; font-size: 0.75rem; color: var(--m-texte-2, #666); }
.m-espace::before { content: ""; width: var(--l); height: 12px; background: var(--m-marque-300, #ccc); border-radius: 2px; }
@media (max-width: 640px) { .m-echelle { grid-template-columns: minmax(0, 1fr); gap: 4px; } .m-echelle > dd { margin-bottom: 14px; } }

/* ══ Les blocs de contenu courants (10/11/2026, inventaire de toutes les
   apps) : chacun existait en 3 à 6 dessins différents. ══ */

/* ── Ligne de constat ── Un fait d'alerte en UNE ligne, son état en tête
   (pastille + mot), sans cadre : « une alerte tient en une ligne »
   (Benjamin, 09/11/2026). Plusieurs constats se suivent en liste. */
.m-constats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: var(--m-lecture, 68ch); }
.m-constat { display: flex; gap: 10px; align-items: baseline; font-size: var(--m-t-petit, 0.9375rem); line-height: 1.5; }
.m-constat::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--m-gris-500)); transform: translateY(-1px); }
.m-constat--ok { --c: var(--etat-ok-trait); }
.m-constat--attention { --c: var(--etat-alerte-trait); }
.m-constat--alerte { --c: var(--etat-erreur-trait); }
.m-constat__etat { font-weight: 700; flex: none; }
.m-constat--ok .m-constat__etat { color: var(--etat-ok-texte); }
.m-constat--attention .m-constat__etat { color: var(--etat-alerte-texte); }
.m-constat--alerte .m-constat__etat { color: var(--etat-erreur-texte); }

/* ── Liste de faits « intitulé : valeur » ── L'intitulé en gris à gauche,
   la valeur à droite ; une ligne par fait, un filet entre deux. */
.m-faits { display: grid; grid-template-columns: minmax(8rem, 16rem) minmax(0, 1fr); margin: 0; font-size: var(--m-t-petit, 0.9375rem); max-width: 52rem; }
.m-faits > dt, .m-faits > dd { padding: 9px 0; border-bottom: 1px solid var(--m-filet, #e3e3e3); margin: 0; }
.m-faits > dt { color: var(--m-texte-2, #666); padding-right: var(--m-esp-4, 16px); }
.m-faits > dd { font-variant-numeric: tabular-nums; min-width: 0; }

/* ── Partie repliable ── Le complément qu'on ouvre si on veut : jamais le
   contenu principal (« un sujet, une page »). Un seul dessin : un filet, le
   titre en gras, un signe + / - à droite. */
.m-repli { border-top: 1px solid var(--m-filet, #e3e3e3); border-bottom: 1px solid var(--m-filet, #e3e3e3); max-width: var(--m-lecture, 68ch); }
.m-repli + .m-repli { border-top: 0; }
.m-repli > summary {
  list-style: none; cursor: pointer; padding: 12px 28px 12px 0; position: relative;
  font-weight: 600; color: var(--m-texte, #1a1a1a);
}
.m-repli > summary::-webkit-details-marker { display: none; }
.m-repli > summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.15rem; color: var(--m-texte-2, #666); }
.m-repli[open] > summary::after { content: "−"; }
.m-repli > summary:hover { color: var(--m-lien); }
.m-repli__corps { padding: 0 0 16px; }
.m-repli__resume { font-weight: 400; color: var(--m-texte-2, #666); margin-left: 8px; }

/* ── Étapes numérotées ── Une marche à suivre : le numéro dans un rond,
   le titre de l'étape, son texte. */
.m-etapes { list-style: none; counter-reset: etape; padding: 0; margin: 0; display: grid; gap: var(--m-esp-5, 24px); max-width: var(--m-lecture, 68ch); }
.m-etapes > li { counter-increment: etape; display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: var(--m-esp-4, 16px); }
.m-etapes > li::before {
  content: counter(etape); grid-row: span 2;
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--m-marque-100); color: var(--m-marque-800); font-weight: 700; font-variant-numeric: tabular-nums;
}
.m-etapes > li > p { margin: 0; }
.m-etapes > li > .m-etapes__titre { font-weight: 700; margin: 4px 0; }

/* ── Citation ── Une phrase rapportée, sa source dessous. Dans la colonne
   de lecture, un filet de la couleur de marque à gauche. */
.m-citation { margin: 0; padding: 4px 0 4px var(--m-esp-5, 24px); border-left: 2px solid var(--m-marque-300); max-width: var(--m-lecture, 68ch); }
.m-citation > p { font-family: var(--font-heading, inherit); font-size: 1.25rem; line-height: 1.45; margin: 0; }
.m-citation__source { font-size: var(--m-t-note, 0.8125rem); color: var(--m-texte-2, #666); margin-top: 8px; }

/* ── Le chiffre dans une phrase ── La réponse de la page en une phrase,
   son chiffre en grand : « 29,6 % des montants financés par Bricks sont en
   retard ou en défaut. » */
.m-phrase-chiffre { font-family: var(--font-heading, inherit); font-size: 1.5rem; line-height: 1.3; font-weight: 700; max-width: var(--m-lecture, 68ch); margin: 0; }
.m-phrase-chiffre b { font-size: 2.25rem; font-weight: 900; font-variant-numeric: tabular-nums; }

/* ── Source et méthode ── En bas de la page ou d'un bloc : d'où viennent
   les chiffres, de quand ils datent, comment ils sont calculés. Un filet au
   dessus, le texte en note. */
.m-source { border-top: 1px solid var(--m-filet, #e3e3e3); padding-top: var(--m-esp-4, 16px); max-width: var(--m-lecture, 68ch); font-size: var(--m-t-note, 0.8125rem); color: var(--m-texte-2, #666); }
.m-source p { margin: 0 0 6px; }
.m-source b { color: var(--m-texte, #1a1a1a); font-weight: 600; }

/* ── Voir aussi ── Les liens vers les pages voisines, en pastilles. */
.m-voir-aussi { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.m-voir-aussi__titre { font-size: var(--m-t-note, 0.8125rem); color: var(--m-texte-2, #666); margin-right: 4px; }

/* ── État vide ── Une liste sans résultat : la phrase qui le dit et ce
   qu'on peut faire. Centré, comme tout bloc qui se suffit à lui-même. */
.m-vide { text-align: center; padding: var(--m-esp-7, 48px) var(--m-esp-4, 16px); border: 1px dashed var(--m-filet-fort, #ccc); border-radius: var(--m-rayon, 8px); color: var(--m-texte-2, #666); }
.m-vide__titre { font-weight: 700; color: var(--m-texte, #1a1a1a); margin: 0 0 6px; }

/* ── Choix segmenté ── Deux à cinq options exclusives qui changent
   l'affichage (devise, période, unité) : des boutons collés, le choisi
   plein. Pas des onglets : rien n'est caché, seule l'unité change. */
.m-segments { display: inline-flex; border: 1px solid var(--m-filet-fort, #ccc); border-radius: var(--m-rayon-petit, 4px); overflow: hidden; }
.m-segments a, .m-segments button, .m-segments label {
  padding: 6px 12px; font: inherit; font-size: var(--m-t-note, 0.8125rem); color: var(--m-texte, #1a1a1a);
  background: var(--m-surface, #fff); border: 0; text-decoration: none; cursor: pointer;
}
.m-segments > * + * { border-left: 1px solid var(--m-filet-fort, #ccc); }
.m-segments [aria-current], .m-segments [aria-pressed="true"] { background: var(--m-texte, #1a1a1a); color: var(--marque-fond, #fff); }
@media (max-width: 640px) { .m-faits { grid-template-columns: minmax(0, 1fr); } .m-faits > dt { border-bottom: 0; padding-bottom: 0; } }

/* ── Bloc de code ── Un extrait à copier (une clé, une commande, l'usage
   d'un bloc dans la charte) : police à chasse fixe, fond doux, défile de
   côté plutôt que de casser la page. */
.m-code {
  font-family: var(--m-label-police, ui-monospace, monospace); font-size: 0.8125rem; line-height: 1.55;
  background: var(--m-surface-douce, #f3f3f3); border: 1px solid var(--m-filet, #e3e3e3);
  border-radius: var(--m-rayon-petit, 4px); padding: var(--m-esp-3, 12px) var(--m-esp-4, 16px);
  overflow-x: auto; white-space: pre; margin: var(--m-esp-3, 12px) 0 0; max-width: 100%;
}

/* ── Lien de chapitre ── Une carte entière cliquable qui mène à une page :
   son titre, une phrase. */
a.m-carte { display: block; color: inherit; text-decoration: none; transition: border-color 0.15s; }
a.m-carte:hover { border-color: var(--m-lien); }
a.m-carte:hover .m-intertitre { text-decoration: underline; }

/* ══ Repris des enquêtes ZB (10/11/2026) : lecture au doigt, nom au bout de
   la courbe, repères numérotés, n.p., échelle à deux sens, hachures, bande
   de tolérance, seuil d'un classement, répartitions comparées. Les PRINCIPES
   sont repris, pas les valeurs : couleurs et tailles restent celles de la
   charte (la palette des enquêtes ne tient pas en daltonisme). ══ */

/* L'échelle à deux sens et les hachures (second moyen de distinguer une part,
   sans la couleur). */
.m-div-pos { --c: var(--m-divergent-pos); }
.m-div-neg { --c: var(--m-divergent-neg); }
.m-motif { background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--marque-fond, #fff) 55%, transparent) 0 2px, transparent 2px 6px); }
.m-graph__legende .m-motif .m-graph__pastille, .m-graph__legende li.m-motif .m-graph__pastille { background-image: repeating-linear-gradient(45deg, color-mix(in srgb, var(--marque-fond, #fff) 55%, transparent) 0 2px, transparent 2px 5px); }

/* Une valeur absente (« n.p. » : non publiée), écrite sur l'axe. */
.m-graph__absent {
  position: absolute; left: calc((var(--x) + var(--l) / 2) * 1%); bottom: calc(var(--y) * 1%);
  transform: translate(-50%, -4px); font-size: 0.75rem; font-style: italic; color: var(--m-texte-2);
}

/* La bande de tolérance autour d'une courbe : la couleur de sa série, pâle. */
.m-graph__tolerance { fill: var(--c); fill-opacity: 0.14; stroke: none; }

/* Le nom de chaque courbe au bout de son trait, dans une marge à droite ; un
   halo du fond derrière le texte pour qu'il reste lisible sur la grille. */
.m-graph__corps--fin .m-graph__trace { margin-right: var(--m-graph-marge-fin, 10rem); }
.m-graph__corps--fin .m-graph__axe-x { margin-right: var(--m-graph-marge-fin, 10rem); }
.m-graph__etiquette {
  position: absolute; left: calc(100% + 10px); bottom: calc(var(--y) * 1%); transform: translateY(50%);
  font-size: 0.8125rem; font-weight: 600; line-height: 1.2; width: 9.25rem; color: var(--m-texte);
  text-shadow: 0 0 3px var(--marque-fond, #fff), 0 0 3px var(--marque-fond, #fff);
  display: inline-flex; align-items: center; gap: 6px;
}
.m-graph__etiquette::before { content: ""; width: 10px; height: 2px; background: var(--c); flex: none; }

/* Les repères numérotés : un rond chiffré en haut du trait, la liste dessous. */
.m-graph__num {
  display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  font-size: 0.6875rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--m-texte); color: var(--marque-fond, #fff); flex: none;
}
.m-graph__repere > .m-graph__num { position: absolute; top: -2px; left: 0; transform: translateX(-50%); }
.m-graph__num--alerte, .m-graph__repere--alerte > .m-graph__num { background: var(--etat-erreur-trait); color: #fff; }
.m-graph__reperes { list-style: none; padding: 0; margin: var(--m-esp-4) 0 0; display: grid; gap: 6px; max-width: var(--m-lecture); font-size: var(--m-t-petit); }
.m-graph__reperes li { display: flex; gap: 10px; align-items: baseline; }

/* La lecture au doigt et à la souris : le trait guide et la boîte des
   valeurs de toutes les séries. Le tracé laisse défiler la page à la
   verticale (le doigt qui glisse de côté lit le graphique). */
.m-graph__trace[data-lecture] { touch-action: pan-y; cursor: crosshair; }
.m-graph__guide:not([hidden]) {
  position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 1%); width: 0;
  border-left: 1px solid var(--m-gris-600); pointer-events: none; z-index: 2;
}
.m-graph__lecteur:not([hidden]) {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--m-surface); color: var(--m-texte); border: 1px solid var(--m-filet-fort); border-radius: var(--m-rayon-petit);
  padding: 8px 10px; font-size: 0.8125rem; line-height: 1.45; min-width: 8rem; max-width: min(18rem, calc(100vw - 16px));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}
.m-graph__lecteur p { margin: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.m-graph__lecteur b { font-variant-numeric: tabular-nums; }
.m-graph__lecteur p.m-graph__lecteur-titre { font-weight: 700; margin-bottom: 4px; }

/* Le seuil d'un classement : un trait vertical sur toutes les lignes, son
   libellé au-dessus. */
.m-classement__piste { position: relative; }
.m-classement__seuil { position: absolute; top: -4px; bottom: -4px; left: calc(var(--x) * 1%); border-left: 1px dashed var(--m-gris-600); }
.m-classement__seuil-titre {
  display: grid; grid-template-columns: minmax(7rem, 14rem) minmax(0, 1fr) 5.5rem; column-gap: var(--m-esp-3);
  margin: 0 0 4px; font-size: 0.75rem; color: var(--m-texte);
}
.m-classement__seuil-titre span { grid-column: 2; padding-left: calc(var(--x) * 1%); transform: translateX(-50%); white-space: nowrap; }

/* Les répartitions comparées : une barre de 100 % par ligne, la part
   écrite dans son segment quand il est assez large. */
.m-repartitions { display: grid; gap: 10px; }
.m-repartitions__ligne { display: grid; grid-template-columns: minmax(5rem, 10rem) minmax(0, 1fr); column-gap: var(--m-esp-3); align-items: center; font-size: var(--m-t-petit); }
.m-repartitions .m-repartition__part { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.m-repartition__valeur { font-size: 0.75rem; font-weight: 600; color: #fff; text-shadow: 0 0 2px rgba(0, 0, 0, 0.35); white-space: nowrap; }
.m-e-inconnu .m-repartition__valeur, .m-e-neutre .m-repartition__valeur { color: var(--m-texte); text-shadow: none; }

/* Les panneaux empilés : plusieurs graphiques l'un sous l'autre, sur la
   même échelle de temps (enquêtes ZB, Primopierre et Arkéa). */
.m-panneaux { display: grid; gap: var(--m-esp-5); }
.m-panneaux .m-intertitre { margin-bottom: var(--m-esp-2); }
@media (max-width: 640px) {
  .m-graph__corps--fin .m-graph__trace, .m-graph__corps--fin .m-graph__axe-x { margin-right: 5.5rem; }
  .m-graph__etiquette { width: 5.25rem; font-size: 0.75rem; }
}

/* ── Frise verticale à états ── Une suite datée de faits, chacun avec son
   état (pastille + mot), reliés par un filet (repris des enquêtes ZB). */
.m-frise { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--m-filet); max-width: var(--m-lecture); display: grid; gap: var(--m-esp-5); }
.m-frise > li { position: relative; }
.m-frise > li::before {
  content: ""; position: absolute; left: -29px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--c, var(--m-gris-500)); box-shadow: 0 0 0 3px var(--marque-fond, #fff);
}
.m-frise > li.m-constat--ok { --c: var(--etat-ok-trait); }
.m-frise > li.m-constat--attention { --c: var(--etat-alerte-trait); }
.m-frise > li.m-constat--alerte { --c: var(--etat-erreur-trait); }
.m-frise__date { display: block; font-size: var(--m-t-note); color: var(--m-texte-2); font-variant-numeric: tabular-nums; }
.m-frise__titre { font-weight: 700; margin: 2px 0 4px; }
.m-frise p { margin: 0; }

/* ── Document cité ── Un extrait de pièce (jugement, contrat, courrier) :
   fond de papier, filet, source dessous ; un passage surligné (`mark`) et un
   passage masqué (`m-caviarde`, dit comme tel au lecteur d'écran). */
.m-document {
  margin: 0; max-width: var(--m-lecture); background: var(--m-surface); border: var(--m-trait);
  border-radius: var(--m-rayon-petit); padding: var(--m-esp-4) var(--m-esp-5);
  font-family: var(--m-document-police, ui-serif, Georgia, serif); font-size: 0.9375rem; line-height: 1.7;
}
.m-document mark { background: color-mix(in srgb, var(--etat-alerte-trait) 22%, transparent); color: inherit; padding: 0 2px; }
.m-caviarde { background: var(--m-texte); color: transparent; border-radius: 2px; user-select: none; }
.m-document > figcaption { font-family: var(--font-body, inherit); font-size: var(--m-t-note); color: var(--m-texte-2); margin-top: var(--m-esp-3); }

/* ── Renvoi de source ── Un numéro en exposant dans le texte, qui ouvre la
   source dans une bulle (au doigt comme à la souris, par l'attribut popover
   du navigateur, sans script) ; la liste des sources en bas de page. */
.m-renvoi {
  display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 3px;
  margin: 0 1px; vertical-align: super; font-size: 0.625rem; font-weight: 700; line-height: 1;
  border: 1px solid var(--m-lien); border-radius: 999px; background: transparent; color: var(--m-lien); cursor: pointer;
}
.m-renvoi:hover { background: var(--m-lien); color: var(--marque-fond, #fff); }
.m-sources { font-size: var(--m-t-note); color: var(--m-texte-2); max-width: var(--m-lecture); padding-left: 1.5em; margin: 0; }
.m-sources li + li { margin-top: 4px; }

/* ── Fiche d'une personne ── Le portrait (ou ses initiales), le nom, ce
   qu'elle est dans l'affaire, une phrase. */
.m-personne { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); column-gap: var(--m-esp-4); align-items: start; }
.m-personne__portrait {
  width: 3.5rem; height: 3.5rem; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; background: var(--m-marque-100); color: var(--m-marque-800);
  font-weight: 700; font-size: 1.05rem;
}
.m-personne__nom { font-weight: 700; margin: 2px 0 0; }
.m-personne__role { font-size: var(--m-t-note); color: var(--m-texte-2); margin: 0 0 6px; }
.m-personne p:last-child { margin: 0; font-size: var(--m-t-petit); }

/* ── La lecture, une seule pour tous les graphiques (10/11/2026) ──
   Les marques qu'on lit une à une (`data-bulle`) s'éclairent au survol, au
   toucher et au clavier ; la boîte est celle des barres et des courbes. */
.m-graph [data-bulle] { cursor: pointer; transition: opacity 0.12s, box-shadow 0.12s; }
.m-graph [data-bulle]:focus { outline: none; }
.m-graph [data-bulle]:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.m-graph__point.m-graph--actif { box-shadow: 0 0 0 2px var(--marque-fond, #fff), 0 0 0 4px var(--c); transform: scale(1.25); }
.m-repartition__part.m-graph--actif, .m-graph__barre.m-graph--actif { filter: brightness(0.88); }
.m-halteres__ligne.m-graph--actif, .m-classement li.m-graph--actif { background: var(--m-gris-100); }
/* Sous le doigt, une marque fine se touche quand même : la zone de contact
   déborde de 8 px autour du point. */
.m-graph__point::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; }

/* Le premier et le dernier libellé de l'axe se calent vers l'intérieur au
   lieu de déborder (« 800M€ » coupé au bord, relevé à 390 px). */
.m-graph__axe-x span.m-graph__x-fin { transform: translateX(-100%); }
.m-graph__axe-x span.m-graph__x-debut { transform: none; }

/* La répartition sur téléphone : une ligne par part, sa barre de couleur à
   la longueur de la part, puis son libellé collé à droite. */
@media (max-width: 640px) {
  .m-repartition__parts { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
  .m-repartition__parts li {
    border-top: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 6rem) minmax(0, 1fr);
    column-gap: 10px; align-items: baseline;
  }
  .m-repartition__parts li::before {
    content: ""; grid-column: 1; grid-row: 1 / span 3; align-self: start; margin-top: 6px; height: 12px;
    border-radius: 2px; width: max(4px, calc(var(--l) * 1%)); background: var(--c);
  }
  .m-repartition__parts li > * { grid-column: 2; }
  .m-repartition__pct { font-size: 1.05rem; }
}
