/* ===== Variables ===== */
:root {
  --ocean-deep:   #07111f;
  --ocean-mid:    #0d2137;
  --ocean-light:  #1a4d7a;
  --ocean-bright: #2878b5;
  --teal:         #1fada8;
  --teal-light:   #4ecdc4;
  --coral:        #ff6b6b;
  --sand:         #f0ece2;
  --text:         #e8f4f8;
  --text-muted:   #8ab0c8;
  --success:      #27ae60;
  --error:        #c0392b;
  --success-bg:   #1a3d2a;
  --error-bg:     #3d1a1a;
  --card-bg:      #0f1e30;
  --border:       #1e3a55;
  --radius:       12px;
  --shadow:       0 8px 32px rgba(0,0,0,.5);
}

/* ===== Thème clair (crème / encre) — base aussi des thèmes Livre et Liseuse ===== */
[data-theme="light"], [data-theme="livre"], [data-theme="liseuse"] {
  --ocean-deep:   #faf9f5;
  --ocean-mid:    #f1ede3;
  --ocean-light:  #e7e0d0;
  --ocean-bright: #2878b5;
  --teal:         #1f8a7a;
  --teal-light:   #15776a;
  --coral:        #d64545;
  --sand:         #5b5340;
  --text:         #22201b;
  --text-muted:   #6f6657;
  --success:      #1f8a4c;
  --error:        #c0392b;
  --success-bg:   #dff3e6;
  --error-bg:     #fbe3df;
  --success-text: #15703c;
  --error-text:   #b02a2a;
  --card-bg:      #ffffff;
  --border:       #e3ddcd;
  --shadow:       0 8px 28px rgba(60,50,30,.14);
}

/* ===== Polices de lecture (auto-hébergées, SIL OFL 1.1 — voir static/fonts/LICENCES.md) ===== */
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/literata-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/literata-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("../fonts/literata-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("../fonts/literata-italic-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: italic; font-weight: 200 900; font-display: swap;
  src: url("../fonts/source-sans-3-italic-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-style: italic; font-weight: 200 800; font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-next-italic-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "OpenDyslexic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/opendyslexic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "OpenDyslexic"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/opendyslexic-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "OpenDyslexic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/opendyslexic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "OpenDyslexic"; font-style: italic; font-weight: 700; font-display: swap;
  src: url("../fonts/opendyslexic-latin-700-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Police choisie par le lecteur (html[data-font], posé avant le rendu dans base.html).
   Chaque police a ses réglages : OpenDyslexic, très large, est réduite et aérée. */
:root {
  --read-font: "Literata", Georgia, serif;
  --read-font-scale: 1; --read-lh: 1.72; --read-ls: normal; --read-ws: normal;
}
html[data-font="sans"] {
  --read-font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --read-font-scale: 1.04; --read-lh: 1.68;
}
html[data-font="atkinson"] {
  --read-font: "Atkinson Hyperlegible Next", Verdana, sans-serif;
  --read-font-scale: 1; --read-lh: 1.75; --read-ls: .01em;
}
html[data-font="dyslexie"] {
  --read-font: "OpenDyslexic", "Comic Sans MS", sans-serif;
  --read-font-scale: .9; --read-lh: 1.85; --read-ls: normal; --read-ws: normal;
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ocean-deep);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--teal-light); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }

/* ===== Header ===== */
.site-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 2rem;
  background: var(--ocean-mid);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo { margin-right: auto; }
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: transform .2s ease;
  transform-origin: left center;
}
.logo:hover { text-decoration: none; }
.logo-icon { height: 2rem; width: auto; max-width: 3rem; display: block; }
.logo-text { letter-spacing: -.5px; }
nav { display: flex; gap: 1rem; align-items: center; }
.site-nav { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  color: var(--text-muted);
  font-size: .95rem;
  padding: .4rem .8rem;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: var(--ocean-light); text-decoration: none; }
.nav-link.is-active { color: var(--text); background: var(--ocean-light); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.theme-toggle {
  width: 2.2rem; height: 2.2rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem; line-height: 1;
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 9px;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.theme-toggle:hover { border-color: var(--teal); background: var(--ocean-light); }

/* Burger (mobile uniquement) */
.nav-burger {
  display: none;
  width: 2.4rem; height: 2.2rem;
  flex-direction: column; justify-content: center; gap: 5px;
  background: transparent; border: 1.5px solid var(--border); border-radius: 9px;
  cursor: pointer; padding: 0 .5rem;
}
.nav-burger span {
  display: block; height: 2px; width: 100%;
  background: var(--text); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* ===== Nav mobile (burger + menu bulle) ===== */
@media (max-width: 860px) {
  .nav-burger { display: flex; }
  .site-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    min-width: 220px;
    padding: .5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-8px) scale(.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
  }
  
  .nav-link { padding: .6rem .8rem; }
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  padding: 1.2rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
}

main { flex: 1; }

/* ===== Hero ===== */

/* ===== Stats ===== */

   /* rapproché du bouton « Commencer le quiz » */

/* Tuto vidéo du quiz (sous « Comment ça marche ») */

/* Variante mobile (vidéo verticale filmée en viewport iPhone) : cadre portrait centré */

.hint { color: var(--text-muted); font-size: .85rem; margin-top: 1rem; }

/* ===== How section ===== */

   /* glyphe ⚙ (option, pas une étape numérotée) */

/* Mobile : une étape par ligne, bulle à GAUCHE du texte (au lieu de dessus) */

/* ===== Quiz page ===== */
/* Quiz page : pas de scroll vertical, layout plein écran */

/* ── Indice « configurez le quiz » (mode découverte) ─────────────────── */
@keyframes cfg-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(78, 205, 196, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(78, 205, 196, 0); }
  100% { box-shadow: 0 0 0 0 rgba(78, 205, 196, 0); }
}

@keyframes cfg-bubble-in { to { opacity: 1; } }

/* ===== Config panel ===== */

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== End screen ===== */

/* Photo */

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Nom du photographe cliquable (lien vers son profil iNaturalist) */

/* ── Modal copyright ─────────────────────────────── */
.copyright-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.copyright-overlay.hidden { display: none !important; }
.copyright-modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(480px, 100%);
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.copyright-modal-header {
  display: flex; align-items: center; gap: .85rem;
  padding: 1.25rem 1.4rem .8rem;
  border-bottom: 1px solid var(--border);
}
.copyright-modal-icon {
  width: 2.4rem; height: 2.4rem; flex-shrink: 0;
  background: rgba(168,85,247,.15);
  border: 1px solid rgba(168,85,247,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; color: #c084fc;
}
.copyright-modal-title { font-weight: 700; font-size: 1rem; color: var(--text); }
.copyright-modal-sub   { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; font-style: italic; }

.copyright-modal-body { padding: 1.1rem 1.4rem .5rem; }
.copyright-label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: .4rem; letter-spacing: .02em;
}
.copyright-required { color: #f87171; }
.copyright-input,
.copyright-textarea {
  width: 100%;
  background: var(--ocean-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  padding: .6rem .8rem;
  outline: none;
  transition: border-color .15s;
}
.copyright-input:focus,
.copyright-textarea:focus { border-color: #c084fc; background: rgba(168,85,247,.06); }
.copyright-textarea { resize: vertical; min-height: 90px; }
.copyright-char-count { text-align: right; font-size: .7rem; color: var(--text-muted); margin-top: .3rem; }

.copyright-modal-actions {
  display: flex; gap: .7rem;
  padding: .9rem 1.4rem 1.25rem;
}
.copyright-btn-send {
  flex: 1; background: #7c3aed; color: #fff;
  border: none; border-radius: 10px;
  font-size: .88rem; font-weight: 700;
  padding: .65rem 1rem; cursor: pointer;
  transition: background .15s;
}
.copyright-btn-send:hover { background: #6d28d9; }
.copyright-btn-send:disabled { background: #3b1f6e; color: var(--text-muted); cursor: not-allowed; }
.copyright-btn-cancel {
  background: none; border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-muted);
  font-size: .88rem; padding: .65rem 1rem;
  cursor: pointer; transition: color .15s;
}
.copyright-btn-cancel:hover { color: var(--text); }

/* ===== Thème clair : overlays sur la photo en pastilles claires ===== */

/* Étoiles du quiz colorées par niveau, alignées sur Observer (.sp-diff) */

/* Steps */

/* État RÉVÉLÉ (espèce répondue → #next-container visible) : la photo se fige à une
   bonne taille et la zone d'infos (critères/confusion/observations, longue) scrolle.
   Pendant les questions, on garde la mise en page d'origine (tout tient, pas de scroll). */

/* Barre du bas = toolbar distincte : teinte de cadre (--ocean-mid, comme la barre de
   score / le fond photo), séparateur + ombre → le contenu scrolle visiblement dessous. */

/* Indice de scroll : fondu dans la teinte de la barre + chevron centré (au-dessus du
   milieu vide de la toolbar, entre liens et bouton), estompés une fois en bas. */

/* Chevron CLIQUABLE (fait défiler le contenu vers le bas) — vrai bouton dans .next-container */

.step { padding: 1rem 1.4rem; transition: opacity .28s ease; }

/* Résultat groupe (barre compacte en tête de step 2) */

/* Groupe buttons */

/* Species buttons */

/* Feedback */

/* Next */

/* Liens-pastilles (iNat/DORIS/BioObs/Wiki) dans le quiz : toujours visibles, même
   sur mobile où .sp-links de la liste Observer est masqué. */

/* Error */

/* ===== Page groupe ===== */

/* Caractéristiques */

/* Toolbar recherche / tri */

/* Lignes espèces */

/* Chevron indicateur */

/* Panneau expand */

/* Conteneur critères dans le quiz */

/* Clés d'identification */

/* Icône de section (œil / barres / triangle), monochrome, suit la couleur du label */

/* Bloc « Ne pas confondre » (espèces ressemblantes) */

/* Vignette-photo au survol d'un nom de sosie (banque locale) */

/* Nom de sosie NAVIGABLE : la fiche cible existe chez nous → on peut y sauter.
   (Placé après .has-thumb pour l'emporter quand un nom a aussi une vignette.) */
/* Nom de sosie navigable : on garde l'apparence d'origine (soulignement pointillé + bulle
   photo de .has-thumb) ; seule différence, un surlignage au survol qui signale le clic. */

/* Lien de retour inline « ← Revenir à … » : greffé en tête du panneau quand on arrive
   sur une fiche via un lien de confusion. Discret mais visible, dans le flux du contenu. */

/* Observations par mois (histogramme brut iNaturalist France — l'utilisateur juge) */

/* Grille photos */

/* Carte photo dans le panneau (largeur = colonne de grille, identique partout) */

/* Crédit photo SOUS l'image (sorti de la photo) — légende dans le fond de la carte. */

/* Survol PC uniquement (jamais au tap mobile) : agrandissement de la carte.
   Sur smartphone (pas de hover), seul le clic → visionneuse s'applique. */

/* Bouton signalement dans le panneau */

/* Thème clair : teintes plus saturées (les pastels du sombre paraissent palottes sur crème) */
   /* peu commun — ambre */
   /* commun — vert */
   /* rare — orange */
   /* ultra rare — rouge */

/* Tooltip photo (desktop) */

/* État vide */

/* ===== Responsive ===== */
@media (max-width: 520px) {
  .site-header { padding: .8rem 1rem; }

  /* Quiz mobile : photo en hauteur fixe, question area scrollable */

  /* Sur mobile : 4 colonnes × 5 rangées */

  /* Feedbacks plus compacts */

  /* Fix iOS Safari : overflow:hidden + border-radius tue le scroll des enfants */

  /* Bouton "Question suivante" fixé en bas */

  /* Espace pour ne pas cacher le contenu derrière le bouton fixe */

  .step { padding: .8rem 1rem; }

  /* Page groupes mobile */

  /* Critères quiz mobile : 1 colonne */

}

@keyframes zoom-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ===== Intros de page, sommaire, À propos ===== */
.section-intro { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem 1rem; }   /* même colonne que le sommaire (.learn-modules) */
.section-intro h1 { font-size: 2.4rem; line-height: 1.1; margin-bottom: .5rem; }
.section-intro-sub { color: var(--text-muted); font-size: 1.05rem; max-width: 62ch; line-height: 1.6; }

.modules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.modules li {
  display: flex; align-items: baseline; gap: 1rem; padding: 1rem 1.2rem;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
}

@media (max-width: 760px) {

  .section-intro h1 { font-size: 1.9rem; }
  .modules li { flex-direction: column; gap: .25rem; }
}

/* ===== Article — police de lecture au choix (voir Polices de lecture) ===== */
.article {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.2rem 1.5rem 5rem;
  font-family: var(--read-font);
  font-size: calc(1.2rem * var(--reading-scale, 1) * var(--read-font-scale));
  line-height: var(--read-lh);
  letter-spacing: var(--read-ls);
  word-spacing: var(--read-ws);
  font-optical-sizing: auto;
  color: var(--text);
}

.article h1 { font-size: 2.25rem; line-height: 1.15; letter-spacing: -.01em; margin: .1em 0 .55em; }
.article h2 { font-size: 1.5rem; line-height: 1.25; margin: 1.8em 0 .5em; }
.article h3 { font-size: 1.2rem; margin: 1.5em 0 .35em; }
.article p { margin: 0 0 1.1em; }
.article ul, .article ol { margin: 0 0 1.15em 1.3em; padding: 0; }
.article li { margin: .3em 0; }
/* Encadrés (« Remarquable — … ») : texte droit dans l'encre de lecture, sur un fond
   légèrement teinté et un cadre complet. L'ancien gris italique fatiguait l'œil et
   effaçait les noms scientifiques (italique dans l'italique). */
.article blockquote {
  margin: 1.6em 0; padding: .95em 1.15em; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--border));
  background: color-mix(in srgb, var(--teal) 5%, var(--card-bg));
  color: inherit; font-style: normal; font-size: .96em; line-height: 1.6;
}
.article blockquote > :last-child { margin-bottom: 0; }
.article blockquote > p:first-child > strong:first-of-type { color: var(--teal-light); font-weight: 700; }   /* accroche : seulement le 1er paragraphe */
[data-theme="liseuse"] .article blockquote { background: transparent; border-color: currentColor; }
[data-theme="liseuse"] .article blockquote > p:first-child > strong:first-of-type { color: inherit; }
.article code {
  font-family: ui-monospace, Menlo, monospace; font-size: .84em;
  background: var(--ocean-mid); padding: .12em .4em; border-radius: 5px;
}
.article pre {
  background: var(--ocean-mid); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.1rem; overflow-x: auto; margin: 0 0 1.2em;
}
.article pre code { background: none; padding: 0; }
.article a { color: var(--teal-light); text-decoration: underline; text-underline-offset: 2px; }
.article img { max-width: 100%; height: auto; border-radius: 10px; }
.article hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* Tableaux des articles (Markdown) : lecture, pas tableur. Filets horizontaux
   seuls, en-tête aligné comme ses colonnes, air entre les cellules et marge
   avant le paragraphe suivant. Défilement horizontal si trop large (mobile). */
.article-body table:not(.cmp-table) {
  display: block; max-width: 100%; overflow-x: auto;
  border-collapse: collapse; margin: 1.4em 0 1.7em;
  font-size: .9em; line-height: 1.45;
  font-variant-numeric: tabular-nums lining-nums;
}
.article-body table:not(.cmp-table) th,
.article-body table:not(.cmp-table) td {
  padding: .55em 1.2em .55em 0; text-align: left; vertical-align: baseline;
  min-width: 6.5em;   /* sur téléphone, un tableau large défile plutôt que d'émietter ses mots */
  border-bottom: 1px solid var(--border);
}
.article-body table:not(.cmp-table) :is(th, td):last-child { padding-right: 0; }
.article-body table:not(.cmp-table) thead th {
  font-size: .85em; font-weight: 700; letter-spacing: .02em; color: var(--text-muted);
  line-height: 1.3; vertical-align: bottom; padding-bottom: .5em; border-bottom: 2px solid var(--text-muted);
}
.article-body table:not(.cmp-table) tbody tr:last-child :is(th, td) { border-bottom: 0; }

/* Page du poster : aperçu cliquable puis les deux téléchargements côte à côte. */
.poster-preview { margin: 1.4em 0 1.2em; }
.poster-preview a { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: 0 6px 22px -14px rgba(0,0,0,.35); }
.poster-preview img { display: block; width: 100%; height: auto; border-radius: 0; }
.poster-preview a:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 3px; }
.poster-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .8rem; margin: 0 0 2em; }
.article .poster-dl-item {
  display: flex; flex-direction: column; gap: .35em; padding: .95rem 1.05rem 1rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg);
  color: var(--text); text-decoration: none; transition: border-color .15s, background-color .15s;
}
.article .poster-dl-item:hover { border-color: var(--teal); background: var(--ocean-mid); }
.article .poster-dl-item:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.poster-dl-name { font-weight: 700; font-size: 1.05em; color: var(--teal-light); }
.poster-dl-name { display: inline-flex; align-items: center; gap: .45em; }
.poster-dl-name svg { width: 1em; height: 1em; flex: none; }
.poster-dl-meta { font-size: .78em; color: var(--text-muted); letter-spacing: .02em; margin-top: auto; padding-top: .2em; }
.poster-credits { font-size: .85em; color: var(--text-muted); }

/* Conseils de lecture : une liste de livres, couverture à gauche, notice à droite. */
.lectures-cats { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 0 0 1.6em; font-size: .88em; }
.article .lectures-cats a {
  padding: .3em .75em; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); text-decoration: none; background: var(--card-bg);
}
.article .lectures-cats a:hover { border-color: var(--teal); color: var(--teal-light); }
.lectures-intro { color: var(--text-muted); font-size: .95em; }
.article ul.lectures { list-style: none; margin: 0 0 2.2em; padding: 0; }
.article .livre {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.1rem; align-items: start;
  margin: 0; padding: 1.15rem 0; border-top: 1px solid var(--border);
}
.article .livre:first-child { border-top: 0; padding-top: .4rem; }
.article img.livre-couv {
  width: 100%; height: auto; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 6px 16px -10px rgba(0,0,0,.45);
}
.livre-txt > p { margin: 0; }
.article h3.livre-titre { margin: 0; font-size: 1.08em; line-height: 1.3; }
.article .livre-sous { font-size: .9em; line-height: 1.4; color: var(--text-muted); margin-top: .15em; }
.article .livre-auteurs { font-size: .9em; margin-top: .35em; }
.article .livre-meta { font-size: .8em; color: var(--text-muted); margin-top: .15em; }
.livre-tags { display: flex; flex-wrap: wrap; gap: .35em; margin-top: .45em !important; }
.livre-tags span {
  font-size: .72em; font-weight: 600; letter-spacing: .02em; padding: .12em .55em; border-radius: 4px;
  background: var(--ocean-mid); color: var(--text);
}
.article .livre-resume { margin-top: .6em; line-height: 1.55; }
.article .livre-ref { font-size: .78em; color: var(--text-muted); margin-top: .5em; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .article .livre { grid-template-columns: 4.6rem 1fr; gap: .85rem; }
}

