/* ============================================================
   Shared chapter page styles — SQUALP / Isoar V2
   Used by: architecture-fonctionnelle.html, organisation.html, …
   ============================================================ */

/* @view-transition RETIRÉ (2026-07-03) : les ViewTransitions inter-documents restaient
   parfois ACTIVES indéfiniment (rendu gelé → planche invisible, capturé en prod sur
   administration-des-ventes). Le prerender (speculationrules) garde les navigations
   instantanées ; ne PAS réactiver sans re-tester le gel. */

/* Navigation « livre » fluide : on donne une IDENTITÉ stable aux éléments partagés
   (menu du haut, sommaire de gauche, fil d'Ariane, pied de page). Le navigateur les
   reconnaît comme « le même élément » d'une page à l'autre → ils restent EN PLACE
   (pas de clignotement) pendant que seul le contenu central fait la transition.
   (Chrome 126+ / Safari 18.2+ ; ailleurs : navigation classique, sans régression.) */
.menu         { view-transition-name: vt-menu; }
.menu__crumbs { view-transition-name: vt-crumbs; }
.book-nav     { view-transition-name: vt-booknav; }
.home-footer  { view-transition-name: vt-footer; }

/* Anti-« resize » au chargement : le contenu (schéma ou texte) est masqué le temps que fit.js
   le dimensionne (au vrai viewport, après activation d'un prérendu), puis révélé en fondu → il
   apparaît directement à la bonne taille, sans saut. Filet de sécurité : révélé après 2s même
   si le JS échoue (animation CSS). */
.chapter-content--fit .chapter-fit,
.chapter-content--text .chapter-fit {
  opacity: 0;
  animation: chapterReveal 0.01s linear 2s forwards;
}
.chapter-content--fit.is-fitted .chapter-fit,
.chapter-content--text.is-fitted .chapter-fit {
  opacity: 1;
  animation: none;
  transition: opacity 0.18s ease-out;
}
@keyframes chapterReveal { to { opacity: 1; } }

/* Sigle → lexique : lien DISCRET (souligné pointillé rouge) posé sur la première
   occurrence d'un sigle dans la prose d'une page (MRP, MCD, PIC, PERT, SPC, ERP…). */
.lex-link { color: inherit; text-decoration: underline dotted var(--mondrian-blue); text-decoration-thickness: 2px; text-underline-offset: 3px; }   /* bleu — le rouge évoquait une faute (client 2026-07-12) */
.lex-link:hover { color: var(--mondrian-blue); }

/* Visually-hidden but kept for screen readers / SEO (e.g. an h1 whose visible
   title would duplicate a diagram's own heading). */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

:root {
  --mondrian-red: #FE0908;
  --mondrian-blue: #3374CE;
  --mondrian-yellow: #F3C14F;
  --mondrian-black: #1A1A1A;
  --mondrian-white: #F7F4EF;
  --mondrian-cream: #FAF8F3;
  --page-bg: #537780;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--page-bg);
  min-height: 100vh;
  font-family: Verdana, Geneva, sans-serif;
  color: var(--mondrian-black);
  overflow-x: hidden;
}

