/* Livret Maths 2nde — refonte du 14/10/2026.
   Les neutres viennent de commun/theme.css (clair et sombre) ; le module
   n'ajoute qu'un accent et trois couleurs d'état. Une seule colonne de
   lecture, la démarche de l'exercice numérotée de 1 à 5. */

:root {
  --m-accent: #4357d0;
  --m-accent-fond: #eef0fc;
  --m-sur-accent: #fff;
  --m-vert: #157347;
  --m-vert-fond: #e9f7ef;
  --m-ambre: #9a5b06;
  --m-ambre-fond: #fdf4e3;
  --m-rouge: #b42318;
  --m-rouge-fond: #fdeeec;
  --m-largeur: 1040px;
  --m-lecture: 760px;
  --m-rayon: 12px;
}
:root[data-theme="dark"] {
  --m-accent: #9aa8ff;
  --m-accent-fond: #18224a;
  --m-sur-accent: #0b1020;
  --m-vert: #6fdca4;
  --m-vert-fond: #0f2a1f;
  --m-ambre: #f4c35a;
  --m-ambre-fond: #2e230b;
  --m-rouge: #ffaba3;
  --m-rouge-fond: #3a1517;
}

/* ---------- Base ---------- */
body.maths { background: var(--fond); color: var(--encre); }
.maths main { display: block; max-width: var(--m-largeur); margin: 0 auto; padding: 1.75rem 1.25rem 3rem; min-height: 60vh; }
.maths main:focus { outline: none; }
.maths h1, .maths h2, .maths h3 { line-height: 1.2; margin: 0; letter-spacing: -.015em; }
.maths h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-weight: 700; }
.maths h2 { font-size: 1.2rem; font-weight: 650; }
.maths h3 { font-size: 1rem; font-weight: 650; }
.maths p { margin: 0 0 .75rem; }
:where(.maths) a { color: var(--m-accent); }
.maths :focus-visible { outline: 3px solid var(--m-accent); outline-offset: 2px; border-radius: 4px; }
.discret, .maths small { color: var(--encre-2); }
.evitement { position: fixed; left: 1rem; top: -10rem; z-index: 300; padding: .6rem .9rem; background: var(--carte); border-radius: 8px; }
.evitement:focus { top: .5rem; }
.surtitre { font-size: .78rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--encre-2); margin: 0 0 .5rem; }
.chapo { font-size: 1.05rem; color: var(--encre-2); max-width: 62ch; }
.chargement { padding: 3rem 1rem; text-align: center; color: var(--encre-2); }
.message-vide { padding: 1.25rem; text-align: center; color: var(--encre-2); border: 1px dashed var(--trait); border-radius: var(--m-rayon); }

/* ---------- Avis et onglets ---------- */
.avis { padding: .55rem 1rem; text-align: center; font-size: .85rem; background: var(--m-accent-fond); color: var(--encre); }
.avis-local { background: var(--m-ambre-fond); color: var(--m-ambre); }
.onglets { border-bottom: 1px solid var(--trait); background: var(--carte); }
.onglets-int { max-width: var(--m-largeur); margin: 0 auto; padding: 0 .75rem; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.onglets-int::-webkit-scrollbar { display: none; }
.onglets a { flex: 0 0 auto; display: flex; align-items: center; min-height: 48px; padding: 0 .85rem; color: var(--encre-2); text-decoration: none; font-weight: 550; font-size: .95rem; border-bottom: 2px solid transparent; }
.onglets a:hover { color: var(--encre); }
.onglets a[aria-current="page"] { color: var(--encre); border-bottom-color: var(--m-accent); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .55rem 1rem; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); color: var(--encre); font: inherit; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--encre-3); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primaire { background: var(--m-accent); border-color: var(--m-accent); color: var(--m-sur-accent); }
.btn.primaire:hover { filter: brightness(1.06); }
.btn.lien { border-color: transparent; background: none; color: var(--m-accent); padding-inline: .4rem; }
.btn.petit { min-height: 36px; padding: .35rem .75rem; font-size: .85rem; }
.btn[aria-pressed="true"] { border-color: var(--m-accent); background: var(--m-accent-fond); color: var(--m-accent); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ---------- Cartes génériques ---------- */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--m-rayon); padding: 1.15rem 1.25rem; }
.section { margin-top: 2.25rem; }
.section > h2 { margin-bottom: .9rem; }
.section-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; }
.section-tete h2 { margin: 0; }