.livre-zoom { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 3px; }
.livre-zoom:hover img { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 12px 22px -12px rgba(0,0,0,.5); }
.livre-zoom img { transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s; }
.livre-zoom:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 3px; }
.couv-dialog {
  margin: auto; padding: 0; border: 0; background: none; max-width: min(92vw, 640px); max-height: 88vh;
  overflow: visible; cursor: zoom-out;
}
.couv-dialog::backdrop { background: rgba(10, 12, 16, .78); }
.couv-dialog img { display: block; max-width: 100%; max-height: 88vh; width: auto; height: auto; border-radius: 4px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.7); }
.couv-close {
  position: absolute; top: -.6rem; right: -.6rem; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: #fff; color: #1f1d19; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.couv-close:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .livre-zoom img { transition: none; } }

/* Glossaire : recherche, index alphabétique, entrées par lettre. */
.gl-tools { margin: 0 0 1.4em; }
.gl-search { position: relative; }
.gl-search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.gl-search input {
  width: 100%; font: inherit; font-size: .95em; padding: .6em .9em .6em 2.4rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg); color: var(--text);
}
.gl-search input:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; border-color: var(--teal); }
.article .gl-count { margin: .45em 0 0 .9rem; min-height: 1.2em; font-size: .82em; color: var(--text-muted); }
.gl-index { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .5rem; }
.article .gl-index a, .otp-letters .otp-list a {
  display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .3rem;
  border-radius: 6px; text-decoration: none; font-weight: 600; color: var(--teal-light);
}
.article .gl-index a:hover { background: var(--ocean-mid); }
.article .gl-index a.is-off { color: var(--text-muted); opacity: .4; pointer-events: none; }
.gl-letter h2 { font-size: 1.5rem; margin: 1.4em 0 .4em; padding-bottom: .2em; border-bottom: 1px solid var(--border); }
.article dl.glossaire { margin: 0; }
.gl-entry { padding: .55em 0; scroll-margin-top: 5rem; }
.gl-entry dt { font-weight: 700; display: inline; }
.gl-entry dt::after { content: " — "; font-weight: 400; color: var(--text-muted); }
.gl-entry dd { display: inline; margin: 0; }
.gl-entry:target { background: var(--ocean-mid); border-radius: 6px; box-shadow: 0 0 0 .4rem var(--ocean-mid); }
.article .gl-empty { color: var(--text-muted); font-style: italic; }
/* « Sur cette page » du glossaire : les lettres en grille, pas une colonne de 26 lignes. */
.otp-letters .otp-list { display: flex; flex-wrap: wrap; gap: .1rem; border-left: 0; }
.otp-letters .otp-list li { margin: 0; }
.otp-letters .otp-list a { min-width: 1.75rem; height: 1.75rem; padding: 0; border-left: 0; margin: 0; font-size: .85rem; }
.otp-letters .otp-list a.active { background: var(--ocean-mid); }
/* Avec la colonne « Sur cette page » visible, l'index en tête ferait doublon. */
@media (min-width: 1101px) { html:not([data-dock-right="off"]) .gl-index { display: none; } }

@media (max-width: 600px) {
  .article { font-size: calc(1.08rem * var(--reading-scale, 1) * var(--read-font-scale)); }
  .article h1 { font-size: 1.8rem; }
}

/* ===== Apprendre : barre de recherche ===== */
.learn-search { position: relative; margin: 1.4rem 0 0; }
.learn-search-ic {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  width: 1.05rem; height: 1.05rem; pointer-events: none;
  fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round;
}
.learn-search-input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 999px;
  padding: .7rem 2.5rem .7rem 2.5rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.learn-search-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,138,122,.16); }
.learn-search-input::placeholder { color: var(--text-muted); }
.learn-search-input::-webkit-search-cancel-button { display: none; }
.learn-search-clear {
  position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
  width: 1.7rem; height: 1.7rem; border: none; background: transparent; color: var(--text-muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer; border-radius: 50%; transition: .12s;
}
.learn-search-clear:hover { color: var(--text); background: var(--border); }

/* ===== Apprendre : résultats de recherche ===== */
.learn-results { max-width: 760px; margin: 1.2rem auto 0; padding: 0 1.5rem 4rem; }
.lr-count {
  font-size: .72rem; color: var(--text-muted); margin: 0 0 .6rem .2rem;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
}
.lr-def ~ .lr-count {   /* sépare la liste d'articles des fiches définition au-dessus */
  margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--border);
}
.lr-item { display: block; padding: .7rem .9rem; border-radius: 9px; border: 1px solid transparent; }
.lr-item:hover, .lr-item.is-active { background: var(--card-bg); text-decoration: none; }
.lr-item.is-active { border-color: var(--border); }
.lr-title { font-size: 1.02rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.lr-crumb {
  font-size: .72rem; color: var(--text-muted); margin-top: .15rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.lr-snippet { font-size: .88rem; color: var(--text-muted); line-height: 1.45; margin-top: .3rem; }
.lr-item mark {
  background: rgba(214,158,46,.28); color: inherit; border-radius: 3px; padding: 0 .1em;
}
.lr-empty { text-align: center; color: var(--text-muted); padding: 2.5rem 1rem; }
.lr-def { background: color-mix(in srgb, var(--teal) 7%, transparent); }   /* fiche définition (glossaire) */
.lr-def .lr-crumb { color: var(--teal-light); }
.lr-def .lr-snippet { color: var(--text); }

/* Recherche dans le sommaire des pages article : champ compact + popover flottant */
.side-search { position: relative; margin: 0 1.1rem 1.1rem; }
.side-search-input { font-size: .88rem; padding-top: .5rem; padding-bottom: .5rem; }
.side-results {     /* position/largeur posées en JS (position: fixed) */
  position: fixed; z-index: 120; max-height: 70vh; overflow-y: auto;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); padding: .5rem;
}
.side-results .lr-item { padding: .55rem .7rem; }
.side-results .lr-snippet { font-size: .82rem; }

/* ===== Apprendre : landing par modules ===== */
.learn-modules { max-width: 760px; margin: 0 auto; padding: 1rem 1.5rem 4rem; }
.learn-module { margin-bottom: 2.4rem; }
.learn-module-title {
  font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--teal-light); font-weight: 700; margin-bottom: .7rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.learn-articles { list-style: none; padding: 0; margin: 0; }
.learn-section {     /* sous-titre de section dans la liste d'articles (landing) */
  display: flex; align-items: center; gap: .6rem;
  margin: 1.2rem 0 .25rem; padding: 0 .9rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text);
}
.learn-section::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.learn-section:first-child { margin-top: .4rem; }
.learn-article {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .42rem .9rem; border-radius: 8px; color: var(--text);   /* compact : la liste se parcourt d'un coup d'œil */
  transition: background .15s, color .15s;
}
.learn-article:hover { background: var(--card-bg); text-decoration: none; }
.learn-article-title {
  position: relative; flex: 1; font-size: 1.02rem; line-height: 1.35; padding-left: 1.05rem;
}
.learn-article-title::before {     /* puce devant chaque article */
  content: ''; position: absolute; left: .1rem; top: .58em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--teal); opacity: .55;
}
.learn-article:hover .learn-article-title::before { opacity: 1; }
.learn-article-meta {
  flex-shrink: 0; font-size: .78rem; color: var(--text-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.learn-article-go { color: var(--text-muted); flex-shrink: 0; transition: transform .15s, color .15s; }
.learn-article:hover .learn-article-go { color: var(--teal-light); transform: translateX(3px); }

/* ===== Article : méta (module, temps) + outils de lecture ===== */
.reading-tools {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 1.2rem; font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Taille du texte (A− / A+) */
.text-size {
  display: inline-flex; gap: .15rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 10px; padding: .2rem;
}
.ts-btn {
  border: none; background: transparent; color: var(--text);
  font-weight: 700; cursor: pointer; border-radius: 7px;
  padding: .3rem .65rem; line-height: 1; transition: background .15s, opacity .15s;
}
.ts-btn[data-step="-1"] { font-size: .8rem; }
.ts-btn[data-step="1"]  { font-size: 1.05rem; }
.ts-btn:hover:not(:disabled) { background: var(--ocean-light); }
.ts-btn:disabled { opacity: .3; cursor: default; }

/* ===== Glossaire interactif (infobulle au survol) ===== */
.gloss {
  border-bottom: 1px dashed var(--teal-light);
  cursor: help; position: relative;
}
.gloss-pop {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(calc(-50% + var(--gloss-shift, 0px)));   /* décalage posé en JS pour rester à l'écran */
  width: max-content; max-width: min(280px, calc(100vw - 24px));
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: .55rem .75rem;
  font: 400 .82rem/1.5 'Segoe UI', system-ui, sans-serif;
  text-align: left; box-shadow: var(--shadow); z-index: 50;
  opacity: 0; visibility: hidden; transition: opacity .12s ease;
  pointer-events: none;
}
.gloss-pop::after {      /* la flèche reste pointée sur le mot, même si la bulle est décalée */
  content: ''; position: absolute; top: 100%;
  left: clamp(14px, calc(50% - var(--gloss-shift, 0px)), calc(100% - 14px)); transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--border);
}
/* Pas assez de place au-dessus (sous l'en-tête collant) : la bulle passe dessous. */
.gloss.gloss-below .gloss-pop { bottom: auto; top: calc(100% + 8px); }
.gloss.gloss-below .gloss-pop::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--border); }
.gloss:hover .gloss-pop, .gloss:focus .gloss-pop,
.gloss:focus-visible .gloss-pop { opacity: 1; visibility: visible; }

/* ===== Article : bouton « Signaler une incohérence » ===== */
.article-report { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--border); text-align: center; }
.article-report-btn {
  font-family: 'Segoe UI', system-ui, sans-serif; font-size: .85rem;
  color: var(--text-muted); background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  padding: .5rem 1.05rem; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.article-report-btn:hover { color: var(--coral); border-color: var(--coral); background: var(--card-bg); }
.ar-error { color: var(--coral); font-size: .8rem; margin-top: .6rem; }
.ar-error.hidden { display: none; }

/* ===== Apprendre : layout article + sommaire latéral ===== */
.article-layout {
  display: flex; align-items: flex-start; gap: 2.2rem;
  max-width: 1460px; margin: 0 auto; padding: 0 1.5rem;
}
.article-layout > .article { flex: 1 1 auto; min-width: 0; max-width: 800px; margin: 0 auto; }

.article-sidebar {
  flex: 0 0 250px; position: sticky; top: 4.4rem;
  max-height: calc(100vh - 5rem); overflow: hidden;
  padding: 0; font-family: 'Segoe UI', system-ui, sans-serif;
}
/* La recherche reste fixe en haut ; seule la liste défile, sous elle (jamais derrière). */
.side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .2rem 0 2rem; overscroll-behavior: contain; }
.article-sidebar-head {
  display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin-bottom: .8rem; padding-left: .35rem;
}
.article-sidebar-head:hover { color: var(--teal-light); text-decoration: none; }

/* « Sur cette page » (rail droit) */
.article-onthispage {
  flex: 0 0 190px; position: sticky; top: 4.4rem;
  max-height: calc(100vh - 5rem); overflow-y: auto;
  padding: 1.6rem 0 2rem; font-family: 'Segoe UI', system-ui, sans-serif;
}
.otp-head {
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin-bottom: .7rem; padding-left: .8rem;
}
.otp-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.otp-list a {
  display: block; font-size: .8rem; line-height: 1.3; color: var(--text-muted);
  padding: .3rem .7rem; margin-left: -1px; border-left: 2px solid transparent;
  transition: color .12s, border-color .12s;
}
.otp-list a:hover { color: var(--text); text-decoration: none; }
.otp-list a.active { color: var(--teal-light); border-left-color: var(--teal); font-weight: 600; }

.toc-module { margin-bottom: .2rem; }
.toc-module-title {
  position: relative; cursor: pointer; list-style: none;
  font-size: .82rem; font-weight: 700; color: var(--text);
  padding: .4rem .5rem .4rem 1.25rem;   /* retrait pendu : 2e ligne alignée sous le texte du titre */
  border-radius: 7px;
}
.toc-module-title::-webkit-details-marker { display: none; }
.toc-module-title::before {
  content: '▸'; position: absolute; left: .45rem; top: .5rem;
  color: var(--text-muted); font-size: .7rem; line-height: 1;
  display: inline-block; transition: transform .15s;
}
.toc-module[open] > .toc-module-title::before { transform: rotate(90deg); }
.toc-module-title:hover { background: var(--card-bg); }
.toc-list { list-style: none; margin: .15rem 0 .7rem; padding: 0 0 0 .55rem; }
.toc-link {
  position: relative; display: block;
  font-size: .84rem; line-height: 1.3; color: var(--text-muted);
  padding: .32rem .55rem .32rem 1.15rem;   /* retrait pendu : 2e ligne alignée sous le TEXTE */
  margin-bottom: .12rem; border-radius: 6px; border-left: 2px solid transparent;
  transition: color .12s, background .12s;
}
.toc-link::before {     /* puce qui « pend » à gauche du bloc de texte */
  content: ''; position: absolute; left: .5rem; top: .72em;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-muted); opacity: .5;
}
.toc-link:hover { color: var(--text); background: var(--card-bg); text-decoration: none; }
.toc-link:hover::before { opacity: 1; }
.toc-link.is-current {
  color: var(--teal-light); border-left-color: var(--teal);
  background: var(--card-bg); font-weight: 600;
}
.toc-link.is-current::before { background: var(--teal); opacity: 1; }
/* Sous-niveau : article rangé sous un autre (ex. LUCA sous la Cartographie).
   Indenté, avec un filet-guide vertical qui matérialise la relation parent→enfant. */
.toc-sublist {
  list-style: none; margin: .1rem 0 .25rem; padding: 0 0 0 .6rem;
  margin-left: 1.15rem;                       /* aligné sous le texte du parent */
  border-left: 1px solid var(--border);
}
.toc-sublink { font-size: .8rem; }
.toc-sublink::before {                        /* puce en tiret plutôt qu'en point : c'est un rattachement */
  width: 5px; height: 1.5px; border-radius: 1px; top: .82em;
}
.toc-section {     /* sous-titre de section dans le sommaire (non cliquable) */
  list-style: none; margin: .9rem 0 .3rem; padding: .7rem .55rem 0;
  border-top: 1px solid var(--border);
  font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted);   /* sous le module dans la hiérarchie */
}
.toc-section:first-child { margin-top: .25rem; padding-top: 0; border-top: none; }
/* Le sous-titre de section utilise la même couleur que les liens d'article par
   défaut → on le rend plus contrasté pour qu'il se détache comme un en-tête :
   plus clair en sombre, plus foncé en clair. */
[data-theme="dark"]  .toc-section { color: #c3d9e6; }
[data-theme="light"] .toc-section, [data-theme="livre"] .toc-section, [data-theme="liseuse"] .toc-section { color: var(--sand); }

/* Barre haut d'article (back + bouton sommaire mobile) */
  /* visible en mobile seulement */
/* l'ancre d'un titre ne doit pas passer sous le header sticky */
.article h2, .article h3 { scroll-margin-top: 5rem; }
.toc-toggle {
  display: none; font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: .82rem; font-weight: 600; color: var(--text); background: transparent;
  border: 1px solid var(--border); border-radius: 8px; padding: .35rem .7rem; cursor: pointer;
}
.toc-toggle:hover { border-color: var(--teal); }

/* Pager précédent / suivant */
.article-pager {
  display: flex; gap: 1rem; margin-top: 3.2rem; padding-top: 1.6rem;
  border-top: 1px solid var(--border); font-family: 'Segoe UI', system-ui, sans-serif;
}
.pager {
  flex: 1; display: flex; flex-direction: column; gap: .2rem;
  padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); transition: border-color .15s, background .15s;
}
.pager:hover { border-color: var(--teal); background: var(--card-bg); text-decoration: none; }
.pager-next { text-align: right; }
.pager-dir { font-size: .75rem; color: var(--text-muted); }
.pager-title { font-size: .92rem; font-weight: 600; line-height: 1.3; }
.pager-spacer { flex: 1; }

/* fond assombri : sous le header (z<100) et démarre sous lui → header non masqué */
.article-drawer-backdrop {
  position: fixed; left: 0; right: 0; bottom: 0; top: var(--header-h, 0);
  z-index: 90; background: rgba(0,0,0,.45);
}

/* Mobile : sommaire en drawer */
/* Écrans intermédiaires : on masque le rail droit « Sur cette page » */
@media (max-width: 1100px) {
  .article-onthispage { display: none; }
}

@media (max-width: 900px) {
  .article-layout { display: block; padding: 0; }
  .article-layout > .article { max-width: 680px; margin: 0 auto; }
  
  .toc-toggle { display: inline-flex; align-items: center; }
  .article-sidebar {
    position: fixed; top: var(--header-h, 64px); left: 0; bottom: 0; z-index: 95;
    width: 282px; max-width: 85vw; height: auto; max-height: none;
    background: var(--ocean-mid); border-right: 1px solid var(--border);
    padding: 1.2rem 1rem; box-shadow: var(--shadow);
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.toc-open .article-sidebar { transform: translateX(0); }
}

/* La règle globale `nav { display:flex }` (header) ne doit pas mettre le
   sommaire des articles en ligne : on rétablit l'empilement vertical. */
.article-toc { display: block; }

/* ===== Cartographie taxonomique interactive ===== */
.carto-mount { font-family: 'Segoe UI', system-ui, sans-serif; margin: 2rem 0 1rem; }
.carto-loading, .carto-error { color: var(--text-muted); font-size: .9rem; }
.carto {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card-bg); padding: 1rem 1.1rem 1.2rem;
}
.carto-lbl {   /* libellés de la carte en minuscules, comme ceux de l'arbre des origines */
  font-size: .84rem; color: var(--text-muted); font-weight: 600; margin-right: .3rem;
}

/* Légende + calques */
 .carto-layers {
  display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  padding-bottom: .8rem; margin-bottom: .8rem; border-bottom: 1px solid var(--border);
}
/* Le label coiffe les chips (sur sa propre ligne), groupes en dessous. */
.carto-layers-head { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 0 0 .15rem; }
.carto-layers .carto-lbl { margin: 0; }
.carto-layers-head .meta-fs { margin-left: auto; font-size: .82rem; font-family: "Segoe UI", system-ui, sans-serif; }
@media (max-width: 600px) { .carto-layers-head .meta-fs { display: none; } }   /* comme dans la méta : utile sur grand écran seulement */
.cbadge {
  font-size: .66rem; font-weight: 700; padding: .12rem .42rem;
  border-radius: 5px; white-space: nowrap;
}

/* Boutons de surlignage : même langage que les calques de l'arbre (interrupteurs à
   pastille) ; la pastille et l'état allumé reprennent le jaune des membres surlignés. */
