/* Wiki Systems : thèmes clair et sombre définis par jetons ; tout le reste s'y réfère.
   Mise en page : barre du haut, arbre des pages à gauche, page au centre, sommaire à droite (écrans larges). */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fdfdfc;
  --surface-2: #f2f1ec;
  --surface-3: #e8e7e1;
  --ink: #0b0b0b;
  --ink-corps: #232321;
  --ink-2: #52514e;
  --muted: #6c6a65;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.20);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-surface: #e7f0fb;
  --on-accent: #ffffff;
  --mark: #fce38a;
  --ombre: 0 10px 30px rgba(11, 11, 11, 0.12), 0 2px 6px rgba(11, 11, 11, 0.06);

  --ok-ink: #1d6a2a; --ok-bg: #e6f3e8; --ok-border: #b5dcbc;
  --alerte-ink: #8a4f00; --alerte-bg: #fcf0da; --alerte-border: #efcf92;
  --critique-ink: #b42323; --critique-bg: #fbe8e8; --critique-border: #efbcbc;
  --info-ink: #1c5cab; --info-bg: #e8f1fb; --info-border: #bad4f2;
  --neutre-ink: #52514e; --neutre-bg: #efeee9; --neutre-border: #d9d7cf;
  --note-ink: #5a3ea6; --note-bg: #f1ecfb; --note-border: #d4c7ef;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  --barre: 56px;
  --nav: 292px;
  --toc: 236px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111110; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2d2d2b;
    --ink: #f1f0ec; --ink-corps: #e2e1dc; --ink-2: #c3c2b7; --muted: #a09e95;
    --border: rgba(255, 255, 255, 0.11); --border-strong: rgba(255, 255, 255, 0.22);
    --accent: #5b9be6; --accent-ink: #8fbcf0; --accent-surface: #1b2b3e; --on-accent: #0b0b0b;
    --mark: #6b5713; --ombre: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
    --ok-ink: #8fd69a; --ok-bg: #15281a; --ok-border: #2b4f32;
    --alerte-ink: #f0c069; --alerte-bg: #2d2311; --alerte-border: #5a451a;
    --critique-ink: #f29292; --critique-bg: #321718; --critique-border: #5f2b2b;
    --info-ink: #8fbcf0; --info-bg: #162435; --info-border: #2a4668;
    --neutre-ink: #c3c2b7; --neutre-bg: #262624; --neutre-border: #3b3b38;
    --note-ink: #c5b2f6; --note-bg: #231d35; --note-border: #44376c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111110; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2d2d2b;
  --ink: #f1f0ec; --ink-corps: #e2e1dc; --ink-2: #c3c2b7; --muted: #a09e95;
  --border: rgba(255, 255, 255, 0.11); --border-strong: rgba(255, 255, 255, 0.22);
  --accent: #5b9be6; --accent-ink: #8fbcf0; --accent-surface: #1b2b3e; --on-accent: #0b0b0b;
  --mark: #6b5713; --ombre: 0 10px 30px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
  --ok-ink: #8fd69a; --ok-bg: #15281a; --ok-border: #2b4f32;
  --alerte-ink: #f0c069; --alerte-bg: #2d2311; --alerte-border: #5a451a;
  --critique-ink: #f29292; --critique-bg: #321718; --critique-border: #5f2b2b;
  --info-ink: #8fbcf0; --info-bg: #162435; --info-border: #2a4668;
  --neutre-ink: #c3c2b7; --neutre-bg: #262624; --neutre-border: #3b3b38;
  --note-ink: #c5b2f6; --note-bg: #231d35; --note-border: #44376c;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--barre) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink-corps); font: 15.5px/1.65 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--accent-ink); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 12px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; box-shadow: var(--ombre); transform: translateY(-200%); }
.evitement:focus { transform: none; }
.discret { color: var(--muted); }
.erreur { color: var(--critique-ink); }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
kbd { font: 12px/1 var(--mono); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: var(--muted); background: var(--surface); }