/* ---------- Accueil ---------- */
.accueil-intro { padding: .5rem 0 0; max-width: 46rem; }
.accueil-intro h1 { margin-bottom: .75rem; }
.reprise { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; border-left: 4px solid var(--m-accent); }
.reprise p { margin: 0; }
.reprise strong { display: block; font-size: 1.05rem; }
.methode { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; counter-reset: etape; }
.methode li { position: relative; padding: 1rem 1rem 1rem 3.1rem; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--m-rayon); font-size: .9rem; color: var(--encre-2); }
.methode li::before { counter-increment: etape; content: counter(etape); position: absolute; left: 1rem; top: 1rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--m-accent-fond); color: var(--m-accent); font-weight: 700; font-size: .85rem; }
.methode strong { display: block; color: var(--encre); font-size: .95rem; margin-bottom: .2rem; }
.choix-depart { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.choix-depart a { display: flex; flex-direction: column; gap: .35rem; padding: 1.15rem 1.25rem; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--m-rayon); color: var(--encre); text-decoration: none; }
.choix-depart a:hover { border-color: var(--m-accent); }
.choix-depart .question { font-size: .82rem; color: var(--encre-2); }
.choix-depart strong { font-size: 1.05rem; }
.choix-depart p { font-size: .9rem; color: var(--encre-2); margin: 0; flex: 1; }
.choix-depart .go { color: var(--m-accent); font-weight: 600; font-size: .9rem; margin-top: .4rem; }
.domaines { display: grid; gap: .5rem; }
.domaine { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem 1rem; align-items: center; padding: .9rem 1.1rem; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--m-rayon); color: var(--encre); text-decoration: none; }
.domaine:hover { border-color: var(--encre-3); }
.domaine strong { font-weight: 600; }
.domaine small { font-size: .85rem; }
.barre { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--trait); overflow: hidden; }
.barre span { display: block; height: 100%; background: var(--m-accent); border-radius: inherit; }
.mention { margin-top: 2.25rem; font-size: .85rem; color: var(--encre-2); }

/* ---------- Listes de fiches ---------- */
.page-tete { margin-bottom: 1.25rem; }
.page-tete h1 { margin-bottom: .5rem; }
.page-tete p { color: var(--encre-2); margin: 0; max-width: 62ch; }
.filtres { display: grid; gap: .75rem; margin: 1.25rem 0 .5rem; }
.recherche { width: 100%; min-height: 46px; padding: .6rem .9rem; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); color: var(--encre); font: inherit; }
.puces { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .2rem; }
.puces::-webkit-scrollbar { display: none; }
.puces .btn { flex: 0 0 auto; min-height: 38px; padding: .35rem .85rem; border-radius: 99px; font-weight: 550; font-size: .88rem; }
.compte { font-size: .85rem; color: var(--encre-2); margin: .5rem 0 0; }
.groupe { margin-top: 1.5rem; }
.groupe h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--encre-2); font-weight: 650; margin-bottom: .6rem; }
.liste { display: grid; gap: .4rem; }
.ligne { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto; align-items: center; gap: .85rem; min-height: 60px; padding: .7rem 1rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; color: var(--encre); text-decoration: none; }
.ligne:hover { border-color: var(--encre-3); }
.ligne .num { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--encre-2); text-align: center; }
.ligne strong { display: block; font-weight: 600; line-height: 1.3; }
.ligne small { display: block; font-size: .82rem; margin-top: .1rem; }
.statut { justify-self: end; font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; white-space: nowrap; color: var(--encre-2); background: var(--carte-2); }
.statut.en-cours { color: var(--m-accent); background: var(--m-accent-fond); }
.statut.fini { color: var(--m-vert); background: var(--m-vert-fond); }
.statut.revoir { color: var(--m-ambre); background: var(--m-ambre-fond); }

/* ---------- Parcours ---------- */
.cartes-parcours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.carte-parcours { display: flex; flex-direction: column; gap: .4rem; }
.carte-parcours p { color: var(--encre-2); font-size: .9rem; margin: 0; flex: 1; }
.carte-parcours .actions { margin-top: .6rem; }