/* === Top navigation bar (shared) === */
.page-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 36px;
  background: var(--mondrian-black);
  border-bottom: 4px solid var(--mondrian-red);
  overflow: hidden;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-bottom-width 0.3s ease;
  max-height: 220px;
}
.page-bar.is-collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-width: 0;
}
.page-bar__toggle {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.28);
  color: white;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.page-bar__toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-1px);
}
.page-bar-show {
  position: fixed;
  top: 0;
  right: 24px;
  z-index: 100;
  background: var(--mondrian-yellow);
  color: var(--mondrian-black);
  border: 2px solid var(--mondrian-black);
  border-top: none;
  padding: 7px 18px;
  cursor: pointer;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.2s ease;
}
.page-bar-show[hidden] {
  display: none;
}
.page-bar-show:hover {
  background: var(--mondrian-red);
  color: white;
  transform: translateY(2px);
}
.page-bar__home {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  background: var(--mondrian-white);
  color: var(--mondrian-black);
  padding: 6px 18px;
  border: 2px solid var(--mondrian-black);
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.page-bar__home:hover { transform: translateY(-1px); background: var(--mondrian-yellow); }
.page-bar__crumbs {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-bar__crumbs a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: color 0.15s ease;
}
.page-bar__crumbs a:hover { color: var(--mondrian-yellow); }
.page-bar__crumbs .sep { margin: 0 10px; color: rgba(255,255,255,0.3); }
.page-bar__crumbs [aria-current] { color: var(--mondrian-yellow); font-weight: 700; }
.page-bar__back {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mondrian-black);
  background: var(--mondrian-yellow);
  padding: 9px 18px;
  border: 2px solid var(--mondrian-black);
  text-decoration: none;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.page-bar__back:hover {
  background: var(--mondrian-red);
  color: white;
  transform: translateX(-2px);
}

/* === Chapter content card === */
.chapter-content {
  position: relative;        /* anchor for the Isoar signature in the bottom-right corner */
  max-width: 1280px;
  margin: 36px auto 60px;
  background: var(--mondrian-cream);
  border: 4px solid var(--mondrian-black);
  box-shadow: 12px 12px 0 var(--mondrian-black);   /* ombre dure De Stijl (audit A9) — remplace l'ombre douce web */
  /* Fill the screen so the injected footer always sits below the fold. */
  min-height: calc(100vh - 96px);
}
/* When the top menu is hidden the content shifts up — keep the footer below the fold. */
body.menu-collapsed .chapter-content {
  min-height: calc(100vh - 30px);
}
/* iOS : 100vh inclut la barre d'URL → la carte dépassait l'écran et son contenu
   centré « tombait » vers le bas. 100dvh = hauteur réellement visible. */
@supports (height: 100dvh) {
  .chapter-content { min-height: calc(100dvh - 96px); }
  body.menu-collapsed .chapter-content { min-height: calc(100dvh - 30px); }
}
/* CONTENANT COLLÉ AU HEADER (comme la photo d'accueil) — la bordure haute de la carte
   RECOUVRE la bordure basse du header (trait partagé). On ne touche QUE la marge du haut :
   la position horizontale (centrage/marges auto) reste inchangée → le contenant ne dérive
   jamais vers le bord de l'écran.
   ⚠️ SEULES les pages TEXTE GABARIT (type « Enterprise Resources Planning » : principes-
   fondateurs, architecture-fonctionnelle-2, organisation-2…) sont collées. PAS les pages
   GRAPHIQUE (--fit), PAS PIC/CBN (--text[data-no-fit]), PAS Références/Histoire (.refs-page).
   Client 2026-07-30. body_padding_top = menu-height + 4 ; margin-top −4 ⇒ haut de carte =
   menu-height, donc les 2 bordures de 4px coïncident quelle que soit --menu-height.
   ⚠️ 2026-07-30 (retour client) : le collage ne s'applique QU'À ≥1800px, quand la carte
   texte est clampée à 2 tuiles (alignée sur 2 entrées du menu). En dessous de 1800px
   (carte alignée sur 4 entrées), PAS de collage. */
@media (min-width: 1800px) {
  body.has-book-nav:not(.menu-collapsed) .chapter-content--text:not([data-no-fit]):not(.refs-page) { margin-top: -4px; }
}

/* Mobile graphic pages that keep the desktop layout (data-fit-mobile): the chart
   is zoom-scaled by fit.js. Le schéma est ALIGNÉ EN HAUT de la carte (sous la bande
   réservée au bouton ▶ Sommaire) — centré, il « flottait » trop bas (retour client
   mobile 2026-07-07) ; le vide éventuel reste SOUS les boutons prev/next. */
@media (max-width: 1099px) {
  .chapter-content--fit[data-fit-mobile] {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
  }
  /* Le bouton fixe « ▶ Sommaire » n'est PAS en haut de la carte : il est ancré sur le
     bord gauche, à ~200px du haut du viewport. Réserver 50px de bande en haut ne le
     protégeait donc de rien — ça ne faisait que creuser un vide au-dessus du titre
     (retour client mobile 2026-07-14). Ce qui le protège vraiment, c'est le padding
     GAUCHE de la règle ci-dessous. On garde juste une respiration. */
  body.has-book-nav .chapter-content { padding-top: 18px; }
  /* …et les TITRES longs des pages texte ne passent jamais SOUS ce bouton (zone
     gauche fixe ~46px) : le « G » de « Gestion de la production » était masqué. */
  body.has-book-nav .chapter-content--text .chapter-content__header { padding-left: 52px; padding-right: 52px; }
}

/* Passthrough wrapper — invisible by default, becomes the scalable card on
   wide screens (see "Fit-to-viewport" block below). */
.chapter-fit { display: block; }
.chapter-content__header {
  display: flex;
  align-items: center;
  justify-content: center;   /* RÈGLE : tous les titres de chapitre sont CENTRÉS */
  text-align: center;
  gap: 22px;
  padding: 28px 56px 24px;
  border-bottom: 4px solid var(--mondrian-black);
  background: var(--mondrian-white);
}
.chapter-badge {
  background: var(--mondrian-red);
  color: white;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 9px 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chapter-content__header h1 {
  font-family: Verdana, Geneva, sans-serif;
  font-size: clamp(1.6rem, 2.6vw, 2.5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--mondrian-black);
  flex: 1;
}
.chapter-content__body {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

/* Text column */
.chapter-text {
  padding: 38px 42px 38px 56px;
  border-right: 4px solid var(--mondrian-black);
}
.chapter-text h2 {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 14px;
  color: var(--mondrian-black);
}
.chapter-lead {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--mondrian-black);
  font-weight: 500;
  margin-bottom: 18px;
  /* trait rouge + retrait supprimés sur TOUTES les pages texte (client 2026-07-12) */
}
.chapter-text p {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(26,26,26,0.88);
  margin-bottom: 14px;
}
.chapter-bullets { margin: 12px 0 18px 0; padding-left: 0; list-style: none; }
.chapter-bullets li {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(26,26,26,0.85);
  padding-left: 26px;
  margin-bottom: 10px;
  position: relative;
}
.chapter-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  background: var(--mondrian-red);
  border: 2px solid var(--mondrian-black);
}
.chapter-tag {
  margin-top: 22px;
  padding: 14px 18px;
  background: var(--mondrian-blue);
  color: white;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  font-style: italic;
  border: 3px solid var(--mondrian-black);
}

/* === Modules grid (Architecture fonctionnelle) — flow with connectors === */
.modules-grid {
  padding: 36px 40px 40px;
  background: var(--mondrian-cream);
}

/* Flow grid: 5 columns (3 cells + 2 arrow gaps).
   Default: 4 module rows (Architecture fonctionnelle).
   .is-three-rows: 3 module rows (Architecture technique). */
.mg-flow {
  display: grid;
  grid-template-columns: 1fr 26px 1fr 26px 1fr;
  grid-template-rows:
    auto 22px
    auto 22px
    auto 22px
    auto 22px
    auto 26px
    auto;
  gap: 0;
}
.mg-flow.is-three-rows {
  grid-template-rows:
    auto 22px
    auto 22px
    auto 22px
    auto 26px
    auto;
}
.mg-title {
  grid-column: 1 / 6;
  grid-row: 1;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
  background: var(--mondrian-white);
  padding: 14px 20px;
  border: 4px solid var(--mondrian-black);
  box-shadow: 6px 6px 0 var(--mondrian-black);   /* gabarit boîte-titre (audit B2) */
}
.mg-squalp {
  grid-column: 1 / 6;
  grid-row: 11;
  text-align: center;
  background: var(--mondrian-white);
  border: 3px solid var(--mondrian-black);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.mg-squalp-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 80%;
}
.mg-squalp-tagline {
  font-family: Verdana, Geneva, sans-serif;
  font-style: italic;
  font-size: 1.38rem;   /* ×1.5 — bigger tagline under the SQUALP box */
  color: rgba(26,26,26,0.75);
}

/* === RULE — title "fan" connectors (chart pages) ===
   When a TITLE box fans out to children with LEFT/RIGHT arrows, those side
   arrows MUST leave from the MIDDLE of the box's left/right sides — never from
   its bottom corners. The fan SVG overlaps the box's lower half so that y=0 in
   its viewBox is the box's vertical centre; side paths therefore start at
   "M <box-edge-x> 0 L ...". The centre arrow starts at the box bottom
   (y = --title-h / 2). Set --title-h to the title box height on the fan.
   Canonical reference: innovation-rupture.html (.ir-arrows-top). */
.mg-title { position: relative; z-index: 2; }
.mg-fan--top {
  position: relative;
  z-index: 1;
  margin-top: calc(var(--title-h, 86px) / -2);
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  border: 3px solid var(--mondrian-black);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 3px 3px 0 var(--mondrian-black);
  min-height: 84px;
  text-align: center;
}
.module-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--mondrian-black);
}
.module-card.mod-blue { background: var(--mondrian-blue); color: white; }
.module-card.mod-red { background: var(--mondrian-red); color: white; }
.module-card.mod-yellow { background: var(--mondrian-yellow); color: var(--mondrian-black); }
.module-card.mod-gray { background: var(--mondrian-grey, #5B5B54); color: white; }
.mod-name {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}
.mod-acronym {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-top: 8px;
  opacity: 0.9;
}

/* Multi-line card variant (Architecture technique cards with title + list) */
.module-card.mod-multi {
  align-items: stretch;
  justify-content: flex-start;
  padding: 14px 14px 16px;
  text-align: left;
  min-height: 116px;
}
.mod-multi .mod-name {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.05;
  padding-bottom: 7px;
  border-bottom: 2px solid rgba(255,255,255,0.45);
  margin-bottom: 8px;
}
.module-card.mod-yellow.mod-multi .mod-name { border-bottom-color: rgba(0,0,0,0.35); }
.mod-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
}
.mod-list li {
  padding: 1px 0;
  letter-spacing: 0.005em;
}
.mod-tagline {
  font-family: Verdana, Geneva, sans-serif;
  font-style: italic;
  font-size: 0.88rem;
  line-height: 1.3;
  font-weight: 500;
}

/* Text-only footer (Architecture technique) */
.mg-text-footer {
  grid-column: 1 / 6;
  text-align: center;
  background: var(--mondrian-white);
  border: 3px solid var(--mondrian-black);
  padding: 18px 24px;
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--mondrian-blue);
  letter-spacing: 0.005em;
}

