/* Plans de travail en ligne — cahiers multimédias gris (comme les cahiers de vocabulaire, en gris).
   Dans les pages, les couleurs des fiches imprimées : bleu le français, orange les maths, violet les défis, vert la correction. */
@font-face { font-family: "Andika"; src: url("polices/Andika-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("polices/Andika-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Marelle"; src: url("polices/Marelle-Regular.woff2") format("woff2"); font-display: swap; }
:root {
  --gris: #5D6670; --gris-fonce: #3B4249; --gris-clair: #ECEEF1; --fond: #F4F5F7; --lisere: #D3D7DD; --doux: #66707A; --encre: #2B241D;
  --bleu: #1F6FB2; --orange: #D9711C; --violet: #7E4BB5; --vert: #1E8E3E; --ko: #E0662B;
  font-family: "Andika", Arial, sans-serif; color: var(--encre); background: var(--fond); font-size: 18px; line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--gris-fonce); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #E0A800; outline-offset: 2px; }
.bouton { display: inline-flex; align-items: center; gap: .4em; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--lisere); background: #fff;
  color: var(--gris-fonce); font-weight: 700; text-decoration: none; cursor: pointer; }
.bouton.principal { background: var(--gris); border-color: var(--gris); color: #fff; }
.violet { color: var(--violet); }
.etoile-svg { width: 1em; height: 1em; vertical-align: -.12em; fill: var(--violet); }

/* ---------- Liste des cahiers ---------- */
header.haut { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 14px 48px; background: #fff; border-bottom: 1px solid var(--lisere); }
.marque { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--gris-fonce); font-weight: 700; font-size: 1.3rem; line-height: 1.2; }
.marque img { width: 52px; height: 52px; }
.marque small { display: block; font-weight: 400; font-size: .8rem; color: var(--doux); }
main.liste { max-width: 1180px; margin: 0 auto; padding: 36px 24px 64px; }
.surtitre { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--gris); }
main.liste h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; margin: .3rem 0 .8rem; color: var(--gris-fonce); }
.intro { max-width: 62ch; }
.outils { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: 1.4rem 0; padding: 14px; background: #fff; border: 1px solid var(--lisere); border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.outils input { flex: 1; min-width: 14rem; padding: 8px 12px; border: 1px solid var(--lisere); border-radius: 10px; }
.vues { display: inline-flex; border: 1px solid var(--lisere); border-radius: 10px; overflow: hidden; }
.vues button { font-weight: 700; border: 0; background: #fff; color: var(--gris-fonce); padding: 8px 14px; cursor: pointer; }
.vues button[aria-pressed="true"] { background: var(--gris); color: #fff; }
.compte { color: var(--doux); }
.cartes { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.lignes { display: flex; flex-direction: column; gap: 12px; }
.cahier-carte { background: #fff; border: 1px solid var(--lisere); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.lignes .cahier-carte { flex-direction: row; align-items: center; }
.vignette { display: block; background: var(--gris); padding: 16px; text-decoration: none; }
.lignes .vignette { width: 170px; flex: none; padding: 10px; }
.vignette-dessin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; aspect-ratio: 16 / 9; background: #fff; border-radius: 12px; }
.vignette-dessin > svg { width: 30%; }
.vignette-dessin b { font-family: "Marelle", cursive; font-weight: 400; font-size: 1.5rem; color: var(--encre); }
.lignes .vignette-dessin b { font-size: .9rem; }
.infos { padding: 14px 18px 0; flex: 1; }
.lignes .infos { padding: 10px 16px; }
.infos h2 { font-size: 1.12rem; margin: 0 0 .3rem; line-height: 1.3; }
.resume { margin: 0 0 .4rem; font-size: .92rem; color: var(--doux); }
.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .4rem; }
.etiquette { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 6px; background: var(--gris-clair); color: var(--gris-fonce); }
.chiffres { color: var(--doux); font-size: .88rem; margin: 0; }
.pt { display: inline-block; width: .7em; height: .7em; border-radius: 50%; margin-right: .3em; vertical-align: 0; }
.pt.fr { background: var(--bleu); } .pt.ma { background: var(--orange); } .pt.defi { background: var(--violet); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 18px 18px; }
.lignes .actions { padding: 10px 16px; }
.actions .bouton { padding: 8px 14px; font-size: .92rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--gris-fonce); color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; }
.niveaux { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 1.5rem; }
.niveaux a { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 180px; height: 130px; border-radius: 18px; background: var(--gris); color: #fff; text-decoration: none; font-weight: 700; font-size: 2.2rem; box-shadow: 0 6px 0 var(--gris-fonce); }
.niveaux a small { font-size: .85rem; font-weight: 400; }
footer.pied { text-align: center; color: var(--doux); font-size: .85rem; padding: 1rem 0 2rem; }

/* ---------- Le cahier ouvert ---------- */
body.cahier-page { background: #E3E6EA; }
.cahier { position: relative; height: 100vh; height: 100dvh; padding: 18px 70px 18px 44px; }
.spirale { position: absolute; left: 22px; top: 44px; bottom: 44px; display: flex; flex-direction: column; justify-content: space-between; z-index: 2; }
.spirale span { display: block; width: 32px; height: 7px; border-radius: 4px; background: #4a4f58; }
.feuille { position: relative; height: 100%; background: #fff; border-radius: 24px; display: flex; flex-direction: column; overflow: hidden; padding: 16px 22px 18px 36px; }
.cahier[data-type="couverture"] .feuille { background: var(--gris); box-shadow: 0 8px 0 var(--gris-fonce); padding: 28px 60px; }
.cahier[data-type="bravo"] .feuille { background: #fff repeating-linear-gradient(#fff 0 31px, #E4E7EB 31px 32px); }
.cahier button { cursor: pointer; }
.couverture { flex: 1; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.titre { background: #fff; border: 2px solid var(--encre); border-radius: 18px; padding: 10px 22px 12px; }
.titre .niveau { display: block; font-weight: 700; color: var(--doux); font-size: .85rem; border-bottom: 2px solid #E3E6EA; padding-bottom: 4px; }
.titre h1 { margin: 4px 0; font-size: clamp(1.5rem, 3.6vw, 2.3rem); line-height: 1.15; }
.titre .sous { display: block; font-size: .95rem; color: var(--doux); border-top: 2px solid #E3E6EA; padding-top: 4px; }
.image { flex: 1; min-height: 0; background: #fff; border-radius: 22px; display: flex; align-items: center; justify-content: center; padding: 18px; }
.dessin-couverture { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.dessin-couverture > svg { width: min(26vh, 200px); margin-bottom: 1.2rem; }
.cursive { font-family: "Marelle", cursive; font-size: clamp(2.4rem, 7vh, 4.4rem); line-height: 1.2; }
.pastilles { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.p { color: #fff; font-weight: 700; border-radius: 999px; padding: .2em .9em; font-size: .95rem; }
.p.fr { background: var(--bleu); } .p.ma { background: var(--orange); } .p.defi { background: var(--violet); }
.p.defi .etoile-svg { fill: #fff; }
.bas { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: #fff; font-size: .85rem; }
.logo img { height: 40px; width: 40px; background: #fff; border-radius: 10px; padding: 2px; }
.ouvrir { background: var(--gris-fonce); color: #fff; border: 0; border-radius: 999px; padding: .65em 1.8em; font-weight: 700; font-size: 1.15rem; }

.tete { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 10px; padding-right: 10px; }
.tete .pastille { background: var(--gris); color: #fff; font-weight: 700; padding: .2em .9em; border-radius: 999px; }
.tete .phrase { flex: 1; min-width: 10em; font-weight: 700; font-size: 1.15rem; }
.nom-defi { font-weight: 400; color: var(--doux); }
.nav { display: inline-flex; align-items: center; gap: .8rem; }
.avant, .retour-plan { background: #fff; border: 2px solid var(--gris); color: var(--gris-fonce); border-radius: 999px; padding: .3em 1em; font-weight: 700; }
.num-page { font-size: .85rem; color: var(--doux); font-weight: 700; white-space: nowrap; }
.corps { flex: 1; min-height: 0; overflow: auto; padding: 4px 70px 50px 4px; }
.coin { position: absolute; right: 0; bottom: 0; width: 96px; height: 96px; border: 0; background: transparent; padding: 0; }
.coin::after { content: ""; position: absolute; right: 0; bottom: 0; width: 76px; height: 76px; background: var(--gris); clip-path: polygon(100% 0, 100% 100%, 0 100%); border-bottom-right-radius: 24px; }
.coin span { position: absolute; right: 6px; top: -34px; width: 80px; font-size: .72rem; font-weight: 700; line-height: 1.1; text-align: center; color: var(--encre); }

/* les codes F1, M1, défis */
.code { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 2.6em; padding: .15em .5em; border-radius: 999px; color: #fff; font-weight: 700; }
.code.fr { background: var(--bleu); } .code.ma { background: var(--orange); } .code.defi-fr, .code.defi-ma { background: var(--violet); }
.code .etoile-svg { fill: #fff; }

/* Mon plan */
.mon-plan { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.groupe h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.groupe h2.fr { color: var(--bleu); } .groupe h2.ma { color: var(--orange); }
.ligne-plan { width: 100%; display: flex; align-items: center; gap: .7rem; text-align: left; background: #fff; border: 1px solid var(--lisere); border-radius: 12px; padding: .45em .7em; margin-bottom: 6px; }
.ligne-plan:hover { border-color: var(--gris); }
.ligne-plan.defi-fr, .ligne-plan.defi-ma { background: #F4EEFA; border-color: #D9C8EC; }
.ligne-plan .obj { flex: 1; font-size: .95rem; line-height: 1.3; }
.ligne-plan .obj b { color: var(--violet); }
.fait-ici { display: inline-flex; align-items: center; gap: .3rem; }
.fait-ici .visage { width: 30px; height: 30px; }
.coche { color: var(--vert); font-weight: 700; }
.pas-fait { font-size: .8rem; color: var(--doux); }
.comment { margin-top: 1rem; font-size: 1.05rem; }

/* une activité */
.activite .objectif { margin: 0 0 .4rem; padding: .4em .9em; border-radius: 10px; background: var(--gris-clair); }
.activite.fr .objectif { background: #E4EEF7; } .activite.fr .objectif b { color: var(--bleu); }
.activite.ma .objectif { background: #FBEBDD; } .activite.ma .objectif b { color: var(--orange); }
.activite.defi-fr .objectif, .activite.defi-ma .objectif { background: #F1EAF8; } .activite[class*="defi"] .objectif b { color: var(--violet); }
.intro-defi { font-weight: 700; margin: .6rem 0 0; }
.ex { margin: 1.1rem 0 0; }
.ex h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .55rem; font-size: 1.12rem; }
.ex h3 .n { display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em; border-radius: 50%; color: #fff; font-size: .85rem; flex: none; background: var(--gris); }
.activite.fr .ex h3 .n, .activite.defi-fr .ex h3 .n { background: var(--bleu); }
.activite.ma .ex h3 .n, .activite.defi-ma .ex h3 .n { background: var(--orange); }
.haut-parleur { border: 0; background: var(--gris-clair); border-radius: 999px; padding: .1em .5em; font-size: .95rem; }
.sans-voix .haut-parleur { display: none; }
.aide { display: inline-block; border: 2px solid var(--orange); border-radius: 8px; padding: 0 .5em; font-weight: 700; margin-bottom: .4rem; font-size: .95rem; }
.modele { margin: 0 0 .3rem; font-style: italic; }
.trous { display: grid; grid-template-columns: repeat(var(--col), minmax(0, max-content)); column-gap: 3rem; row-gap: .55rem; font-size: 1.15rem; }
.ligne { white-space: normal; }
.trou { border: 0; border-bottom: 2.5px solid var(--gris); background: #FAFAFB; border-radius: 6px 6px 0 0; padding: .05em .3em; text-align: center; font-size: 1.1rem; min-width: 2.5ch; max-width: 100%; }
.trou:focus { background: #FFF8DC; outline: none; border-bottom-color: #E0A800; }
.ok { border-color: var(--vert) !important; background: #E6F4EA !important; }
.ko { border-color: var(--ko) !important; background: #FDEBDD !important; }
.corrige { border-color: var(--vert) !important; color: var(--vert) !important; font-weight: 700; background: #E6F4EA !important; }
.classer { display: flex; flex-direction: column; gap: .4rem; }
.mot { display: flex; align-items: center; gap: .6rem; padding: .15em .4em; border: 2px solid transparent; border-radius: 10px; width: fit-content; }
.mot span { min-width: 6.5em; font-size: 1.15rem; }
.mot button, .etiq { border: 2px solid var(--lisere); background: #fff; border-radius: 999px; padding: .15em .9em; }
.mot button.pris, .etiq.pris { border-color: var(--gris-fonce); background: var(--gris-clair); font-weight: 700; }
.etiquettes-ex { display: flex; flex-wrap: wrap; gap: .5rem; font-size: 1.1rem; padding: .2em; border: 2px solid transparent; border-radius: 12px; width: fit-content; }
.relier { display: flex; flex-direction: column; gap: .5rem; font-size: 1.12rem; }
.relier label { display: flex; align-items: center; gap: .8rem; }
.relier label span { min-width: 6.5em; }
.relier select { border: 2px solid var(--lisere); border-radius: 10px; padding: .2em .5em; background: #fff; min-width: 9em; }
.ordre .rang { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; padding: .3em; border: 2px solid transparent; border-radius: 12px; width: fit-content; }
.case-rang { display: inline-flex; align-items: center; gap: .3rem; min-width: 7em; border-bottom: 2.5px solid var(--gris); padding: .1em .3em; }
.case-rang b { color: var(--doux); font-size: .85rem; }
.case-rang em { font-style: normal; font-weight: 700; }
.effacer { border: 0; background: none; color: var(--doux); text-decoration: underline; }
.mesures { display: flex; flex-direction: column; gap: .4rem; }
.mesure { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mesure > b { width: 1em; }
.mesure svg, .tracer svg { max-width: 100%; height: auto; display: block; }
.seg { stroke: var(--encre); stroke-width: 3; stroke-linecap: round; }
.seg.fin { stroke-width: 2; }
.seg.trace { stroke: var(--ko); stroke-width: 3.5; }
.poignee { fill: var(--ko); stroke: #fff; stroke-width: 2; }
.regle { fill: #FFF6D6; stroke: #C9B66A; }
.trait { stroke: #6B5E2E; stroke-width: 1; }
.chiffre { font-size: 10px; text-anchor: middle; fill: #6B5E2E; font-family: Arial, sans-serif; }
.tracer { padding: .3em; border: 2px solid transparent; border-radius: 12px; width: fit-content; max-width: 100%; }
.tracer input[type=range] { width: calc(100% - 2 * 16px * var(--k, 1)); margin: .3rem 0 0; display: block; accent-color: var(--ko); }
.barres { display: grid; grid-template-columns: 3.5em auto; gap: .3rem .6rem; align-items: center; margin-bottom: .6rem; font-size: .95rem; }
.barres b { display: inline-block; border: 2px solid var(--orange); text-align: center; font-weight: 400; padding: .05em 0; }
.barres b.clair { background: #FBEBDD; }
.barres div { display: flex; }
.barres i { display: inline-block; border: 2px dashed var(--doux); border-left: 0; text-align: center; font-style: normal; font-weight: 700; }
.ecrit { width: 100%; max-width: 46em; border: 2px solid var(--lisere); border-radius: 12px; padding: .5em .8em; font-size: 1.1rem; line-height: 1.8;
  background: #fff repeating-linear-gradient(transparent 0 calc(1.8em - 1px), #DDE1E6 calc(1.8em - 1px) 1.8em); background-attachment: local; }
.exemple { color: var(--vert); margin: .4rem 0 0; }
.cocher { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: .4rem 1rem; font-size: 1.05rem; }
.cocher input { width: 1.2em; height: 1.2em; accent-color: var(--violet); vertical-align: -.15em; }
.verif { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }
.verifier { background: var(--gris-fonce); color: #fff; border: 0; border-radius: 999px; padding: .45em 1.6em; font-weight: 700; font-size: 1.1rem; }
.corriger { background: #fff; color: var(--vert); border: 2px solid var(--vert); border-radius: 999px; padding: .35em 1.2em; font-weight: 700; }
.message { font-weight: 700; }
.message.bien { color: var(--vert); } .message.encore { color: var(--ko); }
.reussi { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-weight: 700; }
.choix-visage { border: 3px solid transparent; background: none; border-radius: 50%; padding: 2px; line-height: 0; }
.choix-visage.pris { border-color: var(--gris-fonce); background: var(--gris-clair); }
.visage { width: 42px; height: 42px; fill: none; stroke: var(--encre); stroke-width: 1.4; stroke-linecap: round; }
.visage .oeil { fill: var(--encre); stroke: none; }

.bravo { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; text-align: center; }
.grande-etoile .etoile-svg { width: 5rem; height: 5rem; }
.bravo h1 { font-size: 3rem; margin: 0; }
.fait { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; max-width: 860px; }
.fait button { border: 2px solid var(--lisere); background: #fff; border-radius: 10px; padding: .2em .7em; font-size: .9rem; }
.fait button.vu.fr { border-color: var(--bleu); color: var(--bleu); font-weight: 700; }
.fait button.vu.ma { border-color: var(--orange); color: var(--orange); font-weight: 700; }
.fait button.vu.defi-fr, .fait button.vu.defi-ma { border-color: var(--violet); color: var(--violet); font-weight: 700; }

.marge { position: absolute; right: 8px; top: 18px; bottom: 18px; width: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.grand { position: absolute; top: 0; width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--gris); background: #fff; color: var(--gris-fonce); display: flex; align-items: center; justify-content: center; }
.onglet { writing-mode: vertical-rl; background: var(--gris-fonce); color: #fff; border: 0; border-radius: 0 14px 14px 0; padding: 1.6rem .55rem; font-weight: 700; margin-left: -8px; }
.etapes { position: absolute; right: 70px; top: 50%; transform: translateY(-50%); z-index: 5; display: grid; grid-template-columns: repeat(2, auto); gap: 6px; max-height: 86vh; overflow: auto; padding: 4px; }
.etapes[hidden] { display: none; }
.etapes button { background: var(--gris); color: #fff; border: 2px solid #fff; border-radius: 12px; padding: .3em .9em; font-weight: 700; text-align: left; font-size: .88rem; }
.etapes button.fr { background: var(--bleu); } .etapes button.ma { background: var(--orange); } .etapes button.defi-fr, .etapes button.defi-ma { background: var(--violet); }
.etapes button.ici { outline: 3px solid var(--encre); }
.etapes button.vu::after { content: " ✔"; }
.etat { padding: 3rem; text-align: center; font-weight: 700; }
@media (max-width: 760px) {
  :root { font-size: 16px; }
  header.haut { padding: 12px 16px; }
  .cahier { padding: 8px; }
  .spirale { display: none; }
  .feuille { padding: 12px; }
  .cahier[data-type="couverture"] .feuille { padding: 16px; }
  .marge { right: 12px; top: 12px; bottom: auto; width: auto; flex-direction: row; gap: 6px; z-index: 6; }
  .grand { position: static; }
  .onglet { writing-mode: horizontal-tb; border-radius: 12px; padding: .5rem .9rem; margin: 0; }
  .etapes { right: 12px; top: 64px; transform: none; grid-template-columns: 1fr; }
  .tete { padding-right: 8.5rem; }
  .corps { padding: 4px 4px 80px; }
  .trous { grid-template-columns: 1fr; }
}
.trous.large { grid-template-columns: minmax(0, 32em); }
/* placer la règle : le 0 au début du trait */
.placer { padding: .3em; border: 2px solid transparent; border-radius: 12px; width: fit-content; max-width: 100%; }
.placer svg { max-width: 100%; height: auto; display: block; touch-action: none; }
.regle-mobile { cursor: grab; }
.regle-mobile:active { cursor: grabbing; }
.pousser { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; color: var(--doux); font-size: .95rem; }
.pousser button { border: 2px solid var(--gris); background: #fff; border-radius: 10px; width: 2.4em; height: 2em; font-size: 1rem; }
.pousser .lire { margin-left: 1.2rem; font-size: 1.1rem; color: var(--encre); }
.placer { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; margin-bottom: .4rem; }
.placer > svg, .placer > .pousser { grid-column: 2; }
.nom-trait { grid-row: 1; align-self: start; margin-top: 2px; }
.autres-traits { border: 2px solid var(--gris); background: #fff; border-radius: 999px; padding: .25em 1em; font-weight: 700; color: var(--gris-fonce); }
/* les versions à imprimer (PDF, Word) */
.imprimer a { font-weight: 700; }
.bas .imprimer { color: #fff; font-size: .95rem; margin-left: auto; margin-right: 1rem; }
.bas .imprimer a { color: #fff; }
.pour-imprimer { margin-top: .8rem; color: var(--doux); }
.pour-imprimer a { color: var(--gris-fonce); }

/* ---------- les trois niveaux d'une activité (★, ★★, ★★★) et les fractions ---------- */
.niveaux-choix { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: .2rem 0 .8rem; }
.niveaux-choix > span { font-weight: 700; }
.niveaux-choix button { border: 2px solid var(--lisere); background: #fff; border-radius: 999px; padding: 4px 14px; font-weight: 700; color: var(--gris-fonce); cursor: pointer; letter-spacing: .05em; }
.activite.fr .niveaux-choix button[aria-pressed="true"] { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.activite.ma .niveaux-choix button[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }
.code-niveau { margin-left: 4px; font-weight: 700; letter-spacing: .04em; }
.code-niveau.fr { color: var(--bleu); } .code-niveau.ma { color: var(--orange); }
.niv-etat { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--lisere); font-size: .75rem; color: var(--doux); }
.niv-etat.fait { border-color: var(--vert); color: var(--vert); }
.niv-etat .visage { width: 1.1em; height: 1.1em; }
.fractions { display: flex; flex-wrap: wrap; gap: 14px 28px; }
.fraction { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: 10px; }
.bande { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(240px, 60vw); height: 34px; border: 2px solid var(--encre); border-radius: 4px; overflow: hidden; }
.bande .part { border: 0; border-right: 2px solid var(--encre); background: #fff; padding: 0; }
.bande .part:last-child { border-right: 0; }
.bande .part.pris { background: #F2B37A; }
.colorier .bande .part { cursor: pointer; }
.frac-saisie { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.frac-saisie input.trou { width: 2.6em; min-width: 2.6em; height: 1.7em; padding: 0; }
.frac-saisie i { display: block; width: 3.6ch; border-top: 2px solid var(--encre); }
.frac-lue { font-size: 1.2rem; min-width: 2.6em; }
.fraction.ok { outline: 3px solid var(--vert); } .fraction.ko { outline: 3px solid var(--ko); } .fraction.corrige .part.pris { background: #9ED3A8; }
.ex .modele { font-style: italic; background: var(--gris-clair); padding: 8px 12px; border-radius: 10px; }
.etoiles { display: inline-flex; gap: 1px; vertical-align: -.1em; }
.etoiles svg { width: .95em; height: .95em; fill: currentColor; }

/* ---------- les aires sur quadrillage et les paires de droites (cycle 3) ---------- */
.aires { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: flex-end; }
.figure-aire { display: flex; flex-direction: column; gap: 6px; padding: 4px; border-radius: 10px; }
.figure-aire svg { max-width: 100%; height: auto; }
.figure-aire rect.vide { fill: #fff; stroke: #C9CED6; stroke-width: 1; }
.figure-aire rect.plein { fill: #F2B37A; stroke: #8A6A4E; stroke-width: 1; }
.droites { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.paire-droites { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--lisere); }
.paire-droites svg { width: 100%; max-width: 220px; background: #fff; border-radius: 8px; }
.paire-droites line { stroke: var(--encre); stroke-width: 1.6; stroke-linecap: round; }
.paire-droites .etiquettes-ex { justify-content: center; }
.paire-droites.ok { outline: 3px solid var(--vert); } .paire-droites.ko { outline: 3px solid var(--ko); }
.sur-fiche { background: #FFF6E5; border-left: 5px solid var(--orange); padding: 8px 12px; border-radius: 8px; font-weight: 700; }

/* ---------- les gestes de géométrie simulés (gestes.js) : équerre, règle, quadrillage, angle droit ---------- */
.geste { display: grid; grid-template-columns: minmax(180px, 1fr) 3fr; gap: 10px 18px; align-items: start; }
.geste .g-feuille { grid-column: 2; grid-row: 1 / span 3; width: 100%; background: #fff; border: 1px solid var(--lisere); border-radius: 10px; touch-action: none; user-select: none; }
.geste .g-etapes { grid-column: 1; margin: 0; padding-left: 1.3em; font-size: .92rem; }
.geste .g-etapes li { padding: 4px 6px; border-radius: 8px; margin-bottom: 4px; color: var(--doux); }
.geste .g-etapes li.ici { background: #FFF6E5; color: var(--encre); font-weight: 700; }
.geste .g-etapes li.fait { color: var(--vert); }
.geste .g-etapes li.fait::after { content: " ✔"; }
.geste .g-commandes, .geste .g-sommets { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.geste .g-commandes button, .g-verif { min-height: 44px; min-width: 48px; border-radius: 10px; border: 2px solid var(--lisere); background: #fff; font-weight: 700; cursor: pointer; padding: 0 10px; }
.geste .g-commandes button:disabled { opacity: .4; cursor: default; }
.geste .g-tracer:not(:disabled) { background: var(--orange); border-color: var(--orange); color: #fff; }
.geste .g-message { grid-column: 1 / -1; margin: 0; min-height: 1.4em; font-weight: 700; color: var(--ko); }
.geste .g-message.bien { color: var(--vert); }
.geste .droite-d { stroke: var(--encre); stroke-width: 2.5; }
.geste .trace-ok { stroke: var(--vert); stroke-width: 3; }
.geste .pt { fill: var(--encre); }
.geste .nom-pt, .geste .nom-sommet { font: 700 18px Andika, Arial, sans-serif; fill: var(--encre); }
.geste .nom-sommet { dominant-baseline: middle; text-anchor: middle; }
.geste .carreau { stroke: #DCE3EA; stroke-width: 1; }
.geste .escalier { fill: none; stroke: var(--orange); stroke-width: 3; stroke-dasharray: 6 4; }
.geste .nb-carreaux { font: 700 15px Andika, Arial, sans-serif; fill: var(--orange); }
.geste .equerre { fill: rgba(31, 111, 178, .18); stroke: var(--bleu); stroke-width: 2; }
.geste .equerre-creux { fill: #fff; fill-opacity: .55; stroke: var(--bleu); stroke-width: 1; }
.geste .g-equerre { cursor: grab; transition: transform .6s ease; }
.geste.g-equ .g-equerre { transition: none; }
.geste .g-equerre.colle .equerre { fill: rgba(30, 142, 62, .25); stroke: var(--vert); }
.geste .g-equerre.ecarte .equerre { fill: rgba(224, 102, 43, .22); stroke: var(--ko); }
.geste .coin-droit { fill: none; stroke: var(--bleu); stroke-width: 1.5; }
.geste .grad { stroke: var(--encre); stroke-width: 1; }
.geste .regle-g { fill: #FFF3C4; stroke: #B8962E; stroke-width: 1.5; }
.geste .figure { fill: #F5EEDD; stroke: var(--encre); stroke-width: 2.5; }
.geste .g-sommet { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 4px; border-radius: 10px; }
.geste .g-sommet.ok { outline: 3px solid var(--vert); } .geste .g-sommet.ko { outline: 3px solid var(--ko); }
.geste.ok .g-feuille { outline: 3px solid var(--vert); } .geste.ko .g-feuille { outline: 3px solid var(--ko); }
@media (max-width: 700px) { .geste { grid-template-columns: 1fr; } .geste .g-feuille, .geste .g-etapes, .geste .g-commandes, .geste .g-sommets { grid-column: 1; grid-row: auto; } }
.geste .g-etapes li { display: list-item; }
.geste .g-etapes li.fait::after { display: inline; }
.geste .g-commandes svg { width: 22px; height: 22px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
