/* Jetons : DESIGN.md (racine du projet). */
:root {
  --paper: #F4F5F1; --surface: #FFFFFF; --ink: #1E2A45; --ink-soft: #55607A; --line: #D9DCD2;
  --action: #2747B8; --action-ink: #FFFFFF; --success: #2B7A4B; --error: #B3261E;
  --marker-jaune: #FFE45C; --marker-rose: #FFA8CC; --marker-vert: #A3E9AE;
  --marker-bleu: #A6D6FF; --marker-orange: #FFC98A; --marker-lilas: #CDBCFF;
  --marker: var(--marker-jaune);
  --lecture: "Literata", Georgia, serif; --ui: "Figtree", system-ui, sans-serif;
  --sm: 8px; --md: 16px; --lg: 24px; --xl: 40px; --xxl: 64px;
  --r-sm: 6px; --r-md: 12px; --r-lg: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 500 1rem/1.45 var(--ui);
  display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
a { color: var(--action); }
h1, h2, h3 { font-family: var(--ui); font-weight: 800; line-height: 1.2; margin: 0 0 var(--md); letter-spacing: -.01em; }
h1 { font-size: 2.1rem; max-width: 26ch; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 var(--md); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.discret { color: var(--ink-soft); font-size: .9rem; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 4px; }

/* Menu */
.menu { position: sticky; top: 0; height: 100vh; padding: var(--lg) var(--md); display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--line); background: var(--paper); }
.menu a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; font-weight: 600; }
.menu a:hover { background: var(--surface); }
.menu a[aria-current] { background: var(--surface); font-weight: 800; box-shadow: inset 4px 0 0 var(--marker-jaune); }
.menu .marque { font: 800 1.3rem var(--ui); margin-bottom: var(--md); padding-left: 12px; }
.menu .marque:hover { background: none; }
.ico { width: 22px; text-align: center; color: var(--ink-soft); }
.compte { margin-left: auto; background: var(--marker-jaune); border-radius: 999px; padding: 0 9px; font-size: .85rem; font-weight: 800; }
.recherche { margin-top: auto; }
input, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; }
textarea { resize: vertical; font-weight: 400; }

/* Boutons */
.btn, .btn-calme { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 1rem var(--ui); border-radius: 999px; padding: 13px 22px;
  cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn { background: var(--action); color: var(--action-ink); }
.btn:hover { filter: brightness(1.1); }
.btn.grand { padding: 16px 28px; font-size: 1.05rem; }
.btn-calme { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-calme:hover { border-color: var(--ink-soft); }

/* Pages */
.page { padding: var(--xl) var(--xxl) var(--xxl); max-width: 1100px; }
.entete { margin-bottom: var(--lg); }
.entete h1 { margin-bottom: 0; }
section { margin-bottom: var(--xl); }
.panneau, .encadre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--lg); margin-bottom: var(--lg); }
.encadre ul { padding-left: 20px; margin: 0; } .encadre li { margin-bottom: 6px; }
.encadre summary { cursor: pointer; font-weight: 700; }
.ligne { display: flex; gap: var(--sm); align-items: stretch; }
.demande-rapide { margin-bottom: var(--xl); }
.demande-rapide label { display: block; font: 700 1.05rem var(--ui); margin-bottom: var(--sm); }
.retour { display: inline-block; color: var(--ink-soft); text-decoration: none; font-weight: 600; margin-bottom: var(--lg); }
.retour:hover { color: var(--ink); }

/* Le surligneur */
.matiere-tag { font-weight: 700; font-size: .9rem; background: var(--marker); padding: 2px 8px; border-radius: var(--r-sm); color: var(--ink); }
.heure { display: inline-block; font: 700 .82rem var(--ui); background: var(--marker-jaune); color: var(--ink); text-decoration: none;
  border-radius: var(--r-sm); padding: 1px 7px; white-space: nowrap; }
a.heure:hover { background: var(--ink); color: var(--marker-jaune); }
mark { background: var(--marker-jaune); color: inherit; }

