/* Site public du manuel : trois colonnes (navigation, contenu, « sur cette page »), clair et sombre, contrastes AA. */
:root {
  --fond: #ffffff; --fond-2: #f6f8fa; --fond-3: #eef2f6; --texte: #1a2433; --texte-2: #4a5568; --trait: #e2e8f0;
  --accent: #0f6e66; --accent-fond: #e6f4f2; --accent-texte: #ffffff; --ombre: 0 1px 2px rgb(16 24 40 / .06), 0 4px 16px rgb(16 24 40 / .06);
  --entete: 60px; --nav: 280px; --toc: 240px; --lecture: 840px; --rayon: 10px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0b1220; --fond-2: #111a2c; --fond-3: #18233a; --texte: #e6ebf2; --texte-2: #a7b3c4; --trait: #24314a;
    --accent: #5fd4c4; --accent-fond: #0f2e2c; --accent-texte: #06201d; --ombre: 0 1px 2px rgb(0 0 0 / .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0b1220; --fond-2: #111a2c; --fond-3: #18233a; --texte: #e6ebf2; --texte-2: #a7b3c4; --trait: #24314a;
  --accent: #5fd4c4; --accent-fond: #0f2e2c; --accent-texte: #06201d; --ombre: 0 1px 2px rgb(0 0 0 / .4); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--entete) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.6 var(--police); }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: 12px/1 var(--police); border: 1px solid var(--trait); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; color: var(--texte-2); background: var(--fond); }
.evitement { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-texte); padding: 8px 12px; border-radius: 6px; }
.evitement:focus { left: 8px; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.entete { position: sticky; top: 0; z-index: 30; height: var(--entete); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: color-mix(in srgb, var(--fond) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--trait); }
.marque { display: flex; align-items: center; gap: 10px; color: var(--texte); text-decoration: none; font-weight: 650; white-space: nowrap; }
.recherche-ouvrir { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; width: min(420px, 50vw); height: 38px; padding: 0 10px;
  border: 1px solid var(--trait); border-radius: 8px; background: var(--fond-2); color: var(--texte-2); font: inherit; font-size: 14px; cursor: pointer; }
.recherche-ouvrir:hover { border-color: var(--texte-2); }
.recherche-ouvrir .recherche-libelle { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bouton-icone { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--texte-2); cursor: pointer; }
.bouton-icone:hover { background: var(--fond-2); color: var(--texte); }
.theme .lune { display: none; }
:root[data-theme="dark"] .theme .soleil { display: none; } :root[data-theme="dark"] .theme .lune { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .soleil { display: none; } :root:not([data-theme="light"]) .theme .lune { display: block; } }
.menu-mobile { display: none; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 4px; border: 0; border-radius: 8px; background: none;
  color: var(--texte); font: inherit; font-size: 16px; cursor: pointer; white-space: nowrap; }
.menu-mobile:hover { background: var(--fond-2); }
.menu-libelle { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
/* Accueil : pas de colonne de navigation, elle s'ouvre en tiroir depuis « ☰ Accueil » (comme sur mobile). */
.accueil .menu-mobile { display: inline-flex; }
.accueil .marque span { display: none; }

/* Trois colonnes */
.cadre { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr) var(--toc); gap: 40px; max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.cadre:not(:has(.sur-cette-page)) { grid-template-columns: var(--nav) minmax(0, 1fr); }
.accueil .cadre { display: block; max-width: 1200px; }
.accueil .navigation { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); max-height: none; padding: 16px;
  background: var(--fond); border-right: 1px solid var(--trait); transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
.accueil .navigation.ouverte { transform: none; visibility: visible; }
.accueil .voile:not([hidden]) { position: fixed; inset: 0; z-index: 35; background: rgb(10 16 28 / .45); }
.navigation { position: sticky; top: var(--entete); align-self: start; max-height: calc(100vh - var(--entete)); overflow-y: auto; padding: 24px 8px 40px 0; font-size: 14px; }
.nav-accueil { display: block; padding: 6px 10px; border-radius: 6px; color: var(--texte); text-decoration: none; font-weight: 600; margin-bottom: 8px; }
.nav-module summary { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-weight: 600; list-style: none; }
.nav-module summary::-webkit-details-marker { display: none; }
.nav-module summary::before { content: ""; width: 6px; height: 6px; border: solid var(--texte-2); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); margin-right: 10px; transition: transform .15s; }
.nav-module[open] summary::before { transform: rotate(45deg); }
.nav-module summary:hover, .nav-accueil:hover { background: var(--fond-2); }
.nav-module summary .compte { margin-left: auto; font-weight: 400; color: var(--texte-2); font-size: 12px; }
.nav-module ul { list-style: none; margin: 2px 0 10px 13px; padding: 0 0 0 10px; border-left: 1px solid var(--trait); }
.nav-module a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--texte-2); text-decoration: none; line-height: 1.35; }
.nav-module a:hover { color: var(--texte); background: var(--fond-2); }
.nav-module a[aria-current="page"], .nav-accueil.actif { color: var(--accent); background: var(--accent-fond); font-weight: 600; }
.nav-tous a { font-style: italic; }
.contenu { min-width: 0; padding: 28px 0 64px; outline: none; }
.sur-cette-page { position: sticky; top: var(--entete); align-self: start; max-height: calc(100vh - var(--entete)); overflow-y: auto; padding: 28px 0; font-size: 13px; }
.toc-titre { margin: 0 0 8px; font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2); }
.sur-cette-page ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--trait); }
.sur-cette-page a { display: block; padding: 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--texte-2); text-decoration: none; line-height: 1.4; }
.sur-cette-page a:hover { color: var(--texte); }
.sur-cette-page a.actif { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

/* Contenu d'un guide */
.fil ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 20px; padding: 0; font-size: 13px; color: var(--texte-2); }
.fil li + li::before { content: "›"; margin-right: 6px; }
.fil a { color: var(--texte-2); text-decoration: none; } .fil a:hover { color: var(--accent); text-decoration: underline; }
.guide, .guide-tete, .suite { max-width: var(--lecture); }
.surtitre { margin: 0 0 6px; color: var(--accent); font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; }
.chapo { font-size: 18px; color: var(--texte-2); margin: 0 0 12px; }
.meta { font-size: 13px; color: var(--texte-2); margin: 0 0 28px; }
.guide h2 { font-size: 22px; margin: 44px 0 14px; padding-top: 20px; border-top: 1px solid var(--trait); letter-spacing: -.01em; }
.guide ul { padding-left: 22px; }
.etapes { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.etape { position: relative; padding: 0 0 28px 44px; }
.etape::before { content: ""; position: absolute; left: 14px; top: 34px; bottom: 6px; width: 1px; background: var(--trait); }
.etape:last-child::before { display: none; }
.etape-tete { display: flex; align-items: baseline; gap: 10px; position: relative; }
.etape-numero { position: absolute; left: -44px; top: 0; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-fond); color: var(--accent); font-weight: 700; font-size: 13px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.etape h3 { margin: 2px 0 6px; font-size: 17px; line-height: 1.4; }
.ancre { opacity: 0; color: var(--texte-2); text-decoration: none; font-size: 14px; }
.etape:hover .ancre, .ancre:focus { opacity: 1; }
.etape-corps p { margin: 0 0 8px; }
.etape-corps ul { margin: 6px 0 10px; font-size: 15px; color: var(--texte-2); }
.etape-corps strong { color: var(--texte); }
.capture { margin: 12px 0 0; }
.capture a { display: inline-block; max-width: 100%; border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); background: var(--fond-2); }
.capture img { display: block; max-width: 100%; height: auto; }
.capture figcaption { margin-top: 8px; font-size: 13px; color: var(--texte-2); }
.etape:target .etape-numero, .etape.visee .etape-numero { background: var(--accent); color: var(--accent-texte); }
.suite { display: flex; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--trait); }
.suite a { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--trait); border-radius: var(--rayon); text-decoration: none; color: var(--texte); font-weight: 600; }
.suite a:hover { border-color: var(--accent); }
.suite span { font-size: 12px; font-weight: 500; color: var(--texte-2); }
.suite .suivant { text-align: right; margin-left: auto; }