.icone { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
.icone--plein { fill: currentColor; stroke: none; }
.icone--externe { width: 0.8em; height: 0.8em; margin-left: 2px; vertical-align: 0; opacity: 0.75; }

.btn { font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn--primaire { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; padding: 9px 18px; }
.btn--icone { padding: 7px; border-color: transparent; background: transparent; }
.btn--icone:hover { background: var(--surface-2); border-color: transparent; }
.btn--icone .icone { width: 20px; height: 20px; }
.btn--petit { font-size: 13px; padding: 4px 10px; }

/* ------------------------------------------------------------------ barre du haut */
.barre { position: sticky; top: 0; z-index: 30; height: var(--barre); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.barre__menu { display: none; }
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap; min-width: calc(var(--nav) - 28px); }
.marque:hover { text-decoration: none; }
.marque__logo { width: 28px; height: 28px; }
.marque__logo rect, .connexion__logo rect { fill: var(--accent); }
.marque__logo path, .connexion__logo path { fill: var(--on-accent); }
.compte { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; margin-left: auto; }
.compte__adresse { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.recherche { position: relative; flex: 1 1 auto; max-width: 560px; }
.recherche input { width: 100%; font: inherit; font-size: 14.5px; padding: 7px 36px 7px 36px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--page); color: var(--ink); }
.recherche input:disabled { opacity: 0.6; }
.recherche input::-webkit-search-cancel-button { display: none; }
.recherche__loupe { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.recherche__raccourci { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.recherche input:focus + .recherche__raccourci, .recherche input:not(:placeholder-shown) + .recherche__raccourci { display: none; }
.suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--ombre); max-height: min(70vh, 560px); overflow: auto; }
.suggestion a, .suggestions__tout a { display: grid; gap: 1px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-corps); }
.suggestion[aria-selected="true"] a, .suggestion a:hover, .suggestions__tout a:hover { background: var(--accent-surface); }
.suggestion__titre { font-weight: 600; color: var(--ink); }
.suggestion__fil { font-size: 12px; color: var(--muted); }
.suggestion__extrait { font-size: 13px; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.suggestions__vide { padding: 10px; color: var(--muted); font-size: 14px; }
.suggestions__tout { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.suggestions__tout a { color: var(--accent-ink); font-size: 13.5px; }

/* ------------------------------------------------------------------ cadre */
.cadre { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr) var(--toc); max-width: 1640px; margin: 0 auto; }
body:not(.connecte) .cadre { grid-template-columns: minmax(0, 1fr); }
body:not(.connecte) .navigation, body:not(.connecte) .sommaire { display: none; }
main { min-width: 0; padding: 28px 44px 72px; outline: none; }
.page { max-width: 880px; margin: 0 auto; }
body:not(.connecte) .page { display: none; }

/* ------------------------------------------------------------------ navigation */
.navigation { position: sticky; top: var(--barre); height: calc(100vh - var(--barre)); display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); }
.navigation__filtre { padding: 12px 12px 6px; }
.navigation__filtre input { width: 100%; font: inherit; font-size: 13.5px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); color: var(--ink); }
.navigation__arbre { flex: 1; overflow: auto; padding: 4px 8px 16px; overscroll-behavior: contain; }
.navigation__pied { list-style: none; margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--border); display: grid; gap: 2px; font-size: 13.5px; }
.navigation__pied a { color: var(--ink-2); text-decoration: none; }
.navigation__pied a:hover { color: var(--accent-ink); }
.arbre, .arbre ul { list-style: none; margin: 0; padding: 0; }
.arbre__enfants { margin-left: 11px; padding-left: 7px; border-left: 1px solid var(--border); }
.arbre__noeud--espace { margin-top: 6px; }
.arbre__rangee { display: flex; align-items: flex-start; gap: 1px; }
.arbre__bascule, .arbre__vide { flex: none; width: 24px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.arbre__bascule { border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; padding: 0; }
.arbre__bascule:hover { background: var(--surface-2); color: var(--ink); }
.arbre__bascule .icone { transition: transform 0.15s; width: 15px; height: 15px; }
.arbre__bascule[aria-expanded="true"] .icone { transform: rotate(90deg); }
.arbre__lien { flex: 1; min-width: 0; padding: 4px 8px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.arbre__lien:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.arbre__lien[aria-current="page"] { background: var(--accent-surface); color: var(--accent-ink); font-weight: 600; }
.arbre__noeud--espace > .arbre__rangee > .arbre__lien, .arbre__noeud--accueil .arbre__lien { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ sommaire */
.sommaire { position: sticky; top: var(--barre); height: calc(100vh - var(--barre)); overflow: auto; padding: 32px 18px 24px 8px; font-size: 13px; }
.sommaire__titre { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.sommaire__liste, .sommaire-mobile ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.sommaire__liste a, .sommaire-mobile a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.4; }
.sommaire__liste a:hover { color: var(--ink); }
.sommaire__liste a.actif { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.sommaire__niveau-3 a { padding-left: 24px; font-size: 12.5px; }
.sommaire-mobile { display: none; margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 8px 14px; font-size: 14px; }
.sommaire-mobile summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.sommaire-mobile ol { margin-top: 8px; }

/* ------------------------------------------------------------------ connexion */
.connexion { max-width: 420px; margin: 12vh auto 0; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; box-shadow: var(--ombre); }
.connexion__logo { width: 52px; height: 52px; }
.connexion h1 { margin: 12px 0 6px; font-size: 22px; color: var(--ink); }
.connexion p { color: var(--ink-2); margin: 0 0 20px; }

/* ------------------------------------------------------------------ page */
.fil ol { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; color: var(--muted); }
.fil li + li::before { content: "›"; margin-right: 4px; color: var(--muted); }
.fil a { color: var(--ink-2); text-decoration: none; }
.fil a:hover { color: var(--accent-ink); text-decoration: underline; }
.page__entete { margin-bottom: 18px; }
.page__entete h1 { margin: 0; font-size: 2rem; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); outline: none; overflow-wrap: anywhere; }
.page__resume { margin: 8px 0 0; font-size: 1.08rem; color: var(--ink-2); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.meta__element { display: inline-flex; align-items: center; gap: 6px; }
.meta a { color: var(--muted); }
.etiquettes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.etiquette { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); font-size: 12.5px; text-decoration: none; line-height: 1.6; }
.etiquette:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.etiquette .icone { width: 12px; height: 12px; }
.etiquette__nombre { color: var(--muted); font-variant-numeric: tabular-nums; }
.etiquettes--nuage { gap: 8px; margin: 8px 0 24px; }
.etiquettes--nuage .etiquette { font-size: 14px; padding: 4px 12px; }
.bandeau { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 20px; padding: 10px 14px; border-radius: var(--radius); background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-ink); font-size: 13.5px; }
.bandeau .icone { margin-top: 3px; }

/* ------------------------------------------------------------------ contenu */
.prose { overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .tableau, .prose .code, .prose .encadre, .prose .depliable, .prose .figure { margin: 0.85em 0; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: 0.2em 0; }
.prose li > ul, .prose li > ol { margin: 0.2em 0; }
.prose ul.aeree > li, .prose ol.aeree > li { margin: 0.5em 0; }
.prose ul.taches { list-style: none; padding-left: 0.2em; }
.tache { display: flex; gap: 8px; align-items: baseline; }
.tache input { margin: 0; transform: translateY(1px); }
.titre { color: var(--ink); line-height: 1.3; position: relative; scroll-margin-top: calc(var(--barre) + 16px); }
.prose h2 { font-size: 1.45rem; margin: 2.1em 0 0.6em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.18rem; margin: 1.8em 0 0.5em; }
.prose h4 { font-size: 1.02rem; margin: 1.5em 0 0.4em; }
.prose h5, .prose h6 { font-size: 0.95rem; margin: 1.3em 0 0.3em; color: var(--ink-2); }
.titre__ancre { margin-left: 8px; color: var(--muted); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity 0.15s; }
.titre:hover .titre__ancre, .titre__ancre:focus-visible { opacity: 1; }
.prose code { font-family: var(--mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0.08em 0.35em; overflow-wrap: anywhere; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--border-strong); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose img { max-width: 100%; height: auto; }
.lien-casse { color: var(--critique-ink); text-decoration: underline wavy; text-underline-offset: 3px; cursor: help; }

.code { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.code__entete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); font-family: var(--mono); }
.code__copier { border-color: transparent; background: transparent; color: var(--ink-2); }
.code__copier:hover { background: var(--surface); }
.code pre { margin: 0; padding: 12px 14px; overflow: auto; font: 13px/1.55 var(--mono); color: var(--ink); tab-size: 4; }
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.mermaid { margin: 1em 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 10px 12px; }
.mermaid__cadre { display: block; width: 100%; height: 160px; border: 0; background: transparent; }
.mermaid__etat { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.mermaid__source { margin-top: 6px; font-size: 13px; }
.mermaid__source > summary { cursor: pointer; color: var(--muted); }
.mermaid__source .code { margin-top: 8px; }
.mermaid__source pre { max-height: 360px; }

.tableau { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tableau table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.tableau th, .tableau td { text-align: left; vertical-align: top; padding: 7px 12px; border-bottom: 1px solid var(--border); }
.tableau tr:last-child td { border-bottom: 0; }
.tableau thead th { background: var(--surface-2); color: var(--ink); font-weight: 650; white-space: nowrap; position: sticky; top: 0; }
.tableau tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tableau--fiche td:first-child { width: 28%; min-width: 140px; color: var(--ink-2); font-weight: 600; background: var(--surface-2); }
.aligne-droite { text-align: right !important; }
.aligne-centre { text-align: center !important; }
.tri { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tri:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.tri__sens::after { content: "↕"; color: var(--muted); font-size: 11px; }
th[aria-sort="ascending"] .tri__sens::after { content: "↑"; color: var(--accent-ink); }
th[aria-sort="descending"] .tri__sens::after { content: "↓"; color: var(--accent-ink); }

.statut { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1.7; white-space: nowrap; border: 1px solid; vertical-align: 0.05em; }
.statut__point { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statut--ok { color: var(--ok-ink); background: var(--ok-bg); border-color: var(--ok-border); }
.statut--alerte { color: var(--alerte-ink); background: var(--alerte-bg); border-color: var(--alerte-border); }
.statut--critique { color: var(--critique-ink); background: var(--critique-bg); border-color: var(--critique-border); }
.statut--info { color: var(--info-ink); background: var(--info-bg); border-color: var(--info-border); }
.statut--neutre { color: var(--neutre-ink); background: var(--neutre-bg); border-color: var(--neutre-border); }
.statut + .statut { margin-left: 4px; }

.encadre { border: 1px solid; border-left-width: 4px; border-radius: var(--radius); padding: 10px 16px; }
.encadre__titre { display: flex; align-items: center; gap: 8px; margin: 0 0 2px !important; font-weight: 650; }
.encadre__corps { color: var(--ink-corps); }
.encadre__corps > :first-child { margin-top: 0.2em; }
.encadre__corps > :last-child { margin-bottom: 0.2em; }
.encadre--info, .encadre--important { background: var(--info-bg); border-color: var(--info-border); }
.encadre--info .encadre__titre, .encadre--important .encadre__titre { color: var(--info-ink); }
.encadre--note { background: var(--note-bg); border-color: var(--note-border); }
.encadre--note .encadre__titre { color: var(--note-ink); }
.encadre--astuce, .encadre--succes { background: var(--ok-bg); border-color: var(--ok-border); }
.encadre--astuce .encadre__titre, .encadre--succes .encadre__titre { color: var(--ok-ink); }
.encadre--attention { background: var(--alerte-bg); border-color: var(--alerte-border); }
.encadre--attention .encadre__titre { color: var(--alerte-ink); }
.encadre--danger { background: var(--critique-bg); border-color: var(--critique-border); }
.encadre--danger .encadre__titre { color: var(--critique-ink); }

.depliable { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.depliable > summary { cursor: pointer; padding: 9px 14px; font-weight: 600; color: var(--ink); list-style-position: inside; }
.depliable[open] > summary { border-bottom: 1px solid var(--border); }
.depliable__corps { padding: 2px 16px 8px; }

.figure { margin-left: 0; margin-right: 0; }
.schema { display: block; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 14px; overflow-x: auto; }
.schema .chargement { color: var(--muted); font-size: 13px; }
.figure figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--muted); }

/* Schémas SVG du wiki : uniquement des classes, colorées par les jetons du thème. */
.schema__svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: var(--sans); }
.schema__svg .s-zone { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1; }
.schema__svg .s-zone--cloud { fill: var(--info-bg); stroke: var(--info-border); }
.schema__svg .s-zone--local { fill: var(--ok-bg); stroke: var(--ok-border); }
.schema__svg .s-zone--externe { fill: var(--note-bg); stroke: var(--note-border); }
.schema__svg .s-zone--alerte { fill: var(--alerte-bg); stroke: var(--alerte-border); }
.schema__svg .s-boite { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.2; }
.schema__svg .s-boite--accent { stroke: var(--accent); stroke-width: 1.6; }
.schema__svg .s-titre-zone { fill: var(--ink-2); font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; }
.schema__svg .s-texte { fill: var(--ink); font-size: 14px; font-weight: 600; }
.schema__svg .s-detail { fill: var(--ink-2); font-size: 12px; }
.schema__svg .s-etiquette { fill: var(--muted); font-size: 11px; }
.schema__svg .s-lien { fill: none; stroke: var(--ink-2); stroke-width: 1.4; }
.schema__svg .s-lien--tirets { stroke-dasharray: 5 4; }
.schema__svg .s-lien--accent { stroke: var(--accent); }
.schema__svg .s-pointe { fill: var(--ink-2); }
.schema__svg .s-pointe--accent { fill: var(--accent); }

/* Listes de pages, cartes des espaces */
.cartes { list-style: none; padding: 0; margin: 1em 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.carte { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 14px 16px; transition: border-color 0.15s, box-shadow 0.15s; }
.carte:hover { border-color: var(--accent); box-shadow: var(--ombre); }
.carte__lien { text-decoration: none; color: var(--ink); }
.carte__lien::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.carte__titre { font-weight: 700; font-size: 1.02rem; }
.carte__resume { margin: 4px 0 0 !important; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }
.carte__nombre { margin: 8px 0 0 !important; color: var(--muted); font-size: 12px; }
.liste-pages { list-style: none; padding: 0 !important; margin: 0.8em 0; }
.liste-pages li { padding: 7px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.liste-pages li:last-child { border-bottom: 0; }
.liste-pages a { font-weight: 600; text-decoration: none; }
.liste-pages a:hover { text-decoration: underline; }
.liste-pages__meta { color: var(--muted); font-size: 13px; }

.annexe { margin-top: 40px; padding-top: 4px; }
.annexe h2 { font-size: 1.05rem; margin: 0 0 6px; color: var(--ink-2); border: 0; }
.retours { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.retours a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-decoration: none; font-size: 14px; }
.retours a:hover { border-color: var(--accent); }
.voisins { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.voisin { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.voisin:hover { border-color: var(--accent); text-decoration: none; }
.voisin--suivant { text-align: right; grid-column: 2; }
.voisin__sens { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.voisin--suivant .voisin__sens { justify-content: flex-end; }
.voisin__titre { font-weight: 600; color: var(--accent-ink); }
.page__pied { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); }

.resultats { list-style: none; padding: 0; margin: 16px 0; }
.resultat { padding: 14px 0; border-bottom: 1px solid var(--border); }
.resultat__titre { font-size: 1.08rem; font-weight: 650; text-decoration: none; }
.resultat__titre:hover { text-decoration: underline; }
.resultat__fil { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.resultat__extrait { margin: 6px 0; color: var(--ink-2); font-size: 14px; }

.voile { display: none; }

/* ------------------------------------------------------------------ écrans moyens et petits */
@media (max-width: 1240px) {
  .cadre { grid-template-columns: var(--nav) minmax(0, 1fr); }
  .sommaire { display: none !important; }
  .sommaire-mobile { display: block; }
}
@media (max-width: 900px) {
  :root { --nav: 300px; }
  .cadre, body:not(.connecte) .cadre { grid-template-columns: minmax(0, 1fr); }
  .barre { gap: 8px; padding: 0 10px; }
  .barre__menu { display: inline-flex; }
  body:not(.connecte) .barre__menu { display: none; }
  .marque { min-width: 0; }
  .marque #MarqueTitre { display: none; }
  .compte__adresse, .recherche__raccourci { display: none; }
  .navigation { position: fixed; top: var(--barre); left: 0; bottom: 0; height: auto; width: min(86vw, var(--nav)); z-index: 40; transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: none; }
  body.menu-ouvert .navigation { transform: none; box-shadow: var(--ombre); }
  body.menu-ouvert .voile { display: block; position: fixed; inset: var(--barre) 0 0 0; z-index: 35; background: rgba(0, 0, 0, 0.35); }
  main { padding: 18px 16px 56px; }
  .page__entete h1 { font-size: 1.6rem; }
  .voisins { grid-template-columns: 1fr; }
  .voisin--suivant { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ impression */
@media print {
  .barre, .navigation, .sommaire, .sommaire-mobile, .voisins, .page__pied, .bandeau, .titre__ancre, .code__copier, .voile, .evitement { display: none !important; }
  .cadre { display: block; }
  main { padding: 0; }
  body { background: #fff; color: #000; }
  .tableau, .code, .schema { break-inside: avoid; }
  a { color: inherit; }
}
