/*
 * Manuel d'utilisation Masomo Mepesi : feuille de style unique.
 * Mobile d'abord, lisible au soleil (contrastes forts, texte assez grand), impression propre.
 * Aucune dépendance réseau : polices du système, icônes en SVG (inline ou masques en data-URI).
 * Couleurs : celles de l'application (resources/css/app.css).
 */

:root {
    --primary: #1F3A5F;
    --primary-50: #EEF1F5;
    --primary-100: #DCE2EA;
    --primary-200: #B4C0CF;
    --primary-700: #162943;
    --primary-800: #111F33;
    --secondary: #F5B400;
    --secondary-50: #FEF9EB;
    --secondary-100: #FEF4D6;
    --secondary-700: #8A6500;
    --accent: #1FA37A;
    --accent-50: #EDF8F4;
    --accent-700: #146B51;
    --ink: #17253A;
    --muted: #4A5A70;          /* plus foncé que dans l'app : lisible en plein soleil */
    --line: #D5DCE6;
    --ground: #F3F5F9;
    --warn: #B85E00;
    --warn-50: #FFF4E6;
    --warn-line: #F2B366;
    --bad: #C0392B;
    --radius: 16px;
    --barre: 60px;
    --sommaire: 300px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--barre) + 16px);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    overflow-wrap: break-word;
}

img, svg { max-width: 100%; }
svg { flex-shrink: 0; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary-700); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); text-wrap: balance; }
p, ul, ol, dl { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: .3em; }
b, strong { font-weight: 650; }
kbd {
    font-family: var(--font-mono); font-size: .85em; padding: .05em .4em;
    border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #fff;
}
code { font-family: var(--font-mono); font-size: .9em; background: var(--ground); padding: .05em .35em; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
[hidden] { display: none !important; }

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.saut { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--secondary); color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 650; }
.saut:focus { top: 8px; }