/* Accueil : la prochaine étape */
.etapes { display: grid; grid-template-columns: 2fr 1fr; gap: var(--md); }
.etape { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: var(--lg); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); color: var(--ink); text-decoration: none; }
.etape:hover { border-color: var(--ink-soft); }
.etape .btn, .etape .btn-calme { margin-top: auto; }
.etape.principale { border: 2px solid var(--ink); }
.etiquette { font: 800 .8rem var(--ui); color: var(--ink-soft); letter-spacing: .02em; }
.etape-titre { font: 800 1.6rem/1.2 var(--ui); margin-bottom: 4px; }
.etape .barre { width: 100%; margin: 4px 0 var(--sm); }
.bandeau { font: 700 .85rem var(--ui); background: var(--marker); padding: 3px 10px; border-radius: 999px; }

/* Cartes de séance */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--md); }
.seance-carte { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--ink); text-decoration: none; overflow: hidden; }
.seance-carte:hover { border-color: var(--ink-soft); }
.seance-carte .bandeau { border-radius: 0; padding: 8px var(--lg); }
.seance-carte .corps { display: flex; flex-direction: column; gap: 6px; padding: var(--md) var(--lg) var(--lg); flex: 1; }
.seance-titre { font: 800 1.2rem/1.25 var(--ui); }
.etat { color: var(--ink-soft); font-size: .9rem; margin-top: auto; padding-top: 6px; }
.barre { display: block; height: 8px; border-radius: 999px; background: var(--paper); overflow: hidden; }
.barre > span { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.progression { list-style: none; padding: 0; display: grid; gap: 14px; max-width: 640px; }
.progression li { display: grid; grid-template-columns: 260px 1fr 60px; gap: var(--md); align-items: center; }
.progression a { color: var(--ink); text-decoration: none; font-weight: 700; }
.progression .barre > span { background: var(--marker); }
.frise { list-style: none; padding: 0; display: grid; gap: var(--md); max-width: 640px; }
.nuage { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.nuage a { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .92rem; }
.liste { list-style: none; padding: 0; } .liste li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.liste a, .resultats a { color: var(--ink); text-decoration: none; font-weight: 600; }
.resultats { list-style: none; padding: 0; } .resultats li { padding: var(--md) 0; border-bottom: 1px solid var(--line); }
.resultats p { font: 400 1rem/1.6 var(--lecture); margin: 6px 0 0; }

/* Mes matières : les séances de chaque matière, en un clic */
.matiere-bloc { margin-bottom: var(--xl); }
.matiere-ligne { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 12px; }
.matiere-ligne h2 { margin: 0; font-size: 1.1rem; }
.lien-matiere { margin-left: auto; }
.matiere-bloc .seance-carte .bandeau { display: none; }

/* Séance : entrée */
.colonne { max-width: 700px; margin: 0 auto; }
.seance-entete { margin-bottom: var(--xl); }
.seance-entete h1 { font-size: 2.3rem; }
.en-bref { font: 400 1.15rem/1.65 var(--lecture); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--md); margin-top: var(--lg); }
.chapitres { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.chapitres li + li { border-top: 1px solid var(--line); }
.chapitres a { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 14px var(--lg); color: var(--ink); text-decoration: none; }
.chapitres a:hover { background: var(--paper); }
.chapitres .nom { font-weight: 700; }
.pastille { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); font: 800 .9rem var(--ui); color: var(--ink-soft); }
.chapitres .lu .pastille { background: var(--success); border-color: var(--success); color: #fff; }
.chapitres .lu .nom { color: var(--ink-soft); }
.chapitres .ici .pastille { border-color: var(--ink); background: var(--marker); color: var(--ink); }
.lien-video { color: var(--ink-soft); font-weight: 600; }

/* Lecture : un chapitre par écran */
.page-lecture { padding: 0; min-width: 0; }
.lecteur { min-height: 100vh; display: flex; flex-direction: column; }
.barre-lecture { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 40px 1fr auto; gap: var(--md); align-items: center;
  padding: 12px var(--lg); background: rgba(244, 245, 241, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.barre-lecture .retour { margin: 0; font-size: 1.4rem; }
.barre-lecture .ou { display: grid; gap: 6px; min-width: 0; }
.barre-lecture .ou > .discret { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.progres { display: flex; gap: 4px; }
.progres > span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.progres > .fait { background: var(--ink); } .progres > .ici { background: var(--marker); outline: 1px solid var(--ink); }
.compteur { font-weight: 800; }
/* Lecture : sommaire à gauche, texte au centre, l'essentiel à droite */
body:has(.page-lecture) { grid-template-columns: 1fr; }
body:has(.page-lecture) .menu { display: none; }
.menu-chapitres { display: none; position: relative; }
.menu-chapitres summary { cursor: pointer; list-style: none; font-weight: 700; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.menu-chapitres summary::-webkit-details-marker { display: none; }
.menu-chapitres[open] > .sommaire-liste { position: absolute; right: 0; top: calc(100% + 8px); width: min(340px, 88vw); max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sm); box-shadow: 0 10px 30px rgba(30, 42, 69, .18); }
.menu-chapitres .lien-video { display: none; }
.lecture-grille { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: var(--xl) var(--lg) var(--xl);
  display: grid; gap: 0 var(--xl); grid-template-columns: 250px minmax(0, 680px) 290px;
  grid-template-areas: "som tete ess" "som corps ess"; grid-template-rows: auto 1fr; align-items: start; justify-content: center; }
.sommaire { grid-area: som; position: sticky; top: 92px; max-height: calc(100vh - 180px); overflow: auto; }
.sommaire-tete { margin-bottom: 6px; }
.sommaire-seance { font: 800 1.1rem/1.25 var(--ui); margin-bottom: 2px; }
.sommaire-liste { list-style: none; padding: 0; margin: var(--md) 0; display: grid; gap: 2px; }
.sommaire-liste a { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: 7px 8px; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 600; line-height: 1.3; }
.sommaire-liste a:hover { background: var(--surface); }
.sommaire-liste .pastille { width: 24px; height: 24px; font-size: .75rem; border-width: 1.5px; }
.sommaire-liste .lu a { color: var(--ink-soft); }
.sommaire-liste .lu .pastille { background: var(--success); border-color: var(--success); color: #fff; }
.sommaire-liste .ici a { background: var(--surface); box-shadow: inset 3px 0 0 var(--ink); font-weight: 800; }
.sommaire-liste .ici .pastille { background: var(--marker); border-color: var(--ink); color: var(--ink); }
.sommaire .lien-video { font-size: .9rem; }
.chap-tete { grid-area: tete; }
.lecteur h1 { font-size: 2.1rem; max-width: none; margin-bottom: var(--lg); }
.essentiel { grid-area: ess; position: sticky; top: 92px; display: grid; gap: var(--md); max-height: calc(100vh - 180px); overflow: auto; }
.corps-chap { grid-area: corps; min-width: 0; }
.texte { font: 400 1.08rem/1.7 var(--lecture); }
.texte p { margin-bottom: .9em; }
.texte > p:first-child { font-size: 1.12rem; }
.bloc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--lg) var(--lg) calc(var(--lg) - .9em); margin-bottom: var(--md); }
.bloc h3 { font: 800 1.08rem/1.3 var(--ui); margin: 0 0 12px; display: flex; gap: 10px; align-items: baseline; }
.bloc h3::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--marker); outline: 1px solid rgba(30, 42, 69, .25); transform: translateY(-1px); }
.texte ul, .texte ol { padding-left: 1.3em; margin: 0 0 .9em; }
.texte li { margin-bottom: 8px; }
.texte .heure { background: none; color: var(--ink-soft); font: 600 .78rem var(--ui); padding: 0 2px; vertical-align: 2px; }
.texte a.heure:hover { color: var(--action); text-decoration: underline; }
.texte p, .texte li { position: relative; }
.texte strong { font-weight: 600; background: linear-gradient(transparent 60%, var(--marker) 60%); }
.complement { margin: var(--lg) 0; padding: var(--md) var(--lg); border-left: 4px solid var(--line); background: var(--surface); border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 1.05rem; }
.complement-titre { display: block; font: 700 .85rem var(--ui); color: var(--ink-soft); margin-bottom: 4px; }
.a-retenir { padding: var(--lg); background: var(--marker); border-radius: var(--r-lg); }
.a-retenir h2, .ecouter h2 { font-size: 1rem; margin-bottom: var(--sm); }
.a-retenir ul { margin: 0; padding-left: 18px; } .a-retenir li { font: 500 .95rem/1.45 var(--ui); margin-bottom: 8px; }
.a-retenir li:last-child { margin-bottom: 0; }
.qcm-chapitre { margin: var(--xl) 0; }
.ecouter { padding: var(--md) var(--lg); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.ecouter ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: .9rem; }
.ecouter li span { display: block; font-weight: 600; margin-bottom: 2px; }
.pied-lecture { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: var(--md);
  padding: 14px var(--lg); background: var(--paper); border-top: 1px solid var(--line); }
.pied-lecture form { margin-left: auto; }

/* Survol d'un paragraphe */
.para-actions { position: absolute; right: -8px; bottom: 100%; padding-bottom: 6px; display: none; gap: 4px; z-index: 2; }
.para-actions::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }
.texte p:hover > .para-actions, .texte li:hover > .para-actions, .texte .actif > .para-actions, .para-actions:focus-within { display: flex; }
.para-actions button { font: 700 .8rem var(--ui); background: var(--ink); color: var(--surface); border: 0; border-radius: 999px; padding: 5px 11px; cursor: pointer; }

/* QCM */
.question { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--lg); margin-bottom: var(--md); }
.enonce { font: 700 1.08rem/1.45 var(--ui); margin-bottom: 12px; }
.choix { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; cursor: pointer; font-weight: 400; }
.choix:hover { border-color: var(--ink-soft); }
.choix input { width: auto; margin-top: 3px; accent-color: var(--action); }
.choix.bonne { border-color: var(--success); background: #E7F4EC; }
.choix.mauvaise { border-color: var(--error); background: #FBEAE8; }
.question.juste, .question.faux { cursor: default; }
.correction { margin-top: var(--md); } .correction p { margin-bottom: 8px; }
.juste .correction strong { color: var(--success); } .faux .correction strong { color: var(--error); }
.qcm-num > .discret { display: block; margin-bottom: 6px; }
.score { font-weight: 700; }

/* Révision */
.revision { max-width: 640px; }
.carte-rev { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--xl); margin-bottom: var(--lg); }
.flip { cursor: pointer; }
.recto { font: 700 1.4rem/1.35 var(--ui); }
.verso { display: none; font: 400 1.2rem/1.6 var(--lecture); border-top: 1px dashed var(--line); padding-top: var(--lg); }
.flip.retournee .verso { display: block; animation: apparait .25s ease-out; }
.flip.retournee .montrer { display: none; }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } }
.notes { display: flex; gap: var(--sm); align-items: center; flex-wrap: wrap; } .notes p { margin: 0 var(--sm) 0 0; font-weight: 700; }
.carte-rev:has(.flip:not(.retournee)) + .notes, .carte-rev:has(.question:not(.juste):not(.faux)) + .notes { display: none; }
.fini h2 { font-size: 1.8rem; }

