/*
 * Page d'un chapitre en capsules (refonte v2, phase 7) : vue d'ensemble en
 * quatre etapes (`offre/Chapitre*`), lecture d'une capsule en plein ecran
 * (`lecture/*`), exercices (`cours/Exercices*`) et fiche (`cours/Fiche*`).
 * Une vue a la fois (`data-current-view`), toutes dans le HTML livre.
 */
.pilot { display: block; min-height: 100svh; --reader-scale: 1; }
.pilot[data-text-size="grand"] { --reader-scale: 1.15; }
.pilot[data-text-size="tres-grand"] { --reader-scale: 1.3; }
.pilot button, .pilot a { -webkit-tap-highlight-color: transparent; }
.pilot-content { position: relative; width: 100%; max-width: calc(var(--page-max) + 2 * var(--content-gutter)); min-width: 0; margin-inline: auto; padding-inline: var(--content-gutter); }
.pilot [data-pilot-screen] { width: 100%; min-width: 0; }
.pilot .button .site-icon { width: 22px; height: 22px; }

/* --- Gabarit selon la vue ------------------------------------------------------ */
/* Le lecteur prend tout l'ecran : ni en-tete, ni pied, ni barre du bas du site. */
.pilot[data-current-view="learn"] :is(.site-top, .site-foot, [data-site-tabbar]) { display: none; }
.pilot[data-current-view="learn"] .pilot-reader-bar { display: flex; }
.pilot[data-current-view="learn"] .pilot-content { max-width: none; padding-inline: 0; }
/* Onglets des vues : sur les exercices et la fiche seulement. */
.pilot-nav, .pilot-topline { display: none; }
.pilot:is([data-current-view="exercises"], [data-current-view="summary"]) .pilot-nav { display: flex; }
/* Hors de la vue d'ensemble, le titre du chapitre reste le h1 de la page pour
   les lecteurs d'ecran, sans etre affiche ; la colonne d'avancement disparait. */
.pilot:not([data-current-view="overview"]) .pilot-heading { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pilot:not([data-current-view="overview"]) .chapter-aside { display: none; }

/* --- Vue d'ensemble : le chapitre en quatre etapes ------------------------------ */
.pilot-heading { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.pilot-crumb a { display: inline-flex; align-items: center; min-height: 36px; color: var(--muted); font-size: var(--fs-small); font-weight: 800; text-decoration: none; }
.pilot-crumb a:hover { color: var(--text); }
.pilot-domain { margin: 0; color: var(--info-text); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.pilot-heading h1 { margin: 0; font-size: 2.5rem; line-height: .95; }
.pilot-lead { margin: 0; color: var(--muted); font-size: var(--fs-body); font-weight: 700; line-height: 1.4; }
.pilot-credits { margin: 0; color: var(--muted); font-size: var(--fs-small); font-weight: 700; }
[data-pilot-screen="overview"] { display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-5) 0 var(--sp-2); }
[data-pilot-screen="overview"][hidden] { display: none; }

.chapter-progress { display: flex; flex-direction: column; gap: var(--sp-2); padding: 14px; border-radius: 20px; background: var(--surface); }
.chapter-progress__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); color: var(--muted); font-size: .8125rem; font-weight: 800; }
.chapter-progress__title { margin: 0; color: var(--text); font-family: var(--font-display); font-size: var(--fs-body); font-weight: 800; }
.chapter-progress__bar { display: flex; gap: 5px; }
.chapter-progress__bar span { flex: 1; height: 10px; border-radius: var(--radius-pill); background: var(--track); }
.chapter-progress__bar [data-state="done"] { background: var(--step); }
.chapter-progress__bar [data-state="current"] { background: var(--flame); }
.chapter-progress__next { margin: 0; font-size: var(--fs-small); font-weight: 800; }
.chapter-progress .button { width: 100%; }

