/* ARTHUR Éducation — styles des composants. Toutes les valeurs viennent des variables de tokens.css. */

.ae-root, .ae-root *, .ae-cours, .ae-cours *, .ae-app, .ae-app *, .ae-entete, .ae-entete * { box-sizing: border-box; }

/* ——— Bouton ——— */
.ae-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-6);
  border: 2px solid transparent; border-radius: var(--radius-md);
  font-family: var(--font-display); font-size: calc(16px * var(--ae-echelle, 1)); font-weight: 600; line-height: 1;
  cursor: pointer; text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease;
}
.ae-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ae-btn--principal { background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 0 var(--primary-deep); }
.ae-btn--secondaire { background: var(--surface-raised); color: var(--primary); border-color: var(--line-strong); box-shadow: 0 4px 0 var(--line-strong); }
.ae-btn--succes { background: var(--success); color: var(--on-primary); box-shadow: 0 4px 0 var(--success-deep); }
.ae-btn--discret { background: transparent; color: var(--primary); min-height: 40px; padding: 0 var(--space-4); }
.ae-btn--discret:hover { background: var(--primary-soft); }
.ae-btn:not(.ae-btn--discret):active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.ae-btn--large { min-height: 56px; font-size: calc(18px * var(--ae-echelle, 1)); width: 100%; }
.ae-btn[disabled] { background: var(--line); color: var(--ink-muted); border-color: transparent; box-shadow: 0 4px 0 var(--line-strong); cursor: not-allowed; transform: none; }

/* ——— Carte de chapitre ——— */
.ae-chap {
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-6); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-card);
  color: var(--ink); text-decoration: none; font-family: var(--font-sans);
  border: 2px solid transparent; cursor: pointer; max-width: 360px;
}
.ae-chap:hover { border-color: var(--primary-soft); }
.ae-chap:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ae-chap__haut { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ae-badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm);
  font-family: var(--font-display); font-size: calc(14px * var(--ae-echelle, 1)); line-height: 1.429; font-weight: 500;
  background: var(--primary-soft); color: var(--primary);
}
.ae-badge--fini { background: var(--success-soft); color: var(--success); }
.ae-badge--nouveau { background: var(--accent); color: var(--on-accent); }
.ae-chap__titre { margin: 0; font-family: var(--font-display); font-size: calc(20px * var(--ae-echelle, 1)); line-height: 1.4; font-weight: 500; }
.ae-chap__desc { margin: 0; font-size: calc(16px * var(--ae-echelle, 1)); line-height: 1.5; color: var(--ink-muted); }
.ae-chap__meta { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: calc(13px * var(--ae-echelle, 1)); line-height: 1.385; color: var(--ink-muted); }

/* ——— Encadré de cours : onglet de manuel scolaire ——— */
.ae-enc {
  --enc-c: var(--bloc-definition);
  position: relative; margin-top: 22px;
  padding: var(--space-6) var(--space-6) var(--space-4);
  background: var(--surface-raised); color: var(--ink);
  border: 2px solid var(--enc-c); border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
  font-family: var(--font-sans); font-size: calc(18px * var(--ae-echelle, 1)); line-height: 1.556;
}
/* Une couleur par type d'encadré : tokens bloc-* */
.ae-enc--definition { --enc-c: var(--bloc-definition); }
.ae-enc--propriete { --enc-c: var(--bloc-propriete); }
.ae-enc--theoreme { --enc-c: var(--bloc-theoreme); }
.ae-enc--exemple { --enc-c: var(--bloc-exemple); }
.ae-enc--methode { --enc-c: var(--bloc-methode); }
.ae-enc--piege { --enc-c: var(--bloc-piege); }
.ae-enc__onglet {
  position: absolute; bottom: calc(100% - 11px); left: -2px;
  padding: 4px var(--space-4) 3px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--enc-c); color: var(--on-primary);
  font-family: var(--font-display); font-size: calc(20px * var(--ae-echelle, 1)); line-height: 1.3; font-weight: 600;
}
/* Texte de l'onglet en 20 px (08/10, demande de l'utilisateur : « trop petit par rapport au texte dans les blocs ») ; l'onglet grandit vers le haut, son bas reste 11 px sous le haut du cadre */
/* Médaillon de personnage sur l'onglet (« À toi de jouer », « Ce qu'on se demande ») */
.ae-enc__perso { position: absolute; z-index: 1; top: -35px; left: -7px; width: 80px; height: 80px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--surface-raised), 0 0 0 5px var(--enc-c); }
/* Réglage de l'utilisateur (08/10) : tête de 80 px, centre à 35 px à droite et 7 px sous le coin du cadre ; texte de l'onglet 8 px après la tête */
.ae-enc__perso + .ae-enc__onglet { padding-left: 83px; }
.ae-enc:has(> .ae-enc__perso) { margin-left: 5px; }
/* Le texte contourne la tête : la première ligne commence juste après le cercle */
.ae-enc__perso ~ .ae-enc__onglet + *::before { content: ""; float: left; width: 57px; height: 21px; }
.ae-enc__perso ~ .ae-enc__onglet + ul, .ae-enc__perso ~ .ae-enc__onglet + ol { display: block; margin: 0; padding-left: 24px; }
.ae-enc__perso ~ .ae-enc__onglet + ul::before, .ae-enc__perso ~ .ae-enc__onglet + ol::before { width: 73px; margin-left: -24px; }
.ae-enc__perso ~ .ae-enc__onglet + ul > li + li, .ae-enc__perso ~ .ae-enc__onglet + ol > li + li { margin-top: var(--space-1); }
.ae-enc__num { font-weight: 400; margin-left: 4px; }
.ae-enc__titre { display: block; margin-bottom: var(--space-2); font-family: var(--font-display); font-size: calc(20px * var(--ae-echelle, 1)); line-height: 1.4; font-weight: 500; color: var(--ink); }
.ae-enc p { margin: 0 0 var(--space-2); }
.ae-enc p:last-child { margin-bottom: 0; }

/* ——— Retour après une réponse : bande de couleur, verdict, comparaison ——— */
.ae-retour {
  --ret-c: var(--success);
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-6); background: var(--surface-raised);
  border-top: 6px solid var(--ret-c); border-radius: var(--radius-md) var(--radius-md) 0 0;
  box-shadow: 0 -1px 0 var(--line), 0 -8px 24px rgba(43, 33, 27, 0.07);
  font-family: var(--font-sans); color: var(--ink);
}
.ae-retour--pasencore { --ret-c: var(--danger); }
.ae-retour__verdict { margin: 0; font-family: var(--font-display); font-size: calc(24px * var(--ae-echelle, 1)); line-height: 1.25; font-weight: 600; color: var(--ret-c); }
.ae-retour__texte { margin: 0; font-size: calc(16px * var(--ae-echelle, 1)); line-height: 1.5; }
.ae-retour__cmp { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: calc(16px * var(--ae-echelle, 1)); line-height: 1.5; }
.ae-retour__cmp > div { padding: var(--space-2) 12px; }
.ae-retour__cmp > div + div { border-left: 1px solid var(--line); }
.ae-retour__cmp small { display: block; font-family: var(--font-display); font-size: calc(13px * var(--ae-echelle, 1)); line-height: 1.385; font-weight: 500; color: var(--ink-muted); }
.ae-retour__cmp b { font-weight: 700; }

/* ——— Barre de progression ——— */
.ae-barre { display: flex; flex-direction: column; gap: var(--space-2); font-family: var(--font-sans); color: var(--ink); }
.ae-barre__ligne { display: flex; justify-content: space-between; gap: var(--space-2); font-size: calc(13px * var(--ae-echelle, 1)); line-height: 1.385; color: var(--ink-muted); }
.ae-barre__ligne b { color: var(--ink); font-weight: 700; }
.ae-barre__piste { height: 12px; border-radius: var(--radius-full); background: var(--line); overflow: hidden; }
.ae-barre__rempli { height: 100%; border-radius: var(--radius-full); background: var(--accent); transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .ae-barre__rempli { transition: none; } }

/* ——— Chemin de progression ——— */
.ae-chemin { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-family: var(--font-sans); color: var(--ink); }
.ae-chemin__etape { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: var(--space-4); align-items: center; padding-bottom: var(--space-6); }
.ae-chemin__etape:last-child { padding-bottom: 0; }
.ae-chemin__etape:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 40px; bottom: 0; width: 2px; background: var(--line); }
.ae-chemin__etape--fait:not(:last-child)::after { background: var(--success); }
.ae-chemin__pastille { width: 40px; height: 40px; border-radius: var(--radius-full); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: calc(16px * var(--ae-echelle, 1)); background: var(--surface-raised); color: var(--ink-muted); border: 2px solid var(--line-strong); }
.ae-chemin__etape--fait .ae-chemin__pastille { background: var(--success); border-color: var(--success); color: var(--on-primary); }
.ae-chemin__etape--encours .ae-chemin__pastille { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.ae-chemin__nom { font-family: var(--font-display); font-size: calc(16px * var(--ae-echelle, 1)); line-height: 1.375; font-weight: 500; }
.ae-chemin__etat { display: block; font-family: var(--font-sans); font-size: calc(13px * var(--ae-echelle, 1)); line-height: 1.385; font-weight: 400; color: var(--ink-muted); }
.ae-chemin__etape--encours .ae-chemin__etat { color: var(--primary); }

/* ——— Carte mémoire ——— */
.ae-memo { perspective: 1000px; width: 100%; max-width: 360px; height: 220px; border: 0; padding: 0; background: none; cursor: pointer; font: inherit; }
.ae-memo:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: var(--radius-lg); }
.ae-memo__inner { position: relative; width: 100%; height: 100%; transition: transform .5s ease; transform-style: preserve-3d; }
.ae-memo--retournee .ae-memo__inner { transform: rotateY(180deg); }
.ae-memo__face {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-6); border-radius: var(--radius-lg); text-align: center;
  background: var(--surface-raised); box-shadow: var(--shadow-card); border: 2px solid var(--line);
  font-family: var(--font-sans); font-size: calc(18px * var(--ae-echelle, 1)); line-height: 1.556; color: var(--ink);
}
.ae-memo__face--verso { transform: rotateY(180deg); background: var(--primary-soft); border-color: var(--primary-soft); }
.ae-memo__etiquette { font-family: var(--font-display); font-size: calc(14px * var(--ae-echelle, 1)); line-height: 1.429; font-weight: 500; color: var(--ink-muted); }
.ae-memo__face--verso .ae-memo__etiquette { color: var(--primary); }
.ae-memo__texte { font-family: var(--font-display); font-size: calc(22px * var(--ae-echelle, 1)); line-height: 1.364; font-weight: 500; }
.ae-memo__aide { font-size: calc(13px * var(--ae-echelle, 1)); line-height: 1.385; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) { .ae-memo__inner { transition: none; } }

/* =====================================================================
   BLOCS DE COURS — rendu des blocs du format JSON ARTHUR (version 1.19)
   Tout le cours s'affiche dans un conteneur .ae-cours. Voir la section
   « Blocs de cours » du guide pour la correspondance type JSON → HTML.
   ===================================================================== */