:root { --carto-hl: #f0d44e; --carto-hl-ink: #5a4a08; --carto-hl-edge: #c9a400; }
.clayer {
  display: inline-flex; align-items: center; gap: .42rem;
  font: 600 .8rem/1.2 "Segoe UI", system-ui, sans-serif; color: var(--text-muted);
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 999px; padding: .3rem .75rem .3rem .55rem; cursor: pointer;
  transition: background-color .15s ease-out, color .15s ease-out, border-color .15s ease-out;
}
.clayer::before {   /* au repos : case vide et neutre ; la couleur n'apparaît qu'allumé */
  content: ""; width: .6rem; height: .6rem; border-radius: 3px; flex: none; box-sizing: border-box;
  background: transparent; border: 1.5px solid color-mix(in srgb, var(--text-muted) 70%, transparent);
}
.clayer:hover { color: var(--text); border-color: var(--carto-hl-edge); }
.clayer.active { background: var(--carto-hl); border-color: var(--carto-hl); color: var(--carto-hl-ink); }
.clayer.active::before { background: var(--carto-hl-ink); border-color: var(--carto-hl-ink); }
.carto-layer-info {
  font-size: .84rem; line-height: 1.5; color: var(--text);
  background: var(--ocean-deep); border: 1px solid var(--border);
  border-radius: 9px; padding: .6rem .8rem; margin-bottom: .9rem;
}
.carto-layer-def { display: block; color: var(--text-muted); margin-top: .2rem; }

/* Arbre */
.carto-tree-head { display: flex; align-items: center; gap: .6rem; margin: 0 0 .45rem; }
.carto-expand {
  font: inherit; font-size: .72rem; color: var(--text-muted);
  background: transparent; border: 1px solid var(--border); border-radius: 999px;
  padding: .12rem .6rem; cursor: pointer; white-space: nowrap; transition: color .15s, border-color .15s;
}
.carto-expand:hover { color: var(--text); border-color: var(--teal); }
.carto-expand:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--teal); }
/* Bouton « Descriptions » : interrupteur ; coche visible quand elles sont affichées. */
.carto-notes { display: inline-flex; align-items: center; gap: .35rem; }
.carto-notes::before {
  content: ""; width: .62rem; height: .62rem; border-radius: 3px; box-sizing: border-box;
  border: 1.5px solid currentColor; flex: none;
}
.carto-notes[aria-pressed="true"]::before {
  background: currentColor;
  -webkit-mask: none;
  box-shadow: inset 0 0 0 1.5px var(--card-bg);
}
.carto-notes[aria-pressed="true"] { color: var(--text); border-color: color-mix(in srgb, var(--text) 35%, var(--border)); }
.carto.notes-off .cnode:not(.note-open) > .cnode-note,
.cnode.note-closed > .cnode-note { display: none; }
.cnode-ntog {
  display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; flex: none; margin-left: -.1rem;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; opacity: .55;
  transition: opacity .15s ease-out, color .15s ease-out, background-color .15s ease-out;
}
.cnode-ntog:hover { opacity: 1; background: color-mix(in srgb, var(--text) 7%, transparent); }
.cnode-ntog[aria-expanded="true"] { color: var(--teal); opacity: .9; }
.cnode-ntog:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; opacity: 1; }
.cnode:not(.has-kids) > .cnode-row:has(+ .cnode-note) { cursor: pointer; }
.carto-thead {
  margin-left: auto; padding-right: .4rem; white-space: nowrap;
  font-size: .64rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted);
}
.carto-tree { overflow-x: auto; }
.cnode-children { display: none; margin-left: .55rem; padding-left: .7rem; border-left: 1px solid var(--border); }
.cnode.open > .cnode-children { display: block; }
.cnode-note {     /* note du nœud, toujours visible sous la ligne */
  margin: .1rem 0 .45rem 2.1rem;   /* aligné sous le nom */
  font-size: .82rem; line-height: 1.5; color: var(--text-muted); max-width: 62ch;
}
.cnode-row {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  padding: .28rem .4rem; border-radius: 7px; cursor: default;
  transition: background .12s; outline: none;
}
.cnode.has-kids > .cnode-row { cursor: pointer; }            /* clic = déplier les enfants */
.cnode-row:hover { background: var(--ocean-light); }
.cnode-row:focus-visible { box-shadow: 0 0 0 2px var(--teal); }
.cnode-caret {
  width: 1rem; height: 1rem; flex-shrink: 0; color: var(--text-muted);
  transition: transform .15s ease; display: inline-flex; align-items: center; justify-content: center;
}
.cnode-caret svg { display: block; }
.cnode.has-kids > .cnode-row:hover .cnode-caret { color: var(--teal); }
.cnode-br { display: none; }
.cnode.open > .cnode-row .cnode-caret { transform: rotate(90deg); }
.cnode-caret.is-leaf { visibility: hidden; }
.cnode-name { font-weight: 600; color: var(--text); font-size: .9rem; }
.cnode-latin { font-style: italic; color: var(--text-muted); font-size: .8rem; }
.cnode-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 0; white-space: nowrap; }
.cnode-rank { font-size: .68rem; color: var(--text-muted); white-space: nowrap; }
.cnode-clade { font-size: .68rem; color: var(--teal-light); white-space: nowrap; }
.cnode-meta-sep { font-size: .68rem; color: var(--text-muted); opacity: .6; }

/* Groupe surligné : le reste s'efface pour que la dispersion se voie. */
.carto.has-layer .cnode:not(.is-member):not(.is-path) > .cnode-row,
.carto.has-layer .cnode:not(.is-member):not(.is-path) > .cnode-note { opacity: .45; transition: opacity .15s ease; }
/* Sur le chemin : la ligne reste nette, sa note un peu en retrait. */
.carto.has-layer .cnode.is-path:not(.is-member) > .cnode-note { opacity: .7; }
.carto.has-layer .cnode:not(.is-member) > .cnode-row:hover,
.carto.has-layer .cnode:not(.is-member) > .cnode-row:focus-visible { opacity: 1; }
.cnode.is-member > .cnode-row {
  background: rgba(255,200,40,.2);
  box-shadow: inset 0 0 0 1.5px rgba(255,200,40,.6);
}

/* Hors-arbre — mêmes nœuds `.cnode` que l'arbre (note repliée, révélée au clic) */
.carto-hors { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--border); }
.carto-hors .carto-lbl { display: block; margin-bottom: .45rem; }

/* étiquette du calque écologique posée sur les nœuds surlignés */
.cnode-layer-tag {
  font-size: .62rem; font-weight: 700; white-space: nowrap;
  background: #f0d44e; color: #5a4a08; border-radius: 4px; padding: .06rem .36rem;
}

/* chip de grade (procaryotes…) : pointillé pour signaler « groupe non naturel » */

/* nature du groupe surligné (grade / groupe-forme / groupe écologique) */
.carto-layer-nature { font-size: .74rem; font-style: italic; color: var(--text-muted); margin-left: .35rem; }

/* bandeau d'info des groupes actifs (multi-sélection) */
.carto-layer-line { padding: .25rem 0; }
.carto-layer-line + .carto-layer-line { border-top: 1px solid var(--border); }
.carto-layer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap;
  margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border);
}
.carto-layer-hint { font-size: .76rem; color: var(--text-muted); flex: 1 1 18rem; }

/* Interrupteur « Masquer les autres branches » */
.carto-prune {
  display: inline-flex; align-items: center; gap: .5rem; flex-shrink: 0;
  font-family: inherit; font-size: .8rem; font-weight: 600; color: var(--text);
  background: none; border: 0; padding: .3rem .1rem; cursor: pointer; border-radius: 999px;
}
.carto-prune-track {
  position: relative; width: 2.1rem; height: 1.2rem; flex-shrink: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 35%, transparent);
  transition: background-color .18s ease;
}
.carto-prune-thumb {
  position: absolute; top: .15rem; left: .15rem; width: .9rem; height: .9rem; border-radius: 50%;
  background: var(--card-bg); box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .18s cubic-bezier(.2,.8,.2,1);
}
.carto-prune[aria-checked="true"] .carto-prune-track { background: var(--teal); }
.carto-prune[aria-checked="true"] .carto-prune-thumb { transform: translateX(.9rem); }
.carto-prune:hover .carto-prune-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent); }
.carto-prune:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Mode élagué : ne restent que les membres (avec leurs sous-branches) et le
   squelette qui y mène, réduit à ses noms. */
.carto.prune .cnode:not(.is-member):not(.is-path):not(.is-member .cnode) { display: none; }
.carto.prune .cnode.is-path:not(.is-member) > .cnode-note { display: none; }
.carto.prune .cnode.is-path:not(.is-member) > .cnode-row { opacity: 1; }
.carto-hors[hidden] { display: none; }
/* L'étiquette de groupe ne déborde jamais de sa ligne. */
.cnode-layer-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 600px) {
  /* Élagué, le squelette n'a plus de notes à loger : un retrait minimal suffit,
     et les membres profonds (14 niveaux pour les cétacés) gardent leur largeur. */
  .carto.prune .cnode-children { margin-left: .15rem; padding-left: .3rem; }
  .carto.prune .cnode.is-path:not(.is-member) > .cnode-row { padding-top: .12rem; padding-bottom: .12rem; }
  .carto.prune .cnode.is-path:not(.is-member) > .cnode-row .cnode-meta,
  .carto.prune .cnode.is-path:not(.is-member) > .cnode-row .cnode-latin,
  .carto.prune .cnode.is-path:not(.is-member) > .cnode-row .cnode-br { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .carto-prune-track, .carto-prune-thumb { transition: none; }
}

/* rangs et badges survolables (infobulle de définition) */
.carto-mount { position: relative; }
.cnode-rank[data-def], .cnode-clade[data-def], .carto-layer-nature[data-def] { text-decoration: underline dotted; text-underline-offset: 2px; text-decoration-color: currentColor; cursor: help; outline: none; }
.cbadge[data-def] { cursor: help; outline: none; }
.cnode-rank[data-def]:focus-visible, .cnode-clade[data-def]:focus-visible, .carto-layer-nature[data-def]:focus-visible, .cbadge[data-def]:focus-visible { box-shadow: 0 0 0 2px var(--teal); border-radius: 4px; }
.carto-tip {
  position: absolute; z-index: 60; max-width: 280px;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: .5rem .7rem; font-size: .8rem; line-height: 1.45;
  box-shadow: var(--shadow); pointer-events: none;
}
.carto-tip[hidden] { display: none; }
.clayer:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }

/* Téléphone : le nom seul sur sa ligne (avec ses étiquettes), puis le latin et
   le rang en dessous ; le retrait par niveau est resserré pour garder de la
   largeur aux notes. */
@media (max-width: 600px) {
  .carto { padding: .9rem .75rem 1rem; }
  .carto-thead { display: none; }
  .carto-tree-head { justify-content: space-between; }
  /* La flèche se loge dans la marge de la ligne : tout le texte s'aligne
     dessous, et le nom n'est jamais séparé d'elle par un retour à la ligne. */
  .cnode-row { position: relative; row-gap: .15rem; padding-left: 1.55rem; }
  .cnode-caret { position: absolute; left: .3rem; top: .42rem; }
  .cnode-name { flex: 1 1 auto; min-width: 0; }
  .cnode-br { display: block; flex-basis: 100%; height: 0; order: 2; }
  .cnode-layer-tag, .cnode-latin { order: 3; }
  .cnode-meta { order: 4; }
  .cnode-note { margin-left: 1.95rem; }
  .cnode-children { margin-left: .4rem; padding-left: .45rem; }
}

/* ===== Tableaux comparatifs des grands groupes (Module 2) ===== */
.cmp-mount { margin: 2rem 0 1rem; }
.cmp-loading, .cmp-error { color: var(--text-muted); font-size: .9rem; }
.cmp {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card-bg); padding: 1rem 1.1rem 1.1rem;
}

/* Contrôle : sélecteur d'axe */
.cmp-controls { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; margin-bottom: .85rem; }
.cmp-ctrl-lbl {
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.cmp-select {
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--text);
  background: var(--ocean-deep); border: 1px solid var(--border); border-radius: 8px;
  padding: .42rem .7rem; cursor: pointer; max-width: 100%;
}
.cmp-select:hover { border-color: var(--teal); }
.cmp-select:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--teal); }

/* Légende */
.cmp-legend {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .8rem;
  padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.cmp-chip { font-size: .76rem; color: var(--text-muted); white-space: nowrap; }
.cmp-chip b { font-size: .95rem; margin-right: .12rem; }

.cmp-cumul {
  margin-left: auto; font-size: .7rem; font-weight: 700; color: #cf9b1f;
  background: rgba(214,158,46,.14); border-radius: 5px; padding: .12rem .5rem; white-space: nowrap;
}

/* Tableau : 1re colonne (groupe) collante + défilement horizontal sur mobile */
.cmp-scroll { overflow-x: auto; margin-top: .7rem; }
.cmp-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.cmp-table th, .cmp-table td {
  border-bottom: 1px solid var(--border); padding: .5rem .65rem;
  text-align: center; font-size: .86rem;
}
.cmp-table thead th {
  font-size: .74rem; font-weight: 700; color: var(--text); line-height: 1.25;
  vertical-align: bottom; border-bottom: 2px solid var(--border);
}
/* Colonne « Groupe » collante à gauche (défilement horizontal des caractères).
   z-index 3 > cases (auto) : masque les colonnes qui glissent dessous. */
.cmp-corner, .cmp-group {
  position: sticky; left: 0; z-index: 3; text-align: left; white-space: nowrap;
  background: var(--card-bg); box-shadow: 1px 0 0 var(--border);
}
.cmp-group { font-weight: 600; color: var(--text); }
.cmp-emoji { margin-right: .4rem; }
.article img.cmp-ico, .cmp-ico { display: inline-block; width: 1.6rem; height: 1.25rem; max-width: none; object-fit: contain; border-radius: 0; margin-right: .55rem; vertical-align: middle; opacity: .85; }
[data-theme="dark"] .cmp-ico { filter: invert(1); opacity: .8; }
.cmp-credit { margin: .4rem 0 0; font-size: .72rem; color: var(--text-muted); text-align: right; }
.cmp-group a { color: var(--text); text-decoration: none; border-bottom: 1px solid transparent; }
.cmp-group a:hover { color: var(--teal-light); border-bottom-color: var(--teal); }
.cmp-table tbody tr:hover td,
.cmp-table tbody tr:hover th { background: var(--ocean-light); }

/* Cases : présence en vert saillant, absence estompée pour laisser lire les ✓ */
.cmp-cell { font-weight: 700; cursor: default; }
.cmp-cell[title] { cursor: help; }

/* Indice de défilement (affiché seulement quand le tableau déborde) */
.cmp-hint { margin-top: .4rem; font-size: .72rem; color: var(--text-muted); text-align: right; }
.cmp-hint[hidden] { display: none; }

/* Encart détail (commentaire du groupe pour l'axe courant) */
.cmp-detail {
  margin-top: .7rem; font-size: .84rem; line-height: 1.5; color: var(--text);
  background: var(--ocean-deep); border: 1px solid var(--border);
  border-radius: 9px; padding: .55rem .8rem;
}
.cmp-detail-grp { font-weight: 700; color: var(--teal-light); }
.cmp-detail-hint { color: var(--text-muted); font-style: italic; }

@media (max-width: 620px) {
  .cmp { padding: .85rem .7rem 1rem; }
  .cmp-controls { gap: .35rem; }
  .cmp-select { width: 100%; }
  .cmp-cumul { margin-left: 0; }
  .cmp-table th, .cmp-table td { padding: .45rem .5rem; font-size: .82rem; }
  /* noms sur 2 lignes plutôt qu'une colonne très large qui force le scroll */
  .cmp-group { white-space: normal; max-width: 40vw; }
}

/* ══════════════════════════════════════════════════════════════════════════
   L'arbre du vivant (page-feature du module « Classer le vivant »)

   Deux vues du même arbre, servies par static/js/arbre.js depuis
   ressources/arbre-evolution.json. Tout est préfixé `arbre-` sauf les classes
   internes aux SVG (n-box, edge, endo, dia…), qui ne vivent que dans ces deux
   dessins et ne peuvent donc pas entrer en collision.
   ══════════════════════════════════════════════════════════════════════════ */
.arbre-mount {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  margin: 1.5rem 0 0;
}
.arbre-loading { color: var(--text-muted); font-style: italic; }
.arbre-error {
  color: var(--error-text, var(--error));
  background: var(--error-bg); border: 1px solid var(--error);
  border-radius: var(--radius); padding: .9rem 1.1rem;
}

/* Jeton propre à la feature : la couleur des calques écologiques. Elle ne doit
   entrer en concurrence ni avec le turquoise (nœuds reconstruits), ni avec le
   corail (endosymbioses), ni avec le bleu (hypothèses). */
:root { --arbre-layer: #ffb870; --arbre-endo2: #c9a0ea; }
[data-theme="light"], [data-theme="livre"], [data-theme="liseuse"] { --arbre-layer: #a5620c; --arbre-endo2: #7a3f9c; }

/* ── Sélecteur de vue : un contrôle segmenté, neutre (l'orange reste aux calques) ── */
.arbre-views { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin-bottom: .75rem; }
.arbre-seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--card-bg); border: 1px solid var(--border);
}
.arbre-seg button {
  font-family: inherit; font-size: .86rem; font-weight: 600; line-height: 1.2;
  padding: .4rem .95rem; border-radius: 999px; cursor: pointer; border: 0;
  background: transparent; color: var(--text-muted);
  transition: background-color .15s ease-out, color .15s ease-out;
}
.arbre-seg button:hover { color: var(--text); }
.arbre-seg button[aria-pressed="true"] { background: var(--text); color: var(--card-bg); }
.arbre-seg button:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.arbre-views-hint { font-size: .78rem; color: var(--text-muted); }
.arbre-views-hint:empty { display: none; }
.arbre-views-note { font-size: .78rem; line-height: 1.5; color: var(--text-muted); margin-top: .6rem; }

/* ── Calques : interrupteurs ; leur pastille reprend le cadre orange des groupes allumés ── */
.arbre-layers { display: flex; flex-direction: column; gap: .7rem; margin-bottom: .9rem; }
.arbre-layers-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.arbre-layers-lbl { font-size: .84rem; font-weight: 600; color: var(--text-muted); margin-right: .3rem; }
.arbre-layers button {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: inherit; font-size: .84rem; font-weight: 600; line-height: 1.2;
  padding: .38rem .8rem .38rem .62rem; border-radius: 999px; cursor: pointer;
  background: var(--card-bg); color: var(--text-muted); border: 1px solid var(--border);
  transition: background-color .15s ease-out, color .15s ease-out, border-color .15s ease-out;
}
.arbre-layers button::before {   /* au repos : case vide et neutre ; l'orange n'apparaît qu'allumé */
  content: ""; width: .62rem; height: .62rem; border-radius: 3px; flex: none;
  border: 1.5px solid color-mix(in srgb, var(--text-muted) 70%, transparent); box-sizing: border-box;
}
.arbre-layers button:hover { color: var(--text); border-color: var(--arbre-layer); }
.arbre-layers button[aria-pressed="true"] {
  background: var(--arbre-layer); border-color: var(--arbre-layer); color: var(--card-bg);
}
.arbre-layers button[aria-pressed="true"]::before { background: var(--card-bg); border-color: var(--card-bg); }
.arbre-layers button:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.arbre-layer-note {
  background: color-mix(in srgb, var(--arbre-layer) 8%, var(--ocean-mid));
  border: 1px solid color-mix(in srgb, var(--arbre-layer) 45%, var(--border)); border-radius: 8px;
  padding: .85rem 1.05rem; display: flex; flex-direction: column; gap: .35rem;
}
.arbre-layer-note .head { display: flex; flex-wrap: wrap; gap: .55rem; align-items: baseline; }
.arbre-layer-note .head b { font-size: .95rem; }
.arbre-layer-note .head .st {
  font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .16rem .5rem; border-radius: 4px;
  background: var(--arbre-layer); color: var(--ocean-deep);
}
.arbre-layer-note .head .st[data-st="clade"] { background: var(--teal); }
.arbre-layer-note .head .cnt { font-size: .78rem; color: var(--text-muted); }
.arbre-layer-note p { font-size: .93rem; line-height: 1.6; margin: 0; }

/* ── Vue « Schéma » : fenêtre navigable ───────────────────────────────────── */
.arbre-pane[hidden] { display: none; }
/* Le gabarit d'article fait 1460 px pour une colonne de 800 : le schéma reprend
   une partie de ce mou. Le débordement est UNILATÉRAL — vers la droite, là où
   l'espace est libre — car un débordement à gauche passe sous le sommaire. Il
   est borné pour ne jamais dépasser la marge de page. */
#arbre-root { margin-right: calc(-1 * clamp(0px, (100vw - 1200px) / 2, 300px)); }

.arbre-stage {
  position: relative; overflow: hidden; touch-action: none; cursor: grab;
  /* Sans ça, glisser la carte surligne le texte du schéma (bleu sur Safari). */
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  height: min(80vh, 900px); min-height: 240px;   /* ajustée par arbre.js à la proportion du schéma */
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.arbre-stage:active { cursor: grabbing; }
.arbre-stage-inner { transform-origin: 0 0; will-change: transform; }
.arbre-stage-inner svg { display: block; width: 1620px; height: auto; }
.arbre-stage-ctl { position: absolute; right: .6rem; bottom: .6rem; display: flex; gap: .3rem; }
.arbre-stage-ctl--top { top: .6rem; bottom: auto; }
.arbre-stage-ctl button {
  width: 2.1rem; height: 2.1rem; border-radius: 8px; cursor: pointer;
  background: var(--card-bg); border: 1px solid var(--border); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  transition: border-color .15s ease, color .15s ease;
}
.arbre-stage-ctl button:hover { border-color: var(--teal); color: var(--teal); }
.arbre-stage-ctl button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.arbre-stage-ctl button svg { display: block; }

#arbre-root.is-fullscreen {
  position: fixed; inset: 0; z-index: 200; margin: 0;
  width: auto; max-width: none;
  background: var(--ocean-deep);
  padding: 1rem 1.2rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: .7rem;
}
#arbre-root.is-fullscreen .arbre-pane {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
}
/* Sans ceci, la règle ci-dessus l'emporte sur `[hidden]` par spécificité et la
   vue masquée continue d'occuper sa hauteur. */
