/* ---------- Couleurs ---------- */
:root {
  --fond: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --texte: #1c2333;
  --texte-doux: #5a6478;
  --bordure: #d9dee8;
  --accent: #2563c9;
  --accent-texte: #ffffff;
  --accent-doux: #e3ecfb;
  --ok: #1d7a46;
  --ok-fond: #e3f4ea;
  --ko: #b42318;
  --ko-fond: #fde8e6;
  --vu: #8a5a00;
  --vu-fond: #fdf1d8;

  /* Bloc de code : toujours sombre, comme une console */
  --code-fond: #012456;
  --code-texte: #eef3ff;
  --code-com: #8fa7c9;
  --code-str: #f4c27a;
  --code-var: #7ee0c3;
  --code-cmd: #ffe066;
  --code-par: #a9c8ff;
  --code-kw: #ff9ec8;
  --code-num: #c9b6ff;
  --trou-fond: #0b3a7a;

  --rayon: 10px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f141c;
    --surface: #171e29;
    --surface-2: #1f2836;
    --texte: #e6eaf2;
    --texte-doux: #9aa5b8;
    --bordure: #2c3747;
    --accent: #6ea2ff;
    --accent-texte: #0b1420;
    --accent-doux: #1d2c47;
    --ok: #5ad08f;
    --ok-fond: #12301f;
    --ko: #ff8a7a;
    --ko-fond: #3a1a17;
    --vu: #f2c35b;
    --vu-fond: #3a2d10;
    --code-fond: #0a1730;
    --trou-fond: #13305e;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; }
.muted { color: var(--texte-doux); }
.aller-contenu { position: absolute; left: -9999px; }
.aller-contenu:focus { left: 16px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--bordure);
}
.entete-ligne { display: flex; align-items: center; gap: 16px; padding: 10px 24px; }
.marque { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.logo {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  background: var(--code-fond); color: var(--code-cmd);
  padding: 6px 9px; border-radius: 8px; white-space: nowrap;
}
.entete h1 { font-size: 17px; margin: 0; }
.sous-titre { margin: 0; font-size: 13px; color: var(--texte-doux); }
.progression-bloc { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 180px; text-align: right; }
.progression-texte { font-size: 13px; color: var(--texte-doux); }
.progression { width: 180px; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progression-barre { height: 100%; width: 0; background: var(--ok); transition: width .3s ease; }
.bouton-menu { display: none; }

/* ---------- Mise en page ---------- */
.mise-en-page { display: grid; grid-template-columns: 270px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; }
.menu { position: sticky; top: var(--haut-entete, 61px); align-self: start; max-height: calc(100vh - var(--haut-entete, 61px)); overflow-y: auto; padding: 20px 12px 20px 20px; }
.menu ol { list-style: none; margin: 0; padding: 0; }
.menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--texte); text-decoration: none; font-size: 15px;
}
.menu a:hover { background: var(--surface-2); }
.menu a.actif { background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.nav-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--texte-doux);
}
.menu a.actif .nav-num { background: var(--accent); color: var(--accent-texte); }
.nav-titre { flex: 1; min-width: 0; }
.badge { font-size: 12px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.badge.complet { color: var(--ok); font-weight: 700; }

.contenu { padding: 28px 32px 64px; min-width: 0; outline: none; }
.page { max-width: 860px; }
.surtitre { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); font-weight: 600; }
.page > h2 { font-size: 28px; margin: 4px 0 18px; }
.titre-exos { font-size: 22px !important; margin-top: 36px !important; }

/* ---------- Cours ---------- */
.bloc-cours { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); }
.bloc-cours > summary { cursor: pointer; padding: 12px 18px; font-weight: 700; }
.bloc-cours .cours { padding: 0 20px 8px; }
.bloc-cours.deploiement { margin-top: 20px; }
.cours table { border-collapse: collapse; width: 100%; margin: 12px 0 16px; font-size: 15px; display: block; overflow-x: auto; }
.cours th, .cours td { border: 1px solid var(--bordure); padding: 7px 10px; text-align: left; vertical-align: top; }
.cours th { background: var(--surface-2); }
.cours h3 { margin: 22px 0 6px; font-size: 18px; }
pre.algo, pre.exemple {
  font-family: var(--mono); font-size: 14px; line-height: 1.55;
  padding: 12px 16px; border-radius: 8px; overflow-x: auto;
}
pre.algo { background: var(--surface-2); border-left: 4px solid var(--accent); color: var(--texte); }
pre.exemple { background: var(--code-fond); color: var(--code-texte); }
.sommaire { padding-left: 20px; }
.sommaire li { margin: 4px 0; }