/* Connector arrows (red Mondrian) */
.arr {
  display: block;
  position: relative;
  pointer-events: none;
}
.arr-right {
  width: 100%;
  height: 14px;
  align-self: center;
}
.arr-right::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 7px;
  height: 2px;
  background: var(--mondrian-red);
  transform: translateY(-50%);
}
.arr-right::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--mondrian-red);
  transform: translateY(-50%);
}
.arr-down {
  height: 100%;
  width: 14px;
  justify-self: center;
}
.arr-down::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 7px;
  width: 2px;
  background: var(--mondrian-red);
  transform: translateX(-50%);
}
.arr-down::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--mondrian-red);
  transform: translateX(-50%);
}

/* === MCD vertical diagram (Organisation) === */
.mcd-vertical {
  padding: 36px 38px;
  background: var(--mondrian-cream);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mcd-vertical-title {
  background: var(--mondrian-white);
  border: 3px solid var(--mondrian-black);
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
  padding: 14px 16px;
  line-height: 1.15;
}
.mcd-section { display: flex; flex-direction: column; gap: 6px; }
.mcd-section-label {
  background: var(--mondrian-white);
  border: 2px solid var(--mondrian-black);
  font-family: Verdana, Geneva, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  padding: 7px 12px;
  font-style: italic;
}
.mcd-section-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.mcd-block {
  position: relative;
  padding: 12px 6px;
  text-align: center;
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.2;
  color: white;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--mondrian-black);
  box-shadow: 3px 3px 0 var(--mondrian-black);
}
.mcd-block.mcd-red { background: var(--mondrian-red); }
.mcd-block.mcd-blue { background: var(--mondrian-blue); }
/* small red arrowhead linking the rectangles left → right, CENTRED in the 16px gap.
   CSS triangle (not a ► glyph) so it's perfectly symmetric — no font side-bearing. */
.mcd-block:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  /* centré dans la gouttière de 16px : +8 (demi-gouttière) +2 (bordure 2px de la boîte) = 10px,
     la pointe étant ainsi pile au milieu entre les 2 rectangles. */
  margin-left: 10px;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--mondrian-red);
  z-index: 2;
}
/* small red down-arrow: title → sections, and last section → SQUALP */
.mcd-down {
  align-self: center;
  width: 16px;
  height: 12px;              /* réduit (22→12) → libère de la hauteur → fit.js agrandit tout le schéma */
  position: relative;
  margin: -3px 0;
}
.mcd-down::before {          /* shaft */
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 7px;
  width: 3px;
  background: var(--mondrian-red);
  transform: translateX(-50%);
}
.mcd-down::after {           /* head */
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--mondrian-red);
  transform: translateX(-50%);
}
.mcd-vertical-footer {
  margin-top: 8px;
  padding: 14px 18px;
  background: var(--mondrian-blue);
  color: white;
  font-family: Verdana, Geneva, sans-serif;
  font-style: italic;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  border: 3px solid var(--mondrian-black);
}