#arbre-root.is-fullscreen .arbre-pane[hidden] { display: none; }
#arbre-root.is-fullscreen .arbre-stage { height: auto; flex: 1 1 auto; min-height: 0; }
#arbre-root.is-fullscreen .arbre-col { max-width: 620px; }
#arbre-root.is-fullscreen .arbre-layer-note { padding: .5rem .8rem; }
#arbre-root.is-fullscreen .arbre-layer-note p { font-size: .82rem; line-height: 1.45; }
body.arbre-fullscreen { overflow: hidden; }

/* ── Vue « Arbre » : composition verticale ────────────────────────────────── */
/* La colonne est composée pour ~340 unités de large. Étirée sur toute la largeur
   d'un pane de 1100 px, elle rendrait des libellés de 30 px : on la plafonne à
   une largeur de lecture et on la centre. */
.arbre-col {
  display: block; width: 100%; max-width: 500px; margin: 0 auto; height: auto;
  /* #arbre-root déborde à droite (marge négative) pour donner de l'air au schéma :
     on recentre la colonne sur la colonne de texte, pas sur cette largeur élargie. */
  position: relative; left: calc(-.5 * clamp(0px, (100vw - 1200px) / 2, 300px));
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem;
}

/* ── Marques communes aux deux dessins ────────────────────────────────────── */
#arbre-root .n-box     { fill: var(--card-bg); stroke: var(--border); stroke-width: 1.3; }
#arbre-root .n-box--k  { fill: var(--card-bg); stroke: var(--teal);   stroke-width: 2.2; }
#arbre-root .n-box--h  { fill: var(--card-bg); stroke: var(--ocean-bright); stroke-width: 1.2; stroke-dasharray: 3 3; }
#arbre-root .n-box--e  { fill: var(--card-bg); stroke: var(--coral);  stroke-width: 2; }
#arbre-root .edge      { fill: none; stroke: var(--text);        stroke-width: 1.5; stroke-linecap: round; }
#arbre-root .edge--h   { fill: none; stroke: var(--ocean-bright); stroke-width: 1.3; stroke-dasharray: 3 4; }
#arbre-root .edge--x   { fill: none; stroke: var(--text-muted);  stroke-width: 1.2; stroke-dasharray: 4 4; opacity: .7; }
#arbre-root .endo      { fill: none; stroke: var(--coral); stroke-width: 2.3; stroke-dasharray: 7 5; stroke-linecap: round; }
/* Primaire en corail, secondaire en violet : deux couleurs franches, parce que
   la nuance de pointillé ne se voyait pas. Le rang reste écrit sur chaque
   flèche — la couleur n'est donc jamais seule à porter le sens. */
#arbre-root .endo--2,
#arbre-root .endo-grp--p2 .endo { stroke: var(--arbre-endo2); }
#arbre-root .mk-endo2 { fill: var(--arbre-endo2); }
#arbre-root text.vt-e--2,
#arbre-root .endo-grp--p2 text.endo-t,
#arbre-root .endo-grp--p2 text.sub { fill: var(--arbre-endo2); }
/* La glose du nitroplaste appartient à sa flèche : en gris, elle se lirait
   comme une note du décor, détachée du tracé qu'elle explique. */
#arbre-root .endo-grp--nitro text.sub { fill: var(--coral); }
#arbre-root .mk-endo   { fill: var(--coral); }
#arbre-root .mk-hyp    { fill: var(--ocean-bright); }
#arbre-root .dia       { fill: var(--ocean-bright); }
#arbre-root .fus       { fill: var(--card-bg); stroke: var(--teal); stroke-width: 2.5; }
#arbre-root .qb        { fill: var(--card-bg); stroke: var(--ocean-bright); stroke-width: 1.5; }
#arbre-root .lg-box    { fill: var(--ocean-mid); stroke: var(--border); stroke-width: 1; }
#arbre-root .rail      { fill: none; stroke: var(--border); stroke-width: 1; }
#arbre-root .vt-rule   { stroke: var(--border); stroke-width: 1; }

#arbre-root text { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }
#arbre-root .lbl       { fill: var(--text); font-size: 12px;   font-weight: 600; }
#arbre-root .lbl-lg    { fill: var(--text); font-size: 13.5px; font-weight: 700; }
#arbre-root .lbl-dom   { fill: var(--text); font-size: 13px;   font-weight: 700; letter-spacing: .1em; }
#arbre-root .sub       { fill: var(--text-muted); font-size: 9.5px; }
#arbre-root .sub-sm    { fill: var(--text-muted); font-size: 8.5px; }
#arbre-root .sci       { fill: var(--text-muted); font-size: 8.5px; font-style: italic; }
#arbre-root .ext-t     { fill: var(--text-muted); font-size: 9.5px; font-style: italic; opacity: .8; }
#arbre-root .dagger    { fill: var(--text-muted); font-size: 11px; opacity: .8; }
#arbre-root .endo-t    { fill: var(--coral); font-size: 10px; font-weight: 600; }
#arbre-root .q-t       { fill: var(--ocean-bright); font-size: 9.5px; font-weight: 600; }
#arbre-root .qb-t      { fill: var(--ocean-bright); font-size: 10px; font-weight: 700; }
#arbre-root .eyebrow-s { fill: var(--ocean-bright); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
#arbre-root .rail-t    { fill: var(--text-muted); font-size: 9.5px; font-variant-numeric: tabular-nums; }
#arbre-root .vt-t      { fill: var(--text); font-size: 9px; font-weight: 700; }
#arbre-root .vt-s      { fill: var(--text-muted); font-size: 7.5px; }
#arbre-root .vt-a      { fill: var(--text-muted); font-size: 7.5px; font-variant-numeric: tabular-nums; }
#arbre-root .vt-e      { fill: var(--coral); font-size: 6.5px; font-weight: 700; }
/* Les étiquettes des flèches croisent les traits de l'arbre : un liseré couleur
   de fond les en détache, comme les noms de rue sur une carte. */
#arbre-root .vt-e { paint-order: stroke; stroke: var(--card-bg); stroke-width: 2.4px; stroke-linejoin: round; }
#arbre-root .vt-lt     { fill: var(--text-muted); font-size: 7.5px; }

/* ── Nœuds et calques ─────────────────────────────────────────────────────── */
#arbre-root .arbre-nd { cursor: pointer; transition: opacity .15s ease; }
#arbre-root .arbre-nd:focus { outline: none; }
#arbre-root .arbre-nd:hover rect, #arbre-root .arbre-nd:focus rect { stroke: var(--teal); stroke-width: 2.6; }

/* Sous calque actif, tout s'efface sauf les nœuds concernés et le squelette :
   sans les traits, des boîtes allumées ne diraient plus rien de leur dispersion. */
#arbre-root svg[data-layer] > *         { opacity: .16; }
#arbre-root svg[data-layer] > defs      { opacity: 1; }
#arbre-root svg[data-layer] > .edge     { opacity: .5; }
#arbre-root svg[data-layer] > .arbre-nd { opacity: .2; }
#arbre-root svg[data-layer] > .arbre-nd.on { opacity: 1; }
#arbre-root svg[data-layer] > .arbre-nd.trail { opacity: 1; }   /* ancêtres : allumés, sans cadre */
#arbre-root svg[data-layer] .arbre-nd.on rect { stroke: var(--arbre-layer); stroke-width: 2.8; }
/* Une endosymbiose ne se rallume que pour le calque qu'elle explique. */
#arbre-root svg[data-layer="algues"] > .endo-grp--p1,
#arbre-root svg[data-layer="algues"] > .endo-grp--p2,
#arbre-root svg[data-layer="euca"]   > .endo-grp--mito { opacity: 1; }
/* Le badge « ? » du schéma doit se signaler comme cliquable au survol. */
#arbre-root .arbre-nd:hover circle.qb, #arbre-root .arbre-nd:focus circle.qb {
  stroke-width: 2.6; stroke: var(--teal);
}

/* ── Fiche de détail ──────────────────────────────────────────────────────── */
.arbre-tip {
  /* Au-dessus du calque plein écran (200) : sinon la fiche s'ouvre derrière le
     schéma et paraît ne pas répondre. */
  position: fixed; z-index: 240; top: 0; left: 0;
  width: max-content; max-width: min(29rem, calc(100vw - 2rem));
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); padding: 1.05rem 1.25rem 1.15rem;
  pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s ease;
}
.arbre-tip[data-open="1"] { opacity: 1; visibility: visible; }
.arbre-tip.pinned { pointer-events: auto; }
.arbre-tip .kind {
  display: block; font-size: .64rem; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; line-height: 1; color: var(--text-muted);
}
.arbre-tip .kind[data-tone="hyp"] { color: var(--ocean-bright); }
.arbre-tip .kind[data-tone="key"] { color: var(--teal); }
.arbre-tip .kind[data-tone="evt"] { color: var(--coral); }
/* Le badge « ? » du schéma doit se signaler comme cliquable au survol. */

.arbre-tip h3 {
  font-size: 1.15rem; font-weight: 700; line-height: 1.25; text-wrap: balance;
  margin: .5rem 0 0; padding: 0 0 .7rem; border-bottom: 1px solid var(--border);
}
.arbre-tip .body { display: flex; flex-direction: column; gap: .7rem; margin-top: .8rem; }
.arbre-tip .body p { font-size: .95rem; line-height: 1.62; margin: 0; }
.arbre-tip .body p:first-child { font-size: 1rem; color: var(--text); }
.arbre-tip .key {
  margin: .9rem 0 0; padding: .1rem 0 .1rem .85rem;
  border-left: 2px solid var(--teal); font-size: .9rem; line-height: 1.55; color: var(--text-muted);
}
.arbre-tip .key[hidden] { display: none; }
.arbre-tip-close {
  display: none; position: absolute; top: .5rem; right: .55rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; cursor: pointer;
  background: var(--ocean-mid); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 1.1rem; line-height: 1; padding: 0;
}
.arbre-tip.sheet .arbre-tip-close, .arbre-tip.pinned .arbre-tip-close { display: block; }
.arbre-tip.pinned h3 { padding-right: 2rem; }
.arbre-tip.sheet {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none;
  border-radius: 16px 16px 0 0; border-width: 1px 0 0;
  pointer-events: auto; padding: 1.15rem 1.35rem 1.9rem;
  max-height: 66vh; overflow-y: auto;
}

@media (prefers-reduced-motion: reduce) {
  .arbre-tip, #arbre-root .arbre-nd { transition: none; }
}

/* ── Plein écran sur téléphone : le schéma d'abord ───────────────────────────
   Une ligne de commandes (vues + menu des calques), l'encadré replié sur son
   titre, et tout le reste de l'écran pour la scène. */
.arbre-layer-select, .arbre-note-toggle { display: none; }
@media (max-width: 760px) {
  #arbre-root.is-fullscreen { padding: .6rem .7rem; gap: .5rem; }
  #arbre-root.is-fullscreen .arbre-views { flex-wrap: nowrap; margin: 0; }
  #arbre-root.is-fullscreen .arbre-views-hint,
  #arbre-root.is-fullscreen .arbre-layers-row { display: none; }
  #arbre-root.is-fullscreen .arbre-layers { margin: 0; gap: 0; }
  #arbre-root.is-fullscreen .arbre-layer-select {
    display: block; margin-left: auto; min-width: 0; max-width: 55%;
    font-family: inherit; font-size: .8rem; font-weight: 600; color: var(--text);
    padding: .38rem .6rem; border-radius: 999px; cursor: pointer;
    background: var(--card-bg); border: 1px solid var(--border);
  }
  #arbre-root.is-fullscreen .arbre-layer-note { padding: .45rem .5rem .45rem .8rem; gap: .3rem; }
  #arbre-root.is-fullscreen .arbre-layer-note .head { align-items: center; flex-wrap: nowrap; }
  #arbre-root.is-fullscreen .arbre-layer-note .head b {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem;
  }
  /* Le compte se lit déjà sur le schéma allumé ; sur une ligne de 360 px, il
     tronquerait le nom du calque. */
  #arbre-root.is-fullscreen .arbre-layer-note .head .cnt { display: none; }
  #arbre-root.is-fullscreen .arbre-layer-note .head .st { flex-shrink: 0; }
  #arbre-root.is-fullscreen .arbre-layer-note:not(.open) p { display: none; }
  #arbre-root.is-fullscreen .arbre-note-toggle {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    margin-left: auto; width: 2rem; height: 2rem; padding: 0; border-radius: 8px; cursor: pointer;
    background: transparent; border: 1px solid transparent; color: var(--text-muted);
  }
  #arbre-root.is-fullscreen .arbre-note-toggle svg { transition: transform .2s ease; }
  #arbre-root.is-fullscreen .arbre-layer-note.open .arbre-note-toggle svg { transform: rotate(180deg); }
}

@media (max-width: 760px) {
  .arbre-stage { height: min(64vh, 520px); }
  .arbre-layer-note { padding: .7rem .85rem; }
  .arbre-layer-note p { font-size: .85rem; line-height: 1.5; }
  .arbre-layers button, .arbre-seg button { font-size: .8rem; }
  .arbre-tip.sheet { max-height: 52vh; padding: .9rem 1.1rem 1.5rem; }
  .arbre-tip.sheet h3 { font-size: 1rem; padding-bottom: .5rem; }
  .arbre-tip.sheet .body { gap: .5rem; margin-top: .6rem; }
  .arbre-tip.sheet .body p { font-size: .87rem; line-height: 1.5; }
  .arbre-tip.sheet .body p:first-child { font-size: .92rem; }
  .arbre-tip.sheet .key { font-size: .84rem; margin-top: .6rem; }
}