.ae-cours { font-family: var(--font-sans); font-size: calc(17px * var(--ae-echelle, 1)); line-height: 1.6; color: var(--ink); background: var(--surface); display: flex; flex-direction: column; gap: 20px; }
.ae-cours > .ae-enc { margin-top: 32px; }
.ae-cours > * { margin: 0; }
.ae-cours p { margin: 0; }
.ae-cours strong, .ae-cours b { font-weight: 600; }
@keyframes ae-feutre { from { background-size: 0 .28em; } to { background-size: 100% .28em; } }
@keyframes ae-monte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ae-rebond { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: none; } }
.ae-cours .ae-apparait { animation: ae-monte .45s cubic-bezier(.2,.8,.2,1) both; }

/* En-tête de module et sections */
.ae-module-tete { display: flex; flex-direction: column; gap: var(--space-2); padding-bottom: var(--space-2); }
.ae-module-titre { margin: 0; width: fit-content; max-width: 100%; font-family: var(--font-display); font-size: calc(30px * var(--ae-echelle, 1)); line-height: 1.15; font-weight: 600; letter-spacing: -.015em; background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 94% / 100% .28em; animation: ae-feutre .9s .15s cubic-bezier(.3,.8,.3,1) both; }
.ae-module-meta { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: calc(14px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-module-accroche { font-size: calc(18px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-section-num { display: inline-block; width: fit-content; margin-top: var(--space-6); padding: 4px 12px; border-radius: var(--radius-full); background: var(--primary-soft); color: var(--primary-ink); font-family: var(--font-display); font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 600; }
.ae-section-titre { margin: 0; width: fit-content; max-width: 100%; font-family: var(--font-display); font-size: calc(24px * var(--ae-echelle, 1)); line-height: 1.25; font-weight: 600; letter-spacing: -.01em; background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 94% / 100% .28em; animation: ae-feutre .9s .15s cubic-bezier(.3,.8,.3,1) both; }
.ae-intertitre { font-family: var(--font-display); font-size: calc(17px * var(--ae-echelle, 1)); font-weight: 600; letter-spacing: .02em; color: var(--ink); }

/* Texte, adresses, mise en évidence, listes */
.ae-texte { font-size: calc(17px * var(--ae-echelle, 1)); }
.ae-adresse { font-size: calc(17px * var(--ae-echelle, 1)); font-weight: 500; color: var(--primary); }
.ae-adresse--observation { color: var(--ink-muted); font-weight: 400; }
/* format 1.26 (en test) : « Comment lire » devient une annotation au crayon, avec une flèche vers le visuel, sans cadre ni étiquette */
.ae-adresse--lecture { display: flex; gap: 6px; align-items: flex-start; padding-left: 6px; font-family: "Caveat", var(--font-display), cursive; font-size: calc(24px * var(--ae-echelle, 1)); font-weight: 500; line-height: 1.25; color: var(--primary-ink); }
.ae-adresse--lecture .ae-adresse__lab { display: none; }
.ae-adresse__fleche { flex: none; width: 52px; height: 44px; margin-top: -18px; fill: none; stroke: var(--primary); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ae-adresse__texte { transform: rotate(-1deg); }
.ae-adresse__lab { display: block; font-family: var(--font-display); font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 600; color: var(--ink-muted); }
.ae-adresse--action { color: var(--ink); font-weight: 600; }
.ae-adresse--action .ae-adresse__lab { color: var(--primary); }
.ae-cours mark, .ae-hl { background: var(--highlight); color: inherit; padding: 0 3px; border-radius: 3px; font-weight: 600; white-space: nowrap; }
.ae-liste { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: var(--space-1); }

/* Récit : les récits consécutifs forment une seule carte « L'histoire » */
.ae-histoire { position: relative; overflow: visible; display: flex; flex-direction: column; gap: 10px; padding: var(--space-6); background: var(--surface-raised); border: 2px solid var(--line); border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg); font-size: calc(18px * var(--ae-echelle, 1)); line-height: 1.6; }
.ae-histoire__lab { margin: 0; font-family: var(--font-display); font-size: calc(30px * var(--ae-echelle, 1)); line-height: 1.2; font-weight: 600; letter-spacing: -.015em; color: var(--example); }

/* Formule détachée et tableau */
.ae-formule { padding: 14px 16px; text-align: center; overflow-x: auto; background: var(--surface-raised); border: 2px solid var(--line); border-radius: var(--radius-md); font-size: calc(18px * var(--ae-echelle, 1)); }
/* format 1.26 (en test) : membres d'une équation, soulignés de leur couleur et nommés au crayon */
.ae-formule--membres { display: flex; justify-content: center; align-items: flex-start; gap: 10px; padding-bottom: 40px; }
.ae-formule__membre { position: relative; display: inline-flex; padding: 0 4px 2px; border-bottom: 4px solid var(--m); }
.ae-formule__membre--1 { --m: var(--primary); }
.ae-formule__membre--2 { --m: var(--accent); }
.ae-formule__nom { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-family: "Caveat", cursive; font-size: calc(19px * var(--ae-echelle, 1)); font-weight: 500; line-height: 1; white-space: nowrap; color: var(--primary-ink); }
.ae-formule__membre--2 .ae-formule__nom { color: var(--bloc-methode); }
.ae-tableau { overflow-x: auto; background: var(--surface-raised); border: 2px solid var(--line); border-radius: var(--radius-md); }
.ae-tableau table { width: 100%; border-collapse: collapse; font-size: calc(16px * var(--ae-echelle, 1)); font-variant-numeric: tabular-nums; }
.ae-tableau th { background: var(--primary-soft); color: var(--ink); text-align: left; font-family: var(--font-display); font-weight: 600; padding: 10px 12px; }
.ae-tableau td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; white-space: pre-line; }
.ae-tableau tr:nth-child(even) td { background: var(--surface); }

/* Encadrés supplémentaires (s'ajoutent à .ae-enc) */
.ae-enc--defi { --enc-c: var(--bloc-defi); }
.ae-enc--cle { --enc-c: var(--bloc-cle); }
.ae-enc--synthese { --enc-c: var(--bloc-synthese); }
.ae-enc--questions_manque { --enc-c: var(--bloc-questions-manque); }
.ae-enc--question { --enc-c: var(--bloc-question); }
.ae-enc--quiz { --enc-c: var(--bloc-quiz); }
.ae-enc--mission { --enc-c: var(--bloc-mission); }
.ae-enc { display: flex; flex-direction: column; gap: 10px; }
.ae-enc__concl { margin-top: var(--space-2) !important; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 600; }
.ae-enc--defi .ae-enc__corps, .ae-enc--cle .ae-enc__corps { font-weight: 500; }

/* Méthode */
.ae-methode__objectif { font-weight: 600; }
.ae-pas { list-style: none; margin: 0; padding: 0; counter-reset: ae-pas; display: flex; flex-direction: column; gap: 10px; }
.ae-pas li { counter-increment: ae-pas; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.ae-pas li::before { content: counter(ae-pas); width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--enc-c); color: var(--on-primary); font: 600 14px/28px var(--font-display); text-align: center; }
.ae-pourquoi summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--enc-c); min-height: 44px; display: flex; align-items: center; }
.ae-pourquoi p { color: var(--ink-muted); }

/* Piège : une copie corrigée (papier quadrillé, marge rouge) */
.ae-copie { position: relative; display: flex; flex-direction: column; gap: 12px; padding: var(--space-4) var(--space-4) var(--space-4) 44px; border-radius: var(--radius-sm); background-color: var(--surface-raised); background-image: linear-gradient(90deg, transparent 24px, var(--copie-marge) 24px, var(--copie-marge) 26px, transparent 26px), linear-gradient(var(--copie-grille) 1px, transparent 1px), linear-gradient(90deg, var(--copie-grille) 1px, transparent 1px); background-size: 100% 100%, 20px 20px, 20px 20px; border: 1px solid var(--line); }
.ae-copie__situation { font-weight: 600; }
.ae-copie__lab { display: block; font-family: var(--font-display); font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 600; }
.ae-copie__juste .ae-copie__lab { color: var(--success); }
.ae-copie__faux .ae-copie__lab { color: var(--danger); }
.ae-copie__juste, .ae-copie__faux { white-space: pre-line; font-variant-numeric: tabular-nums; }
.ae-copie__faux { color: var(--danger); }

/* Synthèse et questions qu'on se pose */
.ae-synthese__titre { font-family: var(--font-display); font-size: calc(15px * var(--ae-echelle, 1)); font-weight: 600; color: var(--enc-c); }

/* Comparatif : une étiquette en forme de ticket par option + pastilles d'information */
.ae-comparatif { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-4) 12px; }
.ae-etiquette { --et-c: var(--primary); --et-t: var(--on-primary); display: flex; flex-direction: column; background: var(--surface-raised); border: 2px solid var(--et-c); border-radius: 16px; overflow: hidden; transition: transform .2s ease; }
.ae-etiquette:hover { transform: translateY(-3px); }
.ae-etiquette--2 { --et-c: var(--accent); --et-t: var(--on-accent); }
.ae-etiquette--3 { --et-c: var(--success); }
.ae-etiquette--4 { --et-c: var(--example); }
/* format 1.27 (en test) : comparatif en duel, quand chaque option est défendue par un personnage */
.ae-duel { display: flex; flex-direction: column; align-items: stretch; }
@media (min-width: 640px) { .ae-duel { flex-direction: row; } }
.ae-duel__carte { --et-c: var(--primary); --et-t: var(--on-primary); flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 18px; border: 2px solid var(--ink); border-top: 10px solid var(--et-c); border-radius: 18px; background: var(--surface-raised); box-shadow: 0 5px 0 var(--ink); transition: transform .2s cubic-bezier(.3, 1.5, .5, 1); }
.ae-duel__carte:hover { transform: translateY(-3px) rotate(-.6deg); }
/* la carte prend la couleur de son personnage : bande, pastille du prix, rond de la tête */
.ae-duel__carte.ae-perso--2 { --et-c: var(--accent); --et-t: var(--on-accent); }
.ae-duel__carte.ae-perso--3 { --et-c: var(--success); --et-t: var(--on-primary); }
.ae-duel__carte.ae-perso--4 { --et-c: var(--example); --et-t: var(--on-primary); }
.ae-duel__perso { display: flex; align-items: center; gap: 10px; font-size: calc(14px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-duel__perso img { width: 46px; height: 46px; flex: none; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface-raised), 0 0 0 5px var(--et-c); }
.ae-duel__perso b { color: var(--ink); font-weight: 600; }
.ae-duel__nom { margin: 0; font-family: var(--font-display); font-size: calc(18px * var(--ae-echelle, 1)); font-weight: 600; line-height: 1.2; }
.ae-duel__prix { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 0; }
.ae-duel__prix b { display: inline-grid; place-items: center; min-width: 88px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 14px; background: var(--et-c); color: var(--et-t); font-family: var(--font-display); font-size: calc(30px * var(--ae-echelle, 1)); font-weight: 600; line-height: 1; box-shadow: 0 3px 0 var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ae-duel__prix small { font-size: calc(15px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-duel__details { list-style: none; margin: 0; padding: 10px 0 0; border-top: 2px dashed var(--line); display: flex; flex-direction: column; gap: 4px; }
.ae-duel__details li { display: flex; gap: 8px; align-items: baseline; }
.ae-duel__details li::before { content: "+"; font-family: var(--font-display); font-weight: 700; color: var(--ink-muted); }
.ae-duel__vs { position: relative; z-index: 2; align-self: center; flex: none; width: 56px; height: 56px; margin: -14px 0; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--bloc-defi); color: var(--on-primary); font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1; box-shadow: 0 4px 0 var(--ink); transform: rotate(-8deg); animation: ae-vs-pop .6s .2s cubic-bezier(.3, 1.7, .5, 1) both; }
@media (min-width: 640px) { .ae-duel__vs { margin: 0 -16px; } }
@keyframes ae-vs-pop { from { transform: scale(0) rotate(-40deg); } to { transform: rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) { .ae-duel__vs { animation: none; } .ae-duel__carte { transition: none; } }
.ae-etiquette__nom { padding: 9px 14px; background: var(--et-c); color: var(--et-t); font-family: var(--font-display); font-size: calc(14px * var(--ae-echelle, 1)); line-height: 1.25; font-weight: 600; }
.ae-etiquette__prix { margin: 0; padding: 14px 14px 12px; color: var(--ink); font-family: var(--font-display); font-size: calc(22px * var(--ae-echelle, 1)); line-height: 1.15; font-weight: 600; }
.ae-etiquette__prix small { display: block; margin-top: 3px; color: var(--ink-muted); font-family: var(--font-sans); font-size: calc(14px * var(--ae-echelle, 1)); line-height: 1.3; font-weight: 400; }
.ae-etiquette__details { position: relative; display: flex; flex-direction: column; gap: 4px; list-style: none; margin: 0 12px; padding: 12px 2px 14px; border-top: 2px dashed var(--line); font-size: calc(15px * var(--ae-echelle, 1)); line-height: 1.4; }
.ae-etiquette__details::before, .ae-etiquette__details::after { content: ""; position: absolute; top: -11px; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; background: var(--surface); border: 2px solid var(--et-c); }
.ae-etiquette__details::before { left: -23px; }
.ae-etiquette__details::after { right: -23px; }
.ae-etiquette__details li::first-letter { text-transform: uppercase; }
.ae-infos { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ae-info { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid var(--line-strong); border-radius: 10px; background: var(--surface-raised); font-family: var(--font-display); font-size: calc(14px * var(--ae-echelle, 1)); font-weight: 500; }
.ae-info--alerte { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; animation: ae-rebond .5s ease 2; }

/* Visuels : graphique, évolution, balance */
.ae-visuel { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); background: var(--surface-raised); border: 2px solid var(--line); border-radius: 20px; }
.ae-legende { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: calc(14px * var(--ae-echelle, 1)); }
.ae-legende span { display: inline-flex; align-items: center; gap: 6px; }
.ae-legende i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.ae-serie-1 { color: var(--primary); } .ae-serie-2 { color: var(--chart-orange); } .ae-serie-3 { color: var(--success); } .ae-serie-4 { color: var(--danger); }

/* Question à l'élève */
.ae-consigne { font-weight: 600; font-size: calc(17px * var(--ae-echelle, 1)); }
.ae-champs { display: flex; flex-direction: column; gap: 12px; }
.ae-champ { display: flex; flex-direction: column; gap: 4px; }
.ae-champ label { font-size: calc(15px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-champ__ligne { display: flex; align-items: center; gap: var(--space-2); }
.ae-champ input { width: 140px; height: 48px; padding: 0 12px; border: 2px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); font: 500 calc(18px * var(--ae-echelle, 1)) var(--font-sans); color: var(--ink); box-sizing: border-box; }
.ae-champ input:focus { outline: 2px solid var(--primary); outline-offset: 2px; }
.ae-champ--juste input { border-color: var(--success); background: var(--success-soft); }
.ae-champ--faux input { border-color: var(--danger); background: var(--danger-soft); }
.ae-champ__unite { font-family: var(--font-display); font-weight: 500; }
.ae-valider-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.ae-essais { display: inline-flex; align-items: center; gap: 6px; font-size: calc(13px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-essais i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.ae-essais i.ae-essais--use { background: var(--accent); }
.ae-retour-court { display: flex; flex-direction: column; gap: 4px; padding: 12px var(--space-4); background: var(--surface-raised); border: 1px solid var(--line); border-top: 5px solid var(--line-strong); border-radius: 10px 10px 4px 4px; animation: ae-monte .35s ease-out both; }
.ae-retour-court__verdict { font-family: var(--font-display); font-size: calc(19px * var(--ae-echelle, 1)); font-weight: 600; }
.ae-retour-court--juste { border-top-color: var(--success); } .ae-retour-court--juste .ae-retour-court__verdict { color: var(--success); }
.ae-retour-court--faux { border-top-color: var(--danger); } .ae-retour-court--faux .ae-retour-court__verdict { color: var(--danger); }
.ae-indice { display: flex; flex-direction: column; gap: 2px; padding: 12px var(--space-4); background: var(--example-soft); border-radius: var(--radius-md); }
.ae-indice__lab { font-family: var(--font-display); font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 600; color: var(--example); }
.ae-correction { border-top: 1px solid var(--line); padding-top: 10px; }
.ae-correction summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-family: var(--font-display); font-weight: 600; color: var(--primary); }
.ae-correction__corps { display: flex; flex-direction: column; gap: 12px; }
.ae-points { align-self: flex-start; padding: 3px 10px; border: 2px solid var(--primary); border-radius: var(--radius-full); font-family: var(--font-display); font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 600; color: var(--primary); }

/* Options : QCM, vrai/faux, choix, tri, ordre */
.ae-options { display: flex; flex-direction: column; gap: 10px; }
.ae-options--ligne { flex-direction: row; } .ae-options--ligne .ae-option { flex: 1; text-align: center; }
.ae-option { min-height: 48px; padding: 10px var(--space-4); text-align: left; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); box-shadow: 0 3px 0 var(--line); font: 500 calc(16px * var(--ae-echelle, 1)) var(--font-sans); color: var(--ink); cursor: pointer; transition: transform .08s, box-shadow .08s; }
.ae-option:active { transform: translateY(3px); box-shadow: none; }
.ae-option[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 3px 0 var(--primary); }
.ae-option--juste { border-color: var(--success); background: var(--success-soft); box-shadow: 0 3px 0 var(--success); }
.ae-option--fausse { border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 3px 0 var(--danger); }
.ae-tri { --ae-tri-col: 56px; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); overflow: hidden; }
.ae-tri__tete, .ae-tri__ligne { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--ae-tri-n, 2), var(--ae-tri-col)); align-items: center; padding: 0 4px 0 14px; }
.ae-tri__tete { padding-top: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--line); font: 600 calc(13px * var(--ae-echelle, 1)) var(--font-display); color: var(--ink-muted); text-align: center; }
.ae-tri__ligne { min-height: 56px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); transition: background-color .2s; }
.ae-tri__ligne:last-child { border-bottom: 0; }
.ae-tri__info { margin: 0; padding-right: 6px; font-size: calc(16px * var(--ae-echelle, 1)); line-height: 1.45; color: var(--ink); }
.ae-tri__case { position: relative; justify-self: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.ae-tri__case::before { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface-raised); box-sizing: border-box; transition: transform .12s, background-color .12s, border-color .12s; }
.ae-tri__case::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--on-primary); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; opacity: 0; }
.ae-tri__case:active::before { transform: scale(.9); }
.ae-tri__case[aria-checked="true"]::before { border-color: var(--primary); background: var(--primary); }
.ae-tri__case[aria-checked="true"]::after { opacity: 1; }
.ae-tri__ligne--juste { background: var(--success-soft); }
.ae-tri__ligne--juste .ae-tri__case[aria-checked="true"]::before { border-color: var(--success); background: var(--success); }
.ae-tri__ligne--fausse { background: var(--danger-soft); }
.ae-tri__ligne--fausse .ae-tri__case[aria-checked="true"]::before { border-color: var(--danger); background: var(--danger); }
.ae-tri__ligne--fausse .ae-tri__case[aria-checked="true"]::after { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E"); }
.ae-tri__case:focus-visible { outline: 3px solid var(--primary); outline-offset: -4px; border-radius: 50%; }
@media (max-width: 380px) { .ae-tri { --ae-tri-col: 50px; } }
.ae-explication { padding: 10px 14px; background: var(--primary-soft); border-radius: var(--radius-md); font-size: calc(15px * var(--ae-echelle, 1)); }
.ae-quiz__question + .ae-quiz__question { border-top: 1px solid var(--line); padding-top: var(--space-4); }
.ae-quiz__question { display: flex; flex-direction: column; gap: 10px; }

/* Pause entre deux parties et bouton du module suivant */
.ae-pause { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: var(--space-6); border-radius: 20px; background-color: var(--primary-soft); background-image: linear-gradient(var(--pause-grille) 1px, transparent 1px), linear-gradient(90deg, var(--pause-grille) 1px, transparent 1px); background-size: 20px 20px; }
.ae-pause__titre { font-family: var(--font-display); font-size: calc(18px * var(--ae-echelle, 1)); font-weight: 600; color: var(--primary-ink); }
.ae-pause__boutons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ae-suite { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; box-sizing: border-box; padding: 14px 16px 14px 20px; border: 3px solid var(--ink); border-radius: 22px; background: var(--bouton-suite); color: var(--on-bouton-suite); box-shadow: 0 6px 0 var(--ink); text-align: left; text-decoration: none; font-family: var(--font-display); cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.ae-suite:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.ae-suite:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }
.ae-suite__txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ae-suite small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 500; }
.ae-suite__duree { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 2px solid var(--on-bouton-suite); border-radius: var(--radius-full); font-size: calc(12px * var(--ae-echelle, 1)); font-weight: 600; line-height: 1.4; }
.ae-suite__nom { font-size: calc(22px * var(--ae-echelle, 1)); line-height: 1.15; font-weight: 600; }
.ae-suite__go { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--surface); }