/* === Chapter pagination (prev / next) === */
.chapter-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 4px solid var(--mondrian-black);
  background: var(--mondrian-white);
}
.chapter-nav__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 22px;
  text-decoration: none;
  color: var(--mondrian-black);
  transition: background 0.2s ease, transform 0.2s ease;
  position: relative;
}
.chapter-nav__prev { border-right: 4px solid var(--mondrian-black); text-align: left; }
.chapter-nav__next { text-align: right; align-items: flex-end; }
.chapter-nav__item:hover {
  background: var(--mondrian-cream);
}
.chapter-nav__prev:hover { transform: translateX(-3px); }
.chapter-nav__next:hover { transform: translateX(3px); }
.chapter-nav__label {
  font-size: 0;            /* hide the text label — keep only the arrow glyph */
  line-height: 1;
}
.chapter-nav__label::before {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mondrian-red);
  line-height: 1;
  display: block;
}
.chapter-nav__prev .chapter-nav__label::before { content: "\2190"; }  /* ← */
.chapter-nav__next .chapter-nav__label::before { content: "\2192"; }  /* → */
.chapter-nav__title { display: none; }   /* arrows only — no page-name text */
.chapter-nav__hint { display: none; }   /* arrows only — hide "à venir" hint */
/* Desktop: detach prev/next from the bottom and float them on the sides */
@media (min-width: 1100px) {
  .chapter-nav {
    /* unbox the container so the children become free-floating */
    display: contents;
  }
  /* Keep the card narrow enough that the floating side-nav buttons always sit
     in the side gutters and never overlap the card's content. */
  .chapter-content {
    max-width: min(1280px, calc(100vw - 330px));
  }
  .chapter-nav__item {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    background: var(--mondrian-white);
    border: 3px solid var(--mondrian-black);
    box-shadow: 3px 3px 0 var(--mondrian-black);
    padding: 7px 9px;
    width: auto;
    gap: 0;
    align-items: center;
    justify-content: center;
  }
  .chapter-nav__prev { left: 17px; }
  .chapter-nav__next { right: 17px; }
  .chapter-nav__prev:hover {
    transform: translateY(-50%) translateX(-5px);
    background: var(--mondrian-yellow);
  }
  .chapter-nav__next:hover {
    transform: translateY(-50%) translateX(5px);
    background: var(--mondrian-yellow);
  }
  .chapter-nav__label::before { font-size: 1.35rem; }
}

.chapter-nav__item.is-coming {
  pointer-events: none;
  opacity: 0.55;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(0,0,0,0.025) 8px,
    rgba(0,0,0,0.025) 16px
  );
}

/* === Mobile === */
@media (max-width: 900px) {
  .page-bar { padding: 12px 18px; gap: 10px; }
  .page-bar__home { font-size: 0.85rem; padding: 5px 12px; letter-spacing: 0.14em; }
  .page-bar__crumbs { font-size: 0.6rem; letter-spacing: 0.1em; }
  .page-bar__crumbs .sep { margin: 0 6px; }
  .page-bar__back { font-size: 0.62rem; padding: 7px 12px; }
  .page-bar__toggle { width: 32px; height: 32px; font-size: 0.78rem; }
  .page-bar-show { font-size: 0.66rem; padding: 6px 14px; right: 12px; }

  .chapter-content { margin: 18px auto 30px; }
  .chapter-content__header { padding: 22px 22px 18px; gap: 14px; flex-wrap: wrap; }
  .chapter-content__header h1 { font-size: 1.2rem; }
  .chapter-badge { font-size: 0.6rem; padding: 6px 12px; }
  .chapter-content__body { grid-template-columns: 1fr; }
  .chapter-text {
    padding: 24px 22px;
    border-right: none;
    border-bottom: 4px solid var(--mondrian-black);
  }
  .chapter-lead { font-size: 1rem; }
  .chapter-text p { font-size: 0.9rem; }
  .chapter-text h2 { font-size: 1.1rem; }
  .chapter-tag { font-size: 0.88rem; }

  .modules-grid { padding: 22px 18px; }
  .mg-flow {
    grid-template-columns: 1fr 18px 1fr 18px 1fr;
    grid-template-rows:
      auto 16px
      auto 16px
      auto 16px
      auto 16px
      auto 20px
      auto;
  }
  .mg-title { font-size: 1.05rem; padding: 10px 14px; }
  .mg-squalp { padding: 10px 14px; }
  .mg-squalp-logo { height: 30px; }
  .mg-squalp-tagline { font-size: 0.78rem; }
  .module-card { padding: 10px 4px; min-height: 64px; }
  .mod-name { font-size: 0.78rem; }
  .mod-acronym { font-size: 0.56rem; margin-top: 5px; letter-spacing: 0.14em; }
  .module-card.mod-multi { padding: 10px 8px; min-height: 90px; }
  .mod-multi .mod-name { font-size: 0.78rem; padding-bottom: 5px; margin-bottom: 5px; }
  .mod-list { font-size: 0.66rem; line-height: 1.3; }
  .mod-tagline { font-size: 0.7rem; }
  .mg-text-footer { padding: 12px 14px; font-size: 0.84rem; }
  .arr-right, .arr-down { height: 100%; width: 100%; }
  .arr-right::after { border-top-width: 4px; border-bottom-width: 4px; border-left-width: 6px; }
  .arr-down::after { border-left-width: 4px; border-right-width: 4px; border-top-width: 6px; }

  .mcd-vertical { padding: 22px 16px; }
  .mcd-section-blocks { gap: 16px; }   /* keep room for the ► arrowheads */
  .mcd-block { font-size: 0.66rem; min-height: 50px; padding: 8px 4px; }
  .mcd-section-label { font-size: 0.78rem; }
  .mcd-vertical-footer { font-size: 0.84rem; }

  /* Ergonomic prev/next: two tappable buttons side by side (De Stijl style). */
  .chapter-nav {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-top: none;
    background: transparent;
    padding: 4px 12px 16px;
  }
  .chapter-nav__item {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 15px 10px;
    border: 3px solid var(--mondrian-black);
    background: var(--mondrian-white);
    box-shadow: 3px 3px 0 var(--mondrian-black);
    text-align: center;
  }
  .chapter-nav__prev { border-right: 3px solid var(--mondrian-black); border-bottom: none; }
  .chapter-nav__next { align-items: center; text-align: center; }
  .chapter-nav__item:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--mondrian-black); }
  .chapter-nav__label { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.02em; color: var(--mondrian-black); }
  .chapter-nav__label::before { display: none; }   /* the label text already carries the arrow */
  .chapter-nav__title { display: none; }
}