/* ===== Retouches lire.plongee.bio ===== */
::selection { background: color-mix(in srgb, var(--teal) 28%, transparent); color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
html { scrollbar-color: var(--border) transparent; }
.article-body a { text-underline-offset: .18em; }

.logo-sub { color: var(--text-muted); font-weight: 500; }
@media (max-width: 420px) { .logo-sub { display: none; } }
/* Téléphone : « Lire » suivi du domaine en petit, à la place de « · Plongée Bio ». */
.logo-domain { display: none; }
@media (max-width: 420px) {
  .logo-domain {
    display: inline; margin-left: .05em;
    font-size: .58em; font-weight: 500; letter-spacing: 0; color: var(--text-muted);
  }
}

.theme-toggle .ic { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Sommaire : chiffres du parcours, sous-articles */
.learn-stats {
  margin-top: .9rem; font-size: .88rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.learn-subarticles { margin-left: 1.5rem; border-left: 1px solid var(--border); }
.learn-subarticle { padding-top: .3rem; padding-bottom: .3rem; }
.learn-subarticle .learn-article-title { font-size: .95rem; color: var(--text-muted); }
.learn-subarticle:hover .learn-article-title { color: var(--text); }
.learn-module { scroll-margin-top: calc(var(--header-h, 70px) + 1rem); }

/* Article : méta à gauche, taille du texte à droite */
.reading-tools { justify-content: space-between; gap: .75rem 1rem; letter-spacing: normal; word-spacing: normal; }
.article-meta { margin: 0; font-size: .88rem; color: var(--text-muted); }
.article-meta a { color: var(--teal-light); }

/* ===== Impression ===== */
@media print {
  :root, [data-theme] {
    --text: #111; --text-muted: #444; --teal-light: #111; --border: #bbb;
    --ocean-deep: #fff; --card-bg: #fff;
  }
  body { background: #fff; }
  .site-header, .site-footer, .article-sidebar, .side-results,
  .article-drawer-backdrop, .article-onthispage, .text-size,
  .article-pager, .article-report, .learn-search, .learn-results, .gloss-pop { display: none !important; }
  .article-layout { display: block; }
  .article { max-width: none; padding: 0; margin: 0; font-size: 11pt; }
  .article-body a { color: inherit; text-decoration: none; }
  .gloss { border-bottom: 0; }
  .article-body h2, .article-body h3 { break-after: avoid; }
  .article-body p, .article-body li { orphans: 3; widows: 3; }
  .article-body hr { display: none; }
  .learn-article-go { display: none; }
}

/* ===== Choix de la police de lecture ===== */

/* ===== Thème sombre : confort de lecture longue =====
   Un texte quasi blanc sur fond presque noir (16,9:1) produit un halo qui fatigue,
   surtout avec un serif aux déliés fins. On vise ~12:1 pour le corps et un peu plus
   pour les titres (hiérarchie conservée), sur un fond légèrement relevé, avec
   une graisse allégée : un texte clair sur fond sombre paraît plus gras. */
[data-theme="dark"] {
  --ocean-deep: #0c1622;
  --read-text: #c8d2d8;      /* 11,8:1 sur --ocean-deep */
  --read-heading: #dde6ea;
  --read-weight: 380;
  --read-strong: 620;
}
.article { color: var(--read-text, var(--text)); font-weight: var(--read-weight, 400); }
.article h1, .article h2, .article h3 { color: var(--read-heading, var(--text)); }
.article strong, .article b { font-weight: var(--read-strong, 700); color: var(--read-heading, inherit); }
[data-theme="dark"] .article { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
/* OpenDyslexic n'existe qu'en 400/700 : pas d'allègement possible. */
[data-theme="dark"][data-font="dyslexie"] { --read-weight: 400; --read-strong: 700; }

/* ===== Thèmes « papier » : Livre et Liseuse =====
   Livre : papier ivoire chaud (type papier bouffant crème), encre brun-noir.
   Liseuse : encre électronique — gris perle mat, encre quasi noire, AUCUNE couleur
   dans le texte, ni ombre ni animation (l'e-ink ne connaît ni l'un ni l'autre).
   Les deux justifient le texte avec césure française, comme un livre ou un Kobo. */
[data-theme="livre"] {
  --ocean-deep:   #f5eddb;   /* page */
  --ocean-mid:    #ece1c8;   /* en-tête, surfaces */
  --ocean-light:  #e1d3b3;
  --teal:         #2c6457;
  --teal-light:   #2c6457;   /* liens : 5,9:1 */
  --sand:         #5a4b34;
  --text:         #33291a;   /* 12,2:1 */
  --text-muted:   #6b5d45;   /* 5,5:1 */
  --card-bg:      #faf4e6;
  --border:       #dccdaa;
  --shadow:       0 6px 22px rgba(70,50,20,.14);
  --read-text:    #33291a;
  --read-heading: #241c10;
}
[data-theme="liseuse"] {
  --ocean-deep:   #ebeae5;
  --ocean-mid:    #e2e1db;
  --ocean-light:  #d6d5ce;
  --teal:         #1f1f1d;
  --teal-light:   #1f1f1d;
  --coral:        #1f1f1d;
  --sand:         #3a3a37;
  --text:         #1f1f1d;   /* 13,7:1 */
  --text-muted:   #55554f;   /* 6,2:1 */
  --card-bg:      #f2f1ed;
  --border:       #c9c8c0;
  --shadow:       none;
  --read-text:    #1f1f1d;
  --read-heading: #111110;
}
[data-theme="liseuse"] *, [data-theme="liseuse"] *::before, [data-theme="liseuse"] *::after {
  transition: none !important; animation: none !important; box-shadow: none !important;
}
[data-theme="liseuse"] .gloss { border-bottom-style: dotted; border-bottom-color: var(--text-muted); }
[data-theme="liseuse"] .toc-link.is-current, [data-theme="liseuse"] .otp-list a.active { font-weight: 700; }
[data-theme="liseuse"] ::selection { background: #c9c8c0; }
 [data-theme="liseuse"] .side-results { border-color: var(--text); }
[data-theme="livre"] .article, [data-theme="liseuse"] .article {
  -webkit-font-smoothing: auto;
}
[data-theme="livre"] .article-body p, [data-theme="livre"] .article-body li,
[data-theme="liseuse"] .article-body p, [data-theme="liseuse"] .article-body li {
  text-align: justify; hyphens: auto; -webkit-hyphens: auto;
  hyphenate-limit-chars: 7 3 3;   /* pas de césure sur les mots courts */
}

/* ===== Choix du thème (en-tête) ===== */

.theme-toggle .ic { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.theme-toggle[aria-expanded="true"] { border-color: var(--teal); }

.tp-option {
  display: flex; align-items: center; gap: .7rem;
  padding: .5rem .6rem; border-radius: 8px; cursor: pointer;
}
.tp-option:hover { background: var(--ocean-mid); }
.tp-option input { position: absolute; opacity: 0; pointer-events: none; }
.tp-option:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: -2px; }
.tp-option:has(input:checked) .tp-swatch { outline: 2px solid var(--teal); outline-offset: 2px; }
.tp-swatch {
  flex-shrink: 0; width: 2.4rem; height: 2.4rem; border-radius: 8px;
  display: grid; place-items: center;
  font: 600 1.05rem/1 "Literata", Georgia, serif; border: 1px solid rgba(0,0,0,.15);
}

.tp-name { font-size: .95rem; font-weight: 600; color: var(--text); }

.nowrap { white-space: nowrap; }

/* ===== Réglage fin du thème : luminosité du fond et contraste de l'encre =====
   Posés par le panneau Thème sur <html>, de -1 à 1 :
     --paper-k : fond mélangé vers le blanc (> 0) ou le noir (< 0) ;
     --ink-k   : encre mélangée vers --ink-max, noir ou blanc selon le thème
                 (> 0, « plus net »), ou vers la couleur du fond (< 0, « plus doux »).
   color-mix() plutôt que la syntaxe relative oklch(from …), mal prise en charge
   par Safari quand elle contient des calculs. */
:root { --paper-k: 0; --ink-k: 0; --ink-max: #000; }
[data-theme="dark"] { --ink-max: #fff; }
:root {
  --paper: color-mix(in oklab,
    color-mix(in oklab, var(--ocean-deep), #fff calc(max(0, var(--paper-k)) * 100%)),
    #000 calc(max(0, -1 * var(--paper-k)) * 100%));
}
body { background: var(--paper); }
.article {
  color: color-mix(in oklab,
    color-mix(in oklab, var(--read-text, var(--text)), var(--ink-max) calc(max(0, var(--ink-k)) * 100%)),
    var(--paper) calc(max(0, -1 * var(--ink-k)) * 100%));
}
.article h1, .article h2, .article h3, .article strong, .article b {
  color: color-mix(in oklab,
    color-mix(in oklab, var(--read-heading, var(--text)), var(--ink-max) calc(max(0, var(--ink-k)) * 100%)),
    var(--paper) calc(max(0, -1 * var(--ink-k)) * 100%));
}

.tune { padding: .2rem .6rem .5rem; }

.tune-reset {
  background: none; border: 0; padding: .3rem .2rem; cursor: pointer;
  font: 500 .76rem/1 inherit; font-family: inherit; color: var(--teal-light);
  text-decoration: underline; text-underline-offset: .2em;
}
.tune-row {
  display: grid; grid-template-columns: 3rem auto 1fr auto; align-items: center;
  gap: .45rem; padding: .35rem 0;
}
.tune-label { font-size: .85rem; font-weight: 600; color: var(--text); }
.tune-end { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.tune-row input[type="range"] { width: 100%; min-width: 4rem; accent-color: var(--teal); }
@media (max-width: 420px) { .tune-end { display: none; } .tune-row { grid-template-columns: 3rem 1fr; } }
@media print {
  body { background: #fff !important; }
  .article, .article h1, .article h2, .article h3, .article strong, .article b { color: #111 !important; }
}

/* ===== Menus repliables et plein écran (articles) ===== */
.dock-btn {
  display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem;
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.dock-btn:hover { color: var(--text); border-color: var(--border); background: var(--card-bg); }
.dock-btn:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; }
.dock-btn svg {
  width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* Bouton de repli sur la même ligne que ce qu'il replie : à droite de la
   recherche (sommaire, côté gauche), à gauche du titre « Sur cette page ». */
.side-top {                       /* reste visible quand le sommaire défile */
  display: flex; align-items: center; gap: .4rem; margin: 0 .5rem 0 1.1rem; padding: 1.6rem 0 .7rem; flex: none;
  border-bottom: 1px solid transparent;
}
.side-top .side-search { flex: 1 1 auto; min-width: 0; margin: 0; }
.article-sidebar .dock-hide { display: inline-grid; flex-shrink: 0; }
.article-sidebar { display: flex; flex-direction: column; }
.article-onthispage { display: grid; grid-template-columns: auto 1fr; align-items: center; align-content: start; column-gap: .2rem; }
.article-onthispage #onthispage { display: contents; }
.article-onthispage .dock-hide { grid-column: 1; grid-row: 1; }
.article-onthispage { padding-left: .3rem; padding-right: .3rem; }   /* l'anneau de focus du bouton n'est pas rogné par le défilement */
.article-onthispage .otp-head { grid-column: 2; grid-row: 1; margin: 0; padding-left: .2rem; }
.article-onthispage .otp-list { grid-column: 1 / -1; grid-row: 2; margin-top: .55rem; }

.dock-rail { display: none; position: sticky; top: 4.4rem; padding-top: 1.6rem; flex: 0 0 auto; }
html[data-dock-left="off"] .article-sidebar,
html[data-dock-right="off"] .article-onthispage { display: none; }
html[data-dock-left="off"] .dock-rail-left,
html[data-dock-right="off"] .dock-rail-right { display: block; }

/* Écrans où ces menus n'existent pas sous cette forme : pas de bouton de repli. */
@media (max-width: 1100px) { .dock-rail-right, html[data-dock-right="off"] .dock-rail-right { display: none; } }
@media (max-width: 900px) {
  .dock-rail, html[data-dock-left="off"] .dock-rail-left, .article-sidebar .dock-hide { display: none; }
  .side-top { position: static; background: none; margin-right: 1.1rem; }   /* tiroir : pas de bouton de repli */
  html[data-dock-left="off"] .article-sidebar { display: flex; }   /* le tiroir mobile reste disponible */
}

/* Plein écran / mode concentration : le texte seul. */
.focus-exit { display: none; }
.reading-focus .site-footer, .reading-focus .article-sidebar,
.reading-focus .article-onthispage, .reading-focus .dock-rail,
.reading-focus .article-report, .reading-focus .article-drawer-backdrop { display: none !important; }
.reading-focus .article-layout { display: block; max-width: none; }
.reading-focus .article-layout > .article { max-width: 720px; padding-top: 3.2rem; }
.reading-focus .focus-exit {
  display: inline-flex; align-items: center; gap: .4rem;
  position: fixed; top: .9rem; right: .9rem; z-index: 200;
  padding: .4rem .7rem; border-radius: 9px; cursor: pointer;
  font: 600 .8rem/1 'Segoe UI', system-ui, sans-serif;
  color: var(--text-muted); background: var(--card-bg); border: 1px solid var(--border);
  opacity: .55; transition: opacity .2s;
}
.reading-focus .focus-exit:hover, .reading-focus .focus-exit:focus-visible { opacity: 1; color: var(--text); }
.focus-exit svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media print { .dock-btn, .dock-rail, .focus-exit { display: none !important; } }

/* ===== Largeur des lignes (mesure) =====
   Exprimée en `ch` de la police de lecture : la colonne suit la taille du texte
   (A−/A+) et la police choisie, au lieu d'une largeur fixe en pixels qui
   allongeait les lignes quand on réduisait le texte. Normale ≈ 70 caractères
   par ligne, dans la zone confortable (65-75) de la lecture longue. */
:root { --measure: 58ch; }
html[data-measure="etroite"] { --measure: 50ch; }
html[data-measure="large"]   { --measure: 71ch; }
.article-layout > .article,
.reading-focus .article-layout > .article { max-width: calc(var(--measure) + 3rem); }   /* + padding latéral */
@media (max-width: 900px) { .article-layout > .article { max-width: calc(var(--measure) + 3rem); } }

.seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .2rem;
  margin: .1rem .5rem .5rem; padding: .2rem;
  background: var(--ocean-mid); border-radius: 9px;
}
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: .38rem .3rem; border-radius: 7px;
  font-size: .8rem; font-weight: 600; color: var(--text-muted);
}
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--card-bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 1px; }

/* Outils de lecture : même hauteur, même rayon, mêmes bordures, alignés. */

/* Outils de lecture : place stable, quelle que soit la taille du texte.
   (La colonne, mesurée en ch, rétrécit avec A− : les outils ne doivent pas
   passer à la ligne pour autant.) Grand écran : à droite, la méta s'enroule.
   Téléphone : toujours sur leur propre ligne. */
.reading-tools { flex-wrap: nowrap; align-items: center; }
.reading-tools .article-meta { flex: 1 1 auto; min-width: 0; }

@media (max-width: 600px) {
  .reading-tools { flex-wrap: wrap; }
  .reading-tools .article-meta { flex-basis: 100%; }
}

/* ===== Réglages de lecture (roue crantée de l'en-tête) ===== */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.settings { position: relative; }
.settings-toggle[aria-expanded="true"] { border-color: var(--teal); background: var(--ocean-light); }
.settings-toggle .ic { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.settings-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 130;
  width: min(360px, calc(100vw - 1rem));
  max-height: calc(100dvh - var(--header-h, 70px) - 1rem); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
  padding: .9rem 1rem 1rem; font-family: 'Segoe UI', system-ui, sans-serif;
}
.settings-panel[hidden] { display: none; }
.sp-head { margin: 0 0 .2rem; font-size: 1rem; font-weight: 700; }
.sp-sec { border: 0; margin: 0; padding: .85rem 0 0; min-width: 0; }
.sp-sec + .sp-sec { border-top: 1px solid var(--border); margin-top: .85rem; }
.sp-title { display: block; padding: 0; margin: 0 0 .55rem; font-size: .78rem; font-weight: 700; color: var(--text-muted); }
.sp-title-row { display: flex; align-items: baseline; justify-content: space-between; }
.sp-inline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sp-inline .sp-title { margin: 0; }

/* Thèmes : 4 vignettes */
.sp-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.tp-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; cursor: pointer; }
.tp-option input { position: absolute; opacity: 0; pointer-events: none; }
.tp-swatch {
  width: 100%; aspect-ratio: 1 / .78; border-radius: 10px;
  display: grid; place-items: center;
  font: 600 1.15rem/1 "Literata", Georgia, serif; border: 1px solid rgba(0,0,0,.15);
}
.tp-name { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.tp-option:hover .tp-name, .tp-option:has(input:checked) .tp-name { color: var(--text); }
.tp-option:has(input:checked) .tp-swatch { outline: 2px solid var(--teal); outline-offset: 2px; }
.tp-option:has(input:focus-visible) .tp-swatch { outline: 2px solid var(--teal); outline-offset: 4px; }

/* Polices : grille 2 × 2, chaque nom dans sa police */
.sp-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.sp-font {
  position: relative; display: flex; flex-direction: column; gap: .2rem;
  padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sp-font:hover { background: var(--ocean-mid); }
.sp-font input { position: absolute; opacity: 0; pointer-events: none; }
.sp-font:has(input:checked) { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.sp-font:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 2px; }
.sp-font-name { font-size: 1.02rem; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-font-sub { font-size: .72rem; line-height: 1.3; color: var(--text-muted); }

/* Taille : A− 100 % A+ */
.sp-inline .text-size { align-items: center; }
.ts-value { min-width: 3.4rem; text-align: center; font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-inline .ts-btn { padding: .4rem .7rem; }

.settings-panel .seg { margin: 0; }
.settings-panel .tune-row { grid-template-columns: 2.8rem auto 1fr auto; }

/* Action plein écran */
.sp-action {
  width: 100%; display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--ocean-mid); color: var(--text); cursor: pointer;
  font: 600 .88rem/1.2 'Segoe UI', system-ui, sans-serif; text-align: left;
}
.sp-action:hover { border-color: var(--teal); }
.sp-action svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.sp-action .ic-exit, .reading-focus .sp-action .ic-enter { display: none; }
.reading-focus .sp-action .ic-exit { display: block; }
.sp-action-label { flex: 1; }
.sp-action kbd {
  font: 500 .7rem/1 'Segoe UI', system-ui, sans-serif; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 5px; padding: .2rem .35rem; background: var(--card-bg);
}

@media (max-width: 600px) {
  .settings-panel { position: fixed; left: .5rem; right: .5rem; width: auto; top: calc(var(--header-h, 64px) + .4rem); }
}

/* Plein écran : l'en-tête se réduit à « Quitter » + la roue crantée, en haut à droite. */
.reading-focus .site-header {
  position: fixed; top: .7rem; right: .7rem; left: auto; z-index: 200;
  padding: 0; background: none; border: 0; gap: 0;
}
.reading-focus .site-header .logo, .reading-focus .site-nav, .reading-focus .nav-burger { display: none !important; }
.reading-focus .header-actions { gap: .4rem; }
.reading-focus .focus-exit { position: static; display: inline-flex; height: 2.2rem; }
.reading-focus .settings-toggle { background: var(--card-bg); opacity: .6; transition: opacity .2s; }
.reading-focus .settings-toggle:hover, .reading-focus .settings-toggle[aria-expanded="true"],
.reading-focus .settings-toggle:focus-visible { opacity: 1; }
.reading-focus .settings-panel { max-height: calc(100dvh - 4rem); }
/* <legend> se pose sur la bordure du fieldset : on le fait flotter pour qu'il
   se comporte comme un titre ordinaire, sous le trait de séparation. */
fieldset.sp-sec > legend.sp-title { float: left; width: 100%; }
fieldset.sp-sec > legend.sp-title + * { clear: both; }
@media (max-width: 420px) { .settings-panel .tune-row { grid-template-columns: 2.8rem 1fr; } }
/* Choix actif des segments : teinte d'accent, lisible dans tous les thèmes. */
.seg input:checked + span {
  background: color-mix(in srgb, var(--teal) 16%, var(--card-bg));
  color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 55%, transparent);
}

/* ===== Pages À propos / Mentions légales (sur le modèle d'obs.plongee.bio) ===== */
.page-wrap { max-width: 1080px; margin: 0 auto; padding: 3rem 1.5rem 4.5rem; }
.page-head h1 { font-size: clamp(2.1rem, 6vw, 3rem); line-height: 1.05; letter-spacing: -.02em; }
.page-head p { color: var(--text-muted); margin-top: .6rem; font-size: 1.05rem; }
.about-grid { display: grid; gap: 2.5rem; margin-top: 2.2rem; align-items: start; }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 4rem; } }
.about-prose h2 { font-size: 1.4rem; margin: 2.2rem 0 .7rem; }
.about-prose h2:first-child { margin-top: 0; }
.about-prose p { color: var(--text); line-height: 1.65; max-width: 62ch; margin: 0 0 .9rem; }
.about-prose a { color: var(--teal-light); text-decoration: underline; text-underline-offset: .18em; }
.auteur { display: flex; align-items: center; gap: 1.2rem; margin: .3rem 0 1.4rem; }
.auteur__photo { width: 140px; height: 140px; flex: none; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--card-bg); box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.auteur__ligne { margin: 0 !important; font-size: 1.05rem; }
@media (max-width: 520px) { .auteur { flex-direction: column; align-items: flex-start; } .auteur__photo { width: 120px; height: 120px; } }
.about-quote { margin: 0; padding: .2rem 0 .2rem 1.3rem; border-left: 1px solid var(--border);
  font-family: var(--read-font); }
.about-quote p { font-size: 1.12rem; line-height: 1.6; }
.about-quote .about-quote__end { margin-top: 1.3em; }
.about-legal { margin-top: 2rem !important; font-size: .92rem; color: var(--text-muted) !important; }

.contact {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.5rem; box-shadow: var(--shadow);
}
.contact h2 { font-size: 1.35rem; }
.contact__hint { color: var(--text-muted); font-size: .92rem; line-height: 1.5; margin: .4rem 0 1.3rem; }
.contact .field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.contact label { font-size: .88rem; font-weight: 600; }
.input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--paper); border: 1px solid var(--border); border-radius: 9px; padding: .6rem .75rem;
}
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 20%, transparent); }
.input[aria-invalid="true"] { border-color: var(--error); }
.textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
.contact__err { color: var(--error); font-size: .85rem; font-weight: 600; }
.contact__err:empty { display: none; }
.contact__cnt { justify-self: end; color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.contact__trap { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.2rem; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--teal); color: #fff; font: 600 .95rem/1 'Segoe UI', system-ui, sans-serif;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: progress; }
[data-theme="liseuse"] .btn { background: var(--text); color: var(--ocean-deep); }
.contact__status { margin-top: .9rem; font-weight: 600; font-size: .92rem; }
.contact__status:empty { display: none; }
.contact__status.ok { color: var(--teal-light); }
.contact__status.ko { color: var(--error); }
.contact__status a { color: inherit; }

.legal__body { max-width: 72ch; margin-top: 2rem; }
.legal__list { margin: 0 0 1rem; display: grid; gap: .3rem 1.5rem; }
.legal__list dt { font-weight: 700; margin-top: .6rem; }
.legal__list dd { margin: 0; color: var(--text); line-height: 1.6; }
@media (min-width: 700px) { .legal__list { grid-template-columns: 13em minmax(0, 1fr); } .legal__list dt { margin-top: 0; } }
.about-links { margin: 0 0 .9rem 1.2rem; padding: 0; line-height: 1.65; max-width: 62ch; }
.about-links li { margin: .25rem 0; }

/* Sans les boutons d'outils, la méta n'a plus besoin d'un grand dégagement :
   on rapproche le premier intertitre du chapeau (titre + méta). */
.reading-tools { margin-bottom: 0; }
.article-body > :first-child { margin-top: .6rem; }
.article-body > h2:first-child { margin-top: .5em; }

/* Téléphone : pas de plein écran (peu utile sur un petit écran, absent sur iPhone). */
/* … ni de largeur des lignes : l'écran est déjà plus étroit que la colonne. */
@media (max-width: 600px) { .sp-sec-focus, .sp-sec-measure { display: none; } }

/* Module réduit à un lien (Introduction) : même aspect qu'un titre de module, sans triangle. */
.toc-module-link { display: block; margin-bottom: .2rem; text-decoration: none; }
.toc-module-link::before { content: none; }
.toc-module-link:hover { background: var(--card-bg); text-decoration: none; }
.toc-module-link.is-current { color: var(--teal-light); background: var(--card-bg); }

/* Liens vers les autres sites Plongée Bio, avec leur icône. */

/* Bouton mobile « Autres sites » : icône de sortie (lien externe) à la place du burger.
   Sur mobile, le menu ne propose que les autres sites ; le sommaire passe par le
   logo (et « ☰ Sommaire » sur les articles), « À propos » par le pied de page. */
.nav-burger { align-items: center; justify-content: center; padding: 0; color: var(--text); }
.nav-burger svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Logo : l'icône de Lire (tuile encre, livre ouvert), comme les tuiles d'obs et de Trip Compta. */
.logo-icon { width: 2rem; height: 2rem; max-width: none; border-radius: 8px; }
[data-theme="dark"] .logo-icon { box-shadow: 0 0 0 1px rgba(255,255,255,.14); }

/* Burger du sommaire (articles, petits écrans) : à gauche du titre du site,
   il ouvre le tiroir du sommaire. Remplace l'ancien bouton « ☰ Sommaire ». */
.toc-burger {
  display: none; flex-shrink: 0; width: 2.4rem; height: 2.2rem; margin-right: -.4rem;
  align-items: center; justify-content: center; padding: 0; cursor: pointer;
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 9px;
}
.toc-burger svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.toc-burger[aria-expanded="true"] { border-color: var(--teal); background: var(--ocean-light); }
@media (max-width: 900px) { .toc-burger { display: inline-flex; } }
.reading-focus .toc-burger { display: none !important; }
@media (max-width: 900px) { .article-layout > .article { padding-top: 1.4rem; } }

/* Accueil : le sommaire n'existe qu'en tiroir (petits écrans), la page étant
   elle-même le sommaire sur grand écran. */
@media (min-width: 901px) { .article-sidebar.drawer-only, .drawer-only ~ .article-drawer-backdrop { display: none !important; } }

/* ===== Autres sites Plongée Bio : bouton de sortie + bulle, sur toutes les tailles =====
   (même formalisme sur obs, algo-deco et Trip Compta, cf. docs/entete-commune.md) */
.nav-burger.sites-toggle { display: inline-flex; }
.sites { position: relative; }
.sites-toggle[aria-expanded="true"] { border-color: var(--teal); background: var(--ocean-light); }
.sites-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 130;
  min-width: 220px; padding: .5rem;
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
}
.sites-panel[hidden] { display: none; }
.sites-title { margin: 0; padding: .35rem .8rem .25rem; font-size: .75rem; font-weight: 700; color: var(--text-muted); }
.site-link {
  display: flex; align-items: center; gap: .55rem; padding: .6rem .8rem; border-radius: 8px;
  color: var(--text); font-size: .95rem; text-decoration: none;
}
.site-link:hover { background: var(--ocean-light); text-decoration: none; }
.site-link img { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; }
/* Petits écrans : la barre Sommaire / À propos disparaît (logo, ☰ et pied de page y mènent). */
@media (max-width: 860px) { .site-nav { display: none !important; } }
.reading-focus .sites { display: none; }

/* Réglages sur smartphone : rien ne doit dépasser, même avec un texte agrandi
   (réglage de taille de police d'Android). Les grilles peuvent rétrécir
   (minmax(0, …)), les libellés passent à la ligne au lieu d'élargir le panneau. */
.settings-panel { overflow-x: hidden; }
.sp-themes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sp-fonts  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sp-font, .tp-option { min-width: 0; }
.sp-font-name { white-space: normal; overflow-wrap: anywhere; }
.tp-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-title-row { flex-wrap: wrap; gap: .2rem .8rem; }
.settings-panel .tune-row input[type="range"] { min-width: 0; }
.sp-inline { flex-wrap: wrap; gap: .5rem 1rem; }
.settings-panel .seg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .settings-panel { left: .5rem; right: .5rem; width: auto; max-width: calc(100vw - 1rem); }
}
/* En-tête compressible (texte agrandi, écran étroit) : le logo cède la place
   aux boutons, qui gardent leur taille ; le nom se coupe proprement. */
.site-header > button, .header-actions { flex-shrink: 0; }
.logo { min-width: 0; overflow: hidden; }
.logo-icon { flex-shrink: 0; }
.logo-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bulles du glossaire fermées : hors mise en page (display:none). Invisibles mais
   présentes, elles élargissaient la page à droite ; Chrome Android agrandissait
   alors toute la page (panneaux fixes compris). Fondu conservé à l'ouverture. */
.gloss-pop { display: none; }
.gloss:hover .gloss-pop, .gloss:focus .gloss-pop, .gloss:focus-visible .gloss-pop { display: block; }
@starting-style { .gloss:hover .gloss-pop, .gloss:focus .gloss-pop { opacity: 0; } }
/* Garde-fou : aucun débordement horizontal ne doit élargir la page. */
html, body { overflow-x: clip; }

/* ===== Atelier : préparer un poster (/atelier/poster) ===== */
.pz-page { max-width: 1240px; }
.pz { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1.5rem; margin-top: 2rem; align-items: start; }
.pz-h { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 .7rem; }
.pz-h--sub { margin-top: 1.3rem; }
.pz-pick, .pz-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.2rem 1.2rem;
}
.pz-side { position: sticky; top: 5.5rem; }
.pz-card { max-height: calc(100vh - 7rem); overflow: auto; }

/* Outils */
.pz-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .9rem; padding-bottom: .9rem; border-bottom: 1px solid var(--border); }
.pz-search {
  flex: 1 1 16rem; display: flex; align-items: center; gap: .45rem; padding: 0 .75rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--ocean-deep); color: var(--text-muted);
}
.pz-search:focus-within { border-color: var(--teal); }
.pz-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: .9rem; padding: .5rem 0; outline: none; }
#pz-preset {
  font: inherit; font-size: .85rem; color: var(--text); background: var(--ocean-deep);
  border: 1px solid var(--border); border-radius: 999px; padding: .45rem .8rem; max-width: 100%;
}
.pz-btns, .pz-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.pz-btn {
  font-family: inherit; font-size: .8rem; font-weight: 600; color: var(--text-muted); cursor: pointer;
  background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: .4rem .85rem;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.pz-btn:hover { color: var(--text); border-color: var(--teal); }
.pz-btn:focus-visible, .pz-caret:focus-visible, .pz-o-x:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.pz-btn:disabled { opacity: .55; cursor: progress; }
.pz-btn--primary { background: var(--teal); border-color: var(--teal); color: var(--ocean-deep); }
.pz-btn--primary:hover { color: var(--ocean-deep); filter: brightness(1.08); }
.pz-import { position: relative; overflow: hidden; }
.pz-import input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pz-import:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }

