/* Limpide — en-tête fixe, fil qui défile, champ de question fixé en bas (ADR-022) ; réponse générée, textes cités à
   l'identique, panneau « sous le capot ».
   Règle visuelle : la réponse de l'assistant et les textes officiels ne doivent jamais se confondre. */

/* Polices servies par le site (aucune requête vers un tiers) : Public Sans pour l'interface et la réponse, Literata
   pour les seuls textes officiels. Sous-ensemble latin de Fontsource 5.3.0, licence SIL OFL 1.1 (wwwroot/fonts). */
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/public-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/public-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/public-sans-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/literata-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/literata-latin-600-normal.woff2") format("woff2"); }

/* Palette de la direction 2 (bleu-vert), claire puis sombre ; contrastes mesurés, tous au moins AA.
   Thème : réglage « Apparence » du menu. Automatique (par défaut) suit l'appareil ; Clair et Sombre posent
   data-theme sur <html> (App.razor et limpide.js). Le bloc sombre est donc écrit deux fois. */
:root {
    --bg: #F2F5F4;
    --surface: #FFFFFF;
    --text: #14212B;
    --muted: #4F5F69;
    --border: #D3DCDA;
    --control-border: #4F5F69; /* contour des champs : au moins 3:1 contre --surface et --bg */
    --accent: #0E5A6B;
    --on-accent: #FFFFFF; /* texte posé sur --accent */
    --accent-soft: #E3EFF1;
    --source-bg: #FBFAF5;
    --source-rule: #b9a25a; /* filet décoratif */
    --source-ink: #7A6628; /* identifiants [P1] : 5,35:1 sur --source-bg */
    --warn-bg: #fff6e0;
    --warn-border: #e2b74a;
    --danger: #a32020;
    --ok: #2d7a46;
    --band: #1F2D36; /* bande « Au fond » : la couche la plus profonde */
    --band-ink: #E3EAEE;
    --band-muted: #A9B8C1; /* 6,9:1 sur --band */
    --band-rule: #3A4A55;
    --band-step: #4F8C99; /* traits d'étape, décoratifs */
    --radius: 10px;
    --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --serif: Literata, Georgia, "Times New Roman", serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="clair"]) {
        --bg: #0F171D;
        --surface: #17232B;
        --text: #E3EAEE;
        --muted: #A9B8C1;
        --border: #2C3B45;
        --control-border: #6F808A;
        --accent: #7FC4D1;
        --on-accent: #0F171D;
        --accent-soft: #1E3A42;
        --source-bg: #1D1B15;
        --source-rule: #a08a45;
        --source-ink: #D9C27A;
        --warn-bg: #2d2615;
        --warn-border: #8a6d22;
        --danger: #ef8a8a;
        --ok: #7fcf98;
        --band: #0A1116;
        --band-ink: #E3EAEE;
        --band-muted: #A9B8C1; /* 9,3:1 sur --band */
        --band-rule: #2C3B45;
        --band-step: #4F8C99;
        color-scheme: dark;
    }
}

:root[data-theme="sombre"] {
    --bg: #0F171D;
    --surface: #17232B;
    --text: #E3EAEE;
    --muted: #A9B8C1;
    --border: #2C3B45;
    --control-border: #6F808A;
    --accent: #7FC4D1;
    --on-accent: #0F171D;
    --accent-soft: #1E3A42;
    --source-bg: #1D1B15;
    --source-rule: #a08a45;
    --source-ink: #D9C27A;
    --warn-bg: #2d2615;
    --warn-border: #8a6d22;
    --danger: #ef8a8a;
    --ok: #7fcf98;
    --band: #0A1116;
    --band-ink: #E3EAEE;
    --band-muted: #A9B8C1; /* 9,3:1 sur --band */
    --band-rule: #2C3B45;
    --band-step: #4F8C99;
    color-scheme: dark;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 1rem/1.55 var(--font);
}

@media (min-width: 40rem) {
    body { font-size: 1.0625rem; } /* 17 px sur ordinateur, 16 px sur mobile */
}

a { color: var(--accent); }

/* Gabarit : la fenêtre entière, en 100dvh pour suivre le clavier sur mobile ; seule la zone du fil défile. */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
/* position : les éléments masqués (.sr-only, en absolute) se placent dans le fil ; sans elle, ils se plaçaient par
   rapport à la fenêtre et, au bout d'un long fil, faisaient défiler la page entière (double barre de défilement). */