/* Accueil et modules */
.heros { position: relative; isolation: isolate; padding: 56px 0 40px; max-width: 760px; }
.accueil .contenu { overflow-x: hidden; overflow-x: clip; }   /* hidden : repli des navigateurs sans clip */
.heros-points { position: absolute; z-index: -1; inset: 0 -480px 0 -24px; pointer-events: none;
  background: linear-gradient(100deg, #e5484d, #f5a524 22%, #46a758 44%, #3e63dd 66%, #8e4ec6 88%);
  -webkit-mask: radial-gradient(circle, #000 1.6px, transparent 2px) 0 0 / 16px 16px, linear-gradient(120deg, #000 0%, rgb(0 0 0 / .35) 35%, transparent 65%);
  -webkit-mask-composite: source-in; mask: radial-gradient(circle, #000 1.6px, transparent 2px) 0 0 / 16px 16px, linear-gradient(120deg, #000 0%, rgb(0 0 0 / .35) 35%, transparent 65%);
  mask-composite: intersect; opacity: .8; }
.heros h1 { font-size: clamp(40px, 7vw, 56px); letter-spacing: -.03em; margin-bottom: 14px; }
.heros .chapo { font-size: clamp(19px, 2.6vw, 22px); line-height: 1.45; max-width: 620px; }
.heros-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 28px 0 12px; }
.bouton-principal { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 20px; border-radius: 8px; background: var(--accent);
  color: var(--accent-texte); font-weight: 600; font-size: 17px; text-decoration: none; box-shadow: var(--ombre); }
.bouton-principal:hover { filter: brightness(1.08); }
.recherche-ouvrir.grande { flex: 1; min-width: 260px; width: auto; height: 48px; margin: 0; font-size: 16px; background: var(--fond); box-shadow: var(--ombre); }
.recherche-ouvrir.grande span { flex: 1; text-align: left; }
.parcourir { padding: 24px 0 48px; }
.parcourir > h2 { font-size: clamp(24px, 3.4vw, 30px); letter-spacing: -.02em; margin: 0 0 24px; }
.familles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px 48px; }
.famille h3 { margin: 0 0 6px; padding-bottom: 10px; border-bottom: 1px solid var(--trait); font-size: 15px; font-weight: 500; color: var(--texte-2); }
.famille ul { list-style: none; margin: 0; padding: 0; }
.famille li { padding: 12px 0; }
.famille a { display: block; font-size: 18px; font-weight: 650; text-decoration: none; }
.famille a:hover { text-decoration: underline; }
.famille li span { display: block; margin-top: 2px; color: var(--texte-2); font-size: 15px; }
.cartes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; max-width: 980px; }
.carte { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 18px; border: 1px solid var(--trait); border-radius: var(--rayon); color: var(--texte); text-decoration: none; }
.carte:hover { border-color: var(--accent); box-shadow: var(--ombre); }
.carte span { font-size: 14px; color: var(--texte-2); }
.pied { border-top: 1px solid var(--trait); margin-top: 24px; padding: 32px 24px 28px; color: var(--texte-2); font-size: 15px; }
.pied-cadre { max-width: 1200px; margin: 0 auto; }
.pied-liens { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px 32px; }
.pied-liens li { display: flex; align-items: flex-start; gap: 12px; line-height: 1.45; }
.pied-liens svg { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--texte); stroke-width: 1.7; }
.pied-liens a { font-weight: 600; text-decoration: none; } .pied-liens a:hover { text-decoration: underline; }
.bouton-secondaire { height: 40px; padding: 0 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--fond); color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.bouton-secondaire:disabled { opacity: .6; cursor: not-allowed; }
.pied-bas a { color: var(--texte-2); }
.pied-bas { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding-top: 16px; border-top: 1px solid var(--trait); font-size: 13px; }