/* ---------- Exercices ---------- */
.exo {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 18px 20px; margin: 0 0 22px;
}
.exo-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.exo h3 { margin: 0; font-size: 18px; }
.exo-num { color: var(--accent); margin-right: 6px; }
.statut { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 99px; }
.statut:empty { display: none; }
.statut.ok { background: var(--ok-fond); color: var(--ok); }
.statut.vu { background: var(--vu-fond); color: var(--vu); }
.statut.encours, .statut.partiel { background: var(--vu-fond); color: var(--vu); }
.statut.ko { background: var(--ko-fond); color: var(--ko); }
.consigne { margin: 8px 0 12px; }
.consigne p { margin: 6px 0; }

pre.code {
  margin: 0; padding: 16px 18px; border-radius: 8px;
  background: var(--code-fond); color: var(--code-texte);
  font-family: var(--mono); font-size: 14.5px; line-height: 2.05;
  overflow-x: auto; tab-size: 4;
}
pre.code code { background: none; padding: 0; font-size: inherit; color: inherit; }
.t-com { color: var(--code-com); font-style: italic; }
.t-str { color: var(--code-str); }
.t-var { color: var(--code-var); }
.t-cmd { color: var(--code-cmd); }
.t-par { color: var(--code-par); }
.t-kw  { color: var(--code-kw); font-weight: 600; }
.t-num { color: var(--code-num); }

.trou-num {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; margin-right: 2px; padding: 0 4px;
  font-family: var(--police); font-size: 11px; font-weight: 700;
  background: var(--code-cmd); color: var(--code-fond); border-radius: 4px;
  vertical-align: 2px;
}
select.trou {
  font-family: var(--mono); font-size: 14px;
  color: var(--code-texte); background: var(--trou-fond);
  border: 2px dashed var(--code-par); border-radius: 6px;
  padding: 1px 6px; max-width: 100%; cursor: pointer;
}
select.trou option { background: var(--surface); color: var(--texte); }
select.trou.ok { border: 2px solid #4ade80; background: #0f4d2c; }
select.trou.ko { border: 2px solid #ff6b5e; background: #5c1712; }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.essais { font-size: 13px; color: var(--texte-doux); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none;
  padding: 8px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte);
}
.btn:hover { background: var(--surface-2); }
.btn-principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.btn-principal:hover { background: var(--accent); filter: brightness(1.08); }
.btn-discret { border-style: dashed; color: var(--texte-doux); }