/* Assistant : panneau latéral */
.assistant { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); padding: var(--md); background: var(--paper);
  border-left: 1px solid var(--line); z-index: 20; display: flex; transform: translateX(100%); visibility: hidden; transition: transform .2s ease-out, visibility .2s; }
.assistant.ouvert { transform: none; visibility: visible; }
.fermer { position: absolute; top: 22px; right: 26px; font: 400 1.6rem/1 var(--ui); background: none; border: 0; cursor: pointer; color: var(--ink-soft); z-index: 1; }
.ouvrir-assistant { position: fixed; right: var(--lg); bottom: 104px; z-index: 15; display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--surface); font: 700 .95rem var(--ui); border-radius: 999px; padding: 10px 16px 10px 10px; box-shadow: 0 6px 20px rgba(30, 42, 69, .25); }
.ouvrir-assistant > span[aria-hidden] { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--marker-jaune); color: var(--ink); font-size: 1rem; }
.assistant-boite { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--lg); display: flex; flex-direction: column; min-height: 0; width: 100%; }
.assistant-boite h2 { font-size: 1.25rem; margin-bottom: 6px; }
.fil { overflow: auto; display: flex; flex-direction: column; gap: 10px; margin: var(--sm) 0; min-height: 0; flex: 1; }
.msg { padding: 12px 14px; border-radius: var(--r-md); font: 400 1rem/1.55 var(--lecture); }
.msg p:last-child { margin-bottom: 0; }
.msg.moi { background: var(--paper); align-self: flex-end; max-width: 90%; font-family: var(--ui); font-weight: 500; }
.msg.lui { border: 1px solid var(--line); }
.msg.lui.attend::after { content: "Je cherche dans tes cours…"; color: var(--ink-soft); font: 500 .9rem var(--ui); }
.ref { font: 600 .8rem var(--ui); color: var(--action); text-decoration: none; background: var(--paper); border-radius: var(--r-sm); padding: 1px 6px; white-space: nowrap; }
.demande { display: grid; gap: 10px; }
.modes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.modes label { cursor: pointer; } .modes input { position: absolute; opacity: 0; width: 1px; }
.modes span { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; }
.modes input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.modes input:focus-visible + span { outline: 3px solid var(--action); outline-offset: 2px; }
.aide-mode { margin: 0; }
.assistant-boite .revoir { margin: var(--sm) 0 0; }
.echange h2 { font-size: 1.25rem; }