/* Recherche */
.recherche { width: min(680px, calc(100vw - 32px)); max-height: min(70vh, 640px); margin: 10vh auto auto; padding: 0; border: 1px solid var(--trait);
  border-radius: 14px; background: var(--fond); color: var(--texte); box-shadow: 0 20px 60px rgb(0 0 0 / .3); overflow: hidden; }
.recherche[open] { display: flex; flex-direction: column; }
.recherche::backdrop { background: rgb(10 16 28 / .45); backdrop-filter: blur(2px); }
.recherche-boite { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--trait); color: var(--texte-2); }
.recherche-boite input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--texte); font: inherit; font-size: 17px; }
.recherche-boite input::-webkit-search-cancel-button { display: none; }
.recherche-etat { margin: 0; padding: 8px 16px; font-size: 13px; color: var(--texte-2); }
.recherche-etat:empty { display: none; }
.recherche-etat button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.recherche-resultats { list-style: none; margin: 0; padding: 4px 8px 10px; overflow-y: auto; }
.recherche-resultats a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--texte); text-decoration: none; }
.recherche-resultats [aria-selected="true"] a { background: var(--accent-fond); }
.recherche-resultats .r-titre { font-weight: 600; }
.recherche-resultats .r-ou { font-size: 12px; color: var(--texte-2); }
.recherche-resultats .r-extrait { font-size: 13px; color: var(--texte-2); margin-top: 2px; }
.recherche-resultats mark { background: none; color: var(--accent); font-weight: 700; }

/* Tablette : plus de colonne de droite. Mobile : la navigation devient un tiroir. */
@media (max-width: 1200px) { .cadre { grid-template-columns: var(--nav) minmax(0, 1fr); } .sur-cette-page { display: none; } }
@media (max-width: 860px) {
  .cadre, .accueil .cadre, .cadre:not(:has(.sur-cette-page)) { display: block; padding: 0 16px; }
  .menu-mobile { display: inline-flex; }
  .marque span { display: none; }
  .heros { padding-top: 32px; } .heros-points { opacity: .4; } .heros-actions { flex-direction: column; align-items: stretch; } .bouton-principal { justify-content: center; }
  .pied { padding: 28px 16px; }
  .navigation { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); max-height: none; padding: 16px; background: var(--fond);
    border-right: 1px solid var(--trait); transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
  .navigation.ouverte { transform: none; visibility: visible; }
  .voile:not([hidden]) { position: fixed; inset: 0; z-index: 35; background: rgb(10 16 28 / .45); }
  .recherche-ouvrir { width: auto; } .entete .recherche-ouvrir .recherche-libelle, .entete .recherche-ouvrir kbd { display: none; }
  .marque span { overflow: hidden; text-overflow: ellipsis; }
  .etape { padding-left: 38px; } .etape-numero { left: -38px; }
  .suite { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .entete, .navigation, .sur-cette-page, .suite, .pied { display: none; } .cadre { display: block; } }