.retours { margin: 14px 0 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.retours li { padding: 9px 12px; border-radius: 8px; font-size: 15px; border-left: 4px solid; }
.retours li.ok { background: var(--ok-fond); border-color: var(--ok); }
.retours li.ko { background: var(--ko-fond); border-color: var(--ko); }
.retours li.vide { background: var(--surface-2); border-color: var(--texte-doux); }

.pied-page { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.noscript { padding: 24px; text-align: center; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .entete-ligne { padding: 10px 16px; gap: 10px; }
  .bandeau-sorties { padding: 6px 16px; font-size: 13px; }
  .bouton-menu {
    display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
    font-size: 20px; border: 1px solid var(--bordure); border-radius: 8px;
    background: var(--surface); color: var(--texte); cursor: pointer;
  }
  .sous-titre { display: none; }
  .progression-bloc { min-width: 0; }
  .progression { width: 90px; }
  .progression-texte { font-size: 11px; }
  .mise-en-page { grid-template-columns: minmax(0, 1fr); }
  .menu {
    display: none; position: fixed; top: var(--haut-entete, 61px); left: 0; right: 0; bottom: 0; z-index: 15;
    max-height: none; align-self: stretch; background: var(--surface); padding: 16px;
  }
  body.menu-ouvert .menu { display: block; }
  .contenu { padding: 20px 16px 48px; }
  .page > h2 { font-size: 24px; }
  pre.code { font-size: 13px; padding: 14px; }
  .exo { padding: 16px 14px; }
}

/* ---------- Script assemblé ---------- */
.final {
  background: var(--surface); border: 2px solid var(--ok); border-radius: var(--rayon);
  padding: 18px 20px; margin: 8px 0 22px;
}
.final h2 { font-size: 20px; margin: 0 0 8px; }
.final-verrou { margin: 0; color: var(--texte-doux); }
.final .actions { margin: 10px 0 14px; }
pre.code-final { line-height: 1.6; max-height: 70vh; overflow: auto; }

/* ---------- TP noté : sorties, identité, bilan ---------- */
.bandeau-sorties {
  padding: 7px 24px; font-size: 14px; border-top: 1px solid var(--bordure);
  background: var(--surface-2); color: var(--texte-doux);
}
.bandeau-sorties.alerte { background: var(--ko-fond); color: var(--ko); font-weight: 700; }
.alerte-fond {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 15, 25, .6);
}
.alerte-boite {
  max-width: 480px; width: 100%; background: var(--surface); color: var(--texte);
  border: 3px solid var(--ko); border-radius: 14px; padding: 22px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.alerte-boite h2 { margin: 0 0 10px; color: var(--ko); font-size: 22px; }
.alerte-boite p { margin: 0 0 18px; }

.carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 16px 20px; margin: 16px 0; }
.carte p { margin: 4px 0; }
.carte h3 { margin: 0 0 6px; }
.formulaire .champs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 16px; }
.formulaire label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.formulaire input {
  font: inherit; font-weight: 400; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--bordure); background: var(--fond); color: var(--texte);
}
#form-raz label { margin-bottom: 12px; max-width: 320px; }

table.plan { border-collapse: collapse; width: 100%; margin: 10px 0 16px; font-size: 15px; display: block; overflow-x: auto; }
table.plan th, table.plan td { border: 1px solid var(--bordure); padding: 8px 10px; text-align: left; vertical-align: top; }
table.plan th { background: var(--surface-2); }

.note-finale { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; border: 2px solid var(--accent); }
.note-grande { font-size: 52px; font-weight: 800; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.note-sur { font-size: 22px; color: var(--texte-doux); font-weight: 700; }
.sorties-alerte { border: 2px solid var(--ko); background: var(--ko-fond); color: var(--ko); }
.sorties-ok { border: 1px solid var(--ok); background: var(--ok-fond); color: var(--ok); }
.liste-restants { margin: 6px 0 0; padding-left: 20px; columns: 2; }

.note-exo { margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--accent-doux); color: var(--texte); font-size: 15px; font-weight: 600; }

.menu .nav-partie {
  margin: 14px 10px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--texte-doux); display: flex; justify-content: space-between;
}
.menu .nav-partie:first-of-type { margin-top: 10px; }

@media (max-width: 860px) {
  .formulaire .champs { grid-template-columns: minmax(0, 1fr); }
  .liste-restants { columns: 1; }
  .progression-texte { max-width: 150px; }
}