.chapter-steps { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 0; list-style: none; }
.chapter-step { display: flex; flex-direction: column; gap: var(--sp-3); padding: 14px; border: 2px solid var(--border); border-radius: 24px; background: var(--surface); }
.chapter-step[data-current] { border: 3px solid var(--step); box-shadow: 0 var(--edge-md) 0 var(--step-edge); }
.chapter-step__head { display: flex; align-items: center; gap: 14px; }
.chapter-step .step-icon { width: 46px; height: 46px; border-radius: 13px; }
.chapter-step__titles { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.chapter-step__number { color: var(--muted); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.chapter-step h2 { margin: 0; font-size: 1.375rem; line-height: 1; }
.chapter-step__sub { color: var(--muted); font-size: .8125rem; font-weight: 800; }
.chapter-step__detail { display: none; }
.chapter-step__badge { display: inline-flex; flex-shrink: 0; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--flame); color: var(--on-flame); font-size: var(--fs-tiny); font-weight: 900; }
.chapter-step__badge[data-state="done"] { background: var(--green-bg); color: var(--green-strong); }
.chapter-step__badge[data-state="done"]::before { width: 14px; height: 14px; margin-right: var(--sp-1); background: currentColor; content: ''; mask: url("/icones/interface/valider.svg?v=720fe4c2e8") center / contain no-repeat; }
.chapter-step__badge[hidden] { display: none; }
.chapter-step__row { display: flex; align-items: center; gap: 10px; }
.chapter-step__status { flex: 1; color: var(--muted); font-size: var(--fs-small); font-weight: 800; line-height: 1.35; }
.chapter-step__action { flex-shrink: 0; min-height: 44px; padding: 0 var(--sp-4); border-radius: var(--radius-lg); font-size: .9375rem; }
.chapter-step[data-current] .chapter-step__action { --button-edge: var(--flame-edge); --button-edge-size: var(--relief-xl); --button-hi: var(--relief-hi); min-height: var(--button-h); border-radius: var(--radius-card); background: var(--flame); color: var(--on-flame); font-size: 1.0625rem; letter-spacing: .03em; text-transform: uppercase; }
.chapter-step[data-current] .chapter-step__row { flex-wrap: wrap; }
.chapter-step[data-current] .chapter-step__row .chapter-step__action { flex-basis: 100%; }
.chapter-step__target { display: none; margin-left: .35em; }
.chapter-exercises { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chapter-exercises button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px var(--sp-3); border: 2px solid transparent; border-radius: var(--r-sm); background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.chapter-exercises__mark { display: grid; flex-shrink: 0; place-items: center; box-sizing: border-box; width: 24px; height: 24px; border: 2px solid var(--border); border-radius: 50%; }
.chapter-exercises__mark svg { display: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.chapter-exercises [data-done="true"] .chapter-exercises__mark { border: 0; background: var(--good-border); color: var(--bg); }
.chapter-exercises [data-done="true"] .chapter-exercises__mark svg { display: block; }
.chapter-exercises [data-upcoming] { border-color: var(--sel-border); background: var(--sel-bg); }
.chapter-exercises__copy { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.chapter-exercises__title { font-family: var(--font-display); font-size: .9375rem; font-weight: 800; line-height: 1.15; }
.chapter-exercises__meta { color: var(--muted); font-size: var(--fs-tiny); font-weight: 800; }
.chapter-step__note { margin: 0; color: var(--muted); font-size: var(--fs-tiny); font-weight: 700; }
.chapter-step__tools { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.chapter-step__tools .button { min-height: 48px; padding: 0 var(--sp-3); border-radius: var(--radius-lg); font-size: .9375rem; }
.chapter-step__tools .site-icon { width: 20px; height: 20px; }

.chapter-further { display: flex; flex-direction: column; gap: var(--sp-2); }
.chapter-further h2 { margin: 0; font-size: 1.1875rem; line-height: 1.05; }
.chapter-more { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 14px; border-radius: 20px; background: var(--surface); color: var(--text); text-decoration: none; }
.chapter-more > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.chapter-more strong { font-family: var(--font-display); font-size: 1.0625rem; line-height: 1.15; }
.chapter-more small { color: var(--muted); font-size: .8125rem; font-weight: 800; }
.chapter-more__icon { display: grid; flex-shrink: 0; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--soft); }
.chapter-more__icon--flame { background: var(--flame); box-shadow: 0 var(--edge-sm) 0 var(--flame-edge); }
.pilot .course-pager { margin-top: var(--sp-1); }
.pilot .course-member:not([hidden]) { padding: 14px; border-radius: 20px; background: var(--surface); }

.chapter-aside { display: none; }
.chapter-aside__card { display: flex; gap: var(--sp-3); padding: 14px; border-radius: 20px; background: var(--surface); color: var(--text); text-decoration: none; }
.chapter-aside__card small { display: block; color: var(--muted); font-size: .8125rem; font-weight: 800; }
.chapter-aside__card strong { display: block; font-family: var(--font-display); font-size: 1.0625rem; line-height: 1.2; }
.chapter-aside__sheet { align-items: center; }
.chapter-aside__sheet .step-icon { width: 44px; height: 44px; border-radius: 12px; }
.chapter-aside__profs { flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) 18px; border: 2px solid var(--profs-accent); border-radius: 24px; background: var(--profs-bg); }
.chapter-aside__kicker { color: var(--accent-text); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.chapter-aside .chapter-progress { flex-direction: column; gap: var(--sp-3); padding: 18px var(--sp-5); border: 2px solid var(--border); border-radius: 24px; }

/* --- Lecture d'une capsule en plein ecran (lecture/*) --------------------------- */
.pilot-reader-bar { display: none; align-items: center; gap: var(--sp-2); padding: 14px var(--content-gutter) 0; }
.pilot-quit, .pilot-tool { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: var(--sp-2); min-width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-md); background: var(--surface); color: var(--muted); font-family: var(--font-display); font-size: 1.0625rem; font-weight: 800; cursor: pointer; }
.pilot-quit svg, .pilot-back svg, .pilot-topline__back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pilot-quit span { display: none; }
.pilot-tool svg { width: 22px; height: 22px; }
.pilot-reader-bar__title { display: flex; flex: 1; flex-direction: column; min-width: 0; margin: 0; line-height: 1.1; }
.pilot-reader-bar__chapter { overflow: hidden; font-family: var(--font-display); font-size: .9375rem; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.pilot-reader-bar__capsule { color: var(--muted); font-size: var(--fs-tiny); font-weight: 800; }
.pilot-reader-bar__heading { display: none; }

.pilot-learning { display: block; }
.pilot-program { display: none; }
.pilot-workspace { min-width: 0; padding: 10px var(--content-gutter) 112px; }
.pilot-workspace__inner { display: flex; flex-direction: column; gap: 18px; }
.pilot-capsule-progress { margin-bottom: 2px; }
.pilot-segments { display: flex; gap: 5px; }
.pilot-segments > span { display: flex; flex: 1; flex-direction: column; gap: var(--sp-1); }
.pilot-segments__bar { height: 8px; border-radius: var(--radius-pill); background: var(--track); transition: background .2s ease; }
.pilot-segments [data-state="done"] .pilot-segments__bar { background: var(--step-comprendre); }
.pilot-segments [data-state="current"] .pilot-segments__bar { background: var(--flame); }
.pilot-segments__label { display: none; color: var(--muted); font-size: .6875rem; font-weight: 800; }
.pilot-segments [data-state="current"] .pilot-segments__label { color: var(--text); }
.pilot[data-step-kind="end"] .pilot-capsule-progress { display: none; }

.pilot-step { display: flex; flex-direction: column; gap: 18px; animation: pilot-enter .2s ease-out; }
.pilot-step[hidden] { display: none; }
.pilot-pill { align-self: flex-start; display: inline-flex; align-items: center; height: 28px; margin: 0; padding: 0 var(--sp-3); border-radius: var(--radius-pill); background: var(--step-comprendre); color: var(--on-accent); font-family: var(--font-display); font-size: .8125rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pilot-pill--question { background: var(--violet); }
.pilot-step h2 { margin: 0; font-size: calc(2.125rem * var(--reader-scale)); line-height: 1; scroll-margin-top: var(--space-6); }
.pilot-quiz h2 { font-size: calc(1.75rem * var(--reader-scale)); line-height: 1.15; }
.pilot-lesson { display: flex; flex-direction: column; gap: 18px; }
.pilot-copy { display: flex; flex-direction: column; gap: var(--sp-3); font-size: calc(1.125rem * var(--reader-scale)); font-weight: 700; line-height: 1.55; }
.pilot-copy > * { margin: 0; }
.pilot-copy strong { font-family: var(--font-display); font-weight: 800; color: var(--info-text); text-decoration: underline 3px var(--step-comprendre); text-underline-offset: 4px; }
.pilot-copy aside { padding: 0; border: 0; color: var(--muted); font-size: calc(1rem * var(--reader-scale)); }
.pilot-copy ul, .pilot-copy ol { padding-left: 22px; }
.pilot-formula { padding: 18px 14px; border: 2px solid var(--step-comprendre-edge); border-radius: 24px; background: var(--formula-bg); color: var(--text); font-family: var(--font-display); font-size: calc(1.5rem * var(--reader-scale)); text-align: center; overflow-x: auto; }
.pilot-copy .pilot-formula strong, .pilot-box .pilot-formula strong { color: inherit; text-decoration: none; }
.pilot-formula math { font-size: 1.35em; }
.pilot-figure { margin: 0; padding: var(--sp-3); border-radius: 24px; background: var(--surface); }
.pilot-figure figcaption { margin-top: var(--sp-2); color: var(--muted); font-size: .8125rem; font-weight: 700; text-align: center; }
.pilot-figure .pilot-graph { max-height: 260px; }
.pilot-figure .pilot-box { padding: 6px; }
.pilot-step-note { display: flex; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-4) 18px; border: 2px solid var(--warm-border); border-radius: 20px; background: var(--warm-bg); }
.pilot-step-note > .site-icon { flex-shrink: 0; }
.pilot-step-note__body { display: flex; flex-direction: column; gap: 2px; }
.pilot-step-note__label { color: var(--flame-text); font-family: var(--font-display); font-size: var(--fs-small); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.pilot-step-note strong { color: var(--warm-text); font-family: var(--font-display); font-size: calc(1.0625rem * var(--reader-scale)); font-weight: 800; line-height: 1.25; }
.pilot-step-note__more { color: var(--warm-text); font-size: calc(.875rem * var(--reader-scale)); font-weight: 600; opacity: .85; }

.pilot-answers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.pilot-answers--short { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pilot-answer { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 72px; padding: var(--sp-3) 14px; border: 3px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 5px 0 var(--border); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pilot-answers--short .pilot-answer { min-height: 96px; }
.pilot-answer:disabled { cursor: default; }
.pilot-answer__letter { display: grid; flex-shrink: 0; place-items: center; width: 30px; height: 30px; border-radius: var(--r-xs); background: var(--mark); font-family: var(--font-display); font-size: .9375rem; font-weight: 800; }
.pilot-answer__text { font-family: var(--font-display); font-size: calc(1.125rem * var(--reader-scale)); font-weight: 800; line-height: 1.2; }
.pilot-answers--short .pilot-answer__text { font-size: calc(2rem * var(--reader-scale)); line-height: 1; }
.pilot-answer[data-state="correct"] { border-color: var(--good-border); background: var(--green-bg); box-shadow: 0 5px 0 var(--good-border); color: var(--green-strong); }
.pilot-answer[data-state="wrong"] { border-color: var(--game-bad-mark); background: var(--red-bg); box-shadow: 0 5px 0 var(--game-bad-mark); color: var(--red-strong); }
.pilot-feedback { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; gap: 10px; padding: 18px var(--content-gutter) max(18px, env(safe-area-inset-bottom)); border-top: 3px solid var(--good-border); border-radius: 28px 28px 0 0; background: var(--game-good-bg); animation: pilot-sheet .2s ease-out; }
.pilot-feedback[hidden] { display: none; }
.pilot-feedback[data-state="wrong"] { border-top-color: var(--game-bad-mark); background: var(--game-bad-bg); }
.pilot-feedback > p { margin: 0; color: var(--green-text); font-size: calc(1rem * var(--reader-scale)); font-weight: 700; line-height: 1.45; }
.pilot-feedback[data-state="wrong"] > p { color: var(--red-strong); }
.pilot-feedback > .pilot-feedback__title { display: flex; align-items: center; gap: 10px; color: var(--green-strong); font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; outline: 0; }
.pilot-feedback[data-state="wrong"] > .pilot-feedback__title { color: var(--game-bad-title); }
.pilot-feedback__title::before { width: 28px; height: 28px; background: url("/icones/reussi.svg?v=b5a64f7782") center / contain no-repeat; content: ''; }
.pilot-feedback[data-state="wrong"] .pilot-feedback__title::before { background-image: url("/icones/alerte.svg?v=e5cae81d96"); }
.pilot-feedback__actions { display: flex; gap: 10px; }
.pilot-feedback__actions .button--secondary { min-height: 60px; border: 2px solid var(--border); background: transparent; }
.pilot-feedback__actions [data-feedback-next] { flex: 1; min-height: 60px; }
.pilot-feedback__actions [hidden] { display: none; }

.pilot-controls { position: fixed; z-index: 4; right: 0; bottom: 0; left: 0; display: flex; align-items: center; gap: var(--sp-3); padding: 14px var(--content-gutter) max(18px, env(safe-area-inset-bottom)); background: var(--bg); }
.pilot[data-answered] .pilot-controls, .pilot[data-step-kind="end"] .pilot-controls { display: none; }
.pilot-keyboard-hint { display: none; color: var(--muted); font-size: .8125rem; font-weight: 800; }
.pilot-controls__actions { display: flex; flex: 1; gap: var(--sp-3); }
.pilot-back { display: grid; flex-shrink: 0; place-items: center; width: 60px; height: 60px; border: 2px solid var(--border); border-radius: 20px; background: transparent; color: var(--text); cursor: pointer; }
.pilot-back:disabled { opacity: .4; cursor: default; }
.pilot-controls [data-next] { flex: 1; min-height: 60px; font-size: 1.25rem; }
.pilot-text-button { min-height: 44px; border: 0; background: none; color: var(--accent-text); font: 800 .875rem var(--font-body); cursor: pointer; }

/* Ecran de fin d'une capsule (lecture/FinMobile) */
.pilot-end { align-items: center; gap: 14px; padding-top: var(--sp-5); text-align: center; }
.pilot-end__badge .site-icon { width: 72px; height: 72px; }
.pilot-end__badge { display: grid; place-items: center; width: 130px; height: 130px; border-radius: var(--r-2xl); background: var(--step-comprendre); box-shadow: 0 var(--edge-lg) 0 var(--step-comprendre-edge); }
.pilot-end__kicker { margin: 10px 0 0; color: var(--accent-text); font-family: var(--font-display); font-size: .875rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.pilot-end h2 { font-size: 1.875rem; line-height: 1.1; }
.pilot-end__score { margin: 0; }
.pilot-end__score .chip { height: 40px; padding: 0 14px; background: var(--surface); color: var(--text); font-size: .9375rem; }
.pilot-end__path { display: flex; flex-direction: column; gap: 10px; align-self: stretch; padding: 14px var(--sp-4); border-radius: 20px; background: var(--surface); text-align: left; }
.pilot-end__path > p { margin: 0; color: var(--muted); font-size: .8125rem; font-weight: 800; }
.pilot-path { display: flex; justify-content: space-between; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pilot-path li { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--soft); color: var(--muted); font-family: var(--font-display); font-size: .875rem; font-weight: 800; }
.pilot-path svg { display: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.pilot-path [data-complete="true"] { background: var(--good-border); color: var(--bg); }
.pilot-path [data-complete="true"] .pilot-path__number { display: none; }
.pilot-path [data-complete="true"] svg { display: block; }
.pilot-path [data-current]:not([data-complete="true"]) { outline: 2px solid var(--sel-border); }
.pilot-end__next { display: flex; align-items: center; gap: 14px; align-self: stretch; padding: var(--sp-4); border: 2px solid var(--sel-border); border-radius: var(--r-lg); background: var(--sel-bg); text-align: left; }
.pilot-end__next > span:last-child { display: flex; flex-direction: column; }
.pilot-end__number { display: grid; flex-shrink: 0; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--step-comprendre); color: var(--on-accent); font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; }
.pilot-end__number[data-etape] { background: var(--step); }
.pilot-end__label { font-size: .8125rem; font-weight: 800; }
.pilot-end__next strong { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.15; }
.pilot-end__detail { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.pilot-end__actions { display: flex; flex-direction: column; gap: var(--sp-3); align-self: stretch; margin-top: auto; padding-top: 40px; }
.pilot-end__actions .button { width: 100%; }
.pilot-end__actions .button--secondary { border: 2px solid var(--border); background: transparent; }

@keyframes pilot-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pilot-sheet { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pilot-step, .pilot-feedback { animation: none; } .pilot-segments__bar { transition: none; } }

/* --- Exercices et fiche : onglets, retour -------------------------------------- */
.pilot-topline { align-items: center; gap: var(--sp-2); padding-top: 14px; }
.pilot-topline__back { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--radius-md); background: var(--surface); color: var(--text); cursor: pointer; }
.pilot-topline__chip { display: inline-flex; align-items: center; height: 36px; padding: 0 var(--sp-3); border-radius: 12px; background: var(--surface); color: var(--text); font-family: var(--font-display); font-size: .9375rem; font-weight: 800; text-decoration: none; }
.pilot-nav { gap: var(--sp-1); margin: 14px 0 var(--sp-5); padding: var(--sp-1); border-radius: 20px; background: var(--surface); }
.pilot-nav button { flex: 1; min-height: 44px; padding: 0 2px; white-space: nowrap; border: 0; border-radius: 16px; background: none; color: var(--muted); font: 800 .75rem var(--font-body); cursor: pointer; }
.pilot-nav button[aria-current="true"] { background: var(--bg); box-shadow: 0 3px 0 var(--soft); color: var(--text); }
.pilot-page-title { margin: 0 0 var(--sp-2); font-size: 2.125rem; line-height: 1.05; }
.pilot-page-lead { margin: 0 0 var(--sp-5); color: var(--muted); font-size: .8125rem; font-weight: 700; }

.pilot-exercises { display: grid; gap: 14px; }
.pilot-exercise { padding: var(--sp-4) 18px; border: 2px solid transparent; border-radius: 24px; background: var(--surface); }
.pilot-exercise[open] { border-color: var(--sel-border); }
.pilot-exercise > summary { display: flex; align-items: center; gap: var(--sp-3); list-style: none; cursor: pointer; }
.pilot-exercise > summary::-webkit-details-marker { display: none; }
.pilot-exercise__head { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.pilot-exercise__kicker { color: var(--muted); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.pilot-exercise h3 { margin: 0; font-size: 1.25rem; line-height: 1.15; }
.pilot-exercise .chip[hidden] { display: none; }
.pilot-exercise__content { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: 14px; font-size: .9375rem; font-weight: 700; line-height: 1.5; }
.pilot-exercise__content > :is(p, ol, ul) { margin: 0; }
.pilot-exercise__content ol { display: flex; flex-direction: column; gap: 10px; padding-left: 22px; font-family: var(--font-display); font-weight: 800; }
.pilot-hint, .pilot-solution { padding: 14px var(--sp-4); border-radius: var(--r-md); }
.pilot-hint { border: 2px solid var(--warm-border); background: var(--warm-bg); color: var(--warm-text); }
.pilot-solution { background: var(--soft); }
.pilot-hint > summary, .pilot-solution > summary { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; list-style: none; cursor: pointer; }
.pilot-hint > summary { color: var(--flame-text); }
.pilot-hint > summary::-webkit-details-marker, .pilot-solution > summary::-webkit-details-marker { display: none; }
.pilot-hint p { margin: 10px 0 0; font-size: var(--fs-small); }
.pilot-solution > div { display: flex; flex-direction: column; gap: 10px; margin-top: var(--sp-3); }
.pilot-solution > div > * { margin: 0; }
.pilot-solution__done { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding-top: 6px; color: var(--muted); font-size: .8125rem; }
.pilot-solution__done .button { min-height: 48px; }

/* Fiche de revision (cours/Fiche) */
.pilot-fiche__kicker { margin: 0 0 6px; color: var(--muted); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.pilot-fiche__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--sp-2); }
.pilot-fiche__actions .button--secondary { --button-edge-size: 0px; }
.pilot-fiche__actions [hidden] { display: none; }
.pilot-fiche__note { margin: var(--sp-2) 0 0; color: var(--muted); font-size: .8125rem; font-weight: 700; }
.pilot-fiche { display: grid; gap: 14px; margin: var(--sp-5) 0 0; padding: 0; list-style: none; }
.pilot-fiche > li { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); border-radius: 24px; background: var(--surface); }
.pilot-fiche h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--sp-1); font-size: 1.125rem; line-height: 1.2; }
.pilot-fiche__num { display: grid; flex-shrink: 0; place-items: center; width: 32px; height: 32px; border-radius: var(--r-xs); background: var(--subject-color, var(--violet)); color: var(--on-accent); font-size: .9375rem; }
.pilot-fiche__section ul { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.pilot-fiche__section li, .pilot-fiche__formula { margin: 0; padding: var(--sp-3) 14px; border-radius: var(--r-sm); background: var(--soft); font-size: var(--fs-small); font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.pilot-fiche__formula { font-family: var(--font-display); font-size: .9375rem; }
.pilot-fiche > .pilot-fiche__traps { border: 2px solid var(--game-bad-mark); background: var(--red-bg); }
.pilot-fiche__traps h3 { color: var(--red-strong); font-size: 1.25rem; }
.pilot-fiche__traps ul { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; font-size: var(--fs-small); font-weight: 700; }
.pilot-fiche__traps li::before { content: '· '; }
.pilot-fiche__next { margin-top: var(--space-6); }
.pilot-fiche__next h3 { margin: 0 0 10px; font-size: 1.1875rem; }
.pilot-fiche__links { display: grid; gap: 10px; }
.pilot-fiche__links > :is(a, button) { display: flex; align-items: center; gap: 14px; padding: 14px var(--sp-4); border: 0; border-radius: 20px; background: var(--surface); color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.pilot-fiche__links span { display: flex; flex-direction: column; }
.pilot-fiche__links strong { font-family: var(--font-display); font-size: 1rem; }
.pilot-fiche__links small { color: var(--muted); font-size: .8125rem; font-weight: 800; }

/* --- Mobile : en-tete du site remplace par le retour sur les exercices et la fiche */
@media (max-width: 959px) {
  .pilot:is([data-current-view="exercises"], [data-current-view="summary"]) .site-top { display: none; }
  .pilot:is([data-current-view="exercises"], [data-current-view="summary"]) .pilot-topline { display: flex; }
}

/* --- Ordinateur ------------------------------------------------------------------ */
@media (min-width: 960px) {
  .pilot[data-current-view="overview"] main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto 1fr; column-gap: var(--space-8); }
  .pilot[data-current-view="overview"] .pilot-heading { grid-column: 1; grid-row: 1; }
  .pilot[data-current-view="overview"] [data-pilot-screen="overview"] { grid-column: 1; grid-row: 2; padding-top: var(--space-6); }
  .chapter-aside { display: flex; grid-column: 2; grid-row: 1 / span 2; flex-direction: column; gap: 18px; align-self: start; padding-top: 10px; }
  .chapter-progress--inline { display: none; }
  .pilot-heading { gap: var(--sp-3); padding-top: 10px; }
  .pilot-heading h1 { font-size: 3.5rem; }
  .pilot-lead { font-size: 1.125rem; }
  .chapter-step { padding: 18px; }
  .chapter-step .step-icon { width: 50px; height: 50px; }
  .chapter-step h2 { font-size: 1.625rem; }
  .chapter-step__detail { display: inline; }
  .chapter-step__target { display: inline; margin-left: -.3em; }
  .chapter-step__row .chapter-step__status { font-weight: 700; }
  .chapter-exercises { gap: var(--sp-2); }
  .chapter-exercises button { min-height: 60px; }

  .pilot-reader-bar { gap: var(--sp-3); height: 72px; padding: 0 var(--space-6); border-bottom: 2px solid var(--divider); }
  .pilot-quit { padding: 0 var(--sp-4) 0 var(--sp-3); }
  .pilot-quit span { display: inline; font-size: .9375rem; }
  .pilot-reader-bar__chapter, .pilot-reader-bar__capsule { display: none; }
  .pilot-reader-bar__heading { display: block; overflow: hidden; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
  .pilot-learning { display: grid; grid-template-columns: 278px minmax(0, 1fr); min-height: calc(100svh - 72px); }
  .pilot-program { display: flex; flex-direction: column; gap: 10px; padding: var(--space-6) 14px; border-right: 2px solid var(--divider); }
  .pilot-program__title { margin: 0 0 var(--sp-1); padding-left: 0; color: var(--muted); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
  .pilot-outline { display: flex; flex-direction: column; gap: var(--sp-1); margin: 0; padding: 0; list-style: none; }
  .pilot-outline button { display: flex; align-items: flex-start; gap: var(--sp-3); width: 100%; padding: 10px; border: 2px solid transparent; border-radius: 16px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
  .pilot-outline button[aria-current="true"] { border-color: var(--sel-border); background: var(--sel-bg); }
  .pilot-outline__number { display: grid; flex-shrink: 0; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--muted); font-family: var(--font-display); font-size: .8125rem; font-weight: 800; }
  .pilot-outline__number svg { display: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
  .pilot-outline button[data-complete="true"] .pilot-outline__number { background: var(--good-border); color: var(--bg); }
  .pilot-outline button[data-complete="true"] .pilot-outline__number > span { display: none; }
  .pilot-outline button[data-complete="true"] .pilot-outline__number svg { display: block; }
  .pilot-outline button[aria-current="true"] .pilot-outline__number { background: var(--flame); color: var(--on-flame); }
  .pilot-outline button[aria-current="true"] .pilot-outline__number > span { display: block; }
  .pilot-outline button[aria-current="true"] .pilot-outline__number svg { display: none; }
  .pilot-outline__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .pilot-outline__name { font-family: var(--font-display); font-size: .9375rem; font-weight: 800; line-height: 1.15; }
  .pilot-outline__detail { color: var(--muted); font-size: var(--fs-tiny); font-weight: 700; line-height: 1.35; }
  .pilot-program .pilot-text-button { align-self: flex-start; margin-top: auto; }
  .pilot-workspace { display: flex; padding: var(--sp-6) var(--sp-7) var(--space-6); }
  .pilot-workspace__inner { flex: 1; max-width: 930px; }
  .pilot-capsule-progress { width: 420px; }
  .pilot-segments__label { display: block; }
  .pilot-step h2 { font-size: calc(2.875rem * var(--reader-scale)); }
  .pilot-quiz h2 { font-size: calc(2.25rem * var(--reader-scale)); }
  .pilot-lesson { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto 1fr; column-gap: var(--sp-6); row-gap: 18px; }
  .pilot-lesson > .pilot-copy { grid-column: 1; grid-row: 1; }
  .pilot-lesson > .pilot-step-note { grid-column: 1; grid-row: 2; align-self: start; }
  .pilot-lesson > .pilot-figure { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .pilot-quiz .pilot-answers, .pilot-quiz .pilot-feedback { max-width: 760px; }
  .pilot-answers--short { gap: var(--sp-3); }
  .pilot-answers--short .pilot-answer, .pilot-answer { flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; min-height: 80px; padding: 14px 18px; }
  .pilot-feedback { position: static; padding: var(--sp-5) var(--space-6); border: 3px solid var(--good-border); border-radius: 24px; animation: none; }
  .pilot-feedback[data-state="wrong"] { border-color: var(--game-bad-mark); }
  .pilot-feedback [data-feedback-next] { display: none; }
  .pilot-feedback__actions .button--secondary { min-height: 44px; }
  .pilot[data-answered] .pilot-controls { display: flex; }
  .pilot-controls { position: static; justify-content: flex-end; margin-top: auto; padding: var(--space-6) 0 0; background: none; }
  .pilot-keyboard-hint { display: block; }
  .pilot-controls__actions { flex: 0 0 auto; }
  .pilot-controls [data-next] { width: 260px; }
  .pilot-end { max-width: 520px; margin-inline: auto; }

  .pilot-nav { margin-top: 10px; }
  .pilot-nav button { font-size: .9375rem; }
  .pilot-page-title { font-size: 2.5rem; }
  .pilot-page-lead { font-size: var(--fs-small); }
  .pilot-exercises { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; align-items: start; gap: var(--sp-3) var(--sp-4); }
  .pilot-exercises:has(> [open]) > :not([open]) { grid-column: 2; }
  .pilot-exercises > [open] { grid-column: 1; grid-row: 1 / span 20; }
  .pilot-fiche { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .pilot-fiche__links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pilot-page-title + .pilot-fiche__actions { margin-top: var(--sp-3); }
  [data-pilot-screen="summary"] .pilot-page-title { font-size: 2.875rem; }
}

/* --- Schemas et encadres du contenu ------------------------------------------- */
.pilot-graph { display: block; width: 100%; height: auto; overflow: visible; }
/* Une forme sans classe se trace comme un axe : jamais le remplissage noir par defaut du SVG. */
.pilot-graph :where(path, polyline, line, rect, circle) { fill: none; stroke: var(--muted-2); stroke-width: 1.5; }
.pilot-graph text { fill: var(--muted); font: 14px var(--font-body); }
.pilot-graph .graph-axis { stroke: var(--muted-2); stroke-width: 1.5; }
.pilot-graph .graph-grid { stroke: var(--border); stroke-width: 1; }
.pilot-graph .graph-curve { fill: none; stroke: var(--accent-text); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.pilot-graph .graph-guide { fill: none; stroke: var(--warm-strong); stroke-width: 2; stroke-dasharray: 5 4; }
.pilot-graph .graph-point { fill: var(--accent-text); stroke: none; }
.pilot-graph .graph-label { fill: var(--accent-text); font-weight: 800; }
.pilot-graph .graph-second { fill: none; stroke: var(--warm-strong); stroke-width: 3; }
.pilot-graph .graph-area { fill: var(--accent-text); fill-opacity: .15; stroke: none; }
.pilot-graph .graph-tick { fill: var(--muted); font: 600 15px var(--font-body); }
.pilot-graph .graph-big { fill: var(--text); font: 800 20px var(--font-display); }
.pilot-graph .graph-big--accent { fill: var(--accent-text); }
.pilot-graph .graph-big--second { fill: var(--warm-strong); }
.pilot-graph .graph-point--second { fill: var(--warm-strong); stroke: none; }
.pilot-graph .graph-arrow { fill: var(--muted-2); stroke: none; }
.pilot-graph .graph-arrow--second { fill: var(--warm-strong); stroke: none; }
.pilot-graph .graph-set { fill: var(--accent-text); fill-opacity: .1; stroke: var(--accent-text); stroke-opacity: .55; stroke-width: 1.5; }
.pilot-graph .graph-set-name { fill: var(--accent-text); font: 800 17px var(--font-display); }

/* Encadrés : ce qui tient lieu de schéma quand un dessin n'a pas de sens. */
.pilot-box { display: flex; flex-direction: column; gap: 10px; color: var(--text); }
.pilot-box__label { color: var(--accent-text); font-size: .75rem; font-weight: 800; letter-spacing: .0375em; text-transform: uppercase; }
.pilot-box strong { color: var(--accent-text); }
.pilot-box ul, .pilot-box ol { margin: 0; padding: 0; list-style: none; }
.pilot-box li { padding: 10px 0; border-bottom: 1px solid var(--divider); }
.pilot-box li:last-child { border: 0; }
/* Code (SIG) : défile dans son cadre plutôt que d'être rogné sur un écran étroit. */
.pilot pre { min-width: 0; max-width: 100%; margin: 0; padding: var(--sp-3); overflow-x: auto; border-radius: 12px; background: var(--soft); font-size: .875rem; line-height: 1.5; }
.pilot pre code { padding: 0; background: none; }
.pilot-box--formula > p:has(> strong:only-child) { font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; text-align: center; padding: var(--sp-1) 0; }
/* Termes cote a cote, autant de colonnes que de paires : une paire seule prend toute la largeur. */
.pilot-box dl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--sp-1) 14px; margin: 0; text-align: center; }
.pilot-box dt { grid-row: 1; font-weight: 800; }
.pilot-box dd { grid-row: 2; margin: 0; color: var(--muted); font-size: .875rem; }
.pilot-box--method ol { counter-reset: method; }
.pilot-box--method ol li { counter-increment: method; position: relative; padding-left: 40px; }
.pilot-box--method ol li::before { content: counter(method); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--violet); color: var(--on-accent); font-weight: 800; font-size: .875rem; }
.pilot-box--quote blockquote { margin: 0; padding-left: var(--sp-4); border-left: 4px solid var(--violet); font-style: italic; font-size: 1.0625rem; }
.pilot-box--timeline ol { position: relative; padding-left: var(--sp-5); border-left: 3px solid var(--violet-light); }
.pilot-box--timeline li { border: 0; padding: 6px 0; }
.pilot-box--timeline li strong { display: block; }