/* Glossaire */
.glossaire dt { font-weight: 700; margin-top: var(--md); }
.glossaire dd { margin: 4px 0 0; font: 400 1.05rem/1.55 var(--lecture); max-width: 68ch; }
.lettres { display: flex; flex-wrap: wrap; gap: 4px; } .lettres a { padding: 4px 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }

/* Connexion */
body.connexion { display: grid; place-items: center; grid-template-columns: 1fr; padding: var(--md); }
.connexion-boite { width: min(420px, 100%); display: grid; gap: 12px; }
.connexion-boite h1 { font-size: 2rem; }
.erreur { color: var(--error); }

@media (max-width: 1280px) {
  .lecture-grille { grid-template-columns: 240px minmax(0, 700px); grid-template-areas: "som tete" "som corps" "som ess"; grid-template-rows: auto auto 1fr; }
  .essentiel { position: static; max-height: none; grid-template-columns: 1fr 1fr; margin: var(--sm) 0 var(--lg); }
  .essentiel > :only-child { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .lecture-grille { grid-template-columns: minmax(0, 700px); grid-template-areas: "tete" "corps" "ess"; }
  .sommaire { display: none; }
  .menu-chapitres { display: block; }
  .barre-lecture { grid-template-columns: 40px 1fr auto; }
  .barre-lecture .compteur { display: none; }
}

/* Téléphone : menu en bas */
@media (max-width: 860px) {
  body { grid-template-columns: 1fr; padding-bottom: 60px; }
  .menu { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 6px;
    border-right: 0; border-top: 1px solid var(--line); z-index: 10; }
  .menu .marque, .menu .recherche, .menu a:nth-of-type(7) { display: none; }
  .menu a { flex-direction: column; gap: 2px; font-size: .72rem; padding: 6px 4px; }
  .menu a[aria-current] { box-shadow: inset 0 3px 0 var(--marker-jaune); }
  .menu .compte { position: absolute; margin: 0 0 0 26px; font-size: .7rem; }
  .page { padding: var(--lg) var(--md) var(--xl); }
  h1, .seance-entete h1, .lecteur h1 { font-size: 1.65rem; }
  .etapes { grid-template-columns: 1fr; }
  .etape-titre { font-size: 1.35rem; }
  .progression li { grid-template-columns: 1fr 50px; } .progression .barre { grid-column: 1 / -1; grid-row: 2; }
  .lecteur { min-height: calc(100vh - 68px); }
  .barre-lecture { padding: 10px var(--md); }
  .lecture-grille { padding: var(--lg) var(--md); }
  .essentiel { grid-template-columns: 1fr; }
  .bloc { padding: var(--md) var(--md) calc(var(--md) - .9em); }
  .texte { font-size: 1.04rem; }
  .pied-lecture { position: fixed; left: 0; right: 0; bottom: 60px; padding: 10px var(--md); z-index: 9; }
  .lecture-grille { padding-bottom: 96px; }
  body:has(.page-lecture) .menu { display: flex; }
  .pied-lecture .btn.grand { padding: 14px 18px; font-size: 1rem; }
  .pied-lecture .btn-calme { padding: 13px 16px; font-size: 0; } .pied-lecture .btn-calme::before { content: "←"; font-size: 1.1rem; }
  .ouvrir-assistant { bottom: 150px; right: var(--md); padding: 10px; } .ouvrir-assistant .lib { display: none; }
  .chapitres a { padding: 12px var(--md); grid-template-columns: 32px 1fr auto; }
  .ligne { flex-direction: column; }
}
.prepa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--lg); }
.prepa-tete { display: flex; align-items: center; gap: var(--sm); font: 600 1.05rem var(--ui); }
.rond { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--action); animation: tourne .9s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }
.prepa-barre { height: 6px; background: var(--paper); border-radius: 3px; margin: var(--md) 0; overflow: hidden; }
.prepa-barre span { display: block; height: 100%; width: 0; background: var(--action); border-radius: 3px; transition: width .5s linear; }
.prepa-etapes { list-style: none; padding: 0; margin: 0 0 var(--md); display: grid; gap: var(--sm); font: 500 .95rem var(--ui); color: var(--ink-soft); }
.prepa-etapes li { display: flex; align-items: center; gap: var(--sm); }
.prepa-etapes li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.prepa-etapes li.encours { color: var(--ink); }
.prepa-etapes li.encours::before { border-color: var(--action); animation: pulse 1.2s ease-in-out infinite; }
.prepa-etapes li.fait { color: var(--success); }
.prepa-etapes li.fait::before { content: "✓"; border: 0; width: 10px; font-size: .8rem; line-height: 10px; }
@keyframes pulse { 50% { background: var(--action); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }
@media (min-width: 861px) {
  .page-lecture ~ .ouvrir-assistant, .lecteur ~ .ouvrir-assistant, body:has(.page-lecture) .ouvrir-assistant { bottom: 20px; right: auto; left: 50%; transform: translateX(-50%); box-shadow: none; }
}

/* Podcast */
.podcast { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--md) var(--lg); margin-bottom: var(--lg); }
.podcast-tete { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.podcast-tete > span:last-child { display: grid; }
.podcast-ico { font-size: 1.5rem; }
.podcast audio { width: 100%; }
.podcast.mini { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; margin: calc(-1 * var(--sm)) 0 var(--lg); }
.podcast.mini .podcast-ico { font-size: 1.1rem; }
.podcast.mini audio { flex: 1 1 260px; height: 36px; }
.chapitres li { position: relative; }
.chapitres li:has(.ecouter-ici) a { padding-right: 96px; }
.ecouter-ici { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 700 .8rem var(--ui); border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.ecouter-ici:hover { border-color: var(--ink); }
.chapitres li:has(.ecouter-ici) a > .discret { display: none; }

/* Ma classe (WhatsApp) */
.actions-liste { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sm); }
.action { display: flex; gap: var(--md); align-items: flex-start; padding: var(--md); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.action form { margin: 0; }
.action .coche { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--ink); background: var(--surface); cursor: pointer; font: 800 1rem var(--ui); color: var(--ink); flex: none; }
.action .boutons { display: flex; flex-wrap: wrap; gap: var(--sm); margin: var(--sm) 0 0; }
.action .plus { padding: 7px 14px; font-size: .9rem; }
.action.faite { opacity: .55; }
.action.faite .coche { background: var(--marker-vert); }
.action.faite .quoi { text-decoration: line-through; }
.action .quoi { font-weight: 700; }
.action .echeance { font: 700 .82rem var(--ui); background: var(--marker-orange); padding: 2px 8px; border-radius: 999px; margin-left: 6px; white-space: nowrap; }
.action .echeance.proche { background: var(--marker-rose); }
.action blockquote { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--ink-soft); font-size: .9rem; }
.brief { padding: var(--lg); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; gap: var(--md); }
.brief .resume { font: 400 1.05rem/1.6 var(--lecture); margin: 0; }
.sujets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sm); }
.sujets li { padding-left: 12px; border-left: 4px solid var(--marker-bleu); }
.sujets .groupe { font: 700 .78rem var(--ui); color: var(--ink-soft); }
.anciens details { padding: var(--sm) 0; border-top: 1px solid var(--line); }
.anciens summary { cursor: pointer; font-weight: 700; }
.etat-wa { display: flex; align-items: center; gap: 8px; }
.etat-wa .point { width: 10px; height: 10px; border-radius: 50%; background: var(--marker-vert); border: 1px solid var(--ink-soft); }
.etat-wa .point.off { background: var(--marker-rose); }