/* Arbre à cocher */
.pz-tree, .pz-kids { list-style: none; margin: 0; padding: 0; }
.pz-kids { display: none; margin-left: .62rem; padding-left: .75rem; border-left: 1px solid var(--border); }
.pz-node.open > .pz-kids { display: block; }
.pz-node[hidden] { display: none; }
.pz-row { display: flex; align-items: center; gap: .35rem; padding: .18rem .3rem; border-radius: 7px; }
.pz-row:hover { background: var(--ocean-mid); }
.pz-caret {
  width: 1.4rem; height: 1.4rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; color: var(--text-muted); cursor: pointer; border-radius: 5px;
  transition: transform .15s ease, color .15s ease;
}
.pz-caret:hover { color: var(--teal); }
.pz-node.open > .pz-row .pz-caret { transform: rotate(90deg); }
.pz-caret.is-leaf { cursor: default; }
.pz-row input[type="checkbox"] { width: 1.05rem; height: 1.05rem; flex-shrink: 0; margin: 0; accent-color: var(--teal); cursor: pointer; }
.pz-row label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .45rem; flex: 1 1 auto; min-width: 0; cursor: pointer; padding: .12rem 0; }
.pz-name { font-weight: 600; font-size: .92rem; color: var(--text); }
.pz-latin { font-style: italic; font-size: .8rem; color: var(--text-muted); }
.pz-rank { font-size: .7rem; color: var(--text-muted); }
.pz-sub { margin-left: auto; padding-left: .5rem; font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--teal-light); white-space: nowrap; }
.pz-node.is-path > .pz-row .pz-name { color: var(--text-muted); }
.pz-node.is-hit > .pz-row { background: color-mix(in srgb, var(--teal) 14%, transparent); }
.pz-loading, .pz-empty { color: var(--text-muted); font-size: .88rem; }

/* Panneau : compte, actions, aperçu */
.pz-count { font-size: .95rem; color: var(--text-muted); margin: 0 0 .8rem; }
.pz-count b { font-size: 1.5rem; color: var(--text); font-variant-numeric: tabular-nums; margin-right: .15rem; }
.pz-status { min-height: 1.3em; margin: .6rem 0 0; font-size: .8rem; color: var(--text-muted); }
.pz-status.is-dirty { color: var(--coral); }
.pz-outline, .pz-outline ul { list-style: none; margin: 0; padding: 0; }
.pz-outline ul { margin-left: .45rem; padding-left: .6rem; border-left: 1px solid var(--border); }
.pz-o-row { display: flex; align-items: center; gap: .3rem; padding: .08rem 0; }
.pz-o-name { font-size: .84rem; color: var(--text); }
.pz-outline li.is-path > .pz-o-row .pz-o-name { color: var(--text-muted); font-style: italic; }
.pz-o-x {
  margin-left: auto; width: 1.3rem; height: 1.3rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; padding: 0; border-radius: 5px; color: var(--text-muted); cursor: pointer; opacity: 0;
}
.pz-o-row:hover .pz-o-x, .pz-o-x:focus-visible { opacity: 1; }
.pz-o-x:hover { color: var(--coral); }
.pz-legend { margin: .8rem 0 0; font-size: .74rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }
.pz-dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; }
.pz-dot--path { border: 1.5px dashed var(--text-muted); }

@media (hover: none) { .pz-o-x { opacity: 1; } }
@media (max-width: 960px) {
  .pz { grid-template-columns: 1fr; }
  .pz-side { position: static; order: -1; }
  .pz-card { max-height: none; }
  .pz-outline { max-height: 16rem; overflow: auto; }
}

.pz-print { margin: .4rem 0 0; font-size: .8rem; color: var(--text-muted); }
.pz-print a { color: var(--teal-light); text-underline-offset: .18em; }