/* ---------- Bilan ---------- */
.tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.tuile strong { display: block; font-size: 1.8rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tuile strong small { font-size: 1rem; font-weight: 500; }
.tuile span { font-size: .88rem; color: var(--encre-2); }
.note-parcours { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.note-parcours p { margin: .2rem 0 0; font-size: .88rem; color: var(--encre-2); }

/* ---------- Page d'exercice ---------- */
.exo { max-width: var(--m-lecture); margin: 0 auto; }
.fil { font-size: .88rem; color: var(--encre-2); margin-bottom: .9rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.fil a { text-decoration: none; }
.exo-tete h1 { margin-bottom: .9rem; }
.exos { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding: 2px 2px .25rem; margin: 0 -2px; }
.exos::-webkit-scrollbar { display: none; }
.exos a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .35rem .85rem; border: 1px solid var(--trait); border-radius: 99px; background: var(--carte); color: var(--encre-2); text-decoration: none; font-size: .88rem; font-weight: 550; }
.exos a[aria-current="step"] { background: var(--encre); border-color: var(--encre); color: var(--fond); }
.exos .ok { color: var(--m-vert); font-weight: 700; }
.exos a[aria-current="step"] .ok { color: inherit; }
.exos.dense a { min-width: 40px; justify-content: center; padding-inline: .5rem; }

.essentiel-bloc { margin-top: 1.1rem; background: var(--m-accent-fond); border: 0; border-radius: var(--m-rayon); padding: 0; }
.essentiel-bloc summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 48px; padding: .6rem 1.1rem; font-weight: 650; color: var(--encre); }
.essentiel-bloc summary::-webkit-details-marker { display: none; }
.essentiel-bloc summary::after { content: "Afficher"; font-size: .82rem; font-weight: 550; color: var(--m-accent); }
.essentiel-bloc[open] summary::after { content: "Masquer"; }
.essentiel-bloc > div { padding: 0 1.1rem 1rem; }
.essentiel { margin: 0; padding-left: 1.15rem; display: grid; gap: .35rem; }
.essentiel li::marker { color: var(--m-accent); }

/* La démarche : cinq étapes, toujours visibles en haut de l'écran. */
/* L'en-tête commun reste collé en haut : sa hauteur est mesurée par app.js (--m-entete). */
.demarche { position: sticky; top: calc(var(--m-entete, 0px) + .5rem); z-index: 20; margin-top: 1.1rem; padding: .35rem; background: color-mix(in srgb, var(--carte) 97%, transparent); border: 1px solid var(--trait); border-radius: var(--m-rayon); box-shadow: var(--ombre-2); } /* Sans backdrop-filter (21/10/2026) : un flou sur un élément qui défile au-dessus des images faisait scintiller la page dans Chrome. Fond presque opaque à la place. */
.demarche ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .25rem; }
.demarche a { display: flex; align-items: center; justify-content: center; gap: .4rem; min-height: 38px; padding: .2rem .3rem; border-radius: 8px; color: var(--encre-2); text-decoration: none; font-size: .84rem; font-weight: 550; white-space: nowrap; }
.demarche a:hover { background: var(--carte-2); }
.demarche .puce-etape { flex: 0 0 auto; width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--trait); font-size: .75rem; font-weight: 700; }
.demarche .fait { color: var(--encre); }
.demarche .fait .puce-etape { background: var(--m-vert); border-color: var(--m-vert); color: var(--carte); }