/* ============================================================
   Fit-to-viewport (Chapitre 01 pages)
   On wide screens the prev/next nav is already fixed to the
   sides, so the card holds only the header + diagram. We move
   the card's visual chrome onto the inner .chapter-fit wrapper
   and let fit.js scale that wrapper down just enough to keep
   the whole page on one screen — no vertical scroll.
   ============================================================ */
@media (min-width: 1100px) {
  /* HARMONISÉ (2026-06-23) : la carte blanche (zone crème) des pages GRAPHIQUE a
     EXACTEMENT le même gabarit que les pages TEXTE — même largeur, même hauteur
     d'écran. Le chrome (fond crème + bordure + ombre) reste donc sur la carte
     `.chapter-content--fit` (comme `--text`), et fit.js met le graphique à
     l'échelle puis le CENTRE (H & V) à l'intérieur de cette carte fixe.
     But : un rendu identique d'une page à l'autre (cf. demande client). */
  .chapter-content--fit {
    width: min(1500px, calc(100vw - 260px - 40px));
    max-width: none;
    margin: 16px auto 18px;
    background: var(--mondrian-cream);
    border: 4px solid var(--mondrian-black);
    box-shadow: 12px 12px 0 var(--mondrian-black);   /* ombre dure De Stijl (audit A9) — remplace l'ombre douce web */
    /* Centre the scaled chart BOTH axes inside the fixed card (fit.js sets the height). */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  /* Same as --text : keep the constant width (recentre, never resize) when the
     left sommaire opens — the width already reserves the 260px panel. */
  body.has-book-nav:not(.book-nav-collapsed) .chapter-content--fit { max-width: none !important; }
  /* The inner wrapper is now a TRANSPARENT passthrough that fit.js scales — the
     visible frame lives on the outer card above (no more card-in-card). */
  .chapter-content--fit .chapter-fit {
    background: transparent;
    border: none;
    box-shadow: none;
    transform-origin: center center;   /* scale about the centre → stays centred H & V */
  }
  /* Tighter header on fit pages so less down-scaling is needed. */
  .chapter-content--fit .chapter-content__header {
    padding: 18px 56px 16px;
  }
}

/* ============================================================
   TEXT PAGES (--text) — full-bleed card, NO fit-scaling.
   Client (80 yo): text must be LARGE and the card must FILL the
   width (no grey side gaps). fit.js ignores these (it only targets
   .chapter-content--fit), so the card keeps its natural width and
   the page simply scrolls if the text runs long.
   ============================================================ */
@media (min-width: 1100px) {
  /* Constant-width reading card, only RE-CENTRED (never resized) when the left
     sommaire panel opens/closes. The width already reserves the 260px panel, so
     it is identical whether the panel is open or closed; auto margins centre it
     in whatever horizontal space is left — the full page when the panel is
     closed, the remaining space (right of the panel) when it is open. */
  .chapter-content--text {
    width: min(1500px, calc(100vw - 260px - 40px));
    max-width: none;
    margin: 16px auto 18px;
    min-height: calc(100vh - 96px);   /* remplit l'écran → le footer reste SOUS la ligne de flottaison. fit.js mesure .chapter-fit (indépendant du min-height) → le calage police n'est pas affecté. */
  }
  /* Neutralise the generic .chapter-content shrink (menu.css) so the text card
     keeps its constant width when the sommaire is open — we recentre, not resize. */
  body.has-book-nav:not(.book-nav-collapsed) .chapter-content--text { max-width: none !important; }
  /* RULE (template for all --text pages): titre + sous-titre réduits de 40% (demande 29 juin) —
     hauteur de bande et taille de police ×0.6 ; laisse plus de place au corps de texte (fit.js). */
  .chapter-content--text .chapter-content__header { padding: 6px 48px; min-height: 58px; box-sizing: border-box; }
  /* smaller chapter title on text pages (leaves more room for the big body text) */
  .chapter-content--text .chapter-content__header h1 { font-size: clamp(0.9rem, 1.56vw, 1.44rem) !important; }
  /* keep a sensible inner gutter (the outer margin already adds breathing room) */
  .chapter-content--text .chapter-text { padding-left: clamp(24px, 3vw, 48px) !important; padding-right: clamp(24px, 3vw, 48px) !important; }
  /* COLONNE DE LECTURE CENTRÉE façon PIC (client 2026-07-15) : le corps de texte est
     une colonne à largeur limitée, centrée, avec des marges gauche/droite — PAS un
     centrage vertical. La carte peut rester large (bande titre + bandeau noir pleine
     largeur) mais le texte lui-même reste lisible et centré. S'élargit un peu quand le
     rail est replié, comme .pic. */
  .chapter-content--text .chapter-text { max-width: 1000px !important; margin-left: auto !important; margin-right: auto !important; }
  body.book-nav-collapsed .chapter-content--text .chapter-text { max-width: 1240px !important; }

  /* Body text size is driven by fit.js via --tfs (px); children use em so the
     whole block scales together to fill exactly one screen. !important beats
     the per-page rem rules. */
  .chapter-content--text .chapter-text { font-size: var(--tfs, 1.6rem) !important; }
  .chapter-content--text .chapter-text p { font-size: 1em !important; line-height: 1.38 !important; margin-bottom: 0.48em !important; }
  .chapter-content--text .chapter-lead { font-size: 1.16em !important; line-height: 1.34 !important; margin-bottom: 0.6em !important; }
  .chapter-content--text .chapter-bullets { margin: 0.45em 0 0.6em 0 !important; }
  .chapter-content--text .chapter-bullets li { font-size: 0.95em !important; line-height: 1.36 !important; margin-bottom: 0.35em !important; }
  .chapter-content--text .chapter-text p:last-child { margin-bottom: 0 !important; }
}

/* === Intro tagline band — SHARED MODEL for ALL text pages (chapter-content--text).
   Forced onto ONE line and ~1.5× larger. Ancestor-scoped (specificity 0,2,0) so it
   overrides each page's inline `.chapter-intro-strip` (0,1,0) without !important.
   Edit HERE to restyle every text page's subtitle band at once. === */
@font-face {
  font-family: 'mathilde';
  src: url('fonts/mathilde.woff') format('woff'),
       url('fonts/mathilde.ttf') format('truetype');
  /* block : on n'affiche jamais une police de repli (qui se redimensionnerait ensuite) —
     le texte apparaît directement en Mathilde à sa taille finale (le woff est préchargé). */
  font-weight: 400; font-style: normal; font-display: block;
}
.chapter-content--text .chapter-intro-strip {
  /* Sous-titre : police manuscrite « Mathilde » (comme sur le site historique ISOAR) ;
     bandeau noir réduit (52 → 40px). La cursive « lit » plus petit → taille augmentée. */
  font-family: 'mathilde', 'Segoe Script', 'Brush Script MT', cursive;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1.95rem, 3vw, 2.55rem);   /* ~1,3× plus grand */
  line-height: 0.66;                         /* serré → bandeau fin malgré la grande police cursive */
  white-space: normal;                       /* passe sur 2 lignes si le fond blanc est étroit (sommaire ouvert) plutôt que de déborder */
  padding: 2px 28px;
  min-height: 28px;                          /* bandeau réduit d'environ 15 % sur une ligne */
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.chapter-content--text .chapter-intro-strip::before,
.chapter-content--text .chapter-intro-strip::after {
  content: none;   /* tirets rouges SUPPRIMÉS (demande client 2026-07-07) — override des content:"—" inline des pages */
}
/* Sigles en capitales (MCD…) illisibles en cursive Mathilde → Verdana, taille compensée.
   SEULE exception de police dans le bandeau (demande client 2026-07-07). */
.chapter-content--text .chapter-intro-strip .strip-acronym {
  font-family: Verdana, Geneva, sans-serif;
  font-weight: 700;
  font-size: 0.52em;
  letter-spacing: 0.04em;
  /* 2026-08-04 (retour client sur organisation-2 : « le MCD a l'air plus haut que le reste »).
     Mesuré : les deux polices partagent la MÊME ligne de base — mais les capitales Verdana
     montent 15,7px au-dessus quand le bas-de-casse cursif ne monte qu'à 13,1px : le sigle
     paraît donc plus haut. Correctif OPTIQUE : on le descend de ~0,06em pour que son centre
     visuel coïncide avec celui de la cursive. NE PAS repasser vertical-align en positif.
     Espaces : mesurés à ~23px de part et d'autre (mot cursif voisin = 12,6px) → resserrés. */
  vertical-align: -0.06em;
  margin: 0 0.08em;   /* l'espace de la cursive Mathilde est quasi nul → on le recrée (resserré) */
}
/* Pages « article » à défilement (PIC, CBN, Gestion des stocks — data-no-fit) : elles
   n'avaient jamais reçu le BANDEAU NOIR du livre (chaque page texte le déclare dans son
   <style> ; celles-ci ne l'ont pas copié) → cursive noire sur crème, « ne se voit pas bien »
   (retour client 2026-08-05). On leur applique ici le bandeau standard, une fois pour toutes.
   Spécificité 0,2,1 → gagne sur les règles 0,1,0 des pages. */
.chapter-content--text[data-no-fit] .chapter-intro-strip {
  background: var(--mondrian-black, #1A1A1A);
  color: #fff;
  border-bottom: 4px solid var(--mondrian-black, #1A1A1A);
  padding: 16px 28px;
  line-height: 0.9;
  min-height: 0;
}

@media (max-width: 720px) {
  .chapter-content--text .chapter-intro-strip {
    /* cursive Mathilde : elle « lit » moitié plus petit qu'une police droite →
       taille doublée sur mobile (retour client 2026-07-07, bandeau illisible).
       display:block : en flex, le texte autour d'un sigle (.strip-acronym) était
       découpé en 3 blocs superposés (bug MCD capturé le 2026-07-07). */
    display: block;
    text-align: center;
    line-height: 1.05;
    font-size: clamp(1.9rem, 7vw, 2.4rem);
    white-space: normal;        /* allow wrapping on phones */
    padding: 10px 16px;
  }
}

/* === Isoar signature (chapter pages, bottom-right of the WHITE ZONE) — added by menu.js ===
   Official handwritten "Isoar©" logo (transparent PNG, isoar-signature.png).
   Anchored bottom-right of `.chapter-content` (= the cream card on BOTH text and
   graphic pages now that the white zone is harmonised). Not scaled with the chart,
   so it reads the same size on every page. */
.isoar-sig {
  position: absolute;        /* anchored to the card bottom-right; scrolls WITH the page */
  right: 20px;
  bottom: 12px;
  z-index: 6;
  line-height: 0;
  pointer-events: none;
  user-select: none;
  view-transition-name: vt-sig;   /* statique dans le HTML → la transition la garde en place (plus de « rechargement ») */
}
.isoar-sig__img {
  display: block;
  height: 30px;              /* corner-signature size (fit.js réserve BOTTOM_GAP dessous → ne touche plus le texte) */
  width: auto;
  opacity: 0.68;             /* subtle, like an ink stamp on the cream */
}

@media (max-width: 760px) {
  .isoar-sig { right: 12px; bottom: 10px; }
  .isoar-sig__img { height: 28px; }
}
/* ≤1099px : les flèches prev/next sont DANS la carte → la signature passe EN FLUX,
   calée à droite AU-DESSUS du bouton « Suivant » (demande client 2026-07-07) ; elle
   ne chevauche jamais les boutons. (Sans effet desktop : la signature y reste ancrée
   en absolu au coin de la carte, quel que soit son emplacement dans le HTML.) */
@media (max-width: 1099px) {
  .isoar-sig {
    position: static;
    display: flex;
    justify-content: flex-end;
    padding: 4px 16px 2px 0;
  }
}


/* === Feuilletage entre pages (Lot 70) — SANS @view-transition.
   2e tentative de View Transitions inter-documents ABANDONNÉE le 2026-07-12 :
   gel REPRODUIT en local (transition active indéfiniment, rendu figé) malgré un
   garde-fou skipTransition — bug Chrome avec le prérendu. NE PAS RÉACTIVER.
   À la place : simple animation d'ENTRÉE directionnelle de la carte (aucune
   capture inter-pages → aucun gel possible). Le sens vient de <html data-nav-dir>
   (sessionStorage squalpNavDir, posé par menu.js au clic préc./suiv.). === */
@media (prefers-reduced-motion: no-preference) {
  /* On anime .chapter-fit (PAS main) : main contient les flèches préc./suiv. en
     position:fixed — un transform sur main en faisait leur bloc conteneur → elles
     apparaissaient au mauvais endroit puis « sautaient » (client 2026-07-13).
     La propriété `translate` se compose avec le transform:scale posé par fit.js. */
  :root[data-nav-dir="fwd"] main.chapter-content .chapter-fit { animation: leaf-in-r 0.3s ease-out; }
  :root[data-nav-dir="back"] main.chapter-content .chapter-fit { animation: leaf-in-l 0.3s ease-out; }
  @keyframes leaf-in-r { from { opacity: 0.2; translate: 46px 0; } }
  @keyframes leaf-in-l { from { opacity: 0.2; translate: -46px 0; } }
}


/* ============================================================
   RÈGLE PRINCIPALE D'ALIGNEMENT (rappel client 2026-07-13) :
   le FOND BLANC doit aller de la FIN du bouton ERP SQUALP au DÉBUT du
   bouton LEXIQUE quand le rail est ouvert. La géométrie du menu (menu.css,
   section « ALIGNEMENT ») définit --card = min(1500px, 100vw − 630px) :
   logo 270 + ERP 184 à gauche, gouttière 136 + 40 à droite.
   La carte, centrée dans l'espace au droit du rail (270 → 100vw), doit donc
   faire EXACTEMENT var(--card) de large : marge auto = 180 de chaque côté
   → bord gauche à 450 (= fin ERP), bord droit à 100vw − 176 (= début LEXIQUE).
   Rail OUVERT : menu.css docke la carte (margin-left 180, width --card + 4) —
   cette règle-ci ne joue que rail FERMÉ : MÊME largeur, recentrée
   (règle « recentre, jamais resize » ; avant : la carte s'élargissait à la fermeture).
   ============================================================ */
@media (min-width: 1380px) {
  .chapter-content--fit,
  .chapter-content--text {
    width: var(--card, min(1500px, calc(100vw - 630px)));
  }
}


/* ============================================================
   PAGES TEXTE ÉLASTIQUES (demande client 2026-07-13, Lot 77) —
   « toutes les pages de type texte doivent être du même type que PIC :
     elles doivent s'agrandir quand on réduit le menu de gauche ».
   Au repli du rail, la carte TEXTE récupère la place libérée et fit.js
   recompose la police (plafond FS_MAX) → plus de texte lisible, toujours
   sans scroll. Les pages GRAPHIQUE (--fit) NE bougent pas : elles gardent
   la règle « recentre, jamais resize » (les planches doivent rester à la
   même taille d'une page à l'autre).
   PIC et SCM (data-no-fit) redéfinissent cette largeur en local (article
   à défilement, mesure de lecture plus étroite) — leur <style> gagne.
   ============================================================ */
@media (min-width: 1100px) {
  main.chapter-content--text { transition: margin 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
  /* ⚠️ RÈGLE MODIFIÉE 2026-07-30 (retour client) : réduire le rail NE DOIT PLUS agrandir
     la carte texte. On garde la MÊME largeur (var(--card) définie plus haut) et on la
     RECENTRE seulement (« recentre, jamais resize », comme les pages graphique). Ceci
     ANNULE l'élasticité du Lot 77. */
  body.book-nav-collapsed main.chapter-content--text {
    margin-left: auto; margin-right: auto;
  }
}


/* GUTTER-MARK — filigrane de section (gouttière droite) (client 2026-07-16) ===
   Positionné/affiché par menu.js selon la largeur RÉELLE de la gouttière à droite de la
   carte. Présent uniquement sur les pages qui contiennent l'élément .gutter-mark. */
.gutter-mark { position: absolute; top: 122px; right: 18px; pointer-events: none; z-index: 1;
  color: rgba(255,255,255,0.5); font-family: Verdana, Geneva, sans-serif; font-weight: 700; text-transform: none;
  text-align: left; line-height: 1.12; letter-spacing: 0.03em; opacity: 1;
  font-size: clamp(1.1rem, 1.4vw, 1.9rem); display: none; }
/* Initiale du concept mise en évidence (blanc plein, casse forte) → révèle l'acronyme
   (MRP, SCM, AQP…). Demande client 2026-07-18. */
.gutter-mark b { font-weight: 900; font-style: normal; color: #fff; }
.gutter-mark--mobile { display: none; }
@media (max-width: 767px) {
  .gutter-mark:not(.gutter-mark--mobile) { display: none !important; }
  .gutter-mark--mobile { display: flex !important; position: static; top: auto; right: auto; align-items: center;
    gap: 10px; margin: 2px clamp(16px,5vw,24px) 10px; opacity: 1; color: var(--mondrian-black);
    font-size: 0.66rem; letter-spacing: 0.08em; text-align: left; }
  .gutter-mark--mobile b { color: var(--mondrian-blue); }
  .gutter-mark--mobile::before { content: ""; flex: 0 0 24px; height: 3px; background: var(--mondrian-blue); }
}
/* ⚠️ Filigrane de section (« Assurance Qualité Produit », « MRP », etc., coin haut/
   droit + version mobile en tête de page) MASQUÉ à la demande du client (2026-07-29 :
   « plus nécessaire »). Le HTML .gutter-mark reste EN PLACE sur les pages → pour le
   RÉAFFICHER, il suffit de SUPPRIMER cette seule règle. */
.gutter-mark, .gutter-mark--mobile { display: none !important; }
/* Mobile : on décale les planches vers le bas pour dégager le bouton ▶ « Sommaire »
   (fixe au bord gauche, bas ≈ 244px du haut) qui chevauchait le schéma. La carte
   démarre ~128px sous le haut (menu fixe + fil d'Ariane) → il faut ≥ ~116px pour que
   le contenu passe SOUS le bouton.
   ⚠️ SPÉCIFICITÉ : la règle `body.has-book-nav .chapter-content { padding-top: 18px }`
   (≈ ligne 238, @media ≤1099px, spécificité 0,2,1) écrasait un simple
   `.chapter-content--fit` (0,1,0) → les 60px (Lot 81) puis 130px (Lot 84) ne
   s'appliquaient PAS sur les pages du livre. On égale/dépasse donc sa spécificité. */
@media (max-width: 767px) {
  /* ⚠️ 2026-08-06 (retour client) : 130px → 36px. Le bouton ▶ « Sommaire » a été
     REMONTÉ au coin haut-gauche de la carte (menu.css, bloc « ≤767px »), il descend
     désormais à ≈104px du haut du viewport alors que le contenu de la carte démarre
     vers 76px : 36px suffisent à passer dessous. Avant, la planche démarrait à 268px
     → « le graphique s'affiche trop bas », Précédent/Suivant hors écran.
     NE PAS remonter cette valeur sans redescendre le bouton en même temps. */
  .chapter-content--fit,
  body.has-book-nav .chapter-content--fit { padding-top: 36px; }
  /* …et on colle la carte au header : 18px (règle ≤900px) de teal en plus du vide
     déjà supprimé côté menu.css, le client les trouvait « immenses ». */
  .chapter-content { margin-top: 6px; }
  /* Le menu ne se replie JAMAIS sur mobile ; la classe `menu-collapsed` peut malgré
     tout traîner dans le localStorage du visiteur (posée sur son ordinateur). Elle
     rallongeait la carte de 66px (min-height 100dvh−30 au lieu de −96) = encore du
     vide en bas. On la neutralise ici comme pour le padding du body (menu.css). */
  body.menu-collapsed .chapter-content { min-height: calc(100vh - 96px); }
  @supports (height: 100dvh) {
    body.menu-collapsed .chapter-content { min-height: calc(100dvh - 96px); }
  }
}
/* TRÈS GRAND ÉCRAN (≥1800px) — le cadre blanc des pages TEXTE devenait un immense
   rectangle vide avec le texte flottant au milieu. On RÉDUIT le cadre à ≈2 tuiles
   (Services + Contact) et on le centre. Les écrans ≤ ~laptop (13") sont inchangés.
   Client 2026-07-29. (couvre rail ouvert ET rail replié) */
@media (min-width: 1800px) {
  /* ⚠️ Spécificité : la largeur des pages TEXTE vient de
     `body.has-book-nav:not(.book-nav-collapsed) .chapter-content--text { width/max-width:
     calc(var(--card)+4px) }` (0,3,1) ; on l'égale/dépasse et on clampe via max-width.
     Client 2026-07-30 : cadre = 2 tuiles (Services + Contact) = --card/2.
     - Rail OUVERT → CALÉ sous Services+Contact : bord gauche = ERP (184px) + 1 tuile
       Références (--card/4) ; --card=min(1800px,100vw-630px). (Mesuré exact.)
     - Rail REPLIÉ → même largeur mais CENTRÉ. */
  body.has-book-nav:not(.book-nav-collapsed) main.chapter-content--text:not([data-no-fit]) {
    /* Convention menu.css (ligne ~924) : on décale de 4px vers la GAUCHE (la bordure
       gauche de la carte RECOUVRE le séparateur Références/Services) et on élargit de
       4px (le bord droit reste calé sur le séparateur Contact/Actualités). Sans ça un
       liseré teal apparaissait à gauche sur 27" (retour client 2026-07-30). */
    width: calc(var(--card, min(1800px, calc(100vw - 630px))) / 2 + 4px) !important;
    max-width: calc(var(--card, min(1800px, calc(100vw - 630px))) / 2 + 4px) !important;
    margin-left: calc(180px + var(--card, min(1800px, calc(100vw - 630px))) / 4) !important;
    margin-right: 0 !important;
  }
  body.book-nav-collapsed main.chapter-content--text:not([data-no-fit]) {
    width: calc(var(--card, min(1800px, calc(100vw - 630px))) / 2) !important;
    max-width: calc(var(--card, min(1800px, calc(100vw - 630px))) / 2) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  /* PIC / CBN (data-no-fit) : BEAUCOUP de texte → restent sur 4 cases
     (Références/Services/Contact/Actualités) comme les autres pages, pas le clamp
     2 tuiles réservé aux pages TEXTE gabarit. Client 2026-07-30. */
}