/* ===== Reprise de lecture et marque-lignes (static/js/marques.js) ===== */
/* Signet dans la marge : discret au survol, toujours en filigrane au doigt. */
.article-body .mk-host { position: relative; }
.mk-btn {
  position: absolute; left: -2.1rem; top: .12em; width: 1.6rem; height: 1.6rem; padding: .2rem;
  display: grid; place-items: center; border: 0; border-radius: 6px; background: none; cursor: pointer;
  color: var(--text-muted); opacity: 0; transition: opacity .18s ease-out, color .18s, background-color .18s;
  font: inherit; line-height: 1;
}
.mk-btn svg { width: 100%; height: 100%; }
.article-body li.mk-host > .mk-btn { left: calc(-2.1rem - 1.3em); }
.mk-host:hover > .mk-btn, .mk-btn:focus-visible { opacity: .6; }
.mk-btn:hover { opacity: 1 !important; color: var(--teal-light); background: var(--ocean-mid); }
.mk-btn:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; }
@media (hover: none) { .mk-btn { opacity: .28; } }
@media (max-width: 700px) {
  .mk-btn { left: -1.5rem; width: 1.35rem; height: 1.35rem; padding: .15rem; }
  .article-body li.mk-host > .mk-btn { left: calc(-1.5rem - 1.3em); }
}
/* Paragraphe marqué : surligné comme au feutre, signet plein en marge. */
.mk-host.is-marked {
  background: color-mix(in srgb, var(--teal) 13%, transparent);
  box-shadow: 0 0 0 .3em color-mix(in srgb, var(--teal) 13%, transparent);
  border-radius: 3px;
}
.mk-host.is-marked > .mk-btn { opacity: 1; color: var(--teal-light); }
.mk-host.mk-flash { animation: mk-flash 1.6s ease-out; }
@keyframes mk-flash {
  0%, 20% { box-shadow: 0 0 0 .3em color-mix(in srgb, var(--teal) 35%, transparent); background: color-mix(in srgb, var(--teal) 22%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .mk-btn { transition: none; } .mk-host.mk-flash { animation: none; } }
@media print { .mk-btn, .resume-bar { display: none !important; } .mk-host.is-marked { background: none; box-shadow: none; } }

/* « Mes marques » dans la colonne « Sur cette page ». */
.article-onthispage .otp-marks { grid-column: 1 / -1; margin-top: 1.4rem; }
.otp-marks .otp-marks-head { padding-left: 0; margin-bottom: .5rem; }
.otp-marks-list { list-style: none; margin: 0; padding: 0; }
.otp-marks-list a {
  display: grid; grid-template-columns: .9rem 1fr; gap: .45rem; align-items: start;
  padding: .3rem .4rem; border-radius: 6px; font-size: .8rem; line-height: 1.35; color: var(--text-muted); text-decoration: none;
}
.otp-marks-list a svg { width: .9rem; height: .9rem; margin-top: .1rem; color: var(--teal-light); }
.otp-marks-list a:hover { color: var(--text); background: var(--ocean-mid); }
.otp-marks-lost { font-size: .76rem; line-height: 1.4; color: var(--text-muted); margin: .5rem 0 0 .4rem; }
.otp-marks-lost button { font: inherit; color: var(--teal-light); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* Invitation « Reprendre à … » : en bas, centrée, jamais de saut automatique. */
.resume-bar {
  position: fixed; left: 50%; bottom: 1.1rem; z-index: 60; transform: translate(-50%, 1.5rem); opacity: 0;
  display: flex; align-items: center; gap: .15rem; max-width: calc(100vw - 2rem);
  padding: .3rem; border-radius: 999px; background: var(--card-bg); border: 1px solid var(--border);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.08);
  font-family: 'Segoe UI', system-ui, sans-serif; transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .25s;
}
.resume-bar.is-in { transform: translate(-50%, 0); opacity: 1; }
.resume-go {
  display: flex; align-items: center; gap: .55rem; min-width: 0; padding: .45rem .9rem .45rem .7rem;
  border: 0; border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; text-align: left;
}
.resume-go > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-go svg { width: 1.05rem; height: 1.05rem; flex: none; color: var(--teal-light); }
.resume-k { font-weight: 700; }
.resume-go:hover { background: var(--ocean-mid); }
.resume-x {
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem; flex: none; border: 0; border-radius: 50%;
  background: none; color: var(--text-muted); cursor: pointer;
}
.resume-x svg { width: 1rem; height: 1rem; }
.resume-x:hover { background: var(--ocean-mid); color: var(--text); }
.resume-go:focus-visible, .resume-x:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { .resume-bar { transition: none; } }

/* Sommaire et accueil : en cours (demi-disque) / lu (coche). */
.read-state { display: inline-block; flex: none; width: .55rem; height: .55rem; margin-left: .45rem; vertical-align: .1em; border-radius: 50%; }
.read-state.is-reading { border: 1.5px solid var(--teal); background: linear-gradient(90deg, var(--teal) 50%, transparent 50%); }
.read-state.is-read {
  width: .75rem; height: .75rem; border-radius: 0; background: var(--teal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Accueil : carte « Reprendre la lecture ». */
.resume-card {
  display: flex; align-items: center; gap: .9rem; margin: 0 0 1.6rem; padding: .85rem 1.1rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); color: var(--text); text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.resume-card:hover { border-color: var(--teal); }
.resume-card:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.resume-card-ico svg { width: 1.3rem; height: 1.3rem; color: var(--teal-light); display: block; }
.resume-card-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.resume-card-k { font-weight: 700; color: var(--teal-light); }
.resume-card-t { font-weight: 600; }
.resume-card-h { font-size: .85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resume-card-go { color: var(--text-muted); }

/* ===== Compte lecteur (lecteur.js) ===== */
.compte { position: relative; }
.compte-btn {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card-bg); cursor: pointer;
}
.compte-btn:hover, .compte-btn[aria-expanded="true"] { border-color: var(--teal); }
.compte-btn:focus-visible, .compte-login:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.avatar {
  display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: 50%;
  background: var(--av, #1f7a6d); color: #fff; font: 700 .72rem/1 'Segoe UI', system-ui, sans-serif; letter-spacing: .02em;
}
.compte-menu {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 70; min-width: 13rem; padding: .4rem;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 34px -14px rgba(0,0,0,.35); font-family: 'Segoe UI', system-ui, sans-serif;
}
.compte-menu-nom { margin: 0; padding: .45rem .7rem .55rem; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.compte-menu a, .compte-menu button {
  display: block; width: 100%; text-align: left; padding: .5rem .7rem; border-radius: 8px; border: 0; background: none;
  font: inherit; font-size: .9rem; color: var(--text); text-decoration: none; cursor: pointer;
}
.compte-menu a:hover, .compte-menu button:hover { background: var(--ocean-mid); }
.compte-menu form { margin: 0; }
.compte-login {
  display: inline-flex; align-items: center; gap: .4rem; height: 2.4rem; padding: 0 .8rem; border-radius: 999px;
  color: var(--text-muted); text-decoration: none; font: 500 .88rem 'Segoe UI', system-ui, sans-serif;
  border: 1px solid transparent;
}
.compte-login:hover { color: var(--text); border-color: var(--border); background: var(--card-bg); text-decoration: none; }
.compte-login svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
@media (max-width: 600px) { .compte-login-txt { display: none; } .compte-login { padding: 0; width: 2.4rem; justify-content: center; } }
.reading-focus .compte, .reading-focus .compte-login { display: none; }
@media print { .compte, .compte-login, .statut-btn, .suivi-invite { display: none !important; } }

/* Statut de l'article : une pastille, trois états en boucle. */
.statut-btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .32rem .8rem .32rem .55rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text-muted); cursor: pointer;
  font: 500 .85rem 'Segoe UI', system-ui, sans-serif; transition: border-color .15s, color .15s, background-color .15s;
}
.statut-btn:hover { border-color: var(--teal); color: var(--text); }
.statut-btn:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.statut-ico { width: .95rem; height: .95rem; border-radius: 50%; border: 1.6px solid currentColor; flex: none; }
.statut-btn.is-en_cours { color: var(--teal-light); border-color: color-mix(in srgb, var(--teal) 45%, var(--border)); }
.statut-btn.is-en_cours .statut-ico { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.statut-btn.is-lu { color: #fff; background: var(--teal); border-color: var(--teal); }
.statut-btn.is-lu .statut-ico {
  border: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (prefers-reduced-motion: reduce) { .statut-btn { transition: none; } }
.suivi-invite { display: inline-flex; align-items: center; gap: .3em; color: var(--teal-light); text-decoration: none; white-space: nowrap; }
.suivi-invite svg { width: .95em; height: .95em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.suivi-invite:hover { text-decoration: underline; text-underline-offset: .2em; }

/* Note d'un paragraphe : bulle en marge (sous le signet), indépendante de la marque. */
.nt-btn {
  position: absolute; left: -2.1rem; top: 1.95em; width: 1.6rem; height: 1.6rem; padding: .22rem;
  display: grid; place-items: center; border: 0; border-radius: 6px; background: none; cursor: pointer;
  color: var(--text-muted); opacity: 0; transition: opacity .18s ease-out, color .18s, background-color .18s; font: inherit; line-height: 1;
}
.nt-btn svg { width: 100%; height: 100%; }
.article-body li.mk-host > .nt-btn { left: calc(-2.1rem - 1.3em); }
.mk-host:hover > .nt-btn, .nt-btn:focus-visible { opacity: .6; }
.nt-btn:hover { opacity: 1 !important; color: var(--teal-light); background: var(--ocean-mid); }
.nt-btn:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; }
.mk-host.has-note > .nt-btn { opacity: 1; color: var(--teal-light); }
@media (hover: none) { .nt-btn { opacity: .28; } }
@media (max-width: 700px) {
  .nt-btn { left: -1.5rem; width: 1.35rem; height: 1.35rem; padding: .17rem; top: 1.75em; }
  .article-body li.mk-host > .nt-btn { left: calc(-1.5rem - 1.3em); }
}
@media (prefers-reduced-motion: reduce) { .nt-btn { transition: none; } }
@media print { .nt-btn { display: none !important; } }
/* La note elle-même : toujours visible sous son paragraphe, un clic pour la modifier. */
.mk-note {
  display: flex; gap: .5em; align-items: flex-start; width: 100%; margin-top: .6em; padding: .5em .75em; text-align: left;
  border: 0; border-radius: 8px; cursor: text; color: var(--text);
  font: italic .86em/1.5 var(--read-font); background: color-mix(in srgb, var(--teal) 9%, var(--card-bg));
}
.mk-note svg { width: 1.05em; height: 1.05em; flex: none; margin-top: .2em; color: var(--teal-light); font-style: normal; }
.mk-note:hover { background: color-mix(in srgb, var(--teal) 14%, var(--card-bg)); }
.mk-note:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.mk-host.has-note:not(.is-marked) { border-radius: 3px; }
.mk-pop {
  display: block; margin: .7em 0 .2em; padding: .75rem .8rem .7rem; border-radius: 10px;
  background: var(--card-bg); border: 1px solid var(--border); box-shadow: 0 10px 28px -16px rgba(0,0,0,.4);
  font-family: 'Segoe UI', system-ui, sans-serif; font-style: normal;
}
.mk-pop-lbl { display: block; font-size: .8rem; font-weight: 700; margin-bottom: .4rem; color: var(--text); }
.mk-pop-lbl span { font-weight: 400; color: var(--text-muted); }
.mk-pop textarea {
  width: 100%; resize: vertical; min-height: 4.2rem; padding: .5rem .6rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--paper, #fff); color: var(--text); font: .92rem/1.45 'Segoe UI', system-ui, sans-serif;
}
.mk-pop textarea:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; }
.mk-pop-act { display: flex; align-items: center; gap: .4rem; margin-top: .55rem; flex-wrap: wrap; }
.mk-pop-sp { flex: 1; }
.mk-pop-act button { font: 600 .82rem 'Segoe UI', system-ui, sans-serif; padding: .4rem .8rem; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: none; color: var(--text); }
.mk-pop-act .mk-pop-ok { background: var(--teal); border-color: var(--teal); color: #fff; }
.mk-pop-act .mk-pop-del { border-color: transparent; color: var(--text-muted); padding-left: .2rem; text-decoration: underline; text-underline-offset: .2em; }
.mk-pop-act button:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; }
.otp-marks-list a > span { display: flex; flex-direction: column; gap: .15rem; }
.otp-m-n { font-style: italic; color: var(--text); opacity: .85; }

/* Page « Mon compte » */
.compte-page { max-width: 720px; }
.compte-head { display: flex; align-items: center; gap: 1.1rem; }
.avatar--lg { width: 3.6rem; height: 3.6rem; font-size: 1.25rem; flex: none; }
.cp-sec { margin-top: 2.2rem; }
.cp-sec h2 { font-size: 1.2rem; margin: 0 0 .7rem; }
.cp-stats { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 0 0 .9rem; padding: 0; }
.cp-stats li { padding: .55rem .9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); font-size: .92rem; color: var(--text-muted); }
.cp-stats b { color: var(--text); font-size: 1.1rem; margin-right: .2rem; font-variant-numeric: tabular-nums; }
.cp-muted { color: var(--text-muted); line-height: 1.55; }
.cp-small { font-size: .88rem; margin-top: .9rem; }
.cp-list { margin: 0 0 1.3rem 1.2rem; line-height: 1.7; }
.cp-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.cp-btn {
  display: inline-flex; align-items: center; padding: .6rem 1.05rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text); font: 600 .92rem 'Segoe UI', system-ui, sans-serif; text-decoration: none; cursor: pointer;
}
.cp-btn:hover { border-color: var(--teal); text-decoration: none; }
.cp-btn:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.cp-btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.cp-btn--danger { color: #a3341f; }
.cp-btn--danger:hover { border-color: #a3341f; }
[data-theme="dark"] .cp-btn--danger { color: #f0907a; }
.cp-status { min-height: 1.3em; margin-top: .5rem; font-size: .88rem; color: var(--text-muted); }
.compte-alerte { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; padding: .9rem 1.1rem; margin-bottom: 1.6rem;
  border: 1px solid color-mix(in srgb, #c2412d 45%, var(--border)); border-radius: 12px; background: color-mix(in srgb, #c2412d 7%, var(--card-bg)); }
.compte-alerte p { margin: 0; }

/* Accueil, visiteur : une ligne, l'argumentaire sous « Pourquoi ? ». */
.invite-compte {
  margin: 1.4rem 0 0; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 28%, var(--border));
  background: color-mix(in srgb, var(--teal) 6%, var(--card-bg));
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.invite-compte-line { display: flex; align-items: center; gap: .35rem .75rem; flex-wrap: wrap; padding: .55rem .5rem .55rem 1rem; }
.invite-compte-ico { width: 1.05rem; height: 1.05rem; flex: none; fill: var(--teal); }
.invite-compte-t { margin: 0; font-size: .95rem; font-weight: 600; color: var(--text); }
.invite-compte-why {
  border: 0; background: none; padding: .25rem .1rem; cursor: pointer; font: inherit; font-size: .9rem;
  color: var(--teal-light); text-decoration: underline; text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
.invite-compte-why:hover { text-decoration-color: currentColor; }
.invite-compte-why::after { content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .35em; vertical-align: .15em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
.invite-compte.is-open .invite-compte-why::after { transform: rotate(-135deg); vertical-align: -.05em; }
.invite-compte-go {
  margin-left: auto; padding: .42rem .95rem; border-radius: 8px; background: var(--teal); color: #fff;
  font-weight: 600; font-size: .88rem; text-decoration: none; white-space: nowrap;
}
.invite-compte-go:hover { background: color-mix(in srgb, var(--teal) 85%, #000); text-decoration: none; color: #fff; }
.invite-compte-x { width: 2rem; height: 2rem; display: grid; place-items: center; flex: none; border: 0; border-radius: 50%; background: none; color: var(--text-muted); cursor: pointer; }
.invite-compte-x svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.invite-compte-x:hover { background: var(--ocean-mid); color: var(--text); }
.invite-compte-why:focus-visible, .invite-compte-go:focus-visible, .invite-compte-x:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.invite-compte-plus { padding: .1rem 1rem .9rem 2.8rem; font-size: .9rem; color: var(--text-muted); }
.invite-compte-plus ul { margin: 0 0 .5rem; padding-left: 1.1rem; line-height: 1.65; }
.invite-compte-plus b { color: var(--text); font-weight: 600; }
.invite-compte-plus p { margin: 0; font-size: .84rem; }
@media (prefers-reduced-motion: reduce) { .invite-compte-why::after { transition: none; } }
@media (max-width: 560px) {
  /* Téléphone : message et fermeture en haut, « Pourquoi ? » et bouton dessous. */
  .invite-compte-line { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ico txt x" ". why go";
    align-items: center; gap: .3rem .6rem; padding: .7rem .5rem .75rem .9rem; }
  .invite-compte-ico { grid-area: ico; }
  .invite-compte-t { grid-area: txt; }
  .invite-compte-x { grid-area: x; }
  .invite-compte-why { grid-area: why; justify-self: start; }
  .invite-compte-go { grid-area: go; margin-left: 0; }
  .invite-compte-plus { padding-left: .9rem; }
}
}

/* Mon compte : marques et notes */
.cp-annot-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: .9rem; }
.cp-annot-head h2 { margin: 0; }
.cp-filtre { display: inline-flex; padding: .2rem; border-radius: 999px; background: var(--ocean-mid); }
.cp-filtre button {
  border: 0; background: none; padding: .35rem .85rem; border-radius: 999px; cursor: pointer;
  font: 600 .84rem 'Segoe UI', system-ui, sans-serif; color: var(--text-muted);
}
.cp-filtre button span { font-weight: 500; opacity: .75; margin-left: .15rem; font-variant-numeric: tabular-nums; }
.cp-filtre button.is-on { background: var(--card-bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.cp-filtre button:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; }
.cp-art { margin: 0 0 1.4rem; }
.cp-art h3 { font-size: 1rem; margin: 0 0 .4rem; }
.cp-art h3 a { color: var(--text); text-decoration: none; }
.cp-art h3 a:hover { color: var(--teal-light); text-decoration: underline; text-underline-offset: .2em; }
.cp-art ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.cp-it { border-bottom: 1px solid var(--border); }
.cp-it-link { display: grid; grid-template-columns: 2.4rem 1fr; gap: .5rem; padding: .7rem .4rem; color: var(--text); text-decoration: none; border-radius: 6px; }
.cp-it-link:hover { background: var(--ocean-mid); text-decoration: none; }
.cp-it-link:focus-visible { outline: 2px solid var(--teal-light); outline-offset: -2px; }
.cp-it-ico { display: flex; gap: .15rem; color: var(--teal-light); padding-top: .1rem; }
.cp-it-ico svg { width: 1rem; height: 1rem; }
.cp-it-txt { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.cp-it-ex { font-family: var(--read-font); font-size: .95rem; line-height: 1.5; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp-it.is-marque .cp-it-ex { color: var(--text); }
.cp-it-note { font: italic .92rem/1.5 var(--read-font); color: var(--text); padding: .35rem .6rem; border-radius: 6px;
  background: color-mix(in srgb, var(--teal) 9%, var(--card-bg)); white-space: pre-line; }
.cp-empty { margin-top: .5rem; }

/* Sommaire de l'accueil : modules pliables. */
/* Recherche et « tout déplier / replier » sur une même ligne. */
.learn-search-row { display: flex; align-items: center; gap: .5rem; margin-top: 1.4rem; }
.learn-search-row .learn-search { flex: 1; margin: 0; min-width: 0; }
.lm-all {
  flex: none; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card-bg); color: var(--text-muted);
}
.lm-all svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lm-all .lm-all-close, .lm-all[aria-pressed="true"] .lm-all-open { display: none; }
.lm-all[aria-pressed="true"] .lm-all-close { display: block; }
.lm-all:hover { border-color: var(--teal); color: var(--teal-light); }
.lm-all:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.learn-module:has(> details.lm) { margin-bottom: .2rem; }
.lm-sum {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .3rem 1rem;
  list-style: none; cursor: pointer; padding: .95rem .5rem .95rem 0; border-bottom: 1px solid var(--border);
}
.lm-sum::-webkit-details-marker { display: none; }
.lm-sum .learn-module-title { margin: 0; padding: 0; border: 0; }
.lm-meta { font: .82rem 'Segoe UI', system-ui, sans-serif; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lm-prog:not(:empty)::before { content: " · "; }
.lm-prog { color: var(--teal-light); }
.lm-chev { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease-out; }
details.lm[open] > .lm-sum .lm-chev { transform: rotate(180deg); }
.lm-sum:hover .learn-module-title { color: var(--text); }
.lm-sum:hover .lm-chev { stroke: var(--text); }
.lm-sum:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; border-radius: 6px; }
details.lm[open] > .lm-sum { border-bottom-color: transparent; }
details.lm[open] > .learn-articles { padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
@media (max-width: 560px) { .lm-sum { grid-template-columns: 1fr auto; } .lm-meta { grid-column: 1; grid-row: 2; white-space: normal; } .lm-chev { grid-row: 1 / span 2; grid-column: 2; } }
@media (prefers-reduced-motion: reduce) { .lm-chev { transition: none; } }

/* Connexion et bienvenue (sur lire même) */
.cx-page { max-width: 30rem; padding-top: 3.2rem; }
.cx-h { font-size: clamp(1.9rem, 6vw, 2.4rem); line-height: 1.1; letter-spacing: -.015em; margin: 0 0 .6rem; }
.cx-sub { color: var(--text-muted); line-height: 1.55; margin: 0 0 1.4rem; }
.cx-err { margin: 0 0 1rem; padding: .65rem .85rem; border-radius: 10px; font-size: .92rem;
  background: color-mix(in srgb, #c2412d 8%, var(--card-bg)); border: 1px solid color-mix(in srgb, #c2412d 40%, var(--border)); }
.cx-form { display: flex; flex-direction: column; gap: .55rem; }
.cx-lbl { font: 600 .9rem 'Segoe UI', system-ui, sans-serif; }
.cx-input {
  width: 100%; padding: .75rem .9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
  font: 1rem 'Segoe UI', system-ui, sans-serif;
}
.cx-input:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 1px; border-color: var(--teal); }
.cx-code { font-size: 1.5rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.cx-btn {
  display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; margin-top: .4rem;
  padding: .8rem 1rem; border-radius: 10px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
  font: 600 .98rem 'Segoe UI', system-ui, sans-serif; cursor: pointer; text-decoration: none;
}
.cx-btn:hover { border-color: var(--teal); text-decoration: none; }
.cx-btn:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.cx-btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.cx-btn--primary:hover { background: color-mix(in srgb, var(--teal) 85%, #000); color: #fff; }
.cx-google svg { width: 1.15rem; height: 1.15rem; }
.cx-or { display: flex; align-items: center; gap: .8rem; margin: 1.1rem 0 .3rem; color: var(--text-muted); font-size: .85rem; }
.cx-or::before, .cx-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.cx-small { margin-top: 1.2rem; font-size: .84rem; line-height: 1.5; color: var(--text-muted); }
.cx-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: 1rem; }
.cx-links form { margin: 0; }
.cx-link { display: inline-block; margin-top: .9rem; border: 0; background: none; padding: 0; cursor: pointer; font: 500 .9rem 'Segoe UI', system-ui, sans-serif;
  color: var(--teal-light); text-decoration: underline; text-underline-offset: .2em; }
.cx-links .cx-link { margin-top: 0; }
.cx-link:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.cx-demo { margin-top: 2rem; padding: 1rem 1.1rem; border: 1px dashed var(--border); border-radius: 12px; }
.cx-demo h2 { font-size: 1rem; margin: 0 0 .2rem; }
.cx-demo > p { margin: 0 0 .7rem; font-size: .85rem; color: var(--text-muted); }
.cx-demo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.cx-demo form { margin: 0; }
.cx-demo-btn { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text); text-align: left; cursor: pointer; font: .92rem 'Segoe UI', system-ui, sans-serif; }
.cx-demo-btn:hover { border-color: var(--teal); }
.cx-demo-btn:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.cx-demo-btn > span:last-child { display: flex; flex-direction: column; }
.cx-demo-btn > span:last-child span { font-size: .8rem; color: var(--text-muted); }

.ar-compte { margin: 0 0 .2rem; font-size: .9rem; color: var(--text-muted); line-height: 1.5; }
.ar-compte b { color: var(--text); }

/* .article p ajoute une marge basse : la ligne « N min de lecture » se décalait de la pastille. */
.article .reading-tools .article-meta { margin: 0; }

/* « Plein écran » dans la ligne d'information de l'article, à côté de la durée. */
.meta-fs { display: inline-flex; align-items: center; gap: .3em; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--teal-light); white-space: nowrap; }
.meta-fs svg { width: .95em; height: .95em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.meta-fs .ic-exit, .reading-focus .meta-fs .ic-enter { display: none; }
.reading-focus .meta-fs .ic-exit { display: inline; }
.meta-fs:hover .sp-action-label { text-decoration: underline; text-underline-offset: .2em; }
.meta-fs:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; border-radius: 3px; }
@media print { .meta-fs { display: none !important; } }
.meta-sep { margin: 0 .35em; }
@media (max-width: 600px) { .meta-fs-wrap { display: none; } }   /* plein écran : utile sur grand écran seulement */

/* Cadre de lecture plein écran (voir article.html) */
.fs-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; z-index: 9999; background: var(--paper, #fff); }
.side-top { transition: border-color .15s; }
.side-top.is-scrolled { border-bottom-color: var(--border); }

/* ===== Noms d'espèces : repère discret + bulle de liens (especes.js) ===== */
/* Repère choisi par Stef (planche, option F) : le nom reste en italique, dans l'encre
   de lecture, suivi d'une petite feuille verte en exposant ; jamais de soulignement. */
.article-body em.sp { cursor: pointer; border-radius: 3px; transition: color .15s, background-color .15s; }
.article-body em.sp::after {
  content: ""; display: inline-block; width: .55em; height: .55em; margin-left: .15em; vertical-align: .45em;
  background: var(--teal); opacity: .7; transition: opacity .15s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19C5 10 11 4 20 4c0 9-6 15-15 15zM5 19l8-8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19C5 10 11 4 20 4c0 9-6 15-15 15zM5 19l8-8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.article-body em.sp:hover::after, .article-body em.sp[aria-expanded="true"]::after { opacity: 1; }
[data-theme="dark"] .article-body em.sp::after { background: var(--teal-light); opacity: .85; }
[data-theme="liseuse"] .article-body em.sp::after { background: currentColor; opacity: .55; }
.article-body em.sp:hover, .article-body em.sp[aria-expanded="true"] {
  color: var(--teal-light); background: color-mix(in srgb, var(--teal) 10%, transparent);
  box-shadow: 0 0 0 .12em color-mix(in srgb, var(--teal) 10%, transparent);
}
.article-body em.sp:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.sp-pop {
  position: absolute; z-index: 80; width: max-content; max-width: min(20rem, calc(100vw - 16px));
  padding: .7rem .8rem .75rem; border-radius: 12px; background: var(--card-bg); border: 1px solid var(--border);
  box-shadow: 0 14px 34px -14px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.06);
  font-family: 'Segoe UI', system-ui, sans-serif; opacity: 0; transform: translateY(-3px); transition: opacity .15s ease-out, transform .15s ease-out;
}
.sp-pop.is-above { transform: translateY(3px); }
.sp-pop.is-in { opacity: 1; transform: none; }
.sp-pop-head { display: flex; flex-direction: column; gap: .05rem; }
.sp-pop-sci { font-family: var(--read-font); font-size: 1.02rem; font-weight: 600; color: var(--text); }
.sp-pop-fr { font-size: .88rem; color: var(--text); }
.sp-pop-meta { font-size: .76rem; color: var(--text-muted); margin-top: .15rem; }
.sp-pop-links { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.sp-pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .6rem .28rem .3rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--paper, #fff); color: var(--text); text-decoration: none; font-size: .82rem;
}
.sp-pill b { display: grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .25rem; border-radius: 999px;
  font-size: .68rem; font-weight: 800; letter-spacing: .01em; color: #fff; }
.sp-pill--doris b { background: #1d5c9c; }
.sp-pill--inat b { background: #74ac00; }
.sp-pill--bioobs b { background: #d9822b; }
.sp-pill--wiki b, .sp-pill--wiki_en b { background: #3b3b3b; font-family: Georgia, serif; }
.sp-pill--wiki_en b { font-size: .6rem; padding: 0 .35rem; }
.sp-pill:hover { border-color: var(--teal); text-decoration: none; }
.sp-pill:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .sp-pop, .article-body em.sp { transition: none; } }
@media print { .article-body em.sp::after, .sp-pop { display: none; } }


/* ===== Repères masqués (Réglages > Repères dans le texte) ===== */
[data-no-gloss] .article-body .gloss { border-bottom: 0; cursor: text; }
[data-no-gloss] .article-body .gloss-pop { display: none !important; }
[data-no-renvois] .article-body a[href^="/"] { color: inherit; text-decoration: none; }
[data-no-especes] .article-body em.sp { cursor: text; background: none !important; box-shadow: none !important; color: inherit !important; }
[data-no-especes] .article-body em.sp::after { display: none; }

.sp-check { display: flex; align-items: center; gap: .55rem; padding: .3rem 0; font: .9rem 'Segoe UI', system-ui, sans-serif; color: var(--text); cursor: pointer; }
.sp-check input { width: 1.05rem; height: 1.05rem; accent-color: var(--teal); flex: none; margin: 0; }
.sp-check small { color: var(--text-muted); font-size: .8rem; margin-left: .3rem; }
.sp-check--all { font-weight: 600; padding-bottom: .5rem; margin-bottom: .2rem; border-bottom: 1px solid var(--border); }
/* Signets des paragraphes d'un encadré : dans la marge de l'article, hors du cadre. */
.article blockquote > .mk-host > .mk-btn, .article blockquote > .mk-host > .nt-btn { left: calc(-2.1rem - 1.15em - 1px); }
@media (max-width: 700px) { .article blockquote > .mk-host > .mk-btn, .article blockquote > .mk-host > .nt-btn { left: calc(-1.5rem - 1.15em - 1px); } }

/* Tableaux comparatifs : repère de groupe comme les tuiles d'obs (disque teinté). */
.cmp-disc { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; flex: none; margin-right: .6rem; vertical-align: middle;
  border-radius: 50%; background: color-mix(in srgb, var(--gc) 16%, var(--card-bg)); font-size: 1.15rem; line-height: 1; font-style: normal; }
.article .cmp-disc img { width: 82%; height: 82%; max-width: none; object-fit: contain; border-radius: 0; }
[data-theme="liseuse"] .cmp-disc { background: transparent; border: 1px solid currentColor; filter: grayscale(1); }
/* Colonne « Groupe » : alignée à gauche, les disques forment une colonne régulière. */
.cmp-table th.cmp-corner, .cmp-table th.cmp-group { text-align: left; }
.cmp-table th.cmp-group { white-space: nowrap; }
.cmp-table th.cmp-group .cmp-disc { margin-right: .7rem; }

/* Tableaux : définitions de l'axe et des colonnes (champ « aides » des données). */
.cmp-axe-aide { margin: .5rem 0 0; font-size: .86rem; line-height: 1.45; color: var(--text-muted); }
.cmp-table th.cmp-th-aide { cursor: help; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, var(--text-muted) 60%, transparent); text-underline-offset: .25em; }
.cmp-table th.cmp-th-aide:focus-visible { outline: 2px solid var(--teal-light); outline-offset: -2px; }
.cmp-chip[title] { cursor: help; }

/* Tableaux comparatifs : filtre et tableaux empilés */
.cmp-filter { margin: 0 0 1rem; padding: 0 0 1rem; border-bottom: 1px solid var(--border); font-family: 'Segoe UI', system-ui, sans-serif; }   /* pas de carte dans la carte */
.cmp-filter-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .3rem 1rem; margin-bottom: .6rem; }
.cmp-filter-all { font-size: .82rem; color: var(--text-muted); }
.cmp-filter-all button { border: 0; background: none; padding: 0; font: inherit; color: var(--teal-light); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.cmp-filter-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.cmp-f { padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  font: .82rem 'Segoe UI', system-ui, sans-serif; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.cmp-f[aria-pressed="true"] { background: color-mix(in srgb, var(--teal) 13%, var(--card-bg)); border-color: color-mix(in srgb, var(--teal) 40%, var(--border)); color: var(--text); }
.cmp-f[aria-pressed="true"]::before { content: "✓ "; color: var(--teal-light); }
.cmp-f:focus-visible, .cmp-filter-all button:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.cmp-block { margin: 2rem 0 0; scroll-margin-top: 5rem; }
.cmp-block[hidden] { display: none; }
.cmp-h { font-size: 1.25rem; margin: 0 0 .25rem; }
.cmp-block .cmp-axe-aide { margin: 0 0 .7rem; }
.cmp-empty { color: var(--text-muted); font-style: italic; margin-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { .cmp-f { transition: none; } }
.cmp-h { margin-bottom: .1rem; }
.cmp-sous { margin: 0 0 .35rem; font-size: .95rem; color: var(--text-muted); }
.cmp-block .cmp-axe-aide { font-size: .8rem; font-style: italic; }

/* ===== Tableaux comparatifs : version compacte (retour de Stef + audit impeccable) ===== */
.cmp-table th, .cmp-table td { padding: .28rem .55rem; font-size: .84rem; line-height: 1.25; }
.cmp-table thead th { padding-top: .35rem; padding-bottom: .4rem; font-size: .74rem; }
.cmp-disc { width: 1.55rem; height: 1.55rem; font-size: .9rem; margin-right: .5rem; }
.cmp-table th.cmp-group .cmp-disc { margin-right: .5rem; }
.cmp-table th.cmp-group { font-size: .86rem; }
/* Colonnes internes : filet pointillé léger entre les colonnes de données. */
.cmp-table td + td, .cmp-table thead th + th:not(:nth-child(2)) {
  border-left: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
}
.cmp-cell span { font-size: .95rem; }
/* Défilement horizontal visible : ombre au bord qui cache des colonnes + barre fine. */
.cmp-scroll { position: relative; margin-top: .5rem; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  background:
    linear-gradient(to right, var(--card-bg) 30%, transparent) left / 2rem 100% no-repeat local,
    linear-gradient(to left, var(--card-bg) 30%, transparent) right / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.16), transparent) left / .9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.16), transparent) right / .9rem 100% no-repeat scroll;
}
.cmp-scroll::-webkit-scrollbar { height: 6px; }
.cmp-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.cmp-scroll .cmp-group, .cmp-scroll .cmp-corner { background: var(--card-bg); }
.cmp-more { display: none; margin: .3rem 0 0; font: .74rem 'Segoe UI', system-ui, sans-serif; color: var(--text-muted); text-align: right; }
.cmp-block.is-wide .cmp-more { display: block; }
.cmp-block { margin-top: 1.6rem; }
.cmp-detail { margin-top: .5rem; padding: .45rem .7rem; font-size: .82rem; }
.cmp-table th, .cmp-table td { padding-top: .18rem; padding-bottom: .18rem; line-height: 1.2; }
.cmp-disc { width: 1.4rem; height: 1.4rem; font-size: .82rem; }
@media (max-width: 620px) {
  .cmp-table th.cmp-group { white-space: nowrap; max-width: none; font-size: .8rem; }
  .cmp-disc { width: 1.25rem; height: 1.25rem; font-size: .74rem; margin-right: .35rem; }
  .cmp-table th, .cmp-table td { padding-left: .4rem; padding-right: .4rem; }
}

/* Téléphone : colonne « Groupe » réduite à l'icône (le nom reste lu par les lecteurs
   d'écran ; toucher une ligne l'affiche dans l'encadré). Plus de place pour les données. */
@media (max-width: 620px) {
  .cmp-table th.cmp-group, .cmp-table th.cmp-corner { width: 2.4rem; min-width: 0; padding-left: .3rem; padding-right: .3rem; text-align: center; }
  .cmp-table th.cmp-group .cmp-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cmp-table th.cmp-group .cmp-disc { margin: 0; width: 1.6rem; height: 1.6rem; font-size: .92rem; }
  .cmp-table th.cmp-corner { font-size: 0; }
  .cmp-table th.cmp-corner::after { content: ""; }
  .cmp-table th.cmp-group { cursor: pointer; }
}

/* Filtre des tableaux : replié derrière un bouton « Tableaux affichés · tous (17) », liste
   dépliée en colonnes régulières (impeccable : le contenu d'abord, pas un écran d'étiquettes). */
.cmp-filter-toggle {
  display: flex; align-items: center; gap: .4rem; width: 100%; padding: .65rem .8rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text); cursor: pointer;
  font: 600 .9rem 'Segoe UI', system-ui, sans-serif; text-align: left;
}
.cmp-filter-toggle b { font-weight: 500; color: var(--text-muted); margin-right: auto; }
.cmp-filter-toggle svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .2s; }
.cmp-filter-toggle:hover { border-color: var(--teal); }
.cmp-filter.is-open .cmp-filter-toggle svg { transform: rotate(180deg); }
.cmp-filter-toggle:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.cmp-filter-body { display: none; padding-top: .7rem; }
.cmp-filter.is-open .cmp-filter-body { display: block; }
.cmp-filter-body .cmp-ctrl-lbl { display: none; }
.cmp-filter-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .3rem; }
.cmp-f { text-align: left; border-radius: 8px; padding: .5rem .55rem; min-height: 2.6rem; line-height: 1.2; }
.cmp-filter { padding-bottom: .8rem; }
@media (max-width: 620px) { .cmp-filter-list { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .cmp-filter-toggle svg { transition: none; } }

/* Entre deux tableaux : la marge des titres d’article (1,8 em) ne s’applique pas. */
.article .cmp-h { margin: 0 0 .1rem; }
.cmp-block { margin-top: 1.4rem; }
/* Colonne « Groupe » figée : bord net et ombre dès que le tableau défile dessous. */
.cmp-table th.cmp-group, .cmp-table th.cmp-corner { position: sticky; left: 0; z-index: 3; background: var(--card-bg);
  box-shadow: inset -1px 0 0 var(--border); transition: box-shadow .15s; }
.cmp-scroll.is-scrolled .cmp-table th.cmp-group, .cmp-scroll.is-scrolled .cmp-table th.cmp-corner {
  box-shadow: inset -1px 0 0 var(--border), 6px 0 8px -6px rgba(0,0,0,.28); }
.cmp-table tbody tr:hover th.cmp-group { background: color-mix(in srgb, var(--ocean-light) 100%, var(--card-bg)); }
@media (max-width: 620px) { .cmp-table th.cmp-corner { font-size: inherit; color: transparent; } }
@media (prefers-reduced-motion: reduce) { .cmp-table th.cmp-group, .cmp-table th.cmp-corner { transition: none; } }
.cmp-table td, .cmp-table thead th:not(.cmp-corner) { padding-left: .45rem; padding-right: .45rem; }

/* Bulle du glossaire dans un tableau défilant : positionnée par rapport à l'écran (voir article.html). */
.gloss-pop.is-fixed { position: fixed; bottom: auto; transform: none; z-index: 90; }
.gloss-pop.is-fixed::after { left: var(--gloss-arrow, 50%); }
/* Téléphone : durée et pastille de statut sur la même ligne, alignées au centre. */
@media (max-width: 600px) {
  .reading-tools { flex-wrap: nowrap; align-items: center; }
  .reading-tools .article-meta { flex: 1 1 auto; flex-basis: auto; min-width: 0; }
  .reading-tools .statut-btn { flex: none; padding: .26rem .7rem .26rem .5rem; font-size: .8rem; }
}

/* ===== Écoute d'un article (ecoute.js) ===== */
.ecoute {
  display: flex; align-items: center; gap: .85rem; margin: 0 0 1.4rem; padding: .7rem .9rem;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card-bg);
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.ecoute-play {
  flex: none; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%;
  border: 0; background: var(--teal); color: #fff; cursor: pointer;
}
.ecoute-play svg { width: 1.3rem; height: 1.3rem; fill: currentColor; }
.ecoute-play .i-pause, .ecoute.is-playing .ecoute-play .i-play { display: none; }
.ecoute.is-playing .ecoute-play .i-pause { display: block; }
.ecoute-play:hover { background: color-mix(in srgb, var(--teal) 85%, #000); }
.ecoute-play:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.ecoute-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.ecoute-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .84rem; }
.ecoute-lbl { font-weight: 600; color: var(--text); }
.ecoute-time { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ecoute-seek { width: 100%; margin: .1rem 0; accent-color: var(--teal); }
.ecoute-ctl { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.ecoute-skip, .ecoute-rate, .ecoute-chapsel {
  font: 500 .78rem 'Segoe UI', system-ui, sans-serif; padding: .28rem .55rem; border-radius: 7px;
  border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums;
}
.ecoute-chapsel { max-width: 14rem; margin-left: auto; }
.ecoute-skip:hover, .ecoute-rate:hover, .ecoute-chapsel:hover { border-color: var(--teal); }
.ecoute-skip:focus-visible, .ecoute-rate:focus-visible, .ecoute-chapsel:focus-visible, .ecoute-seek:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
.otp-list a.is-heard { color: var(--teal-light); font-weight: 600; }
/* Mini-lecteur collé en bas pendant l'écoute, quand le lecteur est hors de l'écran. */
.ecoute.is-docked {
  position: fixed; left: 50%; bottom: .8rem; transform: translateX(-50%); z-index: 70; width: min(40rem, calc(100vw - 1.5rem));
  margin: 0; box-shadow: 0 14px 34px -14px rgba(0,0,0,.4);
}
@media (max-width: 600px) {
  .ecoute { gap: .6rem; padding: .6rem .7rem; }
  .ecoute-chapsel { max-width: 100%; margin-left: 0; flex: 1 1 100%; }
}
@media print { .ecoute { display: none !important; } }
.reading-focus .ecoute:not(.is-docked) { display: none; }

/* Écoute au repos : un seul bouton discret ; le lecteur complet s'ouvre au premier clic. */
.ecoute:not(.is-open) { display: block; padding: 0; border: 0; background: none; margin: 0 0 1.2rem; }
.ecoute:not(.is-open) > :not(.ecoute-start):not(audio):not(script) { display: none; }
.ecoute.is-open .ecoute-start { display: none; }
.ecoute-start {
  display: inline-flex; align-items: center; gap: .5rem; padding: .42rem .95rem .42rem .55rem; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--teal) 40%, var(--border)); background: color-mix(in srgb, var(--teal) 7%, var(--card-bg));
  color: var(--text); font: 600 .88rem 'Segoe UI', system-ui, sans-serif; cursor: pointer;
}
.ecoute-start svg { width: 1.55rem; height: 1.55rem; padding: .3rem; border-radius: 50%; background: var(--teal); fill: #fff; flex: none; }
.ecoute-start-dur { font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ecoute-start:hover { border-color: var(--teal); }
.ecoute-start:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }

/* Suivi du texte lu : surlignage doux du bloc en cours (texte inchangé). */
.article-body .is-lu { background: color-mix(in srgb, var(--teal) 9%, transparent); box-shadow: 0 0 0 .35em color-mix(in srgb, var(--teal) 9%, transparent);
  border-radius: 4px; transition: background-color .3s ease-out, box-shadow .3s ease-out; }
.article-body table.is-lu { outline: 2px solid color-mix(in srgb, var(--teal) 35%, transparent); outline-offset: 4px; }
.ecoute-retour { font: 600 .78rem 'Segoe UI', system-ui, sans-serif; padding: .28rem .7rem; border-radius: 999px; border: 0;
  background: var(--teal); color: #fff; cursor: pointer; }
.ecoute-retour[hidden] { display: none; }
.ecoute-retour:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 2px; }
[data-theme="liseuse"] .article-body .is-lu { background: none; box-shadow: none; outline: 1px dashed currentColor; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .article-body .is-lu { transition: none; } }

/* Bouton « Écouter l’article » au même gabarit que la pastille de statut. */
.ecoute-start { padding: .32rem .8rem .32rem .32rem; gap: .45rem; font-size: .85rem; border-color: var(--border); background: var(--card-bg); }
.ecoute-start svg { width: 1.3rem; height: 1.3rem; padding: .26rem; }
@media (max-width: 600px) { .arbre-layers-lbl { flex-basis: 100%; } }   /* téléphone : libellé sur sa ligne, interrupteurs dessous */

/* Poster de l'arbre : tuiles sous le schéma (mêmes tuiles que la page du premier poster). */
.arbre-poster { margin: 2.2rem 0 1rem; }
.arbre-poster h2 { margin: 0 0 .8rem; }
.arbre-poster .poster-dl { margin-bottom: 0; }
@media (max-width: 600px) {   /* téléphone : titre de l'arbre sur sa ligne, boutons dessous */
  .carto-tree-head { flex-wrap: wrap; justify-content: flex-start; }
  .carto-tree-head .carto-lbl { flex-basis: 100%; }
}