.etape { scroll-margin-top: calc(var(--m-entete, 0px) + 5rem); margin-top: 1.1rem; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--m-rayon); padding: 1.15rem 1.25rem 1.25rem; }
.etape > h2 { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.etape > h2 .n { flex: 0 0 auto; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; border-radius: 50%; background: var(--m-accent-fond); color: var(--m-accent); font-size: .85rem; }
.etape > h2 small { margin-left: auto; font-size: .82rem; font-weight: 550; }
.consigne { color: var(--encre-2); font-size: .93rem; }
.badge { display: inline-block; font-size: .78rem; font-weight: 650; padding: .15rem .55rem; border-radius: 99px; background: var(--m-ambre-fond); color: var(--m-ambre); }
.etape.verrouillee { background: transparent; border-style: dashed; }
.etape.verrouillee > h2 { color: var(--encre-2); margin-bottom: .3rem; }

/* L'énoncé : texte plus grand, une question par ligne. */
.etape > h3 { margin: -.25rem 0 .5rem; font-size: 1.02rem; }
.enonce { font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.questions { list-style: none; margin: .5rem 0 .75rem; padding: 0; display: grid; gap: .5rem; }
.questions li { display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: .6rem; align-items: baseline; }
.q-label { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.75rem; padding: 0 .3rem; border-radius: 7px; background: var(--carte-2); color: var(--encre); font-weight: 700; font-size: .85rem; line-height: 1; }
.q-puce { width: .45rem; height: .45rem; margin: 0 auto; border-radius: 50%; background: var(--encre-3); transform: translateY(-.15rem); }
.q-math { font-variant-numeric: tabular-nums; }
.code { margin: .5rem 0 .75rem; padding: .85rem 1rem; border-radius: 10px; background: var(--carte-2); overflow-x: auto; font: .88rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.figure { margin: 1rem 0 0; }
.figure img { display: block; max-width: 100%; height: auto; max-height: 420px; object-fit: contain; object-position: left; background: #fff; border-radius: 8px; border: 1px solid var(--trait); }
.figure .btn { margin-top: .5rem; }

/* Chercher */
.outils-chercher { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .25rem; }
.indice { margin-top: .75rem; padding: .75rem 1rem; border-radius: 10px; background: var(--m-ambre-fond); color: var(--encre); }
.indice strong { color: var(--m-ambre); }
.liens-fiches { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .88rem; margin-top: .75rem; color: var(--encre-2); }
.liens-fiches a { padding: .2rem .6rem; border-radius: 99px; background: var(--carte-2); text-decoration: none; font-weight: 550; }
.volet { margin-top: 1rem; border-top: 1px solid var(--trait); padding-top: .75rem; }
.volet summary { cursor: pointer; font-weight: 600; font-size: .93rem; min-height: 40px; display: flex; align-items: center; }
.volet textarea { display: block; width: 100%; min-height: 140px; margin-top: .5rem; padding: .75rem .85rem; border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); color: var(--encre); font: .95rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
.volet .discret { font-size: .82rem; margin: .4rem 0 0; }

/* Vérifier */
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .85rem; margin: .5rem 0 1rem; }
.champ label { display: flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.champ input, .champ select { width: 100%; min-height: 46px; padding: .55rem .75rem; border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); color: var(--encre); font: 1rem/1.4 inherit; font-family: inherit; }
.champ.ok input, .champ.ok select { border-color: var(--m-vert); }
.champ.ko input, .champ.ko select { border-color: var(--m-rouge); }
.vf { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.vf label { margin: 0; justify-content: center; min-height: 44px; border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); font-weight: 550; cursor: pointer; }
.vf input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vf input:checked + span { color: var(--m-accent); }
.vf label:has(input:checked) { border-color: var(--m-accent); background: var(--m-accent-fond); }
.vf label:has(input:focus-visible) { outline: 3px solid var(--m-accent); outline-offset: 2px; }
.champ.ok .vf label:has(input:checked) { border-color: var(--m-vert); background: var(--m-vert-fond); }
.champ.ko .vf label:has(input:checked) { border-color: var(--m-rouge); background: var(--m-rouge-fond); }
.retour { font-size: .85rem; margin: .35rem 0 0; min-height: 1.2em; line-height: 1.45; }
.champ.ok .retour { color: var(--m-vert); }
.champ.ko .retour { color: var(--m-rouge); }
.syntaxe { font-size: .88rem; color: var(--encre-2); margin-top: .75rem; }
.syntaxe summary { cursor: pointer; font-weight: 600; color: var(--m-accent); min-height: 36px; display: inline-flex; align-items: center; }
.syntaxe ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.astuce { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: 10px; background: var(--carte-2); font-size: .9rem; }
.resume-verif { font-weight: 600; margin: .75rem 0 0; }
.resume-verif.ok { color: var(--m-vert); }

/* Corrigé */
.corrige { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--trait); line-height: 1.7; overflow-wrap: anywhere; }
.etapes { margin: 0; padding-left: 1.15rem; display: grid; gap: .3rem; }
.questions.corrige { margin-top: 0; }
.attente { margin-top: .75rem; padding: .85rem 1rem; border-radius: 10px; background: var(--m-ambre-fond); }
.attente p { margin-bottom: .6rem; }

/* Faire le point */
.niveaux { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.niveaux .btn { flex-direction: column; gap: .1rem; min-height: 64px; padding: .5rem; line-height: 1.25; }
.niveaux .btn small { font-weight: 500; font-size: .76rem; }
.niveaux .btn[aria-pressed="true"] small { color: inherit; }
.note-ligne { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; font-size: .92rem; }
.note-ligne input { width: 5.5rem; min-height: 44px; padding: .4rem .6rem; border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); color: var(--encre); font: inherit; }
.conseil { margin-top: .9rem; padding: .75rem 1rem; border-radius: 10px; background: var(--m-accent-fond); font-size: .92rem; }
.conseil p { margin: 0 0 .4rem; }

.sauvegarde { font-size: .8rem; color: var(--encre-2); margin: .75rem 0 0; text-align: center; }
.suite-ex { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.25rem; }
.suite-ex .btn { flex: 0 1 auto; }

/* ---------- Tuteur ---------- */
.tuteur { margin-top: 1rem; border-top: 1px solid var(--trait); padding-top: 1rem; }
.tuteur-tete { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .75rem; }
.tuteur-tete strong { display: block; }
.tuteur-tete p { margin: .1rem 0 0; font-size: .88rem; color: var(--encre-2); }
.avatar { flex: 0 0 auto; width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: 50%; background: var(--m-accent-fond); color: var(--m-accent); font: italic 700 1rem Georgia, serif; }
.conversation { display: grid; gap: .6rem; margin-bottom: .75rem; max-height: 26rem; overflow-y: auto; overscroll-behavior: contain; }
.conversation:empty { display: none; }
.bulle { max-width: 90%; padding: .7rem .9rem; border-radius: 12px; background: var(--m-accent-fond); overflow-wrap: anywhere; white-space: pre-line; font-size: .95rem; }
.bulle small { display: block; font-size: .75rem; font-weight: 650; margin-bottom: .2rem; }
.bulle.eleve { justify-self: end; background: var(--carte-2); }
.reflexion { font-size: .88rem; color: var(--encre-2); margin: 0; }
.form-tuteur label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.form-tuteur textarea { display: block; width: 100%; min-height: 92px; padding: .7rem .85rem; border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); color: var(--encre); font: 1rem/1.55 inherit; font-family: inherit; resize: vertical; }
.form-tuteur textarea:focus { border-color: var(--m-accent); }
.form-tuteur textarea[readonly] { opacity: .7; }
.amorces { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0; }
.amorces .btn { min-height: 34px; padding: .25rem .7rem; border-radius: 99px; font-weight: 500; font-size: .84rem; color: var(--encre-2); }
.envoi { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.etat-tuteur { font-size: .85rem; color: var(--encre-2); }
.etat-tuteur.erreur { color: var(--m-rouge); }
.tuteur-absent { margin: 0; padding: .75rem 1rem; border-radius: 10px; background: var(--carte-2); font-size: .9rem; color: var(--encre-2); }
.confidentialite { font-size: .78rem; color: var(--encre-2); margin: .75rem 0 0; }
.jauge-tuteur .jauge-ia { margin: .5rem 0; }

/* ---------- Verrou, crédits, erreurs ---------- */
.verrou { max-width: 36rem; margin: 2rem auto; text-align: center; padding: 2rem 1.5rem; }
.verrou h1 { margin: .3rem 0 .75rem; }
.verrou .prix-module { font-size: 1.15rem; font-weight: 650; color: var(--encre); }
.verrou .actions { justify-content: center; margin: 1.25rem 0 1rem; }
.credits { max-width: var(--m-lecture); }
.credits .carte { margin-top: 1rem; }
.credits li { margin: .4rem 0; }

/* ---------- Pied et figure agrandie ---------- */
.pied-maths { max-width: var(--m-largeur); margin: 0 auto; padding: 1.5rem 1.25rem 2rem; border-top: 1px solid var(--trait); font-size: .82rem; color: var(--encre-2); }
dialog#figureDialog { width: min(96vw, 1000px); max-height: 94vh; padding: 0; border: 1px solid var(--trait); border-radius: var(--m-rayon); background: var(--carte); color: var(--encre); }
dialog#figureDialog::backdrop { background: rgb(7 17 31 / .78); }
.dialog-entete { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .75rem 1rem; background: var(--carte); border-bottom: 1px solid var(--trait); }
.dialog-entete h2 { font-size: 1rem; }
.dialog-figure { overflow: auto; padding: 1rem; }
.dialog-figure img { display: block; min-width: 520px; width: 100%; background: #fff; border-radius: 6px; }
dialog#figureDialog .discret { font-size: .8rem; padding: 0 1rem 1rem; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .methode { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choix-depart { grid-template-columns: 1fr; }
  .choix-depart a { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: .75rem; }
  .choix-depart .question { flex-basis: 100%; }
  .choix-depart p { flex-basis: 100%; }
}
@media (max-width: 640px) {
  .maths main { padding: 1.1rem 1rem 2.5rem; }
  .demarche { padding: .25rem; }
  .demarche ol { gap: .1rem; }
  .demarche a { flex-direction: column; gap: .15rem; font-size: .72rem; min-height: 46px; padding: .15rem 0; }
  .etape { padding: 1rem; margin-inline: -.25rem; }
  .etape > h2 { font-size: 1.08rem; }
  .enonce { font-size: 1rem; }
  .methode { grid-template-columns: 1fr; }
  .reprise { flex-direction: column; align-items: stretch; }
  .reprise .btn { width: 100%; }
  .cartes-parcours, .tuiles { grid-template-columns: 1fr; }
  .tuiles { gap: .5rem; }
  .tuile { display: flex; align-items: baseline; gap: .75rem; padding: .85rem 1rem; }
  .tuile strong { font-size: 1.5rem; }
  .ligne { grid-template-columns: 2rem minmax(0, 1fr); gap: .25rem .7rem; padding: .7rem .85rem; }
  .ligne .statut { grid-column: 2; justify-self: start; }
  .niveaux { grid-template-columns: 1fr; }
  .niveaux .btn { flex-direction: row; justify-content: space-between; min-height: 52px; padding-inline: 1rem; }
  .suite-ex .btn { flex: 1 1 0; }
  .note-parcours { flex-direction: column; align-items: flex-start; }
  .verrou { padding: 1.5rem 1rem; }
  .verrou .actions .btn { flex: 1 1 100%; }
  .dialog-figure img { min-width: 480px; }
}
@media (max-width: 360px) {
  .demarche .libelle { display: none; }
  .demarche a { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Onglets en couleurs (15/10/2026) ----------
   Chaque onglet porte la couleur d'un domaine du livret ; l'onglet ouvert
   est une pastille pleine. Clair : teinte foncée et texte blanc ; sombre :
   teinte vive et texte foncé, pour garder un bon contraste. */
.onglets a[data-nav="accueil"]    { --c: #26a69a; --c-fonce: #17766c; }
.onglets a[data-nav="diagnostic"] { --c: #f49e25; --c-fonce: #a55d06; }
.onglets a[data-nav="fiches"]     { --c: #6cb45f; --c-fonce: #3d7a33; }
.onglets a[data-nav="parcours"]   { --c: #b07cba; --c-fonce: #6c3a76; }
.onglets a[data-nav="bilan"]      { --c: #ec5e87; --c-fonce: #b02c55; }
.onglets-int { gap: .4rem; padding-top: .55rem; padding-bottom: .55rem; }
.onglets a { min-height: 40px; padding: 0 1rem; gap: .5rem; border: 0; border-radius: 999px; font-weight: 650; transition: background-color .18s, color .18s, transform .18s; }
.onglets a::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); flex: none; transition: transform .18s; }
.onglets a:hover { color: var(--c-fonce); background: color-mix(in srgb, var(--c) 14%, transparent); transform: translateY(-1px); }
.onglets a:hover::before { transform: scale(1.25); }
.onglets a[aria-current="page"] { color: #fff; background: var(--c-fonce); box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 40%, transparent); }
.onglets a[aria-current="page"]::before { background: #fff; }
:root[data-theme="dark"] .onglets a:hover { color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
:root[data-theme="dark"] .onglets a[aria-current="page"] { color: #0b1220; background: var(--c); }
:root[data-theme="dark"] .onglets a[aria-current="page"]::before { background: #0b1220; }
@media (prefers-reduced-motion: reduce) { .onglets a, .onglets a::before { transition: none; } .onglets a:hover { transform: none; } }
.onglets a[data-nav="livret"]     { --c: #e3a21a; --c-fonce: #8a5a00; }