/* ===================== Barre du haut ===================== */
.barre {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 8px;
    height: var(--barre); padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    background: var(--primary); color: #fff;
    box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.barre a, .barre button { color: #fff; }
.barre-bouton {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; min-width: 44px; padding: 0 10px; justify-content: center;
    background: transparent; border: 0; border-radius: 12px;
    font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.barre-bouton:hover { background: rgba(255,255,255,.12); }
.barre-marque { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; font-size: 15px; line-height: 1.2; }
.barre-marque:hover { color: #fff; }
.barre-marque svg { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.barre-marque span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-marque small { display: block; font-size: 12px; opacity: .8; font-weight: 400; }
.barre-marque strong { font-weight: 650; }
.barre-recherche { background: rgba(255,255,255,.1); }
.barre-recherche .libelle, .barre-recherche kbd { display: none; }
.barre-recherche kbd { color: var(--ink); border-color: transparent; font-size: 12px; }
.barre-site { text-decoration: none; }
.barre-site .libelle { display: none; }

@media (min-width: 640px) {
    .barre-recherche { min-width: 220px; justify-content: flex-start; padding: 0 12px; }
    .barre-recherche .libelle { display: inline; flex: 1; text-align: left; font-weight: 400; opacity: .9; }
    .barre-recherche kbd { display: inline; }
    .barre-site .libelle { display: inline; }
}
@media (min-width: 1024px) {
    .barre { padding: 0 20px; }
    .barre-menu { display: none; }
}

/* ===================== Cadre : sommaire + contenu ===================== */
.cadre { position: relative; }
.sommaire {
    position: fixed; z-index: 50; top: 0; bottom: 0; left: 0;
    width: min(88vw, 340px);
    background: #fff; border-right: 1px solid var(--line);
    overflow-y: auto; overscroll-behavior: contain;
    padding: 16px 12px 40px;
    transform: translateX(-102%); transition: transform .2s ease;
    visibility: hidden;
}
.sommaire-ouvert .sommaire { transform: none; visibility: visible; box-shadow: 8px 0 32px rgba(17,31,51,.25); }
.voile { position: fixed; inset: 0; z-index: 45; background: rgba(17,31,51,.45); display: none; }
.sommaire-ouvert .voile { display: block; }
.sommaire-ouvert { overflow: hidden; }
.sommaire-fermer { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 12px; font-weight: 650; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.sommaire-fermer button { border: 0; background: var(--ground); border-radius: 12px; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }

@media (min-width: 1024px) {
    .sommaire {
        top: var(--barre); width: var(--sommaire);
        transform: none; visibility: visible; transition: none;
        background: var(--ground); padding-top: 20px;
    }
    .sommaire-fermer, .voile { display: none !important; }
    .sommaire-ouvert { overflow: visible; }
    .contenu-enveloppe { margin-left: var(--sommaire); }
}

.sommaire ul { list-style: none; margin: 0; padding: 0; }
.sommaire li + li { margin-top: 2px; }
.sommaire a {
    display: flex; align-items: center; gap: 10px;
    min-height: 44px; padding: 8px 12px; border-radius: 12px;
    color: var(--ink); text-decoration: none; font-size: 15.5px; font-weight: 550; line-height: 1.3;
}
.sommaire a:hover { background: var(--primary-50); }
.sommaire a .ico { color: var(--primary); }
.sommaire a[aria-current="page"] { background: var(--primary); color: #fff; }
.sommaire a[aria-current="page"] .ico { color: var(--secondary); }
.sommaire-titre { margin: 18px 12px 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sommaire .toc { margin: 6px 0 10px 22px; padding-left: 10px; border-left: 2px solid var(--primary-100); }
.sommaire .toc a { min-height: 38px; padding: 6px 10px; font-size: 14.5px; font-weight: 450; color: var(--muted); border-radius: 8px; }
.sommaire .toc a:hover { color: var(--ink); }
.sommaire .toc a.actif { color: var(--primary); font-weight: 650; background: #fff; box-shadow: inset 3px 0 0 var(--secondary); }

/* ===================== Contenu ===================== */
.contenu { max-width: 54rem; margin: 0 auto; padding: 20px 16px 64px; }
@media (min-width: 640px) { .contenu { padding: 28px 28px 80px; } }
@media (min-width: 1280px) { .contenu { padding: 36px 48px 96px; } }

.contenu > p, .contenu > ul, .contenu > ol, .groupe > p, .groupe > ul, .groupe > ol { max-width: 44rem; }

/* En-tête de chapitre */
.chapitre-tete { margin: 0 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.surtitre { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.surtitre .ico { color: var(--secondary-700); }
.chapitre-tete h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin: 0 0 10px; letter-spacing: -.01em; }
.chapeau { font-size: 1.12rem; color: var(--muted); margin: 0; max-width: 44rem; }
.chapitre-outils { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.bouton {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
    font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.bouton:hover { border-color: var(--primary); background: var(--primary-50); color: var(--ink); }
.bouton-primaire { background: var(--primary); border-color: var(--primary); color: #fff; }
.bouton-primaire:hover { background: var(--primary-700); color: #fff; }

/* Sommaire du chapitre (dans la page, utile surtout sur téléphone et à l'impression) */
.modules { margin: 0 0 32px; padding: 16px 16px 12px; background: var(--ground); border-radius: var(--radius); }
.modules h2 { font-size: 1rem; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.modules ol { margin: 0; padding: 0; list-style: none; columns: 1; }
@media (min-width: 720px) { .modules ol { columns: 2; column-gap: 24px; } }
.modules li { break-inside: avoid; margin: 0 0 4px; }
.modules a { display: flex; gap: 8px; align-items: baseline; padding: 6px 4px; font-weight: 550; text-decoration: none; color: var(--ink); }
.modules a:hover { color: var(--primary); text-decoration: underline; }
.modules a::before { content: "›"; color: var(--secondary-700); font-weight: 700; }

/* Groupes (blocs de texte libres : accueil, glossaire, FAQ, introductions) */
.groupe { margin: 40px 0; }
.groupe > h2, .fiche-tete h2 { font-size: clamp(1.4rem, 4vw, 1.75rem); margin: 0 0 12px; }
.groupe > h2 { padding-top: 4px; }
.groupe h3 { font-size: 1.2rem; margin: 28px 0 8px; }

/* Lien « copier le lien de cette section » (ajouté par manuel.js) */
.lien-section {
    display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: 6px; vertical-align: middle;
    border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; opacity: .55;
}
.lien-section:hover, .lien-section:focus-visible { opacity: 1; background: var(--primary-50); color: var(--primary); }
.lien-section .ico { width: 18px; height: 18px; }
@media (hover: hover) {
    .lien-section { opacity: 0; }
    h2:hover > .lien-section, h3:hover > .lien-section, .lien-section:focus-visible { opacity: 1; }
}

/* Encadrés */
.note, .astuce, .alerte {
    margin: 16px 0; padding: 12px 16px; border-radius: 12px; border-left: 5px solid;
    max-width: 44rem;
}
.note { background: var(--primary-50); border-color: var(--primary); }
.astuce { background: var(--accent-50); border-color: var(--accent); }
.alerte { background: var(--warn-50); border-color: var(--warn); }
.note > :last-child, .astuce > :last-child, .alerte > :last-child { margin-bottom: 0; }
.note strong:first-child, .astuce strong:first-child, .alerte strong:first-child { display: block; }

.a-rediger {
    color: var(--muted); font-style: italic; padding: 10px 14px; margin: 0 0 12px;
    border: 1px dashed var(--line); border-radius: 10px; background: repeating-linear-gradient(-45deg, #fff, #fff 8px, #F8FAFC 8px, #F8FAFC 16px);
}

/* ===================== Fiche module ===================== */
.fiche {
    margin: 40px 0; border: 1px solid var(--line); border-radius: 20px; background: #fff;
    overflow: clip;
}
.fiche:target, .bloc:target, .groupe:target { animation: cible 1.6s ease-out 1; }
@keyframes cible { 0% { box-shadow: 0 0 0 4px var(--secondary); } 100% { box-shadow: 0 0 0 4px transparent; } }
.fiche-tete {
    padding: 20px 16px 18px;
    background: linear-gradient(180deg, var(--primary-50), #fff);
    border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) { .fiche-tete { padding: 24px 28px 20px; } }
.fiche-espace { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.fiche-espace .ico { width: 18px; height: 18px; color: var(--secondary-700); }
.fiche-resume { font-size: 1.05rem; color: var(--muted); margin: 0 0 14px; max-width: 42rem; }
.fiche-etat { display: inline-block; margin-left: auto; padding: 2px 10px; border-radius: 999px; font-size: 12px; letter-spacing: .03em; text-transform: none; font-weight: 650; }
.fiche[data-etat="a-rediger"] .fiche-etat { background: var(--secondary-100); color: var(--secondary-700); }
.fiche[data-etat="a-verifier"] .fiche-etat { background: var(--warn-50); color: var(--warn); }
.fiche[data-etat="redige"] .fiche-etat { display: none; }

.roles { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; }
.roles li { margin: 0; }
.role {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px;
    border-radius: 999px; background: #fff; border: 1px solid var(--primary-200);
    font-size: 13.5px; font-weight: 600; color: var(--primary-800); line-height: 1.4;
}
.role::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--primary)); }
.role-lecture { border-style: dashed; }
.role-lecture::after { content: "consultation"; font-weight: 400; color: var(--muted); font-size: 12px; }
.role-genius { --c: #17253A; }
.role-admin { --c: #1F3A5F; }
.role-promoteur { --c: #6B4FA0; }
.role-direction { --c: #2B6CB0; }
.role-secretariat { --c: #B7791F; }
.role-caisse { --c: #D39B00; }
.role-comptable { --c: #0F766E; }
.role-pointage { --c: #4D7C0F; }
.role-enseignant { --c: #1FA37A; }
.role-educatrice { --c: #D9537F; }
.role-parent { --c: #8B5E34; }
.role-eleve { --c: #0E7490; }
.role-tous { --c: var(--secondary); }

.chemin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 14.5px; color: var(--muted); }
.chemin > b { font-weight: 650; color: var(--ink); margin-right: 2px; }
.chemin .menu {
    display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 8px;
    background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 14px;
}
.chemin .sep { color: var(--muted); font-weight: 700; }
.chemin + .chemin { margin-top: 6px; }

.fiche-corps { padding: 4px 16px 20px; }
@media (min-width: 640px) { .fiche-corps { padding: 8px 28px 28px; } }

.rubrique { margin: 24px 0 0; }
.rubrique > h3 {
    display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
    font-size: 1.18rem;
}
.rubrique > h3::before {
    content: ""; width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    background: var(--primary-50) var(--i) center / 18px no-repeat;
}
.rubrique > p, .rubrique > ul, .rubrique > ol:not(.etapes) { max-width: 44rem; }

.r-but    { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F3A5F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E"); }
.r-qui    { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F3A5F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.r-etapes { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F3A5F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1'/%3E%3C/svg%3E"); }
.r-logique{ --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F3A5F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2z'/%3E%3C/svg%3E"); }
.r-pratiques { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23146B51' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.r-attention { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B85E00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.r-faq    { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F3A5F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.1 9a3 3 0 0 1 5.8 1c0 2-3 3-3 3M12 17h.01'/%3E%3C/svg%3E"); }
.r-pratiques > h3::before { background-color: var(--accent-50); }
.r-attention > h3::before { background-color: var(--warn-50); }

/* Listes à puces signifiantes */
.r-pratiques ul, ul.ok { list-style: none; padding-left: 0; }
.r-pratiques li, ul.ok li { position: relative; padding-left: 30px; }
.r-pratiques li::before, ul.ok li::before {
    content: ""; position: absolute; left: 4px; top: .45em; width: 16px; height: 16px; border-radius: 50%;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.r-attention { background: var(--warn-50); border: 1px solid var(--warn-line); border-radius: 14px; padding: 14px 16px 4px; }
.r-cas    { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23146B51' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E"); }
/* Cas pratique : une situation réelle de CS SALOMON, racontée du début à la fin (situation, gestes, résultat, logique) */
.r-cas { background: var(--accent-50); border: 1px solid #BFE3D5; border-radius: 14px; padding: 14px 16px 6px; }
.r-cas > h3::before { background-color: #fff; }
.r-cas .cas-situation { font-weight: 600; }
.r-cas ol, .r-cas ul { padding-left: 22px; }
.r-cas .cas-resultat { border-top: 1px dashed #BFE3D5; padding-top: 8px; }

.r-attention > h3 { color: #7A3E00; }
.r-attention > h3::before { background-color: #fff; }
.r-attention ul { padding-left: 1.2em; }
.r-attention li::marker { color: var(--warn); }

/* Questions fréquentes */
details.q { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 8px; background: #fff; max-width: 44rem; }
details.q > summary {
    list-style: none; cursor: pointer; padding: 12px 44px 12px 16px; position: relative;
    font-weight: 650; min-height: 48px; display: flex; align-items: center;
}
details.q > summary::-webkit-details-marker { display: none; }
details.q > summary::after {
    content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; border-radius: 50%; background: var(--primary-50); color: var(--primary);
    display: grid; place-items: center; font-size: 18px; font-weight: 700; line-height: 1;
}
details.q[open] > summary::after { content: "−"; }
details.q[open] > summary { border-bottom: 1px solid var(--line); }
details.q > :not(summary) { margin: 12px 16px; }
details.q > :last-child { margin-bottom: 14px; }

/* ===================== Étapes ===================== */
ol.etapes { list-style: none; padding: 0; margin: 0; counter-reset: etape; }
.etape { position: relative; counter-increment: etape; padding: 0 0 26px 50px; margin: 0; }
.etape::before {
    content: counter(etape); position: absolute; left: 0; top: -2px;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--secondary); color: var(--ink);
    display: grid; place-items: center; font-weight: 800; font-size: 17px;
    box-shadow: 0 0 0 4px #fff;
}
.etape::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--secondary-100); }
.etape:last-child { padding-bottom: 6px; }
.etape:last-child::after { display: none; }
.etape > h4 { font-size: 1.08rem; margin: 3px 0 6px; }
.etape > p, .etape > ul { max-width: 42rem; }
.etape > :last-child { margin-bottom: 0; }
.resultat { display: flex; gap: 8px; align-items: flex-start; color: var(--accent-700); font-weight: 550; }
.resultat::before { content: "→"; font-weight: 800; }

/* ===================== Figures (captures ordinateur + téléphone) ===================== */
figure.capture { margin: 14px 0 18px; }
.capture-vues { display: grid; gap: 14px; align-items: start; }
@media (min-width: 760px) {
    .capture-vues { grid-template-columns: minmax(0, 3fr) minmax(170px, 1fr); gap: 18px; }
    .capture-vues > .vue:only-child { grid-column: 1 / -1; }
    .capture-vues > .vue-telephone:only-child { max-width: 260px; }
}

.vue { position: relative; margin: 0; }
.vue img { display: block; width: 100%; height: auto; cursor: zoom-in; background: var(--ground); }
.vue-ordinateur {
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff;
    box-shadow: 0 8px 24px -12px rgba(17,31,51,.35);
}
.vue-ordinateur::before {
    content: ""; display: block; height: 22px; border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 12px 11px, #E8726B 4px, transparent 4.5px),
        radial-gradient(circle at 26px 11px, #F2C14E 4px, transparent 4.5px),
        radial-gradient(circle at 40px 11px, #5DBB7A 4px, transparent 4.5px),
        var(--ground);
}
.vue-telephone {
    justify-self: center; width: 100%; max-width: 250px;
    border: 7px solid #17253A; border-radius: 28px; overflow: hidden; background: #17253A;
    box-shadow: 0 10px 26px -12px rgba(17,31,51,.5);
}
.vue-telephone img { border-radius: 20px; }
.vue-legende { display: none; }

/* Capture absente : cadre discret, jamais d'image cassée */
.vue.manquante img { display: none; }
.vue.manquante .vue-attente { display: flex; }
.vue-attente {
    display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
    color: var(--muted); font-size: 14px; padding: 12px;
    background: repeating-linear-gradient(-45deg, #F7F9FC, #F7F9FC 10px, #EFF3F8 10px, #EFF3F8 20px);
}
.vue-ordinateur .vue-attente { aspect-ratio: 16 / 10; }
.vue-telephone .vue-attente { aspect-ratio: 390 / 844; border-radius: 20px; }
.vue-attente .ico { width: 28px; height: 28px; opacity: .6; }
.vue-attente code { font-size: 11.5px; background: #fff; word-break: break-all; }
.vue-telephone.manquante { border-color: #9AA7B8; background: #9AA7B8; }

figure.capture figcaption {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px;
    font-size: 14.5px; color: var(--muted);
}
figure.capture figcaption .texte { flex: 1 1 16rem; }

/* Bascule « ordinateur / téléphone » (ajoutée par manuel.js, commune à toutes les figures) */
.bascule { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--ground); border: 1px solid var(--line); }
.bascule button {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 10px;
    border: 0; border-radius: 9px; background: transparent; color: var(--muted);
    font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.bascule button .ico { width: 16px; height: 16px; }
.bascule button[aria-pressed="true"] { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(17,31,51,.18); }
/* .deux : ajoutée par manuel.js aux figures qui ont les deux vues */
html[data-vue="ordinateur"] .capture-vues.deux > .vue-telephone { display: none; }
html[data-vue="telephone"] .capture-vues.deux > .vue-ordinateur { display: none; }
html[data-vue="ordinateur"] .capture-vues.deux,
html[data-vue="telephone"] .capture-vues.deux { grid-template-columns: minmax(0, 1fr); }
html[data-vue="telephone"] .capture-vues.deux > .vue-telephone { max-width: 300px; }

/* Agrandissement (lightbox) */
.loupe {
    position: fixed; inset: 0; z-index: 90; background: rgba(12,22,36,.92);
    display: flex; flex-direction: column; align-items: center;
    overflow: auto; overscroll-behavior: contain; padding: 56px 12px 24px;
}
.loupe img { max-width: min(100%, 1440px); height: auto; border-radius: 8px; background: #fff; cursor: zoom-out; }
.loupe img.telephone { max-width: min(100%, 430px); }
.loupe p { color: #fff; margin: 12px 0 0; max-width: 60rem; text-align: center; font-size: 15px; }
.loupe-fermer {
    position: fixed; top: 10px; right: 10px; width: 48px; height: 48px; border-radius: 50%;
    border: 0; background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer;
}

/* ===================== Recherche ===================== */
.recherche {
    position: fixed; inset: 0; z-index: 80; background: rgba(17,31,51,.55);
    display: flex; justify-content: center; align-items: flex-start; padding: 0;
}
.recherche-boite {
    width: 100%; max-width: 680px; background: #fff; display: flex; flex-direction: column;
    height: 100%; max-height: 100%;
}
@media (min-width: 720px) {
    .recherche { padding: 8vh 16px; }
    .recherche-boite { height: auto; max-height: 80vh; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; }
}
.recherche-champ { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); padding-top: max(10px, env(safe-area-inset-top)); }
.recherche-champ .ico { color: var(--muted); }
.recherche-champ input {
    flex: 1; min-width: 0; min-height: 48px; border: 0; outline: 0; font: inherit; font-size: 18px; color: var(--ink); background: transparent;
}
.recherche-champ button { border: 0; background: var(--ground); border-radius: 12px; min-width: 48px; min-height: 44px; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; padding: 0 12px; }
.recherche-resultats { overflow-y: auto; padding: 8px; margin: 0; list-style: none; flex: 1; }
.recherche-resultats li { margin: 0; }
.recherche-resultats a { display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.recherche-resultats a:hover, .recherche-resultats a.choisi { background: var(--primary-50); }
.recherche-resultats .r-chap { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--primary); }
.recherche-resultats .r-titre { display: block; font-weight: 650; font-size: 16.5px; }
.recherche-resultats .r-extrait { display: block; font-size: 14.5px; color: var(--muted); margin-top: 2px; }
.recherche-resultats mark { background: var(--secondary-100); color: inherit; padding: 0 1px; border-radius: 3px; }
.recherche-vide { padding: 20px 16px; color: var(--muted); margin: 0; }
.recherche-aide { padding: 8px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin: 0; display: none; }
@media (min-width: 720px) { .recherche-aide { display: block; } }

/* Message éphémère (« Lien copié ») */
.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 95; transform: translateX(-50%);
    background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 15px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

/* ===================== Accueil ===================== */
.accueil-tete {
    margin: -20px -16px 28px; padding: 32px 16px 28px;
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-800) 100%); color: #fff;
}
@media (min-width: 640px) { .accueil-tete { margin: -28px -28px 36px; padding: 44px 28px 36px; border-radius: 0 0 24px 24px; } }
@media (min-width: 1280px) { .accueil-tete { margin: -36px -48px 40px; padding: 52px 48px 40px; } }
.accueil-tete h1 { color: #fff; font-size: clamp(2rem, 6vw, 2.8rem); margin: 8px 0 10px; letter-spacing: -.015em; }
.accueil-tete p { color: #DCE2EA; font-size: 1.12rem; max-width: 40rem; }
.accueil-tete .surtitre { color: var(--secondary); }
.accueil-tete .surtitre .ico { color: var(--secondary); }
.accueil-logo { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.accueil-chercher {
    display: flex; align-items: center; gap: 10px; width: 100%; max-width: 32rem; min-height: 54px; margin-top: 18px; padding: 0 16px;
    border: 0; border-radius: 14px; background: #fff; color: var(--muted); font: inherit; font-size: 17px; text-align: left; cursor: text;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
}
.accueil-chercher .ico { color: var(--primary); }

.cartes { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 16px 0 8px; padding: 0; list-style: none; }
@media (min-width: 560px) { .cartes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .cartes-3 { grid-template-columns: repeat(3, 1fr); } }
.cartes > li { margin: 0; }
.carte {
    display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px;
    border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
    color: var(--ink); text-decoration: none;
}
a.carte:hover { border-color: var(--primary); box-shadow: 0 8px 20px -12px rgba(31,58,95,.5); color: var(--ink); }
.carte-tete { display: flex; align-items: center; gap: 12px; }
.carte-icone { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.carte-icone.jaune { background: var(--secondary-100); color: var(--secondary-700); }
.carte-icone.vert { background: var(--accent-50); color: var(--accent-700); }
.carte h3 { margin: 0; font-size: 1.12rem; }
.carte p { margin: 0; color: var(--muted); font-size: 15.5px; }
.carte .ecrans { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }
.carte .ecrans li { margin: 0; font-size: 13px; padding: 2px 8px; border-radius: 7px; background: var(--ground); color: var(--ink); }

/* Tableau des rôles : tableau sur grand écran, cartes empilées sur téléphone */
.tableau { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 15.5px; }
.tableau th, .tableau td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tableau thead th { background: var(--primary); color: #fff; font-size: 14px; font-weight: 650; }
.tableau thead th:first-child { border-radius: 10px 0 0 0; }
.tableau thead th:last-child { border-radius: 0 10px 0 0; }
.tableau tbody tr:nth-child(even) td, .tableau tbody tr:nth-child(even) th { background: #FAFBFD; }
.tableau tbody th { font-weight: 650; white-space: nowrap; }
.puce-espace { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; border-radius: 7px; background: var(--primary-50); color: var(--primary-800); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
@media (max-width: 719px) {
    .tableau thead { display: none; }
    .tableau, .tableau tbody, .tableau tr, .tableau td, .tableau th { display: block; width: 100%; }
    .tableau tr { border: 1px solid var(--line); border-radius: 14px; margin: 0 0 10px; overflow: hidden; }
    .tableau tbody th { background: var(--primary-50) !important; border-bottom: 1px solid var(--line); }
    .tableau td { border: 0; padding: 6px 12px; }
    .tableau td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
}

/* Schéma de la fiche (page d'accueil) */
.schema-fiche { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 8px; }
@media (min-width: 640px) { .schema-fiche { grid-template-columns: 1fr 1fr; } }
.schema-fiche li { margin: 0; counter-increment: s; padding: 10px 12px 10px 48px; position: relative; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.schema-fiche li::before { content: counter(s); position: absolute; left: 12px; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.schema-fiche b { display: block; }
.schema-fiche span { color: var(--muted); font-size: 15px; }

/* Glossaire */
.terme { margin: 0 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.terme > h3 { margin: 0 0 4px; font-size: 1.1rem; color: var(--primary); }
.terme > :last-child { margin-bottom: 0; }
.terme .voir { font-size: 14.5px; color: var(--muted); }
.lettres { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
.lettres li { margin: 0; }
.lettres a { display: inline-flex; min-height: 40px; align-items: center; padding: 0 12px; border-radius: 10px; background: var(--ground); text-decoration: none; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.lettres a:hover { background: var(--primary-50); color: var(--primary); }

/* Pied de chapitre : précédent / suivant */
.suite { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.suite a { display: flex; flex-direction: column; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); font-weight: 650; min-height: 64px; justify-content: center; }
.suite a:hover { border-color: var(--primary); background: var(--primary-50); }
.suite small { font-weight: 500; color: var(--muted); font-size: 13px; }
.suite .suivant { text-align: right; grid-column: 2; }
.pied { margin-top: 40px; font-size: 14px; color: var(--muted); }

/* Remonter */
.haut {
    position: fixed; right: 14px; bottom: 16px; z-index: 30; width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid var(--line); background: #fff; color: var(--primary); display: grid; place-items: center;
    box-shadow: 0 6px 16px -6px rgba(17,31,51,.35); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.haut.visible { opacity: 1; pointer-events: auto; }

/* ===================== Impression ===================== */
@media print {
    @page { margin: 16mm 14mm; }
    body { font-size: 11pt; line-height: 1.5; color: #000; }
    .barre, .sommaire, .voile, .haut, .chapitre-outils, .bascule, .lien-section, .suite, .toast, .loupe, .recherche, .saut, .accueil-chercher { display: none !important; }
    .contenu-enveloppe { margin: 0 !important; }
    .contenu { max-width: none; padding: 0; }
    .accueil-tete { margin: 0 0 16pt; padding: 0; background: none; color: #000; }
    .accueil-tete h1, .accueil-tete p { color: #000; }
    a { color: #000; text-decoration: none; }
    .fiche { border: 0; border-radius: 0; margin: 0; break-before: page; overflow: visible; }
    .fiche-tete { background: none; padding: 0 0 8pt; border-bottom: 2px solid #000; }
    .fiche-corps { padding: 0; }
    .rubrique > h3::before { display: none; }
    .r-attention { background: none; border: 1px solid #000; }
    .r-cas { background: none; border: 1px solid #000; break-inside: avoid-page; }
    .etape { break-inside: avoid-page; }
    figure.capture { break-inside: avoid; }
    .capture-vues { grid-template-columns: 3fr 1fr !important; }
    .vue { display: block !important; }
    .vue-ordinateur, .vue-telephone { box-shadow: none; }
    .vue.manquante { display: none !important; }
    details.q { border: 0; break-inside: avoid; }
    details.q > summary::after { display: none; }
    .a-rediger { display: none; }
    .modules { background: none; border: 1px solid #999; }
    h2, h3, h4 { break-after: avoid; }
}

/* ===================== Ajustements téléphone ===================== */
.accueil-logo { display: block; margin-bottom: 14px; }
.vue { z-index: 1; }
@media (max-width: 639px) {
    /* Étapes : pastille à gauche du titre, texte et figures sur toute la largeur */
    .etape { padding-left: 0; }
    .etape::before { position: relative; top: 0; float: left; width: 32px; height: 32px; margin: 0 12px 4px 0; font-size: 16px; box-shadow: none; }
    .etape::after { display: none; }
    .etape > h4 { min-height: 32px; padding-top: 3px; }
    .etape > :not(h4) { clear: left; }
    .etape > figure.capture { margin-left: 0; }
    .etape + .etape { border-top: 1px dashed var(--line); padding-top: 18px; }
}
@media (max-width: 759px) {
    .vue-telephone.manquante { max-width: 170px; }
}