.medias { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--md); }
.media { padding: var(--md); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; gap: var(--sm); min-width: 0; }
.media p { margin: 0; }
.media img, .media video { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--r-sm); background: var(--line); }
.media audio { width: 100%; }
.media .doc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; overflow-wrap: anywhere; }
.media .transcription { font: italic 400 .95rem/1.5 var(--lecture); }
.extrait-media { white-space: pre-wrap; font-size: .9rem; max-height: 320px; overflow: auto; margin-top: 6px; }
.media .doc .btn-calme { padding: 4px 12px; font-size: .85rem; }

.plus-popup { width: min(640px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; padding: var(--lg); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.plus-popup::backdrop { background: rgb(0 0 0 / .4); }
.plus-popup h2 { margin: 0 40px var(--md) 0; font-size: 1.15rem; }
.plus-popup .fermer { position: absolute; top: var(--sm); right: var(--sm); width: 36px; height: 36px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--ink); }
.plus-popup .msg.lui { max-width: none; }

.sources li, .plan > li { margin-bottom: var(--sm); }
.plan ul { margin: 4px 0 0; }
.devoir-fil { margin-top: var(--xl); }

/* Support écrit du prof intégré au chapitre */
.support { margin: var(--xl) 0 var(--lg); padding: var(--lg); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; gap: var(--md); }
.support.nouveau { border-color: var(--marker-lilas); box-shadow: inset 4px 0 0 var(--marker-lilas); }
.support h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: var(--sm); flex-wrap: wrap; }
.support p { margin: 0; }
.precision { display: flex; flex-direction: column; gap: 4px; padding-left: var(--md); border-left: 3px solid var(--marker); font: 400 1rem/1.55 var(--lecture); }
.etiquette { display: block; font: 700 .8rem var(--ui); color: var(--ink-soft); }
.support-plus { font: 400 1rem/1.6 var(--lecture); }
.support-plus ul { padding-left: 18px; margin: 4px 0 0; }
.badge-nouveau { display: inline-block; font: 700 .72rem var(--ui); background: var(--marker-lilas); color: var(--ink); padding: 1px 8px; border-radius: 999px; vertical-align: middle; }
.bandeau-support { margin: var(--md) 0; padding: var(--md); background: var(--surface); border: 1px solid var(--marker-lilas); border-radius: var(--r-md); font-size: .95rem; }