/* ---------- Version serveur ---------- */
.bandeau-message {
  padding: 8px 24px; font-size: 15px; font-weight: 700;
  background: var(--accent); color: var(--accent-texte);
}
.bandeau-message.flash { animation: flash 1s ease 3; }
@keyframes flash { 50% { filter: brightness(1.35); } }
.page-seule .menu { display: none; }
.page-seule .mise-en-page { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.connexion { max-width: 460px; margin: 40px auto; }
.connexion input[name=code] {
  font-family: var(--mono); font-size: 26px; letter-spacing: .15em; text-transform: uppercase; text-align: center;
}
.erreur { color: var(--ko); font-weight: 600; margin: 8px 0 0; }
.chrono-restant.urgent { color: var(--ko); font-weight: 700; }
.confirmation { border: 2px solid var(--ko); }
.chargement { color: var(--texte-doux); padding: 24px 0; }

/* ---------- Pari de lucidité ---------- */
.pari { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.pari[hidden] { display: none; }
.pari-question { font-weight: 700; margin-right: 4px; }
.btn-pari { flex-direction: column; gap: 1px; min-height: 48px; min-width: 112px; border-color: var(--accent); color: var(--accent); }
.btn-pari small { font-size: 12px; font-weight: 500; color: var(--texte-doux); }
.btn-pari:hover { background: var(--accent-doux); }
.btn-pari[data-mise="3"] { border-width: 2px; }
.pari-retour { margin: 12px 0 0; padding: 10px 14px; border-radius: 8px; border-left: 4px solid var(--bordure); background: var(--surface-2); font-size: 15px; font-weight: 600; line-height: 1.45; }
.pari-retour.ok { border-color: var(--ok); background: var(--ok-fond); color: var(--ok); }
.pari-retour.ko { border-color: var(--ko); background: var(--ko-fond); color: var(--ko); }
.pari-retour.certain-ko { border-color: var(--vu); background: var(--vu-fond); color: var(--vu); font-size: 16px; }
.jetons { font-weight: 700; }
.lucidite-fin ul { margin: 8px 0; padding-left: 20px; }

/* ---------- Dissuasion des captures ---------- */
#tatouage { position: fixed; inset: 0; z-index: 900; pointer-events: none; background-repeat: repeat; }
#tatouage[hidden] { display: none; }
body.protege .contenu { -webkit-user-select: none; user-select: none; }
body.protege .contenu input, body.protege .contenu textarea { -webkit-user-select: text; user-select: text; }
@media print {
  body.protege > * { display: none !important; }
  body.protege::after { content: "L'impression du TP est désactivée."; display: block; padding: 40px; font: 20px sans-serif; }
}

/* ---------- Pause ---------- */
.bouton-pause { margin-left: auto; min-height: 40px; white-space: nowrap; border-color: var(--accent); color: var(--accent); }
.bouton-pause[hidden] { display: none; }
.bouton-pause + .progression-bloc { margin-left: 0; }
.pause-page .pause-chrono { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; border: 2px solid var(--accent); }
.pause-page .pause-chrono p { margin: 4px 0; }
.pause-compteur { font-variant-numeric: tabular-nums; }
.pause-page h3 { margin: 0 0 10px; font-size: 17px; }
.sequences { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.sequences li { display: grid; grid-template-columns: minmax(0, 1fr) 120px 64px; gap: 12px; align-items: center; }
.sequences .mini-barre { width: 100%; height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; display: block; }
.sequences .mini-barre i { display: block; height: 100%; background: var(--accent); }
.sequences li.complete .mini-barre i { background: var(--ok); }
.sequences .seq-compte { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pause-page .ok { color: var(--ok); font-weight: 700; }
.pause-page .vu { color: var(--vu); font-weight: 700; }
.pause-page .ko { color: var(--ko); font-weight: 700; }
.btn-reprendre { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 12px 22px; font-size: 17px; text-align: left; }
.btn-reprendre span { font-size: 14px; font-weight: 500; opacity: .9; }
@media (max-width: 640px) { .sequences li { grid-template-columns: minmax(0, 1fr) 64px; } .sequences .mini-barre { grid-column: 1 / -1; } }

/* Points d'étape */
.point-etape { margin: 18px 0; padding: 14px 18px; border-radius: var(--rayon); border: 1px dashed var(--bordure); background: var(--surface-2); color: var(--texte-doux); }
.point-etape p { margin: 4px 0; }
.point-etape.complete { border: 2px solid var(--ok); background: var(--ok-fond); color: var(--texte); }
.point-etape .pe-titre { font-weight: 800; color: var(--ok); text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
article.exo.repere { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow 2s; }

/* ---------- Séquences : menu, parcours, verrous ---------- */
.nav-seq {
  display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; align-items: start;
  margin: 18px 0 6px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-2); border-left: 4px solid var(--bordure);
}
.nav-seq .seq-icone { grid-row: span 2; font-size: 14px; line-height: 20px; text-align: center; }
.nav-seq .seq-nom { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.nav-seq .seq-nom small { display: block; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; color: var(--texte-doux); }
.nav-seq .seq-info { grid-column: 2; font-size: 12px; color: var(--texte-doux); margin-top: 2px; font-variant-numeric: tabular-nums; }
.nav-seq.faite { border-left-color: var(--ok); background: var(--ok-fond); }
.nav-seq.faite .seq-icone, .nav-seq.faite .seq-info { color: var(--ok); }
.nav-seq.en_cours { border-left-color: var(--accent); background: var(--accent-doux); }
.nav-seq.en_cours .seq-icone, .nav-seq.en_cours .seq-nom { color: var(--accent); }
.nav-seq.verrou { opacity: .75; }
.menu a.verrou { color: var(--texte-doux); }
.menu a.verrou .nav-titre { opacity: .7; }
.nav-titre small { color: var(--texte-doux); font-weight: 400; }

.nav-parcours {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px;
  padding: 12px; margin-bottom: 12px;
}
.nav-parcours p { margin: 0; }
.pc-titre { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); margin-bottom: 8px !important; }
.pc-barre { display: flex; gap: 3px; margin-bottom: 10px; }
.pc-seg { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.pc-seg i { display: block; height: 100%; background: var(--accent); }
.pc-seg.faite i { background: var(--ok); }
.pc-seg.verrou { background: repeating-linear-gradient(45deg, var(--surface-2) 0 4px, var(--bordure) 4px 6px); }
.pc-ligne, .pc-temps { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; }
.pc-ligne span, .pc-temps span { color: var(--texte-doux); }
.pc-ligne strong, .pc-temps strong { font-variant-numeric: tabular-nums; text-align: right; }
.pc-temps { border-top: 1px solid var(--bordure); margin-top: 6px !important; padding-top: 8px; }
.pc-verdict { font-size: 13px; font-weight: 700; text-align: right; }
.pc-verdict.ok { color: var(--ok); } .pc-verdict.vu { color: var(--vu); } .pc-verdict.ko { color: var(--ko); }

.exo-verrou { background: var(--surface-2); border-style: dashed; }
.exo-verrou .statut { color: var(--texte-doux); font-weight: 600; }
.exo-verrou.ouvert .statut { color: var(--ok); }
.exo-verrou .verrou-texte { margin: 6px 0 0; color: var(--texte-doux); }
.btn-verrou { opacity: .6; cursor: not-allowed; }
.verrou-carte { border-left: 4px solid var(--bordure); }
.plan-seq tr.faite td.etat-seq { color: var(--ok); font-weight: 700; }
.plan-seq tr.en_cours td.etat-seq { color: var(--accent); font-weight: 700; }
.plan-seq tr.verrou td { color: var(--texte-doux); }
.sequences li.verrou { opacity: .7; }
.plan-seq td:nth-child(2), .plan-seq td:nth-child(3), .plan-seq td.etat-seq { white-space: nowrap; }
.pc-ligne span, .pc-temps span { white-space: nowrap; }
.marque > div { min-width: 0; }
@media (max-width: 640px) {
  .marque { display: none; }
  .bouton-pause { margin-left: auto; }
  .bouton-pause { padding: 6px 10px; min-height: 36px; font-size: 14px; }
  .progression-bloc { min-width: 0; max-width: 42%; }
  .plan-seq td .muted, .plan-seq th:nth-child(3), .plan-seq td:nth-child(3) { display: none; }
  .plan-seq { font-size: 14px; }
}

/* ---------- Copie corrigée : on raye, on ne gomme pas ---------- */
.trou-fige { display: inline-flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.trou-fige > * { padding: 1px 7px; border-radius: 5px; font-weight: 600; }
.tf-ok { border: 2px solid #4ade80; background: #0f4d2c; color: #d9fbe5; }
.tf-ko { border: 2px solid #ff6b5e; background: #5c1712; color: #ffd4cf; text-decoration: line-through; text-decoration-thickness: 2px; }
.tf-corr { border: 2px dashed #4ade80; background: #0f4d2c; color: #d9fbe5; }
.tf-corr::before { content: "✔ "; opacity: .9; }
.retours s { color: var(--ko); text-decoration-thickness: 2px; font-family: var(--mono); font-size: .92em; background: var(--surface); padding: 0 5px; border-radius: 4px; border: 1px solid var(--ko); }
.exo.fige .consigne { opacity: .9; }
select.trou.a-corriger { border: 2px dashed #f2c35b; }
.trou-fige select { margin-left: 2px; }
.point-etape .pe-alerte { color: var(--vu); font-weight: 600; background: var(--vu-fond); padding: 8px 10px; border-radius: 6px; }

/* ---------- Mini-cours avant chaque exercice ---------- */
.notion { margin: 4px 0 16px; border: 1px solid var(--bordure); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--surface); }
.notion > summary { cursor: pointer; padding: 10px 14px; font-weight: 700; color: var(--accent); list-style-position: inside; }
.notion[open] > summary { border-bottom: 1px solid var(--bordure); }
.notion > .cours { padding: 4px 16px 12px; }
.notion h4 { margin: 16px 0 6px; font-size: 16px; }
.notion pre.exemple, .notion pre.algo { margin: 8px 0; }
.cours .piege { background: var(--vu-fond); color: var(--vu); padding: 8px 12px; border-radius: 8px; font-weight: 500; }

/* ---------- Encadré « À retenir » en fin de cours ---------- */
.cours .retenir { margin: 22px 0 6px; padding: 12px 18px; border: 2px solid var(--ok); border-radius: 10px; background: var(--ok-fond); }
.cours .retenir-titre { margin: 0 0 6px; font-weight: 800; color: var(--ok); text-transform: uppercase; letter-spacing: .04em; font-size: 14px; }
.cours .retenir ul { margin: 0; padding-left: 20px; }
.cours .retenir li { margin: 4px 0; }
.cours h4 { margin: 14px 0 6px; font-size: 16px; }

/* Nom de l'étudiant connecté, dans la barre du haut (remplace le filigrane) */
.etudiant-entete { margin-left: auto; font-weight: 700; font-size: 14px; color: var(--texte); background: var(--surface-2); border: 1px solid var(--bordure); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.etudiant-entete[hidden] { display: none; }
.etudiant-entete:not([hidden]) + .bouton-pause { margin-left: 0; }
@media (max-width: 640px) { .etudiant-entete { font-size: 12px; padding: 4px 8px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; } }

/* ---------- Exemples du cours : fenêtre « Administrateur : Windows PowerShell » ---------- */
.cours .term { border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.18); border: 1px solid #2b2b2b; margin: 10px 0 18px; }
.cours .term-barre { background: #1f1f1f; color: #e6e6e6; font: 13px "Segoe UI", Arial, sans-serif; padding: 7px 12px; display: flex; align-items: center; gap: 8px; }
.cours .term-ico { background: #012456; color: #fff; font: bold 11px Consolas, monospace; padding: 1px 4px; border-radius: 2px; }
.cours .term-btn { margin-left: auto; letter-spacing: 10px; color: #aaa; }
.cours pre.term-ecran { margin: 0; border-radius: 0; background: #0c0c0c; color: #cccccc; font: 16px/1.75 Consolas, "Cascadia Mono", monospace; padding: 12px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cours .term .ps, .legende-couleurs .ps { color: #cccccc; }
.cours .term .co, .legende-couleurs .co { color: #16c60c; }
.cours .term .cm, .legende-couleurs .cm { color: #f9f1a5; }
.cours .term .pa, .legende-couleurs .pa { color: #b4b4b4; }
.cours .term .st, .legende-couleurs .st { color: #61d6d6; }
.cours .term .va, .legende-couleurs .va { color: #3bf06a; }
.cours .term .kw, .legende-couleurs .kw { color: #e5a0ff; }
.cours .term .nu, .legende-couleurs .nu { color: #ffffff; }
.cours .term .re, .legende-couleurs .re { color: #e6e6e6; }
.cours .term .cl { color: #ffffff; }
.cours .term .ar, .cours .term .op { color: #cccccc; }

/* Contenu d'un fichier (CSV, extrait de script) : fond clair, comme dans le Bloc-notes */
.cours .fichier { border: 1px solid var(--bordure); border-radius: 8px; overflow: hidden; margin: 10px 0 14px; background: #ffffff; }
.cours .fichier-titre { background: var(--surface-2); color: var(--texte); font: 600 13px "Segoe UI", Arial, sans-serif; padding: 6px 12px; border-bottom: 1px solid var(--bordure); }
.cours pre.fichier-contenu { margin: 0; border-radius: 0; background: #ffffff; color: #1c2333; font: 15px/1.6 Consolas, monospace; padding: 10px 16px; overflow-x: auto; }
.cours pre.fichier-contenu .co { color: #1d7a46; }

/* Légende des couleurs, au début du module 1 */
.legende-couleurs { border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface); padding: 12px 18px; margin: 12px 0 20px; }
.legende-couleurs .legende-titre { margin: 0 0 8px; font-weight: 700; }
.legende-couleurs ul { list-style: none; margin: 0; padding: 0; }
.legende-couleurs li { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.legende-couleurs .ech { flex: none; display: inline-block; min-width: 150px; background: #0c0c0c; border-radius: 5px; padding: 3px 10px; font: 15px Consolas, monospace; white-space: pre; }
@media (max-width: 640px) { .cours pre.term-ecran { font-size: 13px; padding: 10px 12px; } .legende-couleurs li { flex-direction: column; align-items: flex-start; gap: 2px; } }

/* ---------- Course au trésor ---------- */
.tresor { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 18px 20px; margin: 0 0 18px; }
.tresor h2 { margin: 0 0 6px; font-size: 21px; }
.tresor p { margin: 0 0 8px; }
.tresor-objectif { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 12px 0 14px; padding: 12px 14px; background: var(--accent-doux); border-radius: 8px; }
.tresor-objectif > b { font-size: 19px; }
.tresor-global { flex: 1; min-width: 160px; height: 14px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 7px; overflow: hidden; }
.tresor-global i { display: block; height: 100%; background: var(--accent); }
.tresor-bonus { flex-basis: 100%; }
.coffres { list-style: none; margin: 0; padding: 0; }
.coffre { display: grid; grid-template-columns: 30px 1fr minmax(90px, 200px) 80px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--bordure); }
.coffre-ico { font-size: 22px; text-align: center; }
.coffre-nom { font-weight: 600; }
.coffre-nom small { display: block; font-weight: 400; font-size: 14px; color: var(--texte-doux); }
.coffre-barre { position: relative; height: 12px; background: var(--surface-2); border-radius: 6px; }
.coffre-barre i { display: block; height: 100%; border-radius: 6px; background: var(--texte-doux); }
.coffre.ouvert .coffre-barre i { background: var(--ok); }
.coffre-barre b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--texte); }
.coffre-etat { justify-self: end; font-size: 14px; font-weight: 600; padding: 2px 10px; border-radius: 20px; background: var(--surface-2); color: var(--texte-doux); white-space: nowrap; }
.coffre.ouvert .coffre-etat { background: var(--ok-fond); color: var(--ok); }
.tresor-legende { font-size: 14px; color: var(--texte-doux); margin-top: 8px !important; }
.tresor-sorties { font-size: 15px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); margin-bottom: 0 !important; }
.tresor-sorties.ko { background: var(--ko-fond); color: var(--ko); }
.final-morceaux h3 { font-size: 17px; margin: 16px 0 6px; }
.morceau-flou { position: relative; border-radius: 8px; overflow: hidden; }
.morceau-flou pre { filter: blur(5px); user-select: none; margin: 0; }
.morceau-flou span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 12px; font-weight: 600; color: #fff; background: rgba(1, 36, 86, .45); }
.morceau-ferme { color: var(--texte-doux); margin: 0; padding: 10px 14px; border: 2px dashed var(--bordure); border-radius: 8px; }
@media (max-width: 640px) {
  .coffre { grid-template-columns: 26px 1fr 70px; }
  .coffre-barre { grid-column: 2 / 4; grid-row: 2; }
}