.thread { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.page, .site-footer, .composer form {
    max-width: 50rem;
    margin: 0 auto;
    padding-inline: 1rem;
}

.page { padding-block: 1.5rem 1rem; }
.composer form { max-width: 58.75rem; } /* aligné sur les questions du fil */

/* En-tête fixe : nom, mention de l'article 50, retour aux questions (hors de leur écran), menu. Sur mobile, la
   mention passe sur sa propre ligne, entière. */
.site-header {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "brand notice retour menu";
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.brand { grid-area: brand; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.ai-notice { grid-area: notice; margin: 0; font-size: 0.875rem; line-height: 1.45; }
.ai-badge {
    display: inline-block;
    margin-right: 0.6rem;
    padding: 0 0.45rem;
    border: 1.5px solid currentColor;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.15rem;
}

.menu-button {
    grid-area: menu;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 0.9rem;
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--control-border);
    border-radius: 8px;
    font-weight: 600;
}

@media (max-width: 40rem) {
    .site-header {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "menu brand retour" "notice notice notice";
        padding: 0.25rem 1rem 0.6rem;
    }
    .menu-button { width: 2.75rem; padding: 0; justify-content: center; border: 0; background: none; margin-left: -0.6rem; }
    .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .brand { font-size: 1.25rem; }
    .ai-notice { font-size: 0.8125rem; }
    .retour-questions { padding: 0 0.8rem; font-size: 0.9375rem; }
}

/* Fil de lecture (ADR-022) : le retour aux questions, toujours au même endroit, et le filet des quatre chapitres,
   qui sert de bordure à l'en-tête (le chapitre en cours plein). */
.retour-questions {
    grid-area: retour;
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 2px solid transparent; /* visible en contraste élevé (forced-colors), où le fond disparaît */
    border-radius: 8px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.retour-questions:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.site-header.avec-filet { border-bottom: 0; }
.fil-filet { flex: 0 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; height: 3px; background: var(--bg); }
.fil-filet span { background: var(--border); }
.fil-filet .en-cours { background: var(--accent); }
@media (forced-colors: active) {
    .fil-filet span { background: GrayText; }
    .fil-filet .en-cours { background: Highlight; }
}

/* Panneau du menu : <dialog> modal, à droite sur ordinateur, à gauche sur mobile. */
.menu-panel {
    inset: 0 0 0 auto;
    margin: 0;
    width: min(24rem, 100vw);
    height: 100%;
    max-height: none;
    max-width: none;
    padding: 0;
    border: 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: -1rem 0 2.5rem rgba(20, 33, 43, 0.14);
}

.menu-panel::backdrop { background: rgba(20, 33, 43, 0.45); }

@media (max-width: 40rem) {
    .menu-panel { inset: 0 auto 0 0; width: min(19rem, 85vw); }
}

.menu-content { display: flex; flex-direction: column; min-height: 100%; padding: 0.75rem 1.25rem 1.25rem; }
.menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.menu-head h2 { margin: 0; font-size: 1.1rem; }

.menu-close {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0 0.6rem;
    background: none;
    color: var(--text);
    border: 0;
    border-radius: 8px;
    font-weight: 600;
}

.menu-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }

.menu-links a {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.menu-links svg { flex: 0 0 auto; color: var(--accent); }
.menu-links a.current { background: var(--accent-soft); font-weight: 800; }
.menu-hint { display: block; font-size: 0.82rem; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
/* Réglage « Apparence » : trois boutons radio en segments, en bas du panneau. Chaque segment prend la largeur de son
   libellé (« Automatique » tient à 320 px), puis l'espace restant se partage. */
.theme-choice { margin: auto 0 0; padding: 0.9rem 0 0; border: 0; border-top: 1px solid var(--border); }
.theme-choice legend { padding: 0; font-size: 0.875rem; font-weight: 800; }
.theme-segments {
    display: flex;
    margin-top: 0.5rem;
    border: 1.5px solid var(--control-border);
    border-radius: 8px;
    overflow: hidden;
}
.theme-segments label {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.theme-segments input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.theme-segments label:has(input:checked) { background: var(--accent); color: var(--on-accent); }
.theme-segments label:has(input:focus-visible) { outline: 2px solid currentColor; outline-offset: -5px; }
/* Contraste élevé : les fonds disparaissent, le choix actif garde un contour et un soulignement. */
@media (forced-colors: active) {
    .theme-segments label:has(input:checked) { outline: 3px solid Highlight; outline-offset: -4px; text-decoration: underline; }
}
.theme-hint { margin: 0.4rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.menu-foot { display: flex; flex-wrap: wrap; gap: 0 1.1rem; margin: 0.75rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--border); font-size: 0.82rem; }
.menu-foot a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--muted); }

/* Champ de question fixé en bas de la fenêtre. */
.composer {
    flex: 0 0 auto;
    max-height: 45dvh;
    overflow-y: auto;
    padding-block: 0.6rem 0.75rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

h1:focus { outline: none; }

h1, h2, h3 { line-height: 1.25; }

/* Lu par les lecteurs d'écran seulement. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Lignes de 60 à 75 caractères pour les textes à lire ; les mots sans espace (adresses web des textes officiels)
   passent à la ligne au lieu de déborder sur mobile, sans que le texte change. */
.answer-text, .verbatim { max-width: 70ch; }
.answer-text, .verbatim { overflow-wrap: anywhere; }

/* En-tête */
/* Champ de question (ADR-022, maquette) : le bouton dans le cadre, le contour de focus sur le cadre ; dessous, les
   limites à leur approche, puis la ligne de conservation et sa case (ADR-019). */
.ask { display: flex; flex-direction: column; gap: 0.4rem; }
.champ { display: flex; align-items: flex-end; gap: 0.75rem; padding: 0.375rem 0.375rem 0.375rem 1.25rem; background: var(--bg); border: 1.5px solid var(--control-border); border-radius: 12px; }
.champ:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.champ textarea { flex: 1 1 auto; min-width: 0; padding: 0.625rem 0; border: 0; background: transparent; color: inherit; font: inherit; resize: none; overflow-y: hidden; overflow-wrap: anywhere; }
.champ textarea:focus-visible { outline: none; } /* le contour est sur le cadre */
.champ textarea::placeholder { color: var(--muted); opacity: 1; }
.champ button { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1.125rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.champ button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.champ button[aria-disabled="true"] { cursor: progress; } /* le sablier dit l'état ; sans opacité, le contraste reste */
/* Bouton réduit à son icône (le texte d'aide dit déjà « Posez votre question ») : le libellé reste son nom. */
.champ button { position: relative; width: 2.75rem; padding: 0; }
.bouton-libelle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.libelle-court { display: none; } /* variante téléphone d'un libellé (.libelle-long sur ordinateur) */
.limites { display: flex; gap: 1rem; margin: 0; font-size: 0.875rem; font-weight: 600; }
.limites > :first-child { flex: 1 1 auto; }
.compteur { font-variant-numeric: tabular-nums; }
.conservation { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.1rem; font-size: 0.875rem; color: var(--muted); }
.keep-choice { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; margin-left: auto; color: var(--text); cursor: pointer; }
.keep-choice input[type="checkbox"] { width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--accent); cursor: pointer; }

button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.6; }

.error { color: var(--danger); font-weight: 600; margin: 0.6rem 0 0; }
.ask .error { margin: 0; }

/* Fenêtre trop basse (zoom à 400 %, téléphone à l'horizontale, clavier ouvert) : plus rien n'est fixé, toute la page
   défile, pour que le fil ne soit jamais écrasé entre l'en-tête et le champ (WCAG 1.4.10). Au-dessus, le champ compact
   tient entier jusqu'à 320 × 568. */
@media (max-height: 34rem) {
    .app { height: auto; min-height: 100dvh; }
    .thread { overflow: visible; }
    .composer { max-height: none; overflow: visible; }
}

/* Sections de résultat */
section { margin-top: 1.5rem; }

section h2 { font-size: 1.15rem; margin: 0 0 0.6rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.label { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.muted { color: var(--muted); }

/* Réponse générée : encadré bleu, sans-serif */ /* focus posé par le code à l'arrivée de la réponse, pas une étape du clavier */
.answer-text > :first-child { margin-top: 0; }
.answer-text > :last-child { margin-bottom: 0; }

.cite {
    font-size: 0.8em;
    font-weight: 600;
    text-decoration: none;
    background: var(--accent-soft);
    border-radius: 4px;
    padding: 0 0.2em;
}

.warning {
    margin: 1rem 0 0;
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
}

.disclaimer { margin: 1rem 0 0; font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 0.6rem; }

/* Textes officiels reproduits : fond papier, filet doré, serif. La couche « Dessous » d'une réponse est la seule sur
   papier ; chaque extrait y est une carte repliée (<details>), ouverte au clic ou par son renvoi [P1]. */
.couche-textes { background: var(--source-bg); }
.carte { border-top: 1px solid var(--border); scroll-margin-top: 1rem; }
.carte > summary { display: flex; align-items: baseline; gap: 0.75rem; min-height: 2.75rem; padding: 0.6rem 0; list-style: none; cursor: pointer; }
.carte > summary::-webkit-details-marker { display: none; }
.carte > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.id { font-weight: 800; color: var(--source-ink); }
.carte-titre { flex: 1 1 auto; min-width: 0; font: 600 1.125rem/1.3 var(--serif); overflow-wrap: break-word; }
.carte-action { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.carte .replier, .carte[open] .lire { display: none; }
.carte[open] .replier { display: inline; }
.carte[open] .carte-action svg { transform: rotate(180deg); }
.verbatim { font-family: var(--serif); white-space: pre-wrap; } /* reproduit à l'identique, retours à la ligne compris */
.carte .verbatim { margin: 0.1rem 0 0.75rem; padding-left: 1rem; border-left: 3px solid var(--source-rule); font-size: 1.0625rem; line-height: 1.7; }
.carte-pied { margin: 0 0 1rem; font-size: 0.8125rem; color: var(--muted); }

.guardrails { margin: 0; padding-left: 1.2rem; }
.ok { color: var(--ok); margin: 0; }

.table-scroll { overflow-x: auto; }
/* Formulaire de retours */
.feedback {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.feedback label { display: block; font-weight: 600; font-size: 0.92rem; margin: 0.8rem 0 0.3rem; }
.feedback label.checkbox { font-weight: 400; display: flex; gap: 0.5rem; align-items: baseline; }

.feedback textarea {
    width: 100%;
    resize: vertical;
    font: inherit;
    color: inherit;
    background: var(--bg);
    border: 1px solid var(--control-border);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
}

.feedback .hint { font-size: 0.85rem; color: var(--muted); margin: 0.8rem 0 0; }
.feedback .privacy { font-size: 0.82rem; color: var(--muted); margin: 0.9rem 0; }

.feedback button {
    background: var(--surface);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.45rem 1rem;
    font-weight: 600;
}

/* Comment il est construit : les briques (TechStack.razor), en cartes groupées par rôle ; icônes en masque, dans la
   couleur du texte (lisibles en clair comme en sombre). Sous une brique, le choix qui compte et sa décision. */
/* Plus spécifique que .page:has(> .coupe-page) (65rem), écrite plus loin : ces deux pages sont aussi en .coupe-page. */
.page:has(> .construction.coupe-page), .page:has(> .mise-a-jour.coupe-page),
.page:has(> .evaluation.coupe-page), .page:has(> .evaluation-detail.coupe-page),
.page:has(> .donnees-page.coupe-page) { max-width: 74rem; }
.construction .titre-bloc, .mise-a-jour .titre-bloc, .evaluation .titre-bloc, .evaluation-detail .titre-bloc,
.donnees-page .titre-bloc { margin: 0; font-size: 1.375rem; font-weight: 800; }
.construction .chiffres-cles { margin-top: 2.5rem; }
.briques-bloc { margin-top: 4rem; }
.briques-chapeau { margin: 0.25rem 0 0; font-size: 0.9375rem; color: var(--muted); }
.briques { display: flex; flex-direction: column; gap: 2.5rem; margin-top: 1.5rem; }
.briques-groupe h3 { margin: 0 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.briques-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem 1.25rem; }
.brique { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.brique-texte { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.brique .role { color: var(--muted); font-size: 0.875rem; line-height: 1.45; }
.brique-choix { margin-top: 0.35rem; font-size: 0.875rem; line-height: 1.45; }
/* Décisions côte à côte (cibles de 44 px sans chevauchement) ; la marge négative, sur le conteneur, rend l'air du bas. */
.brique-decisions { display: flex; flex-wrap: wrap; gap: 0 1rem; margin-bottom: -0.6rem; }
.brique-decision { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.875rem; font-weight: 600; }
.brique .icon {
    flex: 0 0 1.75rem; height: 1.75rem; margin-top: 0.05rem;
    background-color: var(--text);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}
.brique .icon.text {
    background: none; -webkit-mask: none; mask: none;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border); border-radius: 50%; color: var(--muted); font-weight: 800; font-size: 0.8125rem;
}
@media (forced-colors: active) { .brique .icon { background-color: CanvasText; } }
.briques-plus { margin: 0.75rem 0 0; font-size: 0.9375rem; color: var(--muted); }
.briques-plus a, .lien-decisions a, .maj-retour a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }
.briques .legal { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.lien-decisions { margin: 1.75rem 0 0; }

/* Comment les textes restent à jour (MiseAJour.razor) : les six commandes en chaîne, puis ce qui la rend sûre. */
.mise-a-jour > section { margin-top: 3rem; }
.commandes { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
.commandes li { position: relative; display: flex; flex-direction: column; gap: 0.35rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 0.9375rem; line-height: 1.4; }
.commande-tete { display: flex; align-items: center; gap: 0.6rem; }
.commande-num { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 0.8125rem; font-weight: 800; }
.commandes code { font-size: 1rem; font-weight: 700; }
.principes { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem 2.5rem; }
.principes li { display: flex; flex-direction: column; gap: 0.25rem; padding-top: 0.9rem; border-top: 2px solid var(--text); }
.principes strong { font-size: 1.0625rem; }
.principes a { align-self: flex-start; display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.875rem; font-weight: 600; }
.maj-retour { margin: 3rem 0 0; color: var(--muted); }
@media (min-width: 48rem) { .principes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) {
    .commandes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .commandes.etapes-mesure { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .commandes li { min-height: 7.5rem; }
}

.site-footer { padding-block: 1rem 2rem; font-size: 0.82rem; color: var(--muted); border-top: 1px solid var(--border); }

/* Pages secondaires en coupe (ADR-022) : un bloc à trois couches, de l'essentiel au détail puis à la méthode.
   Le papier et le serif restent réservés aux textes officiels ; la bande du fond est la couche la plus profonde. */
.page:has(> .coupe-page) { max-width: 65rem; }
/* « La suite » (LaSuite.razor), en bas de chaque chapitre du fil : la question suivante, un vrai chiffre, un bouton. */
.la-suite { margin-top: 4.5rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding: 1.5rem 1.25rem; border-radius: 16px; background: var(--accent-soft); }
.la-suite-chapeau { margin: 0; font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.la-suite h2 { margin: 0.35rem 0 0; font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.la-suite-accroche { margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.la-suite-accroche strong { font-size: 2.25rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.la-suite-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0.25rem; }
.la-suite-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; font-weight: 600; }
.la-suite-actions .la-suite-bouton { min-height: 3.25rem; padding: 0 1.5rem; border: 2px solid transparent; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 1.0625rem; font-weight: 800; text-decoration: none; }
.la-suite-bouton:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@media (min-width: 48rem) {
    .la-suite { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.25rem 2.5rem; padding: 1.75rem 2rem; }
    .la-suite h2 { font-size: 1.875rem; }
    .la-suite-actions { align-items: flex-end; }
}

.back-link { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.75rem; margin-left: -0.35rem; padding: 0 0.35rem; font-weight: 600; text-decoration: none; }
.coupe-page h1 { margin: 0.4rem 0 0; font-size: 2.75rem; font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
.coupe-page .lede { margin: 0.75rem 0 0; max-width: 60ch; color: var(--muted); font-size: 1.125rem; }

.coupe { margin-top: 1.75rem; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px rgba(20, 33, 43, 0.10); }
.couche { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.25rem; margin: 0; padding: 1.75rem; } /* sans la marge des anciennes sections */
.couche + .couche { border-top: 1px solid var(--border); }
.couche-label { padding-top: 0.4rem; font-size: 0.8125rem; color: var(--muted); }
.couche h2 { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.couche h3 { margin: 0 0 0.35rem; font-size: 1.0625rem; font-weight: 800; }
.couche p { max-width: 72ch; }
.couche-promise { margin: 0.15rem 0 1.4rem; color: var(--muted); }
.couche-surface { background: var(--surface); }
.couche-dessous { background: var(--bg); }
/* Papier et Literata : réservés aux textes officiels reproduits (extraits sous les réponses), jamais à un texte de
   Limpide, même quand il parle de ces textes. */
.couche-fond { background: var(--band); color: var(--band-ink); color-scheme: dark; scrollbar-color: var(--band-muted) var(--band-rule); } /* bande sombre dans les deux thèmes : barres de défilement sombres */
.couche-fond.couche { border-top-color: var(--band-rule); }
.couche-fond .couche-label, .couche-fond .couche-promise, .couche-fond .muted { color: var(--band-muted); }
.couche-fond a { color: var(--band-ink); }
.couche-fond :focus-visible { outline: 2px solid var(--band-ink); outline-offset: 3px; }

.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem 1.75rem; }
.colonnes > div { padding-top: 0.75rem; border-top: 2px solid currentColor; }
.colonnes p, .colonnes ul { margin: 0; font-size: 0.95rem; }
.colonnes p + p, .colonnes ul + p { margin-top: 0.6rem; }
.separe { margin-top: 1.75rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.couche-fond .colonnes > div, .couche-fond .separe { border-top: 1px solid var(--band-rule); }
.separe.colonnes { padding-top: 0; border-top: 0; } /* chaque colonne porte déjà son filet ; après la règle du fond */
.separe > p { margin: 0; }
.separe > p + p { margin-top: 0.4rem; } /* le filet court sur toute la largeur, le texte garde sa mesure */


.liste-filets { list-style: none; margin: 0; padding: 0; }
.liste-filets li { padding: 0.6rem 0; border-top: 1px solid var(--border); }
.couche-fond .liste-filets li { border-top-color: var(--band-rule); }

/* Ce que fait Limpide, en une minute : le parcours d'une question (étapes ouvertes au clic), un aperçu d'une réponse,
   ce que Limpide ne fait pas, trois chiffres, le reste replié. En colonne jusqu'à 64rem, en rangée au-delà. */
.page:has(> .apropos) { max-width: 74rem; } /* six étapes de front : plus large que les autres pages en coupe */
.apropos .titre-bloc { margin: 0 0 0.6rem; font-size: 1.375rem; font-weight: 800; }

.parcours { margin-top: 3.5rem; }
.parcours-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.9rem; margin-bottom: 1rem; }
.parcours-tete .titre-bloc { margin: 0; }
.parcours-tete p { margin: 0; font-size: 0.875rem; color: var(--muted); }
.parcours-etapes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.75rem; }
.etape { position: relative; }
/* Flèche vers l'étape suivante, dans l'intervalle : vers le bas en colonne, vers la droite en rangée. */
.etape:not(:last-child)::after, .commandes li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.875rem;
    width: 22px;
    height: 14px;
    transform: translate(-50%, 50%) rotate(90deg);
    background-color: var(--accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h19M16 3l6 5-6 5'/%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 26 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h19M16 3l6 5-6 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (forced-colors: active) { .etape:not(:last-child)::after, .commandes li:not(:last-child)::after { background-color: CanvasText; } }
.etape-oui { position: absolute; left: calc(50% + 1rem); bottom: -0.875rem; transform: translateY(50%); font-size: 0.75rem; font-weight: 800; line-height: 1; color: var(--accent); }

.etape-carte {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.etape-carte:hover { border-color: var(--accent); }
.etape-carte:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.decision .etape-carte { background: var(--accent-soft); border: 1.5px dashed var(--control-border); }
.etape-carte[aria-expanded="true"] { background: var(--accent-soft); border: 2px solid var(--accent); }
.decision .etape-carte[aria-expanded="true"] { border-style: dashed; } /* reste une étape de tri, même ouverte */
.etape-tete { align-self: stretch; display: flex; align-items: center; gap: 0.6rem; }
.etape-num { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 0.8125rem; font-weight: 800; }
.etape-titre { font-weight: 800; line-height: 1.25; }
.etape-chevron { flex: 0 0 auto; margin-left: auto; color: var(--accent); transition: transform 0.15s; }
.etape-carte[aria-expanded="true"] .etape-chevron { transform: rotate(180deg); }
.etape-resume { font-size: 0.9375rem; line-height: 1.4; }
/* Où l'étape a lieu ; plein quand la question quitte le serveur de Limpide. */
.repere { margin-top: auto; display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.5rem 0.1rem 0.4rem; border: 1px solid var(--border); border-radius: 0.6rem; color: var(--muted); font-size: 0.8125rem; font-weight: 600; line-height: 1.3; }
.repere svg { flex: 0 0 auto; }
.repere-sortie { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.etape-detail-ici { margin: 0.5rem 0 0; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 0.9375rem; }
.etape-detail-dessous, .vers-reponse { display: none; }

/* Aperçu schématique d'une réponse, en pleine largeur : une rangée par couche (nom réel, contenu, lignes factices). */
.apercu-bloc { margin-top: 2.25rem; }
.apercu { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px rgba(20, 33, 43, 0.10); }
.apercu-couche { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; padding: 1.1rem 1.25rem 1.25rem; }
.apercu-label { font-size: 0.8125rem; color: var(--muted); }
.apercu p { margin: 0; }
.apercu p strong { display: block; font-size: 1.125rem; font-weight: 800; }
.apercu p > span { color: var(--muted); }
.apercu-reponse { background: var(--surface); }
.apercu-textes { background: var(--source-bg); border-top: 1px solid var(--border); }
.apercu-calcul { background: var(--band); color: var(--band-ink); }
.apercu-calcul .apercu-label, .apercu-calcul p > span { color: var(--band-muted); }
.apercu i { display: block; height: 0.5rem; border-radius: 0.25rem; background: var(--border); }
.apercu-lignes { display: flex; flex-direction: column; gap: 0.55rem; }
.apercu-ligne { display: flex; align-items: center; gap: 0.5rem; }
.apercu-ligne i { width: 66%; }
.apercu-ligne:nth-child(2) i { width: 90%; }
.apercu-ligne:nth-child(3) i { width: 48%; }
.apercu-ligne b { padding: 0 0.35rem; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 0.75rem; }
.apercu-extrait { display: flex; flex-direction: column; gap: 0.55rem; padding-left: 0.85rem; border-left: 3px solid var(--source-rule); }
.apercu-extrait i { width: 92%; }
.apercu-extrait i:first-child { width: 40%; background: var(--source-rule); opacity: 0.55; } /* place de la source */
.apercu-extrait i:last-child { width: 70%; }
.apercu-etapes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.apercu-etapes i { height: 0.375rem; background: var(--band-step); }

.ne-fait-pas-bloc { margin-top: 3rem; }
.ne-fait-pas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.ne-fait-pas li { display: flex; gap: 0.75rem; padding-top: 0.9rem; border-top: 2px solid var(--text); }
.ne-fait-pas svg { flex: 0 0 auto; margin-top: 0.15rem; }
.ne-fait-pas strong { display: block; font-size: 1.0625rem; }

/* Chiffres clés, sans lien : on avance par le fil de lecture, on saute une page par le menu. */
.chiffres-cles { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 1.5rem; }
.chiffres-cles li { display: flex; flex-direction: column; gap: 0.15rem; padding: 1.1rem 1.25rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.chiffres-cles strong { font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.chiffres-cles span { font-size: 0.9375rem; }

@media (prefers-reduced-motion: reduce) {
    .etape-chevron { transition: none; }
}

@media (min-width: 64rem) {
    .parcours-etapes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.75rem; }
    .etape-carte { min-height: 9.5rem; }
    .etape:not(:last-child)::after, .commandes li:not(:last-child)::after { left: auto; right: -0.875rem; top: 50%; bottom: auto; transform: translate(50%, -50%); }
    .etape-oui { left: auto; right: -0.875rem; top: 50%; bottom: auto; transform: translate(50%, -1.4rem); }
    /* Le détail dans l'étape reste lu par les lecteurs d'écran ; à l'œil, il s'affiche sous la rangée. */
    .etape-detail-ici { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    .etape-detail-dessous { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.5rem; margin-top: 1rem; padding: 1.15rem 1.5rem; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--surface); }
    .etape-detail-dessous p { margin: 0; max-width: 78ch; }
    .etape-detail-titre { font-size: 1.125rem; font-weight: 800; line-height: 1.3; }
    /* Flèche de la dernière étape vers l'aperçu de la réponse, sous la sixième colonne. */
    .vers-reponse { display: flex; justify-content: center; width: calc((100% - 5 * 1.75rem) / 6); margin-left: auto; padding-top: 0.25rem; color: var(--accent); }
    /* Plus d'air entre les blocs ; l'aperçu suit la flèche de la dernière étape. */
    .apercu-bloc { margin-top: 0.25rem; }
    .apercu-couche { grid-template-columns: 7rem minmax(0, 0.9fr) minmax(0, 1fr); gap: 2rem; align-items: center; padding: 1.5rem 2rem; }
    .ne-fait-pas-bloc, .chiffres-cles { margin-top: 4.5rem; }
    .ne-fait-pas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
}


/* Tableaux : .tableau sur fond clair, .tableau-fond dans la bande du fond. */
.tableau, .tableau-fond { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tableau th, .tableau td { padding: 0.75rem 1rem 0.75rem 0; border-top: 1px solid var(--border); text-align: start; vertical-align: top; }
.tableau thead th { padding-block: 0 0.4rem; border-top: 0; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.tableau tbody th { font-weight: 600; }
.tableau .duree strong { display: block; font-size: 1.15rem; font-weight: 800; }
.tableau .duree span, .fondement { display: block; margin-top: 0.3rem; font-size: 0.85rem; }
.fondement { color: var(--muted); }
.tableau-fond th { padding: 0.4rem 0.75rem 0.4rem 0; text-align: start; font-weight: 400; color: var(--band-muted); }
.tableau-fond td { padding: 0.45rem 0.75rem 0.45rem 0; border-top: 1px solid var(--band-rule); vertical-align: top; }
.decisions td:first-child, .decisions td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.decisions td:last-child { color: var(--band-muted); }
.mesures th:nth-child(1) { width: 20%; }
.mesures th:nth-child(2) { width: 15%; }
.mesures th:nth-child(3) { width: 30%; }
.historique td:first-child { white-space: nowrap; }
.seuils { margin: 0.75rem 0; }
.seuils th { padding-block: 0.45rem; font-weight: 400; vertical-align: top; }
.seuils td { font-weight: 800; }
.historique td { font-variant-numeric: tabular-nums; }
.historique td:nth-child(n+3) { white-space: nowrap; }
.historique tr.en-ligne td { font-weight: 600; }
.historique a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.etiquette { display: inline-block; margin-top: 0.25rem; padding: 0 0.5rem; border-radius: 4px; background: var(--accent-soft); color: var(--text); font-size: 0.8125rem; font-weight: 800; }

.moments { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 1.25rem 2.5rem; }
.moments li { display: flex; flex-direction: column; gap: 0.2rem; padding-top: 0.9rem; border-top: 2px solid var(--text); font-size: 0.95rem; }
.moments a { align-self: flex-start; display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }
.moment-date { font-size: 0.8125rem; color: var(--muted); }

/* Résultats d'évaluation, en une minute (Evaluation.razor) : l'avertissement, six cartes de mesure, la méthode en
   quatre étapes (.commandes de la mise à jour des textes), le moment où la barrière a servi. */
.version-evaluee { margin: 0.6rem 0 0; font-size: 0.875rem; color: var(--muted); }
.avertissement-juriste, .encadre-attention { margin: 1.75rem 0 0; padding: 0.9rem 1.1rem; border: 1px solid var(--warn-border); border-radius: 12px; background: var(--warn-bg); }
/* Enfants directs : « La suite » (une section aussi) garde ses 4,5rem, comme dans les autres chapitres. */
.evaluation > section, .evaluation-detail > section { margin-top: 3.5rem; }
.mesures-cartes { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: 1rem 1.25rem; }
.mesures-cartes li { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 1.1rem 0.9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.mesure-questions { font-size: 0.8125rem; color: var(--muted); }
.mesure-resultat { font-size: 1.875rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mesure-limite { margin-top: auto; padding-top: 0.65rem; border-top: 1px solid var(--border); font-size: 0.875rem; line-height: 1.45; }
.mesure-limite-titre { display: block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.evaluation > section.moment-cle { padding: 1.25rem 1.5rem 0.5rem; border: 1.5px solid var(--accent); border-radius: 14px; background: var(--surface); }
.moment-chapeau { margin: 0; font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.moment-cle h2 { margin: 0.35rem 0 0; font-size: 1.375rem; font-weight: 800; }
.moment-cle p { max-width: 72ch; }
.moment-cle a, .lien-detail a, .detail-retour a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }
.lien-detail { margin: 2.5rem 0 0; color: var(--muted); }

/* Vos données (Confidentialite.razor), lisible, tout sur la page (mention d'information, ADR-019) : l'essentiel, le
   trajet de la question (étapes de .commandes, repères de lieu du parcours), donnée par donnée, droits, protection. */
.donnees-page > section, .donnees-page > .droits { margin-top: 3.5rem; }
.donnees-page .chiffres-cles { margin-top: 1rem; } /* juste sous son titre, malgré l'écart des autres pages */
.trajet .repere { align-self: flex-start; }
@media (forced-colors: active) { .repere-sortie { border-width: 2px; } } /* sans fond, la sortie se distingue encore */
.trajet-ensuite { margin: 1.75rem 0 0; font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.principes.reste { margin-top: 0.5rem; }
.donnees-chapeau { margin: 0.25rem 0 0; font-size: 0.9375rem; color: var(--muted); }
.donnees-cartes { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: 1rem 1.25rem; align-items: start; }
.donnees-cartes li { display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 0.9375rem; line-height: 1.45; }
/* Le titre vient d'abord dans le code (lecteurs d'écran, navigation par titres) ; la durée s'affiche en premier. */
.donnee-duree { order: -1; font-size: 1.625rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.donnee-titre { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.4; }
.donnees-cartes .fondement { margin-top: 0.25rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.droits { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 3rem; align-items: start; }
.droits p { margin: 0.5rem 0 0; }
/* Opposition présentée à part (RGPD, article 21.4) : filet avant et après, sous son propre titre. */
.droits .droits-opposition { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
@media (min-width: 48rem) { .droits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) {
    .commandes.trajet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .principes.reste, .principes.protection { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.detail-chapeau { margin: 0.25rem 0 0.75rem; max-width: 80ch; font-size: 0.9375rem; color: var(--muted); }
.detail-retour { margin: 3rem 0 0; color: var(--muted); }


/* Fiches d'identité (mentions légales) : libellé, valeur. */
.fiche { margin: 0.75rem 0 0; display: grid; grid-template-columns: minmax(7rem, auto) minmax(0, 1fr); gap: 0.45rem 1rem; font-size: 0.95rem; }
.fiche dt { color: var(--muted); }
.fiche dd { margin: 0; overflow-wrap: anywhere; }
.separe-sans-filet { margin-top: 1rem; }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 0 2.25rem; }
.colonnes.deux-colonnes { gap: 1.5rem 2.5rem; }
.separe-sans-filet > div { border-top-width: 2px; }

/* Page « Votre avis » : le formulaire sans son cadre, à la largeur d'un texte. */
.avis-page .feedback { max-width: 45rem; margin-top: 1.75rem; padding: 0; background: none; border: 0; }
.avis-page .feedback label { margin: 1.25rem 0 0.4rem; font-size: 1rem; }
.avis-page .feedback label:first-of-type { margin-top: 0; }
.avis-page .feedback textarea { min-height: 5.5rem; padding: 0.6rem 0.9rem; background: var(--surface); border: 1.5px solid var(--control-border); border-radius: 12px; }
.avis-page .feedback .privacy { margin: 1.25rem 0; font-size: 0.95rem; }
.avis-page .feedback button { min-height: 2.75rem; padding: 0 1.25rem; background: var(--accent); color: var(--on-accent); border: 0; border-radius: 8px; }
.avis-page .feedback textarea:focus-visible, .avis-page .feedback button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.avis-page .feedback button:disabled { opacity: 0.6; cursor: progress; }

/* Accueil, fil vide (ADR-022, écran O1) : la promesse et les exemples, sur une colonne centrée (coupe des trois
   couches retirée le 2026-11-10). */
.page:has(> .intro), .page:has(> .fil) { max-width: 82rem; }
.intro { display: flex; flex-direction: column; align-items: center; max-width: 46rem; margin: 0 auto; padding-block: 3rem 1.5rem; text-align: center; }
.intro .exemples { align-items: center; margin-inline: auto; }
.intro .exemple { text-align: center; }
.intro h1 { margin: 0 auto; max-width: 14ch; font-size: clamp(2.5rem, 5vw, 4.25rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.intro .lede { margin: 1.4rem auto 0; max-width: 46ch; color: var(--muted); font-size: 1.125rem; }
.exemples-titre { margin: 1.75rem 0 0.6rem; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
/* Exemples en pastilles discrètes, à la largeur de leur texte ; la cible garde ses 44 px de haut. Au survol (ou à
   l'appui), le texte fonce, le contour et un voile prennent l'accent, la pastille glisse un peu vers la droite. */
.exemples { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; max-width: 36rem; }
.exemple { min-height: 2.75rem; padding: 0.4rem 1rem; border: 1px solid var(--border); border-radius: 1.375rem; background: transparent; color: var(--muted); font: inherit; font-size: 0.9375rem; line-height: 1.35; text-align: start; cursor: pointer; }
.exemple:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; color: var(--text); }
.exemple:active { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
@media (hover: hover) { .exemple:hover { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); } }
@media (prefers-reduced-motion: no-preference) {
    /* Arrivée échelonnée, puis réaction au survol et à l'appui. « backwards » : l'animation finie ne retient pas
       transform, que le survol reprend. */
    .exemple { animation: exemple-entree 0.45s ease-out backwards; transition: color 0.15s, border-color 0.15s, background-color 0.15s, transform 0.2s ease-out; }
    .exemple:nth-child(2) { animation-delay: 0.1s; }
    .exemple:nth-child(3) { animation-delay: 0.2s; }
    .exemple:active { transform: scale(0.98); }
    @media (hover: hover) { .exemple:hover { transform: translateX(4px); } }
}
@keyframes exemple-entree { from { opacity: 0; transform: translateY(6px); } }
.fond-ligne button:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; } /* à l'intérieur : le conteneur arrondi rogne ce qui dépasse */

/* Fil de questions : chaque question en coupe, la réponse en surface, les textes cités dessous, le calcul au fond. */
.fil { padding-block: 0.5rem 1rem; }
.question { max-width: 58.75rem; margin: 0 auto 3.5rem; scroll-margin-top: 1rem; }
.question > h2 { margin: 0 0 1.1rem; font-size: 1.875rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.question > h2:focus, .feedback h2:focus { outline: none; } /* focus posé par le code (réponse arrivée, avis ouvert), pas une étape du clavier */
.question .coupe { margin-top: 0; }
.attente { margin: 0; color: var(--muted); }
/* Même segment que l'étape en cours du fond, là où le regard se pose ; sans mouvement, le texte suffit. */
.attente-barre { display: none; }
@media (prefers-reduced-motion: no-preference) {
    .attente-barre { display: block; position: relative; overflow: hidden; width: min(100%, 16rem); height: 4px; margin-top: 0.75rem; border-radius: 2px; background: var(--border); }
    .attente-barre::before { content: ""; position: absolute; inset-block: 0; left: 0; width: 40%; border-radius: 2px; background: var(--accent); animation: balayage 1.1s ease-in-out infinite alternate; }
}
.couche .legende { margin: 0 0 0.6rem; font-size: 0.875rem; font-weight: 400; line-height: 1.5; color: var(--muted); }
.fond { margin: 0; } /* sans la marge des anciennes sections, collée à la couche du dessus */
.fond-ligne { margin: 0; }
.fond-ligne button { width: 100%; display: grid; grid-template-columns: 7rem minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; min-height: 3.5rem; padding: 0.9rem 1.75rem; border: 0; background: none; color: inherit; font: inherit; font-weight: 400; text-align: start; cursor: pointer; }
.fond-ligne .couche-label { padding-top: 0; }
.fond-action { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.fond-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 1.1rem; }
.fond-tete h3 { flex: 1 1 auto; margin: 0; font-size: 1.375rem; font-weight: 800; line-height: 1.25; }
.bouton-fond { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; min-height: 2.75rem; padding: 0.35rem 0.9rem; border: 1px solid var(--band-muted); border-radius: 8px; background: none; color: var(--band-ink); font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.etapes-reponse { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr)); gap: 0.9rem; }
.etapes-reponse li { display: flex; flex-direction: column; gap: 0.2rem; padding-top: 0.75rem; border-top: 2px solid var(--band-step); font-size: 0.95rem; }
.etapes-reponse li.arret, .etapes-reponse li.alerte { border-top-color: var(--band-ink); }
.etapes-reponse li.saute { border-top-color: var(--band-rule); color: var(--band-muted); }
.etapes-reponse .etape-nom { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--band-muted); }
.etape-marque { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--band-ink); }
.arret .etape-marque, .alerte .etape-marque { border-radius: 2px; }
.saute .etape-marque, .en-attente .etape-marque { box-sizing: border-box; border: 1.5px solid var(--band-muted); background: none; }
.etapes-reponse li.en-attente { border-top-color: var(--band-rule); color: var(--band-muted); }
.etapes-reponse li.encours { position: relative; border-top-color: var(--band-ink); }
/* Seule l'étape en cours s'anime (ADR-022) : un segment clair balaie son filet, assombri, et sa marque pulse ; rien
   ne bouge si le visiteur a demandé moins de mouvement (filet clair et « en cours… » écrit suffisent alors). */
@media (prefers-reduced-motion: no-preference) {
    .etapes-reponse li.encours { border-top-color: var(--band-rule); }
    .etapes-reponse li.encours::before { content: ""; position: absolute; top: -3px; left: 0; width: 40%; height: 4px; border-radius: 2px; background: var(--band-ink); animation: balayage 1.1s ease-in-out infinite alternate; }
    .encours .etape-marque { animation: pouls 1.2s ease-in-out infinite; }
}
@keyframes balayage { to { transform: translateX(150%); } }
@keyframes pouls { 50% { opacity: 0.3; } }
.etapes-reponse li.encours .etape-ms { color: var(--band-ink); }
.en-ce-moment { margin: 0 0 1rem; font-size: 1.125rem; font-weight: 800; }
.trouves { list-style: none; margin: 0; padding: 0; }
.trouves li { display: flex; align-items: baseline; gap: 0.75rem; min-height: 2.75rem; padding: 0.6rem 0; border-top: 1px solid var(--border); }
.proximite { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.etape-ms { font-size: 0.875rem; color: var(--band-muted); font-variant-numeric: tabular-nums; }
.fond h4 { margin: 1.6rem 0 0.4rem; font-size: 0.95rem; }
.fond-note { margin: 0; font-size: 0.8125rem; color: var(--band-muted); }
.fond .guardrails { margin: 1rem 0 0; padding-left: 1.2rem; font-size: 0.95rem; }
.fond-colonnes { display: grid; grid-template-columns: minmax(0, 18.75rem) minmax(0, 1fr); gap: 2.25rem; }
.barre { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 4.75rem; gap: 0.6rem; align-items: center; margin-bottom: 0.5rem; font-size: 0.875rem; }
.barre-piste { height: 8px; border-radius: 4px; background: var(--band-rule); overflow: hidden; }
.barre-piste span { display: block; height: 100%; background: var(--band-step); }
.barre .etape-ms { text-align: end; }
.barre-total { display: flex; justify-content: space-between; margin: 0.4rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--band-rule); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.cout { margin: 0; font-size: 1.25rem; font-weight: 800; }
.passages-fournis { font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.passages-fournis tr.est-cite td { font-weight: 600; }
.question-actions { margin-top: 0.9rem; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.75rem; }
a.bouton-secondaire { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
a.bouton-secondaire:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bouton-secondaire { min-height: 2.75rem; padding: 0.5rem 1rem; border: 1.5px solid var(--control-border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; }
button.back-link { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.seule { margin: 0; font-size: 0.875rem; }

/* Règle de proximité : décorative (description dans aria-label), positions en pourcentage de l'échelle. */
.regle { position: relative; height: 8.5rem; margin: 0.6rem 0 0.25rem; }
.regle > span { position: absolute; }
.regle-refus { left: 0; top: 50px; height: 28px; background: repeating-linear-gradient(135deg, var(--band-rule) 0 4px, transparent 4px 9px); }
.regle-refus-texte { left: 6px; top: 88px; font-size: 0.8125rem; color: var(--band-muted); }
.regle-axe { left: 0; right: 0; top: 63px; height: 2px; background: var(--band-step); }
.regle-seuil { top: 14px; height: 92px; border-left: 2px dashed var(--band-ink); }
.regle-seuil-texte { top: 0; margin-left: 8px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.regle-graduation { top: 58px; height: 12px; border-left: 1px solid var(--band-muted); }
.regle-graduation-texte, .regle-borne { top: 112px; font-size: 0.8125rem; color: var(--band-muted); font-variant-numeric: tabular-nums; }
.regle-graduation-texte { transform: translateX(-50%); }
.regle-borne { left: 0; }
.regle-borne.fin { left: auto; right: 0; }
.regle-point { top: 58px; width: 12px; height: 12px; margin-left: -6px; box-sizing: border-box; border: 2px solid var(--band-muted); border-radius: 50%; background: var(--band); }
.regle-point.est-cite { border-color: var(--band-ink); background: var(--band-ink); }
.regle-trait { height: 16px; border-left: 1px solid var(--band-muted); }
.regle-trait.haut { top: 40px; }
.regle-trait.bas { top: 72px; }
.regle-etiquette { transform: translateX(-50%); font-size: 0.8125rem; font-weight: 800; white-space: nowrap; color: var(--band-muted); }
.regle-etiquette.haut { top: 20px; }
.regle-etiquette.bas { top: 88px; }
.regle-etiquette.est-cite { color: var(--band-ink); }
.regle-legende { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0.25rem 0 0; font-size: 0.8125rem; }
.pastille { display: inline-block; width: 12px; height: 12px; margin-right: 0.5rem; vertical-align: -1px; box-sizing: border-box; border: 2px solid var(--band-muted); border-radius: 50%; }
.pastille.est-cite { border-color: var(--band-ink); background: var(--band-ink); }

/* Largeurs intermédiaires (fenêtre en demi-écran, tablette) : chaque composant passe sur une colonne quand la sienne
   deviendrait trop étroite, sans attendre la mise en page du téléphone (40rem, plus bas). */
@media (max-width: 64rem) {
    .fond-colonnes { grid-template-columns: minmax(0, 1fr); gap: 0; }

    /* Historique des évaluations (7 colonnes insécables) : une ligne devient un bloc, l'en-tête de colonne passe en
       libellé (data-label), lu une seule fois : l’en-tête de colonne suffit. */
    .historique thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .historique td[data-label]::before { content: attr(data-label) " : " / ""; font-weight: 600; }
    .historique tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.2rem 1rem; padding: 0.75rem 0; border-top: 1px solid var(--border); }
    .historique td { padding: 0; border: 0; white-space: normal; }
    .historique td:nth-child(-n+2), .historique td:last-child { grid-column: 1 / -1; }
    .historique td:nth-child(n+3) { white-space: normal; }
}

@media (max-width: 62rem) {
    /* écran étroit : moins d'espace au-dessus du titre de l'accueil */
    .intro { padding-block: 1.5rem 0.5rem; }
}

@media (max-width: 48rem) {
    /* étiquette de couche au-dessus du contenu : ses 7rem reviennent au texte et aux tableaux */
    .couche { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; } /* minmax : un tableau large défile au lieu d'élargir la couche */
    .couche-label { padding-top: 0; }
    .fond-ligne button { grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.75rem; }
    .fond-ligne .couche-label { grid-column: 1 / -1; }

    /* Tableaux empilés : une ligne devient un bloc, l'en-tête de colonne passe en libellé (data-label). */
    .tableau-empile thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .tableau-empile tr { display: block; padding: 0.9rem 0; border-top: 1px solid var(--border); }
    .tableau-empile th, .tableau-empile td, .tableau-empile th:nth-child(n) { display: block; width: auto; padding: 0; border: 0; }
    .tableau-empile td { margin-top: 0.4rem; }
    .tableau-empile td[data-label]::before { content: attr(data-label) " : " / ""; /* lu une seule fois : l’en-tête de colonne suffit */ font-weight: 600; }
}

@media (max-width: 40rem) {
    .coupe-page h1 { font-size: 2rem; }
    .fiche { grid-template-columns: 1fr; gap: 0 0; }
    .fiche dd { margin-bottom: 0.5rem; }
    .couche { padding: 1.1rem 1rem 1.25rem; }
    .couche h2 { font-size: 1.35rem; }

    .fond-ligne button { grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.75rem; padding: 1rem; }
    .question > h2 { font-size: 1.5rem; }
    .question-actions { justify-content: stretch; }
    .question-actions .bouton-secondaire { flex: 1 1 100%; }
    .champ { gap: 0.5rem; padding: 0.25rem 0.25rem 0.25rem 0.75rem; }
    /* Pied de page compact, textes courts : le champ tient sur une ligne, l'information de conservation sur une autre,
       la case sur la troisième. */
    .libelle-long { display: none; }
    .libelle-court { display: inline; }
    /* Cartes des textes cités : le titre prend toute la largeur, l'action passe dessous (relecture de la PR #74 :
       à 320 px, les titres longs des fiches de la CNIL se coupaient au milieu des mots). */
    .carte > summary, .trouves li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.6rem; }
    .carte-action, .proximite { grid-column: 2; justify-self: start; }
    .carte-titre { font-size: 1rem; }
    .composer .ask { gap: 0.25rem; }
    .seule, .limites, .conservation { font-size: 0.8125rem; line-height: 1.4; }
    .conservation { gap: 0 1rem; }
    .conservation-texte { flex: 1 1 100%; }
    .keep-choice { margin-left: 0; } /* seule sur sa ligne : sous le texte, pas à l'opposé */
    /* La case d'opposition (ADR-019) garde sa cible de 44 px : un appui manqué vaut un choix non exercé. */

    /* Décisions d'architecture : la date passe sous le titre (trois colonnes ne tiennent pas, même en date courte). */
    .decisions thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .decisions tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--band-rule); }
    .decisions td { padding: 0; border: 0; }
    .decisions td:last-child { grid-column: 2; font-size: 0.8125rem; }
}