/* Accueil du chapitre : le chemin des modules */
.ae-accueil { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 10px; }
.ae-accueil::before { content: ""; position: absolute; left: 30px; top: 26px; bottom: 26px; width: 3px; border-radius: 3px; background: var(--line); }
.ae-etape-ligne { position: relative; z-index: 1; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: center; padding: 12px 14px; background: var(--surface-raised); border: 2px solid transparent; border-radius: var(--radius-md); box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink); transition: transform .2s ease, border-color .2s ease; }
.ae-etape-ligne:hover { transform: translateY(-3px); border-color: var(--primary-soft); }
.ae-etape-ligne__num { grid-row: span 2; width: 32px; height: 32px; border-radius: var(--radius-full); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font: 600 calc(14px * var(--ae-echelle, 1)) var(--font-display); box-shadow: 0 0 0 4px var(--surface-raised); }
.ae-etape-ligne__nom { font-family: var(--font-display); font-size: calc(17px * var(--ae-echelle, 1)); font-weight: 600; }
.ae-etape-ligne__duree { margin-left: 8px; font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 400; color: var(--ink-muted); }
.ae-etape-ligne__tag { justify-self: start; padding: 2px 10px; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-ink); font-size: calc(14px * var(--ae-echelle, 1)); }
.ae-etape-ligne--fait .ae-etape-ligne__num { background: var(--success); color: var(--on-primary); }
.ae-etape-ligne--fait .ae-etape-ligne__tag { background: var(--success-soft); color: var(--success); }
.ae-etape-ligne--encours { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.ae-etape-ligne--encours .ae-etape-ligne__num { background: var(--primary); color: var(--on-primary); }
.ae-etape-ligne--encours .ae-etape-ligne__tag { background: var(--primary); color: var(--on-primary); }
.ae-etape-ligne--bientot { opacity: .6; }
.ae-etape-ligne--bientot .ae-etape-ligne__tag { background: transparent; border: 2px solid var(--line); color: var(--ink-muted); }
.ae-etape-ligne--quiz { margin-left: 26px; padding: 8px 12px; }
.ae-etape-ligne--quiz .ae-etape-ligne__nom { font-size: calc(15px * var(--ae-echelle, 1)); }
/* 11/10 (choix de l'utilisateur, piste A) : modules en boutons BD, sans barre verticale ni étiquette */
.ae-accueil { gap: 12px; }
.ae-accueil::before { display: none; }
.ae-etape-ligne { grid-template-columns: 34px minmax(0, 1fr); background: var(--surface-raised); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.ae-etape-ligne:hover { transform: translateY(-2px); border-color: var(--ink); }
.ae-etape-ligne:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.ae-etape-ligne__num { grid-row: auto; }
.ae-etape-ligne__tag { display: none; }
.ae-etape-ligne__duree::before { content: ""; display: inline-block; width: .85em; height: .85em; margin-right: 4px; vertical-align: -1px; border: 1.5px solid currentColor; border-radius: 50%; box-sizing: border-box; }
.ae-etape-ligne--encours { background: var(--primary); color: var(--on-primary); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.ae-etape-ligne--encours .ae-etape-ligne__num { background: var(--on-primary); color: var(--primary); }
.ae-etape-ligne--encours .ae-etape-ligne__duree { color: var(--primary-soft); }
.ae-etape-ligne--bientot { opacity: .55; box-shadow: 0 2px 0 var(--ink); }
@media (prefers-reduced-motion: reduce) { .ae-etape-ligne { transition: none; } }

/* Module Exercices : onglets, cartes d'exercice, pastilles */
/* Module Exercices, style BD comme le cours et le projet (08/10) */
.ae-onglets { display: flex; flex-wrap: wrap; gap: 8px; }
.ae-onglet { flex: 1 1 0; min-width: 0; min-height: 44px; margin-bottom: 3px; padding: 8px 6px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface-raised); box-shadow: 0 3px 0 var(--ink); font: 600 calc(13px * var(--ae-echelle, 1))/1.2 var(--font-display); color: var(--ink); cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.ae-onglet[aria-selected="true"] { background: var(--primary); color: var(--on-primary); transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.ae-onglet__pastille { display: inline-block; min-width: 20px; height: 20px; box-sizing: border-box; margin-left: 4px; padding: 0 5px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--accent); color: var(--on-accent); font: 700 12px/17px var(--font-display); text-align: center; }
.ae-exo-depart { display: flex; flex-direction: column; gap: 14px; }
.ae-exo-meta { margin: 0; font-size: calc(14px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box; margin-bottom: 5px; padding: 13px 16px; border: 3px solid var(--ink); border-radius: 16px; background: var(--primary); color: var(--on-primary); box-shadow: 0 5px 0 var(--ink); font: 600 calc(17px * var(--ae-echelle, 1)) var(--font-display); text-decoration: none; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.ae-go:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.ae-btn-bd { display: inline-flex; align-items: center; gap: 6px; width: fit-content; margin-bottom: 3px; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 14px; background: var(--surface-raised); color: var(--ink); box-shadow: 0 3px 0 var(--ink); font: 600 calc(14px * var(--ae-echelle, 1)) var(--font-display); text-decoration: none; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.ae-btn-bd:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.ae-rubrique { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; margin: var(--space-2) 0 4px !important; padding: 12px 14px; background: var(--primary); color: var(--on-primary); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.ae-rubrique:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.ae-rubrique__num { flex: none; display: grid; place-items: center; width: 44px; height: 44px; box-sizing: border-box; border-radius: 12px; background: var(--accent); color: var(--on-accent); border: 2px solid var(--ink); font: 700 calc(16px * var(--ae-echelle, 1))/1 var(--font-display); }
.ae-rubrique__corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ae-rubrique__titre { font: 600 calc(18px * var(--ae-echelle, 1))/1.2 var(--font-display); letter-spacing: -.01em; }
.ae-rubrique small { font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 400; opacity: .85; }
.ae-rubrique__chev { flex: none; display: grid; place-items: center; width: 30px; height: 30px; box-sizing: border-box; border: 2px solid var(--ink); border-radius: 50%; background: var(--surface-raised); color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.ae-rubrique[aria-expanded="true"] .ae-rubrique__chev svg { transform: rotate(180deg); }
.ae-exo-carte { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: start; margin: 0 3px 3px 0; padding: 12px 14px; background: var(--surface-raised); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); text-align: left; color: var(--ink); text-decoration: none; transition: transform .2s ease; }
.ae-exo-carte:hover { transform: translateY(-2px); }
.ae-exo-carte__titre { font-family: var(--font-display); font-size: calc(16px * var(--ae-echelle, 1)); line-height: 1.25; font-weight: 600; }
.ae-exo-carte__duree { padding: 2px 8px; border: 2px solid var(--ink); border-radius: var(--radius-full); font: 600 calc(12px * var(--ae-echelle, 1))/1.3 var(--font-display); white-space: nowrap; }
.ae-exo-carte__pourquoi { grid-column: 1 / -1; margin: 0; font-size: calc(13.5px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-exo-carte__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ae-exo-carte--fait { background: var(--success-soft); }
.ae-exo-carte--encours { outline: 3px solid var(--accent); outline-offset: 2px; }
.ae-exo-carte--ferme { background: transparent; border-style: dashed; box-shadow: none; }
.ae-exo-carte--ferme .ae-exo-carte__titre { color: var(--ink-muted); }
.ae-exo-carte__titre svg { vertical-align: -1px; }
.ae-exo-titre { margin: 0; width: fit-content; max-width: 100%; font: 600 calc(24px * var(--ae-echelle, 1))/1.2 var(--font-display); letter-spacing: -.015em; background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 94% / 100% .28em; animation: ae-feutre .9s .15s cubic-bezier(.3,.8,.3,1) both; }
.ae-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-full); background: transparent; color: var(--ink-muted); font: 500 calc(12px * var(--ae-echelle, 1)) var(--font-display); white-space: nowrap; }
.ae-chip--famille { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary-ink); }
.ae-chip--pivot { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger); }
.ae-chip--defi { background: var(--highlight); border-color: var(--highlight); color: var(--ink); }
.ae-chip--fait { background: var(--success-soft); border-color: var(--success-soft); color: var(--success); }
.ae-niveau { display: inline-flex; gap: 3px; padding: 3px 6px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-full); } .ae-niveau i { width: 9px; height: 9px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; display: inline-block; } .ae-niveau i.ae-niveau--on { background: var(--accent); }

/* Module Projet : briefing, mission, jauge, donnée retenue */
/* Choix de départ du projet : une option par ticket, empilées */
.ae-strategies { display: flex; flex-direction: column; gap: 18px; }
.ae-strategie { --st-c: var(--primary); --st-t: var(--on-primary); position: relative; display: flex; flex-direction: column; width: 100%; padding: 0; text-align: left; background: var(--surface-raised); color: var(--ink); border: 2px solid var(--st-c); border-radius: 16px; font: inherit; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.ae-strategie:not(:disabled):hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); }
.ae-strategie--2 { --st-c: var(--accent); --st-t: var(--on-accent); }
.ae-strategie--3 { --st-c: var(--success); }
.ae-strategie--4 { --st-c: var(--example); }
.ae-strategie__nom { padding: 9px 14px; background: var(--st-c); color: var(--st-t); border-radius: 13px 13px 0 0; font-family: var(--font-display); font-size: calc(16px * var(--ae-echelle, 1)); line-height: 1.25; font-weight: 600; }
.ae-strategie__chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px 10px; }
.ae-strategie__chiffres b { display: block; font-family: var(--font-display); font-size: calc(22px * var(--ae-echelle, 1)); line-height: 1.1; font-weight: 600; }
.ae-strategie__chiffres small { display: block; margin-top: 2px; font-size: calc(13px * var(--ae-echelle, 1)); line-height: 1.3; color: var(--ink-muted); }
.ae-strategie__det { position: relative; display: flex; flex-direction: column; gap: 10px; margin: 0 12px; padding: 12px 2px 14px; border-top: 2px dashed var(--line); font-size: calc(14px * var(--ae-echelle, 1)); line-height: 1.4; }
.ae-strategie__det::before, .ae-strategie__det::after { content: ""; position: absolute; top: -11px; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; background: var(--surface-raised); border: 2px solid var(--st-c); }
.ae-strategie__det::before { left: -25px; }
.ae-strategie__det::after { right: -25px; }
.ae-strategie__plus, .ae-strategie__moins { display: flex; gap: 8px; align-items: flex-start; }
.ae-strategie__plus i, .ae-strategie__moins i { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; color: var(--on-primary); font-family: var(--font-display); font-size: 13px; font-weight: 700; font-style: normal; }
.ae-strategie__plus i { background: var(--success); }
.ae-strategie__moins i { background: var(--danger); }
.ae-strategie[aria-pressed="true"] { border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.ae-strategie[aria-pressed="true"] .ae-strategie__nom { border-radius: 12px 12px 0 0; }
.ae-strategie[aria-pressed="true"] .ae-strategie__det::before, .ae-strategie[aria-pressed="true"] .ae-strategie__det::after { top: -12px; width: 20px; height: 20px; border: 3px solid var(--ink); }
.ae-strategie[aria-pressed="true"] .ae-strategie__det::before { left: -27px; }
.ae-strategie[aria-pressed="true"] .ae-strategie__det::after { right: -27px; }
.ae-strategie--estompee { opacity: .55; filter: saturate(.6); cursor: default; }
.ae-strategie__badge { position: absolute; top: -13px; right: 12px; padding: 3px 10px; border-radius: var(--radius-full); background: var(--success); color: var(--on-primary); border: 2px solid var(--ink); font-family: var(--font-display); font-size: calc(12px * var(--ae-echelle, 1)); font-weight: 600; }

/* Accueil du projet, façon carnet : le renard présente le rôle, l'objectif sur un post-it, les contraintes en petites cartes */
.ae-briefing { display: flex; flex-direction: column; gap: 14px; }
.ae-briefing__lab { display: block; font-family: var(--font-display); font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 600; color: var(--example); }
.ae-postit { position: relative; align-self: center; width: 88%; box-sizing: border-box; margin: 6px 0 4px; padding: 16px 16px 14px 56px; background: var(--highlight); color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); transform: rotate(-1.5deg); }
.ae-postit::before { content: ""; position: absolute; top: -12px; left: 50%; width: 70px; height: 20px; transform: translateX(-50%) rotate(2deg); background: color-mix(in srgb, var(--primary) 32%, transparent); }
.ae-postit__cible { position: absolute; left: 16px; top: 16px; width: 26px; height: 26px; color: var(--primary); }
.ae-postit p { margin: 2px 0 0; font-family: var(--font-display); font-size: calc(16px * var(--ae-echelle, 1)); line-height: 1.4; font-weight: 600; }
.ae-contraintes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ae-contrainte { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface-raised); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 2px 2px 0 var(--ink); font-size: calc(14px * var(--ae-echelle, 1)); line-height: 1.35; }
.ae-contrainte b { font-family: var(--font-display); font-size: calc(19px * var(--ae-echelle, 1)); line-height: 1.2; font-weight: 600; }
.ae-briefing__info { margin: 0; font-size: calc(13px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-briefing__go { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box; padding: 13px 16px; border: 3px solid var(--ink); border-radius: 16px; background: var(--primary); color: var(--on-primary); box-shadow: 0 5px 0 var(--ink); font-family: var(--font-display); font-size: calc(17px * var(--ae-echelle, 1)); font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .08s ease, box-shadow .08s ease; }
.ae-briefing__go:active { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.ae-jauge { display: flex; flex-direction: column; gap: 6px; padding: 14px var(--space-4); background: var(--surface-raised); border: 2px solid var(--line); border-radius: var(--radius-md); }
.ae-jauge__ligne { display: flex; justify-content: space-between; font-size: calc(14px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-jauge__ligne b { color: var(--ink); }
.ae-jauge__piste { position: relative; height: 14px; border-radius: var(--radius-full); background: var(--line); }
.ae-jauge__rempli { height: 100%; border-radius: var(--radius-full); background: var(--accent); transition: width .6s cubic-bezier(.3,.9,.4,1); }
.ae-jauge--atteinte .ae-jauge__rempli { background: var(--success); }
.ae-jauge__cible { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--ink); }
.ae-retenue { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--success); font-family: var(--font-display); font-size: calc(14px * var(--ae-echelle, 1)); font-weight: 500; animation: ae-rebond .5s ease both; }
/* 10/10 (en test) : module Projet, éléments qui n'avaient pas de design */
.ae-enc--mission .ae-replique, .ae-enc--mission .ae-narrateur { margin-left: 0; }
.ae-utiles { display: flex; flex-direction: column; padding: 10px 14px 4px; background: var(--surface-raised); border: 2px solid var(--line); border-radius: var(--radius-md); }
.ae-utiles__titre { margin: 0 0 4px; font-family: var(--font-display); font-size: calc(14px * var(--ae-echelle, 1)); font-weight: 600; color: var(--ink); }
.ae-utiles__ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: calc(15px * var(--ae-echelle, 1)); }
.ae-utiles__lib { min-width: 0; color: var(--ink-muted); }
.ae-utiles__val { flex: 0 1 auto; max-width: 62%; text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ae-utiles__val span { display: block; white-space: nowrap; }
.ae-decision { display: flex; flex-direction: column; gap: 10px; }
.ae-decision__option { width: 100%; padding: 11px 14px; text-align: left; background: var(--surface-raised); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius-md); box-shadow: 0 3px 0 var(--ink); font-family: var(--font-display); font-size: calc(16px * var(--ae-echelle, 1)); font-weight: 500; line-height: 1.35; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.ae-decision__option:active, .ae-decision__option--choisie { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.ae-decision__option--choisie { background: var(--primary); color: var(--on-primary); }
.ae-decision__option--estompee { opacity: .5; box-shadow: none; }
.ae-issue { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--surface-raised); border: 2px solid var(--ink); border-top: 6px solid var(--success); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); }
.ae-issue--non-atteint { border-top-color: var(--danger); }
.ae-issue__verdict { margin: 0; font-family: var(--font-display); font-size: calc(19px * var(--ae-echelle, 1)); font-weight: 600; color: var(--success); }
.ae-issue--non-atteint .ae-issue__verdict { color: var(--danger); }
.ae-issue__valeurs { display: flex; flex-wrap: wrap; gap: 8px; }
.ae-issue__valeur { display: flex; flex-direction: column; padding: 5px 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; }
.ae-issue__valeur small { font-size: 12px; color: var(--ink-muted); }
.ae-issue__valeur b { font-family: var(--font-display); font-size: calc(18px * var(--ae-echelle, 1)); font-weight: 600; }
.ae-issue__texte { margin: 0; }
.ae-issue__rechoisir { margin: 0; font-size: calc(14px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-tdb { position: sticky; bottom: 8px; z-index: 4; display: flex; flex-direction: column; background: var(--surface-raised); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); overflow: hidden; }
.ae-tdb__barre { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; border: 0; background: transparent; color: var(--ink); font-family: var(--font-display); font-size: calc(15px * var(--ae-echelle, 1)); font-weight: 600; cursor: pointer; }
.ae-tdb__barre small { font-family: var(--font-sans); font-size: 12.5px; font-weight: 400; color: var(--ink-muted); text-align: right; }
.ae-tdb__corps { display: flex; flex-direction: column; padding: 0 14px 12px; max-height: 320px; overflow: auto; }
.ae-tdb__section { margin: 10px 0 2px; font-family: var(--font-display); font-size: calc(14px * var(--ae-echelle, 1)); font-weight: 600; color: var(--ink); }
.ae-tdb__jauge { display: flex; flex-direction: column; margin: 8px 0 4px; padding: 2px 12px 6px; background: var(--highlight-soft, #fbefd2); border: 2px solid #b5862a; border-radius: 12px; }
.ae-tdb__jauge .ae-tdb__section::before { content: "\25B2"; margin-right: 6px; color: var(--success, #46703b); }
.ae-tdb__jauge--baisse .ae-tdb__section::before { content: "\25BC"; color: var(--danger, #a8412a); }
.ae-tdb__jauge .ae-utiles__ligne { border-top: 0; }
.ae-tdb__avant { margin: 2px 0 0; font-size: 13px; color: var(--ink-muted); }
.ae-tdb__nouveau { display: flex; flex-direction: column; margin: 8px 0 4px; padding: 2px 12px 6px; background: var(--success-soft, #e6eedc); border: 2px solid var(--success, #46703b); border-radius: 12px; }
.ae-tdb__nouveau .ae-tdb__section { color: var(--success-deep, #2f4d27); }
.ae-tdb__nouveau .ae-utiles__ligne:first-of-type { border-top: 0; }
.ae-tdb__tout { align-self: flex-start; margin-top: 8px; padding: 4px 12px; background: var(--surface-raised); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 2px 0 var(--ink); font-family: var(--font-display); font-size: 13px; font-weight: 500; cursor: pointer; }
.ae-enc--denouement { --enc-c: var(--bloc-synthese); }
.ae-enc--denouement .ae-cartouche p { font-style: normal; }
.ae-denouement__score { align-self: flex-start; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--success-deep); font-family: var(--font-display); font-size: calc(14px * var(--ae-echelle, 1)); font-weight: 500; }
.ae-mission__etat { display: inline-block; padding: 3px 9px; border-radius: var(--radius-full); background: var(--success-soft); color: var(--success-deep); font-family: var(--font-display); font-size: 12.5px; font-weight: 600; }
.ae-mission__revoir summary { cursor: pointer; color: var(--ink-muted); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .ae-decision__option { transition: none; } }

@media (prefers-reduced-motion: reduce) {
  .ae-module-titre, .ae-section-titre, .ae-cours .ae-apparait, .ae-retour-court, .ae-info--alerte, .ae-retenue { animation: none; }
  .ae-etiquette, .ae-etape-ligne, .ae-exo-carte, .ae-option, .ae-tri__ligne, .ae-tri__case::before, .ae-jauge__rempli, .ae-suite, .ae-briefing__go, .ae-strategie, .ae-onglet, .ae-go, .ae-btn-bd { transition: none; }
  .ae-exo-titre { animation: none; }
  .ae-rubrique { transition: none; }
}

/* =====================================================================
   RÉGLAGES DE LECTURE : taille du texte (data-taille) et thème (data-theme)
   Posés sur <html> : data-taille="normal|grand|tres-grand", data-theme="light|dark".
   ===================================================================== */
:root { --ae-echelle: 1; }
[data-taille="grand"] { --ae-echelle: 1.125; }
[data-taille="tres-grand"] { --ae-echelle: 1.25; }
.ae-reglages { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); }
.ae-reglages__groupe { display: inline-flex; gap: 2px; padding: 3px; border: 2px solid var(--line); border-radius: var(--radius-full); background: var(--surface-raised); }
.ae-reglages__btn { min-width: 34px; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--radius-full); background: transparent; color: var(--ink-muted); font: 600 14px var(--font-display); cursor: pointer; }
.ae-reglages__btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.ae-reglages__btn:hover:not([aria-pressed="true"]) { background: var(--primary-soft); color: var(--primary-ink); }
.ae-reglages__btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ae-reglages__btn .ae-icone { width: 18px; height: 18px; }
.ae-reglages__a1 { font-size: 12px; } .ae-reglages__a2 { font-size: 15px; } .ae-reglages__a3 { font-size: 18px; }

/* Icônes : Lucide, au trait de 2, bouts arrondis */
.ae-icone { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ae-icone--24 { width: 24px; height: 24px; }
.ae-btn-icone { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--ink); cursor: pointer; }
.ae-btn-icone:hover { border-color: var(--primary); color: var(--primary); }
.ae-btn-icone:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Logo provisoire : marque + nom */
.ae-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-display); }
.ae-logo__marque { width: 32px; height: 32px; flex: none; }
.ae-logo__fond { fill: var(--primary); }
.ae-logo__a { fill: none; stroke: var(--on-primary); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.ae-logo__point { fill: var(--accent); }
.ae-logo__nom { font-size: 17px; font-weight: 600; letter-spacing: .05em; line-height: 1; }
.ae-logo__nom small { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 500; letter-spacing: .08em; color: var(--ink-muted); }

/* =====================================================================
   EN-TÊTE MOBILE (téléphone et tablette étroite)
   ===================================================================== */
.ae-entete { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px 12px; background: var(--surface-raised); border-bottom: 1px solid var(--line); color: var(--ink); font-family: var(--font-display); }
.ae-bande { position: absolute; left: 0; right: 0; top: 0; height: 5px; display: flex; }
.ae-bande span:nth-child(1) { flex: 55; background: var(--primary); }
.ae-bande span:nth-child(2) { flex: 20; background: var(--accent); }
.ae-bande span:nth-child(3) { flex: 25; background: var(--success); }
.ae-entete__ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ae-entete__titre { font-size: 17px; font-weight: 600; }
.ae-entete__meta { font-family: var(--font-sans); font-size: 13px; color: var(--ink-muted); }
.ae-entete__outils { display: inline-flex; align-items: center; gap: 8px; }
.ae-entete__nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ae-entete__nav a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); color: var(--ink-muted); text-decoration: none; font: 500 14px var(--font-display); }
.ae-entete__nav a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ae-entete__nav a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* =====================================================================
   MISE EN PAGE ORDINATEUR : barre des modules, colonne de lecture, sommaire
   ===================================================================== */
.ae-app { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: auto 1fr; background: var(--surface); color: var(--ink); font-family: var(--font-sans); }
.ae-app > .ae-entete { display: none; grid-column: 1 / -1; }
.ae-app__haut { position: sticky; top: 0; z-index: 5; grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; height: 68px; padding: 5px 24px 0; background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.ae-app__fil { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; }
.ae-app__fil b { color: var(--ink); font-weight: 600; font-family: var(--font-display); }
.ae-app__barre { position: sticky; top: 68px; align-self: start; height: calc(100vh - 68px); overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 28px 16px; border-right: 1px solid var(--line); }
.ae-app__chapitre { padding: 0 10px; font-family: var(--font-display); }
.ae-app__chapitre small { display: block; font-size: 13px; color: var(--ink-muted); }
.ae-app__chapitre b { display: block; margin-top: 2px; font-size: 18px; line-height: 1.3; font-weight: 600; }
.ae-app__corps { display: grid; grid-template-columns: minmax(0, 720px) 232px; justify-content: center; align-items: start; gap: 56px; padding: 40px 40px 96px; }
.ae-app__cote { position: sticky; top: 108px; display: flex; flex-direction: column; gap: 24px; }
.ae-modules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ae-modules a { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; font: 500 15px var(--font-display); }
.ae-modules a:hover { background: var(--primary-soft); }
.ae-modules a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ae-modules small { display: block; font: 400 12px var(--font-sans); color: var(--ink-muted); }
.ae-modules__num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); color: var(--ink-muted); font: 600 13px var(--font-display); }
.ae-modules__num .ae-icone { width: 16px; height: 16px; stroke-width: 3; }
.ae-modules__fait .ae-modules__num { background: var(--success); border-color: var(--success); color: var(--on-primary); }
.ae-modules a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.ae-modules a[aria-current="page"] .ae-modules__num { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ae-sommaire { display: flex; flex-direction: column; gap: 10px; }
.ae-sommaire__titre { font: 600 13px var(--font-display); color: var(--ink-muted); }
.ae-sommaire ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.ae-sommaire a { display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; color: var(--ink-muted); text-decoration: none; font-size: 14px; line-height: 1.4; }
.ae-sommaire a:hover { color: var(--ink); }
.ae-sommaire a[aria-current="true"] { border-left-color: var(--primary); color: var(--ink); font-weight: 600; }
.ae-sommaire__fait { color: var(--ink) !important; }
@media (max-width: 1180px) {
  .ae-app__corps { grid-template-columns: minmax(0, 720px); }
  .ae-app__cote { display: none; }
}
@media (max-width: 860px) {
  .ae-app { grid-template-columns: minmax(0, 1fr); }
  .ae-app > .ae-entete { display: flex; }
  .ae-app__haut, .ae-app__barre { display: none; }
  .ae-app__corps { padding: 24px 16px 64px; }
}

/* =====================================================================
   PERSONNAGES DU FIL ROUGE : avatars géométriques
   Variante 1 à 6, attribuée dans l'ordre d'apparition des prénoms du chapitre.
   ===================================================================== */
.ae-avatar { --av-fond: var(--primary-soft); --av-corps: var(--primary); position: relative; isolation: isolate; display: inline-block; flex: none; width: 1em; height: 1em; font-size: 40px; border-radius: 50%; overflow: hidden; background: var(--av-fond); vertical-align: middle; }
.ae-avatar--petit { font-size: 32px; } .ae-avatar--grand { font-size: 56px; }
.ae-avatar::before { content: ""; position: absolute; z-index: 2; left: .3em; top: .2em; width: .4em; height: .4em; border-radius: 50%; background: var(--avatar-tete); }
.ae-avatar::after { content: ""; position: absolute; z-index: 1; left: .16em; top: .65em; width: .68em; height: .68em; border-radius: 50%; background: var(--av-corps); }
.ae-avatar i { position: absolute; inset: 0; }
.ae-avatar i::before, .ae-avatar i::after { content: ""; position: absolute; background: var(--avatar-cheveux); }
.ae-avatar i::after { z-index: 3; left: .29em; top: .18em; width: .42em; height: .2em; border-radius: .21em .21em .05em .05em; }
.ae-avatar i::before { display: none; }
.ae-avatar--2 { --av-fond: var(--success-soft); --av-corps: var(--success); }
.ae-avatar--2 i::before { display: block; z-index: 3; left: .42em; top: .06em; width: .16em; height: .16em; border-radius: 50%; }
.ae-avatar--3 { --av-fond: var(--example-soft); --av-corps: var(--example); }
.ae-avatar--3 i::before { display: block; z-index: 1; left: .25em; top: .19em; width: .5em; height: .45em; border-radius: .22em .22em .07em .07em; }
.ae-avatar--4 { --av-fond: var(--accent-soft); --av-corps: var(--accent); }
.ae-avatar--4 i::after { top: .19em; height: .12em; }
.ae-avatar--5 { --av-fond: var(--primary-soft); --av-corps: var(--bloc-question); }
.ae-avatar--5 i::before { display: block; z-index: 1; left: .62em; top: .3em; width: .17em; height: .27em; border-radius: .09em; }
.ae-avatar--6 { --av-fond: var(--success-soft); --av-corps: var(--bloc-propriete); }
.ae-avatar--6 i::before { display: block; z-index: 3; left: .25em; top: .11em; width: .5em; height: .16em; background: radial-gradient(circle at 14% 72%, var(--avatar-cheveux) .075em, transparent .08em), radial-gradient(circle at 50% 55%, var(--avatar-cheveux) .085em, transparent .09em), radial-gradient(circle at 86% 72%, var(--avatar-cheveux) .075em, transparent .08em); }
/* Portraits illustrés (images) : à utiliser quand le personnage a son portrait ; sinon, l'avatar géométrique */
.ae-portrait { display: inline-block; flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.ae-portrait--petit { width: 32px; height: 32px; } .ae-portrait--grand { width: 56px; height: 56px; }
.ae-personnages { display: flex; flex-wrap: wrap; gap: 10px 20px; padding-bottom: 12px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.ae-personnage { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: calc(15px * var(--ae-echelle, 1)); font-weight: 600; line-height: 1.25; }
.ae-personnages .ae-portrait { width: 56px; height: 56px; }
.ae-personnage small { display: block; font-family: var(--font-sans); font-size: calc(13px * var(--ae-echelle, 1)); font-weight: 400; color: var(--ink-muted); }

/* =====================================================================
   RÉUSSITE : coche qui se dessine, essai réussi
   ===================================================================== */
@keyframes ae-trace { to { stroke-dashoffset: 0; } }
@keyframes ae-pop { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: none; } }
@keyframes ae-lueur { 0% { box-shadow: 0 0 0 0 var(--success-soft); } 35% { box-shadow: 0 0 0 8px var(--success-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ae-coche { width: 1.05em; height: 1.05em; margin-right: 6px; vertical-align: -0.16em; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ae-coche path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ae-trace .5s .15s cubic-bezier(.3,.8,.3,1) forwards; }
.ae-retour-court--juste { animation: ae-monte .35s ease-out both, ae-lueur 1.1s .2s ease-out; }
.ae-champ--juste input { animation: ae-rebond .45s ease both; }
.ae-essais i.ae-essais--ok { background: var(--success); animation: ae-pop .45s .2s ease both; }


@media (prefers-reduced-motion: reduce) {
  .ae-coche path { animation: none; stroke-dashoffset: 0; }
  .ae-retour-court--juste, .ae-champ--juste input, .ae-essais i.ae-essais--ok { animation: none; }
}

/* =====================================================================
   HISTOIRE : narration et répliques
   Dans la carte « L'histoire », la narration (contexte) est du texte posé ;
   ce que disent les personnages devient une bulle avec leur portrait.
   ===================================================================== */
.ae-narration { color: var(--ink); }
.ae-histoire:has(.ae-replique, .ae-narrateur) { padding-right: var(--space-4); padding-left: var(--space-4); }
.ae-histoire:has(.ae-replique, .ae-narrateur) > .ae-histoire__lab, .ae-histoire:has(.ae-replique, .ae-narrateur) > .ae-personnages, .ae-histoire:has(.ae-replique, .ae-narrateur) > .ae-narration { margin-left: 8px; margin-right: 32px; }
/* 11/10 (choix de l'utilisateur) : le titre « L'histoire » est écrit sur un bout de papier kraft,
   penché, pincé au bord de la carte par un trombone d'une seule couleur */
.ae-histoire > .ae-histoire__lab, .ae-histoire:has(.ae-replique, .ae-narrateur) > .ae-histoire__lab { position: relative; align-self: flex-start; width: fit-content; margin: calc(-1 * var(--space-6) - 18px) 0 8px 6px; padding: 9px 24px 10px 42px; background: var(--papier-kraft); color: var(--on-papier-kraft); border-radius: 2px; font-size: calc(32px * var(--ae-echelle, 1)); line-height: 1.15; white-space: nowrap; transform: rotate(-3deg); box-shadow: 2px 3px 0 var(--ink); }
.ae-histoire:has(> .ae-histoire__lab) { margin-top: 22px; }
.ae-histoire > .ae-histoire__lab::before { content: ""; position: absolute; top: -18px; left: 8px; width: 24px; height: 70px; background: var(--trombone); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 60'%3E%3Cpath d='M7 16 V44 a4 4 0 0 0 8 0 V10 a6 6 0 0 0 -12 0 V48 a8 8 0 0 0 16 0 V18' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 60'%3E%3Cpath d='M7 16 V44 a4 4 0 0 0 8 0 V10 a6 6 0 0 0 -12 0 V48 a8 8 0 0 0 16 0 V18' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; transform: rotate(4deg); }

.ae-replique { --perso-c: var(--primary); display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: end; margin-right: 24px; animation: ae-monte .45s cubic-bezier(.2,.8,.2,1) both; }
.ae-replique--droite { grid-template-columns: minmax(0, 1fr) 52px; margin-right: 0; margin-left: 24px; }
.ae-replique--droite .ae-replique__portrait { order: 2; }
.ae-replique__portrait { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.ae-replique .ae-avatar { font-size: 40px; }
/* Même personnage qui continue : ni portrait ni nom répétés */
.ae-replique--suite { margin-top: -4px; }
.ae-replique--suite .ae-replique__portrait, .ae-replique--suite .ae-avatar { visibility: hidden; }
.ae-replique--suite .ae-bulle__nom { display: none; }
.ae-replique--suite .ae-bulle::before { display: none; }
.ae-replique--suite .ae-bulle { border-radius: 18px; }
.ae-bulle { position: relative; padding: 10px 14px 12px; background: var(--surface-raised); border: 2px solid var(--perso-c); border-radius: 18px 18px 18px 6px; font-size: calc(17px * var(--ae-echelle, 1)); line-height: 1.5; }
.ae-replique--droite .ae-bulle { border-radius: 18px 18px 6px 18px; }
.ae-bulle::before { content: ""; position: absolute; left: -8px; bottom: 8px; width: 12px; height: 12px; background: var(--surface-raised); border-left: 2px solid var(--perso-c); border-bottom: 2px solid var(--perso-c); transform: rotate(45deg); border-radius: 0 0 0 3px; }
.ae-replique--droite .ae-bulle::before { left: auto; right: -8px; transform: rotate(-135deg); }
.ae-bulle__nom { display: block; margin-bottom: 2px; font: 600 calc(13px * var(--ae-echelle, 1)) var(--font-display); color: var(--ink-muted); }
.ae-perso--1 { --perso-c: var(--primary); }
.ae-perso--2 { --perso-c: var(--accent); }
.ae-perso--3 { --perso-c: var(--success); }
.ae-perso--4 { --perso-c: var(--example); }
.ae-histoire > .ae-replique:nth-of-type(2) { animation-delay: .15s; }
.ae-histoire > .ae-replique:nth-of-type(3) { animation-delay: .3s; }
.ae-histoire > .ae-replique:nth-of-type(4) { animation-delay: .45s; }
@media (prefers-reduced-motion: reduce) { .ae-replique { animation: none; } }

/* Le narrateur : un renard dans le coin d'un cartouche de BD qui porte la narration */
.ae-narrateur { position: relative; margin: 22px 0 0 18px; animation: ae-monte .45s cubic-bezier(.2,.8,.2,1) both; }
.ae-narrateur__portrait { position: absolute; z-index: 1; top: -22px; left: -14px; width: 58px; height: 58px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--surface-raised), 0 0 0 5px var(--ink); }
.ae-cartouche { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px 14px; background: var(--surface); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 3px 3px 0 var(--ink); font-size: calc(17px * var(--ae-echelle, 1)); line-height: 1.55; }
.ae-cartouche p { margin: 0; }
.ae-cartouche p:first-child { text-indent: 44px; }
@media (prefers-reduced-motion: reduce) { .ae-narrateur { animation: none; } }

/* ——— Balance façon BD (09/10, format 1.23) ———
   Dessin : contour encre, ombres pleines, pied en bois (example), fléau et plateaux en primary, pivot et poids en fonte (accent),
   sachets en sacs de papier marqués de l'inconnue, rangés par 5. Un personnage réagit sous la balance (tête + bulle).
   Rythme : la balance penche dès l'appui (pointerdown) en 0,3 s, les objets partent ou arrivent en 0,15 s.
   Le script de référence est exemples/balance-bd.js (kit) et l'aperçu « Balance ». */
.ae-balance { --bal-sac: #d9a46c; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--surface-raised); border: 2px solid var(--line); border-radius: 20px; }
.ae-balance__egalite { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 58px; justify-content: center; font: 700 calc(18px * var(--ae-echelle, 1))/1.3 var(--font-display); font-variant-numeric: tabular-nums; text-align: center; }
.ae-balance__egalite small { font: 600 13px/1 var(--font-display); color: var(--ink-muted); }
.ae-balance__soit { font-size: .85em; font-weight: 600; color: var(--ink-muted); }
.ae-balance__egalite mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 4px; padding: 0 3px; }
.ae-balance__legende { margin: 0; min-height: 48px; padding: 9px 12px; border-radius: 12px; background: var(--primary-soft); font-size: calc(15px * var(--ae-echelle, 1)); }
.ae-balance--contre-exemple .ae-balance__egalite { color: var(--danger); }
.ae-balance--contre-exemple .ae-balance__legende { background: var(--danger-soft); border: 2px solid var(--danger); }
.ae-balance__legende b { color: var(--danger); }
.ae-balance__dessin { width: 100%; max-width: 440px; height: auto; margin: 0 auto; display: block; overflow: visible; }
.ae-balance__sol { fill: var(--ink); opacity: .12; }
.ae-balance__ombre { fill: var(--ink); }
.ae-balance__bois { fill: var(--example); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.ae-balance__metal { fill: var(--primary); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.ae-balance__or { fill: var(--accent); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.ae-balance__or--fin { stroke-width: 2; }
.ae-balance__corde { stroke: var(--ink); stroke-width: 2; }
.ae-balance__anneau { fill: none; stroke: var(--ink); stroke-width: 3; }
.ae-balance__sac { fill: var(--bal-sac); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.ae-balance__lien { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.ae-balance__x, .ae-balance__valeur { font: 700 11px var(--font-display); fill: #2b211b; text-anchor: middle; }
.ae-balance__valeur { font-size: 12.5px; }
.ae-balance__fleau, .ae-balance__plateau { transition: transform .3s cubic-bezier(.2, .9, .3, 1.15); }
.ae-balance__objet { transform-box: fill-box; transform-origin: center; transition: transform .15s ease-out, opacity .15s; }
.ae-balance__objet--entre { animation: ae-balance-pop .18s ease-out both; }
.ae-balance__objet--sort { opacity: 0; transform: translateY(-26px) scale(.6); }
@keyframes ae-balance-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.ae-balance__perso { display: flex; gap: var(--space-3); align-items: center; min-height: 72px; }
.ae-balance__tete { position: relative; flex: none; width: 60px; height: 60px; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface-raised), 0 0 0 5px var(--perso-c, var(--primary)); }
.ae-balance__tete img { position: absolute; inset: 0; width: 60px; height: 60px; border-radius: 50%; }
.ae-balance__tete img { opacity: 0; }
.ae-balance__tete[data-expression="jouer"] .ae-balance__jouer, .ae-balance__tete[data-expression="demande"] .ae-balance__demande, .ae-balance__tete[data-expression="oups"] .ae-balance__oups { opacity: 1; }
/* Expression « oups » (09/10) à l'étape « À ne pas faire » ; sans image oups, la tête « demande » reste visible */
.ae-balance__tete[data-expression="oups"]:not(:has(.ae-balance__oups)) .ae-balance__demande { opacity: 1; }
.ae-balance__tete--hop { animation: ae-balance-hop .22s ease-out; }
@keyframes ae-balance-hop { 40% { transform: translateY(-8px) rotate(-4deg); } }
.ae-balance__bulle { position: relative; flex: 1; min-width: 0; margin: 0; padding: 8px 12px; background: var(--surface-raised); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink); font-weight: 500; font-size: calc(15px * var(--ae-echelle, 1)); }
.ae-balance__bulle::before { content: ""; position: absolute; left: -9px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-right-color: var(--ink); border-left: 0; }
.ae-balance__bulle::after { content: ""; position: absolute; left: -5px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-right-color: var(--surface-raised); border-left: 0; }
.ae-balance__nav { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.ae-balance__nav .ae-btn-bd { touch-action: manipulation; }
.ae-balance__suiv { background: var(--primary); color: var(--on-primary); }
.ae-balance__nav .ae-btn-bd:disabled { opacity: .4; cursor: default; }
.ae-balance__compte { margin-left: auto; font-size: 13px; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) { .ae-balance__fleau, .ae-balance__plateau, .ae-balance__objet { transition: none; } .ae-balance__objet--entre, .ae-balance__tete--hop { animation: none; } }

/* ——— Questionnaire d'avis (phase de test, 09/10) ———
   Bouton « ✎ Avis » dans l'en-tête, puis une feuille qui monte du bas de l'écran. Même style BD que le reste :
   contour encre, ombre pleine, réponse choisie en primary enfoncée, étoiles accent cerclées d'encre.
   Peut être retiré à terme : rien d'autre n'en dépend. */
.ae-avis-bouton { width: fit-content; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface-raised); color: var(--ink); box-shadow: 0 2px 0 var(--ink); font: 600 13px/1 var(--font-display); cursor: pointer; }
.ae-avis-bouton:active { transform: translateY(2px); box-shadow: none; }
.ae-avis-fond { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; background: rgba(43, 33, 27, .38); }
.ae-avis, .ae-avis * { box-sizing: border-box; }
.ae-avis { display: flex; flex-direction: column; gap: var(--space-4); width: 100%; max-height: 82%; overflow-y: auto; padding: 10px 18px 22px; background: var(--surface-raised); color: var(--ink); border-top: 2px solid var(--ink); border-radius: 22px 22px 0 0; font-family: var(--font-sans); font-size: calc(15px * var(--ae-echelle, 1)); animation: ae-avis-monte .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes ae-avis-monte { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ae-avis__poignee { align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.ae-avis__tete { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.ae-avis__titre { width: fit-content; margin: 0; font: 600 calc(20px * var(--ae-echelle, 1))/1.25 var(--font-display); background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: 0 94%; background-size: 100% .28em; }
.ae-avis__fermer { flex: none; width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 50%; background: var(--surface-raised); color: var(--ink); box-shadow: 0 2px 0 var(--ink); font: 700 16px var(--font-sans); cursor: pointer; }
.ae-avis__fermer:active { transform: translateY(2px); box-shadow: none; }
.ae-avis__intro, .ae-avis__deja { margin: 0; color: var(--ink-muted); font-size: .93em; }
.ae-avis__q { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.ae-avis__q legend { margin-bottom: var(--space-2); padding: 0; font-family: var(--font-display); font-weight: 600; }
.ae-avis__options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ae-avis__option { margin-bottom: 3px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface-raised); color: var(--ink); box-shadow: 0 3px 0 var(--ink); font: 600 calc(14px * var(--ae-echelle, 1)) var(--font-display); cursor: pointer; touch-action: manipulation; transition: transform .08s, box-shadow .08s; }
.ae-avis__option:active, .ae-avis__option[aria-pressed="true"] { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.ae-avis__option[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.ae-avis__options--cases .ae-avis__option[aria-pressed="true"]::before { content: "✓ "; }
.ae-avis__etoiles { display: inline-flex; flex-direction: column; gap: 2px; align-self: flex-start; }
.ae-avis__etoiles-ligne { display: flex; gap: 2px; }
.ae-avis__etoile { padding: 0 2px; border: 0; background: none; color: var(--line-strong); font-size: 34px; line-height: 1; cursor: pointer; transition: transform .12s; }
.ae-avis__etoile[aria-pressed="true"] { color: var(--accent); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.ae-avis__etoile:active { transform: scale(1.15); }
.ae-avis__bornes { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--ink-muted); font-size: 12px; }
.ae-avis__precision { display: flex; flex-direction: column; gap: 4px; }
.ae-avis__precision label { color: var(--primary); font-size: .88em; font-weight: 600; }
.ae-avis textarea { width: 100%; min-height: 70px; padding: 8px 10px; border: 2px solid var(--line-strong); border-radius: 12px; background: var(--surface-raised); color: var(--ink); font: 500 calc(14px * var(--ae-echelle, 1)) var(--font-sans); resize: vertical; }
.ae-avis textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.ae-avis__actions { position: sticky; bottom: -22px; display: flex; justify-content: flex-end; gap: var(--space-3); padding: 10px 0 4px; background: var(--surface-raised); }
.ae-avis__envoyer { background: var(--primary); color: var(--on-primary); }
.ae-avis__envoyer:disabled { opacity: .45; border-style: dashed; box-shadow: none; cursor: default; }
.ae-avis__merci { margin: 0; padding: 10px 12px; border: 2px solid var(--success); border-radius: 12px; background: var(--success-soft); color: var(--success-deep, var(--success)); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .ae-avis { animation: none; } .ae-avis__option, .ae-avis__etoile { transition: none; } }

/* =====================================================================
   ÉTOILES DE MAÎTRISE (09/10, format 1.24, en test) : 3 étoiles par notion,
   à la place de la jauge « Mes notions ». Elles ne se perdent jamais.
   ===================================================================== */
.ae-etoiles { display: inline-flex; gap: 2px; flex: none; vertical-align: middle; }
.ae-etoiles svg { width: var(--ae-etoile-t, 18px); height: var(--ae-etoile-t, 18px); display: block; }
.ae-etoile--pleine { fill: var(--accent); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.ae-etoile--vide { fill: none; stroke: var(--line-strong); stroke-width: 1.6; stroke-linejoin: round; }
.ae-etoile--defi { fill: var(--bloc-defi); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.ae-rubrique .ae-etoile--vide { stroke: var(--primary-soft); }
.ae-notions-barre { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 2px solid var(--line-strong); border-radius: 14px; background: var(--surface-raised); color: var(--ink); font: 600 calc(14px * var(--ae-echelle, 1)) var(--font-display); cursor: pointer; }
.ae-notions-barre__total { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-variant-numeric: tabular-nums; --ae-etoile-t: 20px; }
.ae-etoiles-compte { display: flex; align-items: center; gap: 12px; padding: 12px 0 6px; --ae-etoile-t: 34px; }
.ae-etoiles-compte__gros { font: 600 26px/1 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ae-etoiles-compte small { color: var(--ink-muted); font-size: calc(13px * var(--ae-echelle, 1)); line-height: 1.35; }
.ae-etoiles-paliers { list-style: none; margin: 2px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: calc(13px * var(--ae-echelle, 1)); color: var(--ink-muted); --ae-etoile-t: 13px; }
.ae-etoiles-paliers li { display: flex; gap: 8px; align-items: center; }
.ae-etoiles-paliers .ae-etoiles { gap: 1px; min-width: 56px; }
.ae-notion-etoiles { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.ae-notion-etoiles b { font: 600 calc(15px * var(--ae-echelle, 1))/1.25 var(--font-display); }
.ae-notion-etoiles small { grid-column: 1 / -1; color: var(--ink-muted); font-size: calc(13px * var(--ae-echelle, 1)); }
.ae-notion-etoiles--maitrisee b { color: var(--success-deep, var(--success)); }
.ae-notion-etoiles--maitrisee small { color: var(--success); font-weight: 600; }
.ae-chip--etoile { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--ink); }
.ae-chip--etoile-defi { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--bloc-defi); }
.ae-chip--pour-etoile { background: var(--surface-raised); border: 1.5px dashed var(--accent); color: var(--ink-muted); }
.ae-etoile-gagnee { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 2px; text-align: center; border-top: 1px dashed var(--line); --ae-etoile-t: 42px; }
.ae-etoile-gagnee .ae-etoiles { gap: 6px; }
.ae-etoile-gagnee__nouvelle { display: block; transform-origin: 50% 60%; }
.ae-etoile-gagnee--joue .ae-etoile-gagnee__nouvelle { animation: ae-etoile-pop .7s cubic-bezier(.3, 1.7, .5, 1) both; }
@keyframes ae-etoile-pop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 60% { transform: scale(1.35) rotate(8deg); opacity: 1; } 100% { transform: none; } }
.ae-etoile-gagnee__eclats { position: absolute; left: 50%; top: 34px; width: 0; height: 0; pointer-events: none; }
.ae-etoile-gagnee__eclats i { position: absolute; left: -4px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--ink); opacity: 0; }
.ae-etoile-gagnee--joue .ae-etoile-gagnee__eclats i { animation: ae-etoile-eclat .6s .25s ease-out both; }
@keyframes ae-etoile-eclat { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(.4); } }
.ae-etoile-gagnee__titre { font: 600 calc(17px * var(--ae-echelle, 1))/1.2 var(--font-display); color: var(--ink); }
.ae-etoile-gagnee__detail { font-size: calc(13px * var(--ae-echelle, 1)); color: var(--ink-muted); }
.ae-etoile-gagnee__mot { font-weight: 600; font-size: calc(14px * var(--ae-echelle, 1)); color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .ae-etoile-gagnee--joue .ae-etoile-gagnee__nouvelle, .ae-etoile-gagnee--joue .ae-etoile-gagnee__eclats i { animation: none; } }

/* =====================================================================
   LES PERSONNAGES RÉAGISSENT (09/10, format 1.25, en test)
   ===================================================================== */
.ae-enc__perso--change { animation: ae-reac-hop .45s ease-out; }
@keyframes ae-reac-hop { 0% { transform: scale(.85); } 45% { transform: translateY(-8px) rotate(-4deg); } 100% { transform: none; } }
.ae-piege-pastille { display: inline-block; align-self: flex-start; margin-top: 6px; padding: 3px 11px; border-radius: var(--radius-full); background: var(--danger-soft); color: var(--danger); font: 600 calc(13px * var(--ae-echelle, 1))/1.3 var(--font-display); }
.ae-retour-court__invite { margin: 6px 0 0; font-weight: 600; }
.ae-fin { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 2px solid var(--ink); border-top: 6px solid var(--success); border-radius: 18px; background: var(--surface-raised); box-shadow: 0 4px 0 var(--ink); }
.ae-fin--ko { border-top-color: var(--danger); }
.ae-fin__verdict { font: 600 calc(20px * var(--ae-echelle, 1))/1.2 var(--font-display); color: var(--success); }
.ae-fin--ko .ae-fin__verdict { color: var(--danger); }
.ae-fin__expl { margin: 0; font-size: calc(15px * var(--ae-echelle, 1)); }
.ae-reaction { display: flex; gap: 10px; align-items: center; min-height: 62px; }
.ae-reaction__tete { width: 54px; height: 54px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--surface-raised), 0 0 0 5px var(--perso-c, var(--primary)); animation: ae-reac-in .5s .3s ease-out both; }
.ae-reaction__bulle { position: relative; flex: 1; min-width: 0; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 14px; background: var(--surface-raised); box-shadow: 0 3px 0 var(--ink); font-weight: 500; animation: ae-reac-bulle .35s .5s cubic-bezier(.3, 1.5, .5, 1) both; transform-origin: 0 50%; }
.ae-reaction__bulle::before { content: ""; position: absolute; left: -9px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-right-color: var(--ink); border-left: 0; }
.ae-reaction__bulle::after { content: ""; position: absolute; left: -5px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-right-color: var(--surface-raised); border-left: 0; }
@keyframes ae-reac-in { 0% { transform: scale(.6); opacity: 0; } 50% { transform: translateY(-8px) rotate(-4deg); opacity: 1; } 100% { transform: none; } }
@keyframes ae-reac-bulle { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ae-enc__perso--change, .ae-reaction__tete, .ae-reaction__bulle { animation: none; } }

/* =====================================================================
   FIN DU QUIZ ÉCLAIR (09/10, en test) : le renard donne le résultat,
   une pastille par question, « Revoir la question n », puis « Module suivant ».
   Pas de note ni d'XP. Textes : cours.reactions.quiz_fin du JSON.
   ===================================================================== */
.ae-fq { position: relative; display: flex; flex-direction: column; gap: var(--space-4); margin-top: 26px; padding: 20px 18px; background: var(--surface-raised); border: 2px solid var(--ink); border-top: 8px solid var(--bloc-quiz); border-radius: 20px; box-shadow: 0 5px 0 var(--ink); animation: ae-monte .45s cubic-bezier(.2,.8,.2,1) both; }
.ae-fq__onglet { position: absolute; top: -21px; left: 16px; padding: 3px 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--bloc-quiz); color: var(--on-primary); font: 600 calc(15px * var(--ae-echelle, 1)) var(--font-display); }
.ae-fq .ae-narrateur { margin: 14px 0 0 16px; }
.ae-fq__pastilles { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ae-fq__pastilles small { width: 100%; font: 600 calc(13px * var(--ae-echelle, 1)) var(--font-display); color: var(--ink-muted); }
.ae-fq__p { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 2px solid var(--ink); border-radius: var(--radius-full); background: var(--surface); color: var(--ink); font: 600 calc(14px * var(--ae-echelle, 1)) var(--font-display); box-shadow: 0 3px 0 var(--ink); animation: ae-fq-pop .45s cubic-bezier(.3,1.7,.5,1) both; }
.ae-fq__p:nth-child(3) { animation-delay: .12s; } .ae-fq__p:nth-child(4) { animation-delay: .24s; } .ae-fq__p:nth-child(5) { animation-delay: .36s; }
.ae-fq__p i { width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; font-style: normal; font-size: 14px; color: var(--on-primary); }
.ae-fq__p--juste i { background: var(--success); }
.ae-fq__p--faux { background: var(--danger-soft); cursor: pointer; }
.ae-fq__p--faux i { background: var(--danger); }
.ae-fq__p--faux:active { transform: translateY(3px); box-shadow: none; }
.ae-fq__actions { display: flex; flex-direction: column; gap: 12px; padding-top: var(--space-1); border-top: 2px dashed var(--line); }
.ae-fq__actions .ae-btn-bd { margin-top: 12px; }
.ae-fq__confettis { position: absolute; top: 10px; right: 14px; display: flex; gap: 5px; }
.ae-fq__confettis i { width: 10px; height: 10px; border: 2px solid var(--ink); border-radius: 3px; animation: ae-fq-saut 1.4s ease-in-out infinite alternate; }
.ae-fq__confettis i:nth-child(1) { background: var(--accent); } .ae-fq__confettis i:nth-child(2) { background: var(--primary); border-radius: 50%; animation-delay: .2s; } .ae-fq__confettis i:nth-child(3) { background: var(--success); animation-delay: .4s; }
@keyframes ae-fq-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ae-fq-saut { to { transform: translateY(-6px) rotate(20deg); } }
@media (prefers-reduced-motion: reduce) { .ae-fq, .ae-fq__p, .ae-fq__confettis i { animation: none; } }

/* Questionnaire d'avis : cartes qui ouvrent le bilan du chapitre (fin du Projet, Accueil) */
.ae-avis-carte { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 2px solid var(--ink); border-radius: 18px; background: var(--surface-raised); color: var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: var(--font-sans); }
.ae-avis-carte__titre { margin: 0; font: 600 calc(16px * var(--ae-echelle, 1))/1.25 var(--font-display); }
.ae-avis-carte__texte { margin: 0; color: var(--ink-muted); font-size: calc(14px * var(--ae-echelle, 1)); }
.ae-avis-carte .ae-btn-bd { margin-top: 6px; }
