/* Xaraclass : l'espace de révision (maths et français), du CM1 à la 6e.
   Une page de cahier Seyès (lignes bleues, marge rouge), polices système,
   aucune ressource externe ni style en ligne (CSP du site). */

/* Les lettres arabes, plus petites que les latines à taille égale, sont agrandies
   avec une police locale de l'appareil (aucune ressource externe). */
@font-face {
  font-family: "Arabe";
  src: local("Geeza Pro"), local("Noto Naskh Arabic"), local("Noto Sans Arabic"), local("Arial"), local("Tahoma");
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
  size-adjust: 135%;
}

:root {
  --papier: #f8faff;
  --ligne: #e1e8f6;
  --ligne-forte: #c7d5ef;
  --marge: #e47c84;
  --marge-texte: #b8404c;   /* la marge en TEXTE (la ligne reste --marge, décorative) : 5,2:1 sur --papier */
  --encre: #1f3d99;
  --texte: #1d2433;
  --doux: #5a6480;
  --carte: #ffffff;
  --bord: #d5dcec;
  --champ: #7d88a6;   /* bordure d'un champ de saisie : 3,4:1 sur --papier (WCAG 1.4.11) ; --bord reste pour les cartes */
  --ok: #15753f;
  --ok-fond: #e3f5ea;
  --faux: #b93a26;
  --faux-fond: #fbe7e3;
  --etoile: #946300;
  --etoile-fond: #fff4d6;
  --voile: rgba(29, 36, 51, .6);  /* fond assombri derrière la fenêtre de confirmation de l'admin */
  --rayon: 16px;
  --titre: "Arabe", "Comic Neue", "Chalkboard SE", "Segoe Print", "Trebuchet MS", system-ui, sans-serif;
  --corps: "Arabe", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --chiffres: "Arabe", ui-rounded, "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif;
  --maths: "Cambria Math", "STIX Two Math", "Latin Modern Math", "Noto Sans Math", math;   /* écriture mathématique (MathML) */
  --maths-interligne: 1.9;
  --maths-bloc: 1.2em;
  --maths-marge-bloc: 10px;
  --maths-barre: 0.07em;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  /* Les lettres arabes, plus petites que les latines à taille égale, sont agrandies
   avec une police locale de l'appareil (aucune ressource externe). */
@font-face {
  font-family: "Arabe";
  src: local("Geeza Pro"), local("Noto Naskh Arabic"), local("Noto Sans Arabic"), local("Arial"), local("Tahoma");
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
  size-adjust: 135%;
}

:root {
    --papier: #131826;
    --ligne: #1b2234;
    --ligne-forte: #253049;
    --marge: #a8545c;
    --marge-texte: #e0868e;
    --encre: #9fb9ff;
    --texte: #e7eaf2;
    --doux: #9aa3ba;
    --carte: #1b2132;
    --bord: #2c3550;
    --champ: #6b7694;
    --ok: #5fd393;
    --ok-fond: #163223;
    --faux: #ff8c78;
    --faux-fond: #3a1d19;
    --etoile: #ffc93d;
    --etoile-fond: #3a3014;
    --voile: rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--papier); }
body {
  margin: 0;
  color: var(--texte);
  font-family: var(--corps);
  font-size: 18px;
  line-height: 1.55;
  background:
    linear-gradient(90deg, transparent 22px, var(--marge) 22px 24px, transparent 24px),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--ligne-forte) 31px 32px),
    repeating-linear-gradient(to bottom, transparent 0 7px, var(--ligne) 7px 8px),
    var(--papier);
  min-height: 100vh;
}

a { color: var(--encre); }
:focus-visible { outline: 3px solid var(--etoile); outline-offset: 2px; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Barre du haut */
.barre { position: sticky; top: 0; z-index: 10; background: var(--carte); border-bottom: 1.5px solid var(--bord); }
.barre-dedans {
  max-width: 54rem; margin: 0 auto; min-height: 56px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(36px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.marque { font-family: var(--titre); font-weight: 700; font-size: 1.15rem; color: var(--encre); text-decoration: none; }
.barre-droite { display: flex; align-items: center; gap: 14px; }
.etoiles-total { font-family: var(--chiffres); font-weight: 700; color: var(--etoile); font-variant-numeric: tabular-nums; }
.lien-barre { font: inherit; font-size: .95rem; color: var(--doux); background: none; border: none; padding: 4px 0; cursor: pointer; text-decoration: underline; }

/* Page */
.page { max-width: 54rem; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right)) 80px max(36px, env(safe-area-inset-left)); }
h1 { font-family: var(--titre); color: var(--encre); font-size: clamp(2rem, 6vw, 2.7rem); line-height: 1.1; margin: 0 0 12px; text-wrap: balance; }
h2 { font-family: var(--titre); font-size: 1.45rem; margin: 32px 0 10px; line-height: 1.2; }
.surtitre { margin: 16px 0 0; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--marge-texte); font-weight: 700; }
.resume { color: var(--doux); margin: 0 0 18px; max-width: 38rem; }
.aide { color: var(--doux); margin: -4px 0 10px; font-size: .95rem; }
.chargement { color: var(--doux); }
.retour { display: inline-block; color: var(--doux); text-decoration: none; font-size: .95rem; padding: 4px 0; }
.retour:hover { color: var(--encre); }
.message { min-height: 1.5em; font-weight: 600; color: var(--faux); }
.message.ok { color: var(--ok); }

/* Boutons et champs */
.ligne { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bouton {
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--encre); color: var(--carte); border: 2px solid var(--encre);
  border-radius: 12px; padding: 9px 18px; display: inline-block; line-height: 1.3;
}
.bouton:hover { filter: brightness(1.08); }
.bouton:disabled { opacity: .5; cursor: default; }
.bouton.gros { font-size: 1.15rem; padding: 12px 24px; }
.bouton.secondaire { background: var(--carte); color: var(--encre); }
.bouton.danger { background: var(--carte); color: var(--faux); border-color: var(--faux); }
.lien { font: inherit; font-size: .92rem; background: none; border: none; color: var(--doux); text-decoration: underline; cursor: pointer; padding: 0; align-self: flex-start; }
input[type=text], input[type=password] {
  font: inherit; font-size: 1.1rem; padding: 9px 12px; min-width: 0; flex: 1 1 12rem;
  border: 2px solid var(--champ); border-radius: 12px; background: var(--papier); color: var(--texte);
}
input:focus { outline: 3px solid var(--encre); outline-offset: 1px; }

/* Connexion */
.connexion { max-width: 28rem; margin: 8vh 0 0; }
.connexion .aide { margin: 10px 0 6px; }   /* l'aide du code, sous le champ (la marge négative de .aide la collerait dessus) */
.exemple-code { white-space: nowrap; font-weight: 600; }   /* l'exemple ne se coupe jamais au tiret : le tiret doit rester visible */
/* Champ du code, « Entrer » et « Voir le code » : cibles tactiles de 48 px au moins (écran du code des élèves et connexion admin) */
.connexion input, .connexion .bouton, .admin-connexion input, .admin-connexion .bouton { min-height: 48px; }

/* Accueil */
.conseil {
  background: var(--etoile-fond); border: 2px solid var(--etoile); border-radius: var(--rayon);
  padding: 16px 18px; margin: 8px 0 8px; display: grid; gap: 6px; justify-items: start;
}
.conseil-titre { margin: 0; font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--etoile); }
.conseil-texte { margin: 0; font-size: 1.05rem; }
.onglets { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.onglet {
  font: inherit; font-family: var(--titre); font-weight: 700; font-size: 1.1rem; cursor: pointer;
  background: var(--carte); color: var(--encre); border: 2px solid var(--encre); border-radius: 999px; padding: 6px 18px;
}
a.onglet { text-decoration: none; display: inline-block; }
.onglet[aria-selected="true"] { background: var(--encre); color: var(--carte); }
.zone-reponse input.mot { flex: 1 1 16rem; width: 16rem; font-family: var(--corps); font-size: 1.3rem; }
.accents { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.accent {
  font: inherit; font-size: 1.1rem; min-width: 2.4rem; padding: 4px 8px; cursor: pointer;
  background: var(--papier); color: var(--encre); border: 1.5px solid var(--bord); border-radius: 8px;
}
.classe-actuelle { margin: -6px 0 12px; font-weight: 700; color: var(--marge-texte); }
.revisions { margin-top: 32px; border-top: 2px dashed var(--ligne-forte); padding-top: 4px; }
.revisions summary { cursor: pointer; font-family: var(--titre); font-weight: 700; font-size: 1.3rem; padding: 14px 0 6px; color: var(--doux); }
.revisions summary:hover { color: var(--encre); }
.revisions h3 { font-family: var(--titre); font-size: 1.1rem; color: var(--doux); margin: 18px 0 8px; }
select {
  font: inherit; font-size: 1.05rem; padding: 9px 12px;
  border: 2px solid var(--champ); border-radius: 12px; background: var(--papier); color: var(--texte);
}
.chapitres { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 12px; }
.chapitre {
  display: grid; gap: 6px; align-content: start; padding: 14px 16px; min-width: 0;
  background: var(--carte); border: 1.5px solid var(--bord); border-radius: var(--rayon);
  color: var(--texte); text-decoration: none;
}
.chapitre:hover { border-color: var(--encre); }
.chapitre-titre { font-family: var(--titre); font-weight: 700; font-size: 1.15rem; color: var(--encre); line-height: 1.25; }
.chapitre-resume { font-size: .92rem; color: var(--doux); line-height: 1.4; }
.chapitre-bas { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.niveau { display: inline-flex; gap: 4px; align-items: center; font-size: .82rem; color: var(--doux); }
.niveau i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--encre); display: inline-block; }
.niveau i.plein { background: var(--encre); }
.etoiles { font-family: var(--chiffres); font-weight: 700; color: var(--etoile); font-size: .95rem; font-variant-numeric: tabular-nums; }

/* Leçon */
.actions-chapitre { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.niveau-texte { color: var(--doux); font-size: .95rem; }
.lecon { background: var(--carte); border: 1.5px solid var(--bord); border-radius: var(--rayon); padding: 4px 20px 18px; margin-top: 18px; }
.lecon h2 { font-size: 1.25rem; color: var(--marge-texte); margin: 18px 0 8px; }
.lecon ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.exemple-question { font-weight: 700; margin: 0 0 6px; }
.etapes { margin: 0; padding-left: 1.4em; font-family: var(--chiffres); display: grid; gap: 4px; }

/* Maîtresse virtuelle : boutons « Écouter » */
.ecouter {
  font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  background: var(--etoile-fond); color: var(--texte); border: 2px solid var(--etoile);
  border-radius: 999px; padding: 6px 14px; line-height: 1.2;
}
.ecouter:hover { filter: brightness(1.04); }
.ecouter.petit { font-size: .8rem; padding: 2px 10px; margin-left: 6px; vertical-align: middle; font-family: var(--corps); }
.ecouter.en-cours { background: var(--encre); color: var(--carte); border-color: var(--encre); }   /* contraste fort, thème clair et sombre */
/* Lecture refusée par le navigateur (pas de toucher avant) : le bouton « Écouter » se voit et se touche facilement */
.ecouter.a-toucher, .ligne-question .ecouter.a-toucher { font-size: 1.15rem; padding: 12px 22px; min-height: 56px; background: var(--encre); color: var(--carte); border-color: var(--encre); }
.ecouter.a-toucher:not(.petit)::after { content: " Écouter"; }
.ecouter.petit.a-toucher { margin-left: 0; }
.arabe {
  margin: 0; text-align: center; font-family: "Arabe", system-ui, sans-serif; font-size: clamp(3rem, 14vw, 4.5rem);
  line-height: 1.6; color: var(--encre); background: var(--papier); border-radius: 12px; padding: 4px 12px;
}
.option { unicode-bidi: plaintext; }
.enonce-ligne { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.bulle .ecouter { display: block; margin-top: 6px; }

/* Nouvelles questions (parent) */
.questions-ia { display: grid; gap: 10px; margin-top: 10px; }
.question-ia { background: var(--carte); border: 1.5px solid var(--bord); border-radius: 12px; padding: 10px 14px; display: grid; gap: 4px; }
.question-ia .meta { font-size: .8rem; color: var(--doux); }
.question-ia .bonne-reponse { color: var(--ok); font-weight: 700; }
.question-ia .mauvaise-reponse { color: var(--faux); }
.bouton.petit { font-size: .85rem; padding: 4px 10px; }

/* Devoirs en photo */
.devoirs { display: grid; gap: 14px; margin-top: 12px; }
.devoir { background: var(--carte); border: 1.5px solid var(--bord); border-radius: var(--rayon); padding: 14px 16px; display: grid; gap: 10px; }
.devoir-entete { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--doux); font-size: .9rem; }
.devoir-photo { max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; border: 1px solid var(--bord); justify-self: start; }
.devoir h3 { margin: 4px 0 0; font-family: var(--titre); font-size: 1.05rem; color: var(--encre); }
.devoir p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.devoir .explication { background: var(--etoile-fond); border-radius: 10px; padding: 10px 12px; }
.devoir .solution { background: var(--ok-fond); border: 1.5px dashed var(--ok); border-radius: 10px; padding: 10px 12px; }
.devoir .explication, .devoir .solution { line-height: 1.6; }
.devoir .verrou { color: var(--doux); font-style: italic; }
label.bouton { cursor: pointer; }

/* Coran */
.sourate-arabe { margin: -6px 0 6px; font-family: "Arabe", system-ui, sans-serif; font-size: 1.8rem; color: var(--doux); }
.reglages-coran { margin-bottom: 10px; }
.case { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.versets { display: grid; gap: 10px; }
.verset { background: var(--carte); border: 1.5px solid var(--bord); border-radius: var(--rayon); padding: 12px 16px; display: grid; gap: 6px; }
.verset.appris { border-color: var(--ok); }
.verset.focus { border: 2px solid var(--etoile); }
.verset-arabe { margin: 0; font-family: "Arabe", system-ui, sans-serif; font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 2.1; text-align: right; }
.verset-arabe.cache { filter: blur(9px); user-select: none; }
.verset-fr { margin: 0; color: var(--doux); font-size: .95rem; }
.verset-bas { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.numero-verset { font-family: var(--chiffres); font-weight: 700; color: var(--encre); background: var(--papier); border-radius: 99px; padding: 0 10px; }
.professeur, .quiz-coran { margin-top: 22px; background: var(--etoile-fond); border: 2px solid var(--etoile); border-radius: var(--rayon); padding: 4px 16px 16px; display: grid; gap: 10px; }
.professeur h2, .quiz-coran h2 { margin: 12px 0 0; }
.prof-consigne { margin: 0; font-weight: 600; }
.etapes-prof { display: flex; flex-wrap: wrap; gap: 8px; }
.sources { margin-top: 24px; font-size: .82rem; }
.options-versets { display: grid; gap: 8px; }
.option-verset { font: inherit; text-align: right; cursor: pointer; background: var(--carte); border: 2px solid var(--bord); border-radius: 12px; padding: 8px 12px; }
.option-verset .verset-arabe { font-size: 1.5rem; line-height: 1.9; }
.option-verset.bonne { border-color: var(--ok); }
.option-verset.fausse { border-color: var(--faux); opacity: .6; }

/* Cours de la maîtresse (sous-titres) */
.cours { margin-top: 14px; background: var(--carte); border: 2px solid var(--etoile); border-radius: var(--rayon); padding: 10px 18px; }
.cours p { margin: 8px 0; color: var(--doux); transition: color .2s; }
.cours p.en-cours { color: var(--texte); font-weight: 600; }
.cours .cours-titre { font-family: var(--titre); font-weight: 700; color: var(--etoile); }
.cours .cours-attente { font-style: italic; }
#micro.en-cours { background: var(--faux); border-color: var(--faux); color: var(--carte); }

/* Tuteur */
.tuteur { margin-top: 28px; }
.tuteur-intro { color: var(--doux); margin: -4px 0 12px; }
.fil { display: grid; gap: 10px; margin-bottom: 12px; }
.bulle { max-width: 36rem; padding: 10px 14px; border-radius: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.bulle.eleve { justify-self: end; background: var(--encre); color: var(--carte); border-bottom-right-radius: 4px; }
.bulle.ia { justify-self: start; background: var(--carte); border: 1.5px solid var(--bord); border-bottom-left-radius: 4px; }
.bulle.attente { color: var(--doux); font-style: italic; }
.bulle.erreur { color: var(--faux); border-color: var(--faux); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.suggestion { font: inherit; font-size: .9rem; cursor: pointer; background: var(--carte); color: var(--encre); border: 1.5px dashed var(--encre); border-radius: 999px; padding: 5px 12px; }

/* Exercices */
.entete-ex { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.compteur { font-family: var(--chiffres); font-weight: 700; color: var(--doux); font-variant-numeric: tabular-nums; }
.piste { height: 12px; background: var(--ligne-forte); border-radius: 99px; overflow: hidden; margin: 10px 0 18px; }
.piste-remplie { height: 100%; width: 0; background: var(--etoile); border-radius: 99px; transition: width .4s; }
.carte { background: var(--carte); border: 2px solid var(--bord); border-radius: var(--rayon); padding: 20px; display: grid; gap: 14px; }
.carte.juste { border-color: var(--ok); }
.enonce { margin: 0; font-size: 1.15rem; font-weight: 600; white-space: pre-line; unicode-bidi: plaintext; }  /* un texte arabe : une phrase par ligne */
.enonce.grand { font-family: var(--chiffres); font-size: clamp(2rem, 8vw, 2.8rem); color: var(--encre); font-weight: 700; }
.zone-reponse { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.zone-reponse input { font-family: var(--chiffres); font-size: 1.5rem; font-weight: 700; color: var(--encre); flex: 0 1 9rem; width: 9rem; font-variant-numeric: tabular-nums; }
.zone-reponse input.petit { flex-basis: 4.5rem; width: 4.5rem; text-align: center; }
.zone-reponse input:disabled { border-color: var(--ok); color: var(--ok); opacity: 1; }
.zone-reponse.rate input:disabled { border-color: var(--faux); color: var(--faux); text-decoration: line-through; }
.unite { font-weight: 700; color: var(--doux); }
.champ { display: inline-flex; align-items: center; gap: 6px; }
.options { display: flex; flex-wrap: wrap; gap: 10px; }
.option { font-family: var(--chiffres); font-size: 1.3rem; font-weight: 700; cursor: pointer; background: var(--carte); color: var(--encre); border: 2px solid var(--encre); border-radius: 12px; padding: 8px 18px; }
.option:disabled { opacity: .45; cursor: default; }
.option.bonne { border-color: var(--ok); color: var(--ok); opacity: 1; }
.indice { margin: 0; padding: 10px 12px; background: var(--etoile-fond); border-radius: 10px; }
.retour-reponse { margin: 0; min-height: 1.5em; font-weight: 700; }
.retour-reponse.ok { color: var(--ok); }
.retour-reponse.faux { color: var(--faux); }
.correction, .autrement { border: 1.5px dashed var(--ok); border-radius: 12px; padding: 10px 14px; background: var(--ok-fond); }
.autrement { border-color: var(--encre); background: var(--papier); }
.correction-titre { margin: 0 0 4px; font-family: var(--titre); font-weight: 700; color: var(--ok); }
.autrement .correction-titre { color: var(--encre); }
.correction-texte { margin: 0; white-space: pre-line; font-family: var(--chiffres); overflow-wrap: anywhere; }
.boutons-suite { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.fin { background: var(--carte); border: 2px solid var(--etoile); border-radius: var(--rayon); padding: 6px 20px 20px; }
.fin h2 { color: var(--etoile); font-size: 1.9rem; }
.secoue { animation: secoue .35s; }
@keyframes secoue { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Suivi */
.activite { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 120px; padding-top: 18px; }
.jour { display: grid; grid-template-rows: 1fr auto; gap: 4px; height: 100%; min-width: 0; text-align: center; }
.jour-barre { align-self: end; background: var(--encre); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.jour-barre.vide { background: var(--ligne-forte); }
.jour-nombre { position: absolute; top: -18px; left: 0; right: 0; font-size: .72rem; color: var(--doux); font-variant-numeric: tabular-nums; }
.jour-nom { font-size: .7rem; color: var(--doux); }
.tableau-defile { overflow-x: auto; background: var(--carte); border: 1.5px solid var(--bord); border-radius: var(--rayon); }
.tableau { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 42rem; }
.tableau th, .tableau td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.tableau th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.tableau td.nombre { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pastille { display: inline-block; padding: 1px 8px; border-radius: 99px; font-weight: 700; font-size: .82rem; }
.pastille.bien { background: var(--ok-fond); color: var(--ok); }
.pastille.attention { background: var(--faux-fond); color: var(--faux); }
.pastille.neutre { background: var(--ligne); color: var(--doux); }
.rates { margin: 0; padding-left: 1em; color: var(--doux); }
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.questions li { background: var(--carte); border: 1.5px solid var(--bord); border-radius: 10px; padding: 8px 12px; overflow-wrap: anywhere; }
.questions li.bloquee { border-color: var(--faux); background: var(--faux-fond); }
.questions .meta { display: block; font-size: .8rem; color: var(--doux); }

@media (max-width: 480px) {
  body { font-size: 17px; background-position: -10px 0, 0 0, 0 0, 0 0; }
  .page, .barre-dedans { padding-left: max(28px, env(safe-area-inset-left)); }
  .carte { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .secoue { animation: none; }
  .piste-remplie { transition: none; }
}

/* Enfant suivi (parent de plusieurs enfants) et avis */
.choix-enfant { padding: 4px 8px; font-size: 0.9rem; max-width: 11rem; }
.avis { display: grid; gap: 8px; max-width: 36rem; }
.avis label:not(.case), .avis legend { font-weight: 600; margin-top: 8px; }
.avis fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.avis textarea { font: inherit; padding: 8px; border-radius: 8px; border: 1px solid currentColor; background: transparent; color: inherit; }
.avis .bouton { justify-self: start; margin-top: 8px; }

/* Mode jeune lecteur (CE1) : plus gros, plus aéré, des cibles faciles à toucher */
.jeune-lecteur .enonce { font-size: 1.45rem; line-height: 1.5; }
.jeune-lecteur .enonce.grand { font-size: clamp(2.4rem, 10vw, 3.2rem); }
.jeune-lecteur .option { font-size: 1.5rem; padding: 14px 22px; min-width: 4.5rem; }
.jeune-lecteur #ecouter-enonce { font-size: 1.6rem; padding: 8px 14px; }
.jeune-lecteur .lecon, .jeune-lecteur .retour-reponse, .jeune-lecteur .correction { font-size: 1.15rem; line-height: 1.6; }
.jeune-lecteur .champ input { font-size: 1.6rem; }

/* L'enseignant animé : en bas à droite, au-dessus du contenu ; on le touche pour réécouter */
.enseignant { position: fixed; right: 12px; bottom: 12px; z-index: 20; width: 92px; height: 100px; padding: 4px;
  border-radius: 24px; border: 2px solid var(--bord); background: var(--carte); box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  cursor: pointer; transition: box-shadow .2s, transform .2s; }
.enseignant:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
.enseignant-svg { width: 100%; height: 100%; display: block; }
.enseignant-parle .enseignant { box-shadow: 0 0 0 4px rgba(224, 161, 0, .45), 0 6px 18px rgba(0, 0, 0, .15); transform: translateY(-2px); }
.jeune-lecteur .enseignant { width: 120px; height: 130px; }
.avec-enseignant .page { padding-bottom: 150px; }
/* Sur un petit écran, l'enseignant est plus petit et le texte de la leçon s'arrête avant lui : il ne masque jamais un mot. */
@media (max-width: 560px) {
  .enseignant { width: 64px; height: 70px; right: 8px; bottom: 8px; border-radius: 18px; }
  .avec-enseignant .lecon { padding-right: 64px; }
}
.enseignant-corps { animation: respire 4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.enseignant-yeux { animation: cligne 4.5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes respire { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes cligne { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@media (prefers-reduced-motion: reduce) { .enseignant-corps, .enseignant-yeux { animation: none; } }
.apercu-avatar { width: 64px; height: 70px; }
.apercu-avatar svg { width: 100%; height: 100%; }

/* Correction de la récitation : vert juste, orange presque, rouge oublié */
.correction-recitation { margin: 12px 0; padding: 12px 14px; border-radius: var(--rayon); border: 1.5px dashed var(--bord); background: var(--carte); }
.correction-message { font-weight: 700; margin: 0 0 6px; }
.correction-mots { margin: 6px 0; }
.mot-juste { color: var(--ok); }
.mot-proche { color: var(--etoile); text-decoration: underline wavy; }
.mot-manquant { color: var(--faux); text-decoration: underline; }

/* Tajwîd : une couleur par famille de règles, comme dans les mushafs tajwîd */
:root {
  --tj-nez: #12804a;
  --tj-cache: #0f7c8c;
  --tj-rebond: #1d5fd0;
  --tj-madd6: #9e1030;
  --tj-madd4: #d6402a;
  --tj-arret: #b26a00;
  --tj-muet: #8a91a3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --tj-nez: #5fd393;
    --tj-cache: #4fd0e0;
    --tj-rebond: #7fb0ff;
    --tj-madd6: #ff7a9a;
    --tj-madd4: #ff9a7a;
    --tj-arret: #f5b94a;
    --tj-muet: #8e96ab;
  }
}
.tj { cursor: pointer; border-radius: 4px; }
.tj:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.tj.choisi { background: color-mix(in srgb, currentColor 16%, transparent); }
.tj-nez { color: var(--tj-nez); }
.tj-cache { color: var(--tj-cache); }
.tj-rebond { color: var(--tj-rebond); }
.tj-madd6 { color: var(--tj-madd6); }
.tj-madd4 { color: var(--tj-madd4); }
.tj-arret { color: var(--tj-arret); }
.tj-muet { color: var(--tj-muet); }
.pastille { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; background: currentColor; margin-inline-end: 6px; vertical-align: -0.05em; }
.legende-tajwid { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 10px; font-size: 0.92rem; }
.legende-tajwid .aide { flex-basis: 100%; margin: 0; }
.legende-item { display: inline-flex; align-items: center; color: var(--texte); }
.tajwid-info { margin: 8px 0 4px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--bord); background: var(--papier); }
.tajwid-info p { margin: 0; }
.tajwid-titre { font-weight: 700; margin-bottom: 4px !important; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.tajwid-arabe { font-family: "Arabe", system-ui, sans-serif; font-weight: 400; }
.prof-rappel { margin: 0 0 8px; color: var(--doux); font-size: 0.95rem; }
.prof-rappel:empty { display: none; }
.verif-tajwid { margin-top: 12px; padding-top: 10px; border-top: 1.5px dashed var(--bord); }
.liste-tajwid { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.liste-tajwid .case { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mot-tajwid { font-family: "Arabe", system-ui, sans-serif; font-size: 1.5rem; line-height: 1.5; }

/* Coran : série de jours, révisions du jour */
.coran-jour, .revision-sourate { margin: 10px 0 14px; padding: 12px 14px; border-radius: var(--rayon); border: 1.5px solid var(--etoile); background: var(--etoile-fond); }
.coran-jour p, .revision-sourate p { margin: 0 0 6px; }
.coran-jour-titre { font-family: var(--titre); font-weight: 700; font-size: 1.1rem; }
.coran-jour-sous-titre { font-weight: 700; }
.revisions-du-jour { flex-wrap: wrap; gap: 8px; }
.mot-non_recite { color: var(--doux); }
.revision-sourate .bouton.propose { outline: 3px solid var(--etoile); outline-offset: 2px; }
.revision-sourate .ligne { margin-bottom: 10px; }   /* « Réviser au micro » ne colle plus aux trois boutons de note */
.revision-sourate .ligne:last-child { margin-bottom: 0; }
.stats-coran { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 8px; }
.stats-coran .stat { background: var(--carte); border: 1.5px solid var(--bord); border-radius: 12px; padding: 8px; text-align: center; }
.stats-coran strong { display: block; font-size: 1.4rem; font-family: var(--chiffres); }
.stats-coran span { font-size: 0.8rem; color: var(--doux); }
.titre-section { grid-column: 1 / -1; font-size: 1.1rem; margin: 14px 0 2px; }

/* Espace admin : la liste des familles */
.admin-connexion { max-width: 26rem; }
.admin-connexion form { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-titre { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-titre h1 { margin: 0; }
.admin-totaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 10px; margin: 14px 0; }
.admin-totaux .stat { background: var(--carte); border: 1.5px solid var(--bord); border-radius: 12px; padding: 10px; }
.admin-totaux strong { display: block; font-size: 1.4rem; font-family: var(--chiffres); }
.admin-totaux span { font-size: .85rem; color: var(--doux); }
.admin-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 10px; }
.admin label { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.admin input:not([type=checkbox]), .admin select, .admin textarea { font: inherit; font-weight: 400; padding: 8px 10px; border: 1.5px solid var(--champ); border-radius: 10px; background: var(--carte); color: var(--texte); width: 100%; box-sizing: border-box; }
.admin fieldset { border: 1.5px solid var(--bord); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; }
.admin .case { display: inline-flex; font-weight: 400; margin-inline-end: 14px; }
.admin-ligne-enfant { display: grid; grid-template-columns: 1fr 9rem auto; gap: 8px; align-items: end; }
.admin-filtres { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; margin: 16px 0 8px; }
.admin-liste { display: grid; gap: 12px; }
.admin-famille { gap: 10px; }
.admin-famille-tete { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.admin-famille-tete h2 { margin: 0; font-size: 1.15rem; }
.admin-infos { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; color: var(--doux); margin: 0; }
.admin-infos a { color: var(--encre); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; border: 1.5px solid currentColor; }
.badge-test { color: var(--encre); }
.badge-a_relancer { color: var(--etoile); }
.badge-payant { color: var(--ok); }
.badge-arrete { color: var(--doux); }
.admin-enfants { margin: 0; padding-left: 1.2rem; display: grid; gap: 2px; font-size: .95rem; }
.admin-enfants .jamais { color: var(--faux); }
.admin-enfants .ancien { color: var(--etoile); }
.admin-notes { margin: 0; white-space: pre-line; font-size: .92rem; background: var(--papier); border-radius: 10px; padding: 8px 10px; }
.admin-edition { display: grid; gap: 10px; border-top: 1.5px dashed var(--bord); padding-top: 10px; }
.admin-codes pre { white-space: pre-wrap; font-family: var(--corps); background: var(--papier); border-radius: 10px; padding: 10px 12px; margin: 0; }
.admin-code { font-family: ui-monospace, monospace; font-weight: 700; }
/* Espace admin : les paiements d'une famille (maquette admin-paiements.md) : jamais de couleur seule, toujours un texte */
.paiements { display: grid; gap: 10px; }
.paiement-resume { margin: 0; }
.paiement-alerte { margin: 0; padding: 8px 10px; border: 2px solid var(--etoile); background: var(--etoile-fond); color: var(--texte); border-radius: 10px; font-weight: 600; }
.paiements-titre { margin: 6px 0 0; font-size: 1rem; }
.paiements-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.paiement-ligne, .paiement-vide { border: 1.5px solid var(--bord); border-radius: 12px; background: var(--carte); padding: 10px 12px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.paiement-vide { color: var(--doux); }
.paiement-tete, .paiement-detail { margin: 0; }
.paiement-detail { font-size: .9rem; color: var(--doux); }
.paiement-actions { display: grid; gap: 6px; justify-items: start; }
.paiement-form-mini { display: grid; gap: 8px; width: 100%; }
.paiement-form-mini .aide { margin: 0; }
.paiement-recap { margin: 0; padding: 10px 12px; border: 2px solid var(--encre); border-radius: 12px; background: var(--carte); font-weight: 600; }
.aide-champ { font-weight: 400; font-size: .85rem; color: var(--doux); }
@media (max-width: 40rem) {
  .admin-filtres { grid-template-columns: 1fr 1fr; }
  .admin-recherche { grid-column: 1 / -1; }
  .admin-ligne-enfant { grid-template-columns: 1fr 7rem auto; }
}
.admin-demandes { display: grid; gap: 12px; margin: 10px 0 18px; }
.admin-demandes > h2 { margin: 0; font-size: 1.15rem; }
.admin-demande { border-color: var(--etoile); }
.admin-demande .ligne input { flex: 1; min-width: 12rem; }
.admin-demande { overflow-wrap: anywhere; }  /* un prénom très long venu du formulaire public ne doit pas élargir la page */
/* Signalements d'une demande (jamais un blocage) : rouge « À vérifier », orange « Pour information » ; toujours un symbole et un texte */
.signalement { border: 1.5px solid var(--faux); background: var(--faux-fond); color: var(--texte); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.signalement.info { border-color: var(--etoile); background: var(--etoile-fond); }
.signalement-badge { justify-self: start; padding: 2px 10px; border-radius: 999px; border: 1.5px solid var(--faux); background: var(--carte); color: var(--faux); font-size: .85rem; font-weight: 700; }
.signalement.info .signalement-badge { border-color: var(--etoile); color: var(--texte); }
.signalement-liste { margin: 0; padding-left: 1.2rem; display: grid; gap: 2px; font-size: .95rem; overflow-wrap: anywhere; }
.admin-totaux .stat.a-verifier { border-color: var(--faux); background: var(--faux-fond); }
.admin-totaux .stat.a-verifier strong { color: var(--faux); }
.admin-totaux .stat.a-verifier span { color: var(--texte); }

/* Inscription directe : le contact de la famille en évidence (carte de demande, carte de famille, panneau des codes), jamais de couleur seule */
.contact-gros { border: 3px solid var(--encre); border-radius: 12px; background: var(--carte); padding: 12px 14px; display: grid; gap: 6px; }
.contact-gros-etiquette { font-size: .9rem; font-weight: 700; color: var(--doux); margin: 0; }
.contact-gros-valeur { font-family: var(--chiffres); font-size: 1.4rem; font-weight: 700; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.contact-gros-type { font-size: 1rem; font-weight: 700; color: var(--encre); }
.contact-gros-aide { font-size: .9rem; color: var(--doux); margin: 0; }
.contact-gros.manque, .contact-gros.suspect { border-color: var(--faux); background: var(--faux-fond); }
.contact-alerte { margin: 0; padding: 8px 10px; border: 2px solid var(--faux); background: var(--faux-fond); color: var(--texte); border-radius: 10px; font-weight: 600; }
.destinataire { border-width: 4px; }
.actions-envoi { display: grid; gap: 10px; margin-top: 4px; }
.actions-envoi .bouton { width: 100%; min-height: 52px; }
.copie-info { margin: 0; font-weight: 600; color: var(--ok); }
.badge-en-ligne { color: var(--ok); }
.badge-par-eleve { color: var(--encre); }
.contact-gros-eleve { margin: 0; padding: 8px 10px; border: 2px solid var(--etoile); background: var(--etoile-fond); color: var(--texte); border-radius: 10px; font-size: .92rem; font-weight: 600; }
.admin-signalement-recent { margin: 0; }
.admin-codes-courts { margin: 12px 0; }   /* encadré « anciens codes courts » : le composant .signalement.info existant */
.admin-codes-courts .aide { margin: 0; }
.admin-codes-courts .codes-courts-texte { margin: 0; font-weight: 700; }
.admin-codes-courts .bouton { justify-self: start; min-height: 48px; }

/* Espace admin : supprimer une famille, un enfant, un parent supplémentaire ou une demande (maquette admin-suppression.html) */
/* Message après une suppression (sous le titre de la liste) */
.message-suppression { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--ok); background: var(--ok-fond); color: var(--texte); font-weight: 600; }
.message-suppression.info { border-color: var(--etoile); background: var(--etoile-fond); }

/* Zone « Supprimer » dans le panneau « Gérer » : fermée par défaut, séparée des actions courantes */
.zone-suppression { margin-top: 14px; border: 2px dashed var(--faux); border-radius: 12px; padding: 0 14px 14px; background: var(--carte); }
.zone-suppression > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; cursor: pointer; font-weight: 700; color: var(--faux); }
.zone-suppression[open] > summary { border-bottom: 1.5px dashed var(--bord); margin-bottom: 8px; }
.zone-suppression .aide { margin: 0 0 6px; }
.suppr-liste { list-style: none; margin: 0; padding: 0; }
.suppr-liste li { display: flex; justify-content: space-between; align-items: center; gap: 4px 14px; flex-wrap: wrap; min-height: 56px; padding: 4px 0; border-bottom: 1px solid var(--bord); }
.suppr-qui { display: grid; overflow-wrap: anywhere; }
.suppr-detail { font-size: .88rem; color: var(--doux); }
.lien-supprimer { font: inherit; font-weight: 600; color: var(--faux); background: none; border: none; text-decoration: underline; cursor: pointer;
  min-height: 48px; padding: 0 8px; text-align: start; }
.suppr-famille { display: grid; gap: 8px; justify-items: start; margin-top: 14px; }
.suppr-famille .aide { margin: 0; }
.suppr-famille .bouton { min-height: 48px; }
.admin-demande .suppr-demande { margin-inline-start: auto; min-height: 48px; }  /* séparé de « Refuser » */

/* La fenêtre de confirmation : dialog.suppression, ouvert par showModal() (piège de focus, Échap et fond inerte viennent du navigateur) */
dialog.suppression { width: min(34rem, calc(100% - 24px)); max-height: calc(100% - 24px); overflow-y: auto; margin: auto; padding: 18px 18px 20px;
  border: 3px solid var(--faux); border-radius: var(--rayon); background: var(--carte); color: var(--texte); }
dialog.suppression[open] { display: grid; gap: 12px; }
dialog.suppression::backdrop { background: var(--voile); }
html:has(dialog[open]) { overflow: hidden; }  /* la page derrière ne défile pas */
.suppression-titre { font-size: 1.4rem; margin: 0; overflow-wrap: anywhere; }
.suppression-sous-titre { margin: 0; font-size: 1rem; color: var(--doux); }
.suppression-quoi { margin: 0; padding-left: 1.3rem; display: grid; gap: 4px; overflow-wrap: anywhere; }
.suppression-reperes { margin: 0; font-size: .95rem; color: var(--doux); overflow-wrap: anywhere; }
.suppression-alerte { margin: 0; padding: 10px 12px; border: 2px solid var(--faux); background: var(--faux-fond); border-radius: 12px; }
.suppression-rattrapage { margin: 0; font-size: .95rem; }
.suppression-texte { margin: 0; overflow-wrap: anywhere; }
dialog.suppression .aide { margin: 0; }
.suppression-saisie { display: grid; gap: 8px; }
dialog.suppression .suppression-saisie label { font-size: 1rem; font-weight: 600; display: grid; gap: 6px; }
.suppression-nom { display: block; padding: 8px 12px; background: var(--papier); border: 2px solid var(--bord); border-radius: 12px; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
dialog.suppression .suppression-saisie input { font: inherit; font-size: 1.15rem; font-weight: 400; min-height: 52px; padding: 8px 12px; width: 100%;
  border: 2px solid var(--bord); border-radius: 12px; background: var(--papier); color: var(--texte); }
dialog.suppression .suppression-saisie input.exact { border-color: var(--ok); }
.suppression-etat { margin: 0; min-height: 1.5em; font-size: .95rem; color: var(--doux); }
.suppression-etat.exact { color: var(--ok); font-weight: 700; }
.suppression-message { margin: 0; padding: 10px 12px; border: 2px solid var(--faux); background: var(--faux-fond); border-radius: 12px; font-weight: 600; overflow-wrap: anywhere; }
dialog.suppression [hidden] { display: none !important; }  /* « hidden » doit gagner sur les display: grid et inline-block des classes */
.suppression-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.suppression-actions .bouton { min-height: 52px; flex: 0 1 auto; }
.bouton.supprimer { background: var(--faux); border-color: var(--faux); color: var(--carte); }
/* grisé = pointillés, pas seulement pâle */
.bouton.supprimer:disabled { background: var(--carte); color: var(--doux); border: 2px dashed var(--doux); cursor: not-allowed; filter: none; opacity: 1; }
@media (max-width: 560px) {
  .suppression-actions { flex-direction: column; }
  .suppression-actions .bouton { width: 100%; }
}

/* Fin de l'essai gratuit */
.bandeau-acces { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--rayon); border: 1.5px solid var(--etoile); background: var(--etoile-fond); line-height: 1.5; }
.bandeau-acces.restreint { border-color: var(--faux); background: var(--faux-fond); }
.bandeau-acces a { color: var(--encre); font-weight: 700; }
.bandeau-acces a.bouton:not(.secondaire) { color: var(--carte); }   /* le bouton garde le texte de ses couleurs (sinon : texte de la couleur du fond) */

/* Démo de l'espace enseignant (classe fictive) */
.badge-demo { color: var(--etoile); }
.demo-avertissement { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; border: 1.5px dashed var(--etoile); background: var(--etoile-fond); font-size: .92rem; }
.demo-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 10px; margin: 14px 0 16px; }
.demo-chiffres .stat { background: var(--carte); border: 1.5px solid var(--bord); border-radius: 12px; padding: 10px; }
.demo-chiffres strong { display: block; font-size: 1.35rem; font-family: var(--chiffres); }
.demo-chiffres span { font-size: .85rem; color: var(--doux); }
.demo .carte { margin-bottom: 16px; }
.demo .carte h2 { margin: 0; font-size: 1.15rem; }
.demo-barres { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.demo-barres li { display: grid; grid-template-columns: minmax(0, 1fr) 5rem; grid-template-areas: "libelle valeur" "jauge jauge"; gap: 4px 10px; align-items: center; }
.demo-libelle { grid-area: libelle; font-size: .95rem; }
.demo-valeur { grid-area: valeur; text-align: right; font-family: var(--chiffres); font-weight: 700; }
.demo-jauge { grid-area: jauge; height: 10px; border-radius: 999px; background: var(--ligne-forte, var(--bord)); overflow: hidden; }
.demo-rempli { display: block; height: 100%; border-radius: 999px; background: var(--ok); }
.demo-rempli.demo-moyen { background: var(--etoile); }
.demo-rempli.demo-faible { background: var(--faux); }
.demo-r-22 { width: 22%; } .demo-r-44 { width: 44%; } .demo-r-48 { width: 48%; } .demo-r-61 { width: 61%; }
.demo-r-66 { width: 66%; } .demo-r-72 { width: 72%; } .demo-r-84 { width: 84%; } .demo-r-89 { width: 89%; }
.demo-inactif { opacity: .6; cursor: default; }
.demo-tableau { overflow-x: auto; }
.demo-tableau table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 38rem; }
.demo-tableau th, .demo-tableau td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bord); vertical-align: top; }
.demo-tableau th { font-size: .82rem; color: var(--doux); font-weight: 700; }
.demo-suite { color: var(--doux); font-style: italic; }
.demo-alerte { color: var(--etoile); font-weight: 700; }
.demo-alerte.demo-rouge { color: var(--faux); }
.demo-offre ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; }

/* Passage de classe automatique (mi-juillet) */
.annonce-passage { margin: 6px 0 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--ok); background: var(--ok-fond); }
.annonce-passage p { margin: 0 0 8px; }
/* Démo : une classe à la fois, onglets sans script (lien vers la classe, :target) */
.demo-onglets { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.demo-onglet { padding: 8px 14px; border-radius: 999px; border: 2px solid var(--encre); color: var(--encre); background: var(--carte); text-decoration: none; font-weight: 700; font-size: .92rem; }
.demo-classe { display: none; scroll-margin-top: 70px; }
.demo-classe:target { display: block; }
.demo-classes:not(:has(:target)) #classe-ce2 { display: block; }
.demo-onglet.actif { background: var(--encre); color: var(--carte); }
.demo-classe h1 { margin-top: 0; }

/* Courbes des devoirs de lycée : couleurs des variables du thème (clair et sombre), rien en ligne. */
.courbe { margin: 8px 0 12px; }
.courbe-svg { display: block; width: 100%; height: auto; }
.courbe-fond { fill: var(--carte); stroke: var(--bord); stroke-width: 1; }
.courbe-grille { stroke: var(--ligne); stroke-width: 1; }
.courbe-axe { stroke: var(--texte); stroke-width: 1.4; }
.courbe-fleche { fill: var(--texte); }
.courbe-texte { fill: var(--doux); font-size: 9px; font-family: var(--corps); }
.courbe-titre { fill: var(--texte); font-size: 12px; font-weight: 700; font-family: var(--titre); }
.courbe-etiquette { fill: var(--texte); font-size: 9px; font-weight: 700; font-family: var(--corps); }
.courbe-trace { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.courbe-trace-0 { stroke: var(--encre); }
.courbe-trace-1 { stroke: var(--faux); }
.courbe-trace-2 { stroke: var(--ok); }
.courbe-point { fill: var(--etoile); stroke: var(--texte); stroke-width: 1; }
.courbe-asymptote { stroke: var(--doux); stroke-width: 1.2; stroke-dasharray: 5 4; }
.courbe-legende { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.9rem; overflow-wrap: anywhere; }
.courbe-legende li { display: flex; align-items: center; gap: 6px; }
.courbe-pastille { display: inline-block; width: 18px; height: 4px; border-radius: 2px; background: currentColor; flex: none; }
.courbe-pastille.courbe-trace-0 { color: var(--encre); }
.courbe-pastille.courbe-trace-1 { color: var(--faux); }
.courbe-pastille.courbe-trace-2 { color: var(--ok); }

/* Exercices sur plusieurs leçons et exercices type examen : composants de docs/design/tokens.md, maquette probleme-v1.html.
   Aucune couleur en dur : uniquement les variables ci-dessus (clair et sombre). Aucun style en ligne. */
.piste-remplie.w0 { width: 0; } .piste-remplie.w10 { width: 10%; } .piste-remplie.w20 { width: 20%; }
.piste-remplie.w30 { width: 30%; } .piste-remplie.w40 { width: 40%; } .piste-remplie.w50 { width: 50%; }
.piste-remplie.w60 { width: 60%; } .piste-remplie.w70 { width: 70%; } .piste-remplie.w80 { width: 80%; }
.piste-remplie.w90 { width: 90%; } .piste-remplie.w100 { width: 100%; }
.retour.grand { display: inline-flex; align-items: center; min-height: 48px; font-size: 1rem; }
.bouton.pleine { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; }
.carte.rate { border-color: var(--faux); }

/* Liste */
.liste-problemes { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.carte-probleme { display: grid; gap: 10px; padding: 16px; background: var(--carte); border: 2px solid var(--bord); border-radius: var(--rayon);
  color: var(--texte); text-decoration: none; min-height: 48px; }
.carte-probleme.en-cours { border-color: var(--encre); }
.carte-probleme-titre { font-family: var(--titre); font-weight: 700; font-size: 1.2rem; color: var(--encre); line-height: 1.25; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.etiquette { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--ligne);
  color: var(--texte); border: 1.5px solid var(--bord); }
.carte-probleme-bas { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.duree { font-size: .95rem; color: var(--doux); }
.etat-probleme { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .88rem; font-weight: 700; border: 1.5px solid currentColor; }
.etat-probleme.neuf { color: var(--doux); }
.etat-probleme.cours { color: var(--encre); }
.etat-probleme.reussi { color: var(--ok); }
.etat-probleme.termine { color: var(--texte); }
.action-carte { font-weight: 700; color: var(--encre); }
.note-liste { margin: 18px 0 0; color: var(--doux); text-align: center; }
.acces-problemes { margin: 0 0 18px; }

/* Rappel sous une carte d'exercice : les leçons de l'année à revoir avant (ne bloque rien ; la carte reste un lien). */
.rappel-bloc { display: grid; gap: 10px; margin: 10px 0 0; }
.rappel-intro { margin: 0; font-weight: 700; color: var(--texte); }
.rappel-chapitres { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rappel-lien { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 14px;
  background: var(--carte); color: var(--encre); border: 2px solid var(--encre); border-radius: 12px; font-weight: 700; line-height: 1.3;
  text-decoration: none; }
.rappel-lien:hover { background: var(--ligne); }
.rappel-texte { display: grid; gap: 2px; min-height: 48px; padding: 8px 14px; border: 2px dashed var(--bord); border-radius: 12px;
  color: var(--texte); font-weight: 700; line-height: 1.3; }
.rappel-texte small { font-weight: 400; font-size: .9rem; color: var(--doux); }
@media (min-width: 561px) {
  .rappel-chapitres { display: flex; flex-wrap: wrap; }
  .rappel-lien, .rappel-texte { max-width: 100%; }
}

/* En-tête, progression par question */
.sous-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pastilles-q { display: flex; gap: 6px; margin: 4px 0 10px; padding: 0; list-style: none; }
.pastille-q { flex: 1 1 0; min-width: 0; height: 36px; display: flex; align-items: center; justify-content: center; gap: 2px;
  border-radius: 999px; border: 2px solid var(--bord); background: var(--carte); color: var(--doux);
  font-family: var(--chiffres); font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.pastille-q.courante { border-color: var(--encre); color: var(--encre); border-width: 3px; }
.pastille-q.juste { border-color: var(--ok); color: var(--ok); background: var(--ok-fond); }
.pastille-q.fausse { border-color: var(--faux); color: var(--faux); background: var(--faux-fond); }

/* Énoncé commun : collant sous la barre, repliable */
.enonce-commun { position: sticky; top: 56px; z-index: 5; background: var(--carte); border: 2px solid var(--encre); border-radius: var(--rayon); margin-bottom: 14px; }
.enonce-commun.rappel { position: static; }
.enonce-bascule { font: inherit; width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-align: left; background: none; border: none; color: var(--texte); padding: 6px 14px; cursor: pointer; }
.enonce-resume { font-family: var(--chiffres); font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.enonce-resume small { display: block; font-family: var(--corps); font-weight: 600; font-size: .8rem; color: var(--doux); letter-spacing: .05em; text-transform: uppercase; }
.enonce-fleche { color: var(--encre); font-weight: 700; white-space: nowrap; font-size: .95rem; }
.enonce-corps { max-height: 45vh; max-height: min(45vh, 340px); overflow-y: auto; display: grid; gap: 10px; border-top: 1.5px dashed var(--bord);
  padding: 10px 14px 14px; }
.enonce-commun.rappel .enonce-corps { max-height: none; border-top: 0; }
.enonce-texte { margin: 0; font-size: 1.15rem; font-weight: 600; white-space: pre-line; }  /* un poème : un vers par ligne */
/* Dossier de littérature : le texte entier, sans défilement interne ni collant (un poème haut cacherait les questions) */
.enonce-commun.dossier { position: static; }
.enonce-commun.dossier .enonce-corps { max-height: none; overflow: visible; }
.strophe { display: grid; gap: 2px; }
.vers { margin: 0; padding-left: 2em; text-indent: -2em; font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }   /* retrait suspendu */
.source-texte { margin: 0; text-align: right; font-style: italic; font-size: .9rem; color: var(--doux); }
.donnees { margin: 0; padding-left: 1.2em; font-family: var(--chiffres); }
.fonction { font-family: var(--chiffres); font-size: 1.4rem; font-weight: 700; color: var(--encre); margin: 0; text-align: center; overflow-wrap: anywhere; }
.figure { margin: 0; }
.figure figcaption { font-size: .9rem; color: var(--doux); margin-top: 4px; }

/* Question */
.numero-question { display: inline-block; align-self: start; padding: 2px 12px; border-radius: 999px; background: var(--encre); color: var(--carte);
  font-family: var(--chiffres); font-weight: 700; font-size: 1.05rem; }
.ligne-question { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.ligne-question .ecouter { min-width: 48px; min-height: 48px; }
.question-texte { margin: 0; font-size: 1.35rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.question-texte:focus { outline: none; }

/* Réponse courte et clavier de symboles */
.champ-reponse { display: grid; gap: 8px; }
.champ-reponse label { font-weight: 700; }
.champ-reponse input { font-family: var(--chiffres); font-size: 1.5rem; font-weight: 700; color: var(--encre); width: 100%; min-height: 56px; }
.champ-reponse input.invalide { border-color: var(--faux); }
.champ-reponse input:disabled { opacity: 1; }
.champ-reponse input.juste { border-color: var(--ok); color: var(--ok); }
.champ-reponse input.fausse { border-color: var(--faux); color: var(--faux); text-decoration: line-through; }
.champ-reponse .aide { margin: 0; }
.clavier-symboles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.touche { font-family: var(--chiffres); font-size: 1.4rem; font-weight: 700; min-height: 48px; width: 100%; cursor: pointer;
  background: var(--papier); color: var(--encre); border: 2px solid var(--bord); border-radius: 10px; }
.touche.effacer { font-size: 1rem; }
.message-saisie { margin: 0; min-height: 1.5em; font-weight: 700; color: var(--faux); }

/* Propositions à choisir */
.propositions { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.propositions legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.proposition { position: relative; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; cursor: pointer;
  background: var(--carte); border: 2px solid var(--bord); border-radius: 12px; font-family: var(--chiffres); font-size: 1.2rem; font-weight: 700;
  color: var(--texte); overflow-wrap: anywhere; }
div.proposition { cursor: default; }
.proposition input { position: absolute; opacity: 0; }
.proposition-lettre { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--encre); color: var(--encre); display: flex;
  align-items: center; justify-content: center; font-size: 1rem; }
.proposition:has(input:checked) { border-color: var(--encre); border-width: 3px; background: var(--ligne); }
.proposition:has(input:checked) .proposition-lettre { background: var(--encre); color: var(--carte); }
.proposition:has(input:focus-visible) { outline: 3px solid var(--etoile); outline-offset: 2px; }
.proposition.bonne { border-color: var(--ok); border-width: 3px; }
.proposition.choisie-fausse { border-color: var(--faux); border-width: 3px; }
.proposition-marque { display: block; font-family: var(--corps); font-size: .85rem; font-weight: 700; }
.proposition.bonne .proposition-marque { color: var(--ok); }
.proposition.choisie-fausse .proposition-marque { color: var(--faux); }

/* Après la validation */
.donnee-suite { margin: 0; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--etoile); background: var(--etoile-fond); font-weight: 600; }
.donnee-suite strong { font-family: var(--chiffres); font-size: 1.15rem; overflow-wrap: anywhere; }
.correction-etapes { margin: 0; padding-left: 1.5em; display: grid; gap: 6px; font-family: var(--chiffres); overflow-wrap: anywhere; }
.correction-conclusion { margin: 8px 0 0; font-family: var(--chiffres); font-weight: 700; overflow-wrap: anywhere; }
.actions-question { display: grid; gap: 10px; }
.actions-secondaires { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-secondaires .lien { min-height: 48px; padding: 0 4px; font-size: 1rem; align-self: auto; }
.attente { color: var(--doux); font-style: italic; margin: 0; }
.carte .retour-reponse { min-height: 0; }

/* Bilan */
.bilan { background: var(--carte); border: 2px solid var(--etoile); border-radius: var(--rayon); padding: 12px 16px 16px; display: grid; gap: 14px; }
.bilan h2 { color: var(--etoile); font-size: 1.7rem; margin: 8px 0 0; }
.bilan h2.sous-titre { color: var(--texte); font-size: 1.3rem; margin: 6px 0 0; }
.score-grand { font-family: var(--chiffres); font-size: 2.6rem; font-weight: 700; color: var(--encre); line-height: 1.1; margin: 0; }
.score-grand small { font-size: 1.1rem; color: var(--doux); font-weight: 600; }
.bilan .etoiles { font-size: 1.6rem; letter-spacing: .1em; margin: 0; }
.bilan p { margin: 0; }
.resultats-q { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.resultats-q li { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--bord); background: var(--papier); min-height: 44px; }
.resultats-q .num { font-family: var(--chiffres); font-weight: 700; min-width: 2.4em; }
.resultats-q .res { margin-left: auto; font-weight: 700; white-space: nowrap; }
.resultats-q .res.juste { color: var(--ok); }
.resultats-q .res.fausse { color: var(--faux); }
.a-revoir { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chapitre-a-revoir { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 8px 14px;
  border-radius: 12px; border: 2px solid var(--faux); background: var(--faux-fond); color: var(--texte); text-decoration: none; }
.chapitre-a-revoir strong { color: var(--encre); font-family: var(--titre); }
.chapitre-a-revoir small { display: block; color: var(--doux); }
.chapitre-a-revoir .revoir { white-space: nowrap; font-weight: 700; }
.correction-complete { display: grid; gap: 14px; }
.ta-reponse { margin: 0; font-family: var(--chiffres); overflow-wrap: anywhere; }

/* Chargement et erreurs */
.bandeau-etat { margin: 0; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--faux); background: var(--faux-fond); color: var(--texte); display: grid; gap: 8px; }
.bandeau-etat strong { color: var(--faux); }
.squelette { height: 18px; border-radius: 8px; background: var(--ligne-forte); margin: 8px 0; }
.squelette.l40 { width: 40%; } .squelette.l60 { width: 60%; } .squelette.l90 { width: 90%; }

@media (max-width: 480px) {
  .question-texte { font-size: 1.45rem; }
}
/* Bureau : l'énoncé à gauche, toujours déplié ; les questions à droite */
@media (min-width: 900px) {
  .page:has(.probleme-grille) { max-width: 72rem; }
  .probleme-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .probleme-grille .enonce-commun { margin-bottom: 0; }
  .probleme-grille .enonce-bascule { display: none; }
  .probleme-grille .enonce-corps { border-top: 0; padding-top: 14px; max-height: calc(100vh - 200px); }
  .probleme-grille .enonce-commun.dossier .enonce-corps { max-height: none; }
}

/* Leçon illustrée (Méthode de Médine) : bandeau « Dans ton livre », dessins, cartes de mot.
   Les dessins sont des fichiers SVG (img/medine/) posés sur leur propre tuile claire, y compris en mode sombre. */
.repere-livre { display: grid; grid-template-columns: 36px 1fr; gap: 4px 12px; align-items: center; min-height: 56px; margin: 0 0 14px;
  max-width: 36rem; background: var(--carte); border: 1.5px solid var(--bord); border-radius: 12px; padding: 10px 12px; }
.repere-livre .repere-icone { width: 36px; height: 36px; grid-row: 1 / span 2; }
.repere-texte { margin: 0; font-weight: 700; line-height: 1.3; }
.repere-nb { font-family: var(--chiffres); color: var(--encre); font-size: 1.1em; }
.repere-aide { margin: 0; color: var(--doux); font-size: .95rem; line-height: 1.4; grid-column: 2; }

.dessin { margin: 0; }
.dessin-img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 14px; }
.dessin-attente { aspect-ratio: 4 / 3; border-radius: 14px; background: var(--ligne); }
/* Le dessin en tête de leçon (leçons 1 à 6 du tome 1) et le dessin d'un exercice « Choisir la phrase qui correspond au dessin ». */
.dessin-tete { max-width: 320px; margin: 14px auto 6px; }
.dessin-legende { margin: 8px 2px 0; color: var(--doux); font-size: .95rem; line-height: 1.45; }
.dessin-exercice { width: 200px; max-width: 100%; margin: 0 auto; }
#exo-dessin:not([hidden]) { margin: 0 0 14px; }
.dessin-absent { aspect-ratio: 4 / 3; border-radius: 14px; display: grid; place-items: center; align-content: center; justify-items: center;
  gap: 6px; text-align: center; padding: 12px; border: 2px dashed var(--bord); background: var(--carte); }
.dessin-absent .repere-icone { width: 32px; height: 32px; }
.alt-texte { margin: 0; font-weight: 700; font-size: 1rem; line-height: 1.35; }
.dessin-absent-message { margin: 0; color: var(--doux); font-size: .9rem; line-height: 1.35; }
.dessin-mot .dessin-absent { padding: 6px; }
.dessin-mot .alt-texte { font-size: .85rem; }
.dessin-mot .dessin-absent-message { display: none; }

.mots-lecon { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lecon .mots-lecon { padding-left: 0; }
.carte-mot { display: grid; grid-template-columns: 112px 1fr; gap: 6px 14px; align-items: center; background: var(--papier);
  border: 1.5px solid var(--bord); border-radius: var(--rayon); padding: 12px; }
.carte-mot .dessin-mot { width: 112px; }
.mot-bloc { min-width: 0; }
.mot-ar { margin: 0; font-family: "Arabe", system-ui, sans-serif; font-size: 2.2rem; line-height: 1.9; color: var(--encre); direction: rtl; text-align: right; }
.mot-tr { margin: 0; color: var(--doux); font-style: italic; font-size: 1rem; }
.mot-fr { margin: 0; font-weight: 700; }

/* Étape suivante, prévu par la spec (3.9) : mode jeune lecteur pour les dessins (CP et CE1 : le parcours de Médine n'y est pas proposé, pas encore utilisé). */
.jeune-lecteur .dessin-legende { font-size: 1.15rem; }
.jeune-lecteur .dessin-tete { max-width: 400px; }
.jeune-lecteur .dessin-mot, .jeune-lecteur .carte-mot .dessin-mot { width: 140px; }
.jeune-lecteur .carte-mot { grid-template-columns: 140px 1fr; }
.jeune-lecteur .dessin-exercice { width: 250px; }

@media (prefers-color-scheme: dark) {
  /* la tuile claire du dessin ne doit pas éblouir */
  .dessin-img { filter: brightness(.9); border: 1px solid var(--bord); }
}
@media (max-width: 359px) { .dessin-exercice { width: 160px; } }
@media (min-width: 561px) {
  /* une grille de cartes verticales : le dessin en haut, le mot dessous */
  .mots-lecon { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
  .carte-mot, .jeune-lecteur .carte-mot { grid-template-columns: 1fr; align-items: start; }
  .carte-mot .dessin-mot, .jeune-lecteur .carte-mot .dessin-mot { width: 100%; }
}
@media (min-width: 900px) {
  /* le grand dessin à droite du texte */
  .lecon.avec-dessin-tete { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 24px; align-items: start; }
  .lecon.avec-dessin-tete > * { grid-column: 1; }
  .lecon.avec-dessin-tete > #chap-dessin-tete { grid-column: 2; grid-row: 1 / span 4; }
  .lecon.avec-dessin-tete .dessin-tete { margin: 14px 0 0; }
}

/* Signaler une erreur (lot A) et mention « en cours de vérification » (lot C) : docs/design/signaler-et-verification.md. Aucune nouvelle variable. */
.signaler-ligne { margin-top: 12px; }
.signaler-lien, .actions-secondaires .signaler-lien { font-size: 1rem; min-height: 48px; min-width: 48px; padding: 0 4px; align-self: auto; text-align: left; }
.signaler-panneau { display: grid; gap: 14px; margin-top: 12px; padding: 16px; background: var(--carte); border: 2px solid var(--bord); border-radius: 12px; min-width: 0; }
.signaler-panneau[hidden] { display: none; }
.signaler-panneau h3 { margin: 0; font-family: var(--titre); font-size: 1.2rem; color: var(--encre); }
.signaler-contexte { margin: 0; color: var(--doux); overflow-wrap: anywhere; font-size: .95rem; }
.signaler-choix { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.signaler-choix legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.signaler-option { position: relative; display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; cursor: pointer;
  background: var(--carte); border: 2px solid var(--bord); border-radius: 12px; color: var(--texte); overflow-wrap: anywhere; }
.signaler-option input { position: absolute; opacity: 0; }
.signaler-coche { visibility: hidden; font-weight: 700; color: var(--encre); }
.signaler-option input:checked + .signaler-coche { visibility: visible; }
.signaler-option.choisi { border-color: var(--encre); }
.signaler-option.avec-focus { outline: 3px solid var(--etoile); outline-offset: 2px; }
.signaler-panneau textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 1rem; padding: 10px 12px; border: 1.5px solid var(--champ); border-radius: 12px;
  background: var(--carte); color: var(--texte); resize: vertical; }
.signaler-panneau .aide { margin: 0; }
.signaler-compteur { margin: -8px 0 0; text-align: right; color: var(--doux); font-size: .95rem; }
.signaler-compteur.proche { font-weight: 700; color: var(--texte); }
.signaler-actions { display: grid; gap: 12px; }
.signaler-actions .bouton { min-height: 52px; }
.signaler-merci { padding: 12px 14px; border: 2px solid var(--ok); border-radius: 12px; background: var(--ok-fond); color: var(--texte); font-weight: 600; display: grid; gap: 12px; }
.signaler-merci p, .signaler-plafond p { margin: 0; }
.signaler-plafond { display: grid; gap: 12px; }
.signaler-merci .bouton, .signaler-plafond .bouton { min-height: 52px; }
.mention-loupe { margin-right: 8px; }
.mention-verif { display: block; margin: 8px 0 12px; padding: 8px 12px; background: var(--papier); color: var(--doux);
  border: 1.5px dashed var(--bord); border-radius: 12px; font-size: .95rem; }
.mention-verif[hidden] { display: none; }
.mention-verif .lien { font-size: inherit; padding: 0 4px; display: inline; vertical-align: baseline; }
@media (min-width: 561px) {
  .signaler-actions { grid-template-columns: repeat(2, max-content); }
}
.jeune-lecteur .signaler-panneau, .jeune-lecteur .mention-verif { font-size: 1.1em; }

/* Admin : la rubrique « Erreurs signalées » */
.erreurs-chapitre { margin: 0 0 14px; }
.erreurs-chapitre > summary { min-height: 48px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.erreur-signalee { display: grid; gap: 10px; margin: 8px 0; }
.erreur-signalee .erreur-ligne { margin: 0; color: var(--doux); font-size: .95rem; }
.erreur-motif { display: inline-block; padding: 2px 10px; border: 1.5px solid var(--encre); border-radius: 999px; font-weight: 700; color: var(--encre); margin-right: 6px; }
.erreur-citation { margin: 0; padding: 10px 12px; background: var(--papier); border-left: 4px solid var(--bord); font-family: var(--chiffres);
  white-space: pre-line; overflow-wrap: anywhere; }
.erreur-technique { margin: 0; color: var(--doux); font-size: .85rem; overflow-wrap: anywhere; }
.erreur-message { margin: 0; overflow-wrap: anywhere; }
.erreur-actions { display: grid; gap: 10px; }
.erreur-actions .bouton { min-height: 52px; }
@media (min-width: 561px) { .erreur-actions { grid-template-columns: repeat(2, max-content); } }
.admin-saut { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.admin-saut a { display: inline-flex; align-items: center; min-height: 48px; }
.admin-saut .stat.a-verifier { padding: 4px 12px; border: 1.5px solid var(--faux); border-radius: 999px; background: var(--faux-fond); color: var(--texte); font-weight: 700; }
#erreurs-signalees, #avis-lecons { margin-top: 32px; }

/* Espace admin : la rubrique « Utilisation » (lot B). Aucune couleur en dur ; une colonne sous 600 px, le tableau devient des cartes. */
#utilisation { margin-top: 32px; display: grid; gap: 14px; }
.utilisation-contenu, .utilisation-bloc, .liste-arrets { display: grid; gap: 14px; }
.utilisation .aide, .utilisation h2, .utilisation h3 { margin: 0; font-size: 1rem; }
.utilisation h2 { font-size: 1.6rem; }
.utilisation h3 { font-size: 1.2rem; }
.utilisation .onglet { min-height: 48px; }
.utilisation-classe summary { min-height: 48px; display: flex; align-items: center; font-family: var(--titre); font-weight: 700; font-size: 1.2rem; cursor: pointer; }
.tableau-utilisation { border-collapse: collapse; width: 100%; font-size: 1rem; }
.tableau-utilisation th, .tableau-utilisation td { padding: 10px 12px; border-bottom: 1px solid var(--bord); text-align: right; vertical-align: top; }
.tableau-utilisation thead th { font-size: 1rem; color: var(--doux); text-align: right; }
.tableau-utilisation tbody th { text-align: left; }
.tableau-utilisation .nombre { font-family: var(--chiffres); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.icone-matiere { margin-right: 8px; }
.nom-matiere { font-weight: 700; overflow-wrap: anywhere; }
.indic-libelle { display: none; }   /* sur ordinateur, l'en-tête de colonne porte le libellé : pas de doublon pour le lecteur d'écran */
.petit-groupe { margin: 0; padding: 10px 12px; background: var(--etoile-fond); border: 1.5px dashed var(--bord); border-radius: 12px; color: var(--texte); text-align: left; }
.squelette { min-height: 96px; background: var(--ligne); border-color: var(--ligne); }
.note-compteur { padding: 10px 12px; background: var(--etoile-fond); border-radius: 12px; color: var(--texte); }
.filtre-classe { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 700; }
.filtre-classe select { min-height: 48px; font: inherit; }
.chapitre-arret { gap: 8px; }
.chapitre-titre { font-size: 1.2rem; overflow-wrap: anywhere; }
.chapitre-sous-titre { margin: 0; color: var(--doux); }
.chapitre-chiffres { margin: 0; padding-left: 1.2em; font-family: var(--chiffres); font-variant-numeric: tabular-nums; }
.ligne-barre { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.barre-arret { appearance: none; -webkit-appearance: none; border: 0; height: 12px; width: 12rem; max-width: 100%; border-radius: 99px; overflow: hidden; background: var(--ligne-forte); }
.barre-arret::-webkit-progress-bar { background: var(--ligne-forte); }
.barre-arret::-webkit-progress-value { background: var(--encre); }
.barre-arret::-moz-progress-bar { background: var(--encre); }
.arrets-suite { margin: 0; }
.arrets-suite .bouton { min-height: 48px; }
@media (max-width: 600px) {
  /* seulement le tableau d'utilisation (transformé en cartes ci-dessous) : les autres tableaux, comme le suivi, défilent d'un côté à l'autre */
  .tableau-defile:has(.tableau-utilisation) { overflow-x: visible; border: 0; background: transparent; }
  .tableau-utilisation, .tableau-utilisation tbody, .tableau-utilisation tr, .tableau-utilisation th, .tableau-utilisation td { display: block; width: 100%; }
  .tableau-utilisation thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau-utilisation tr.ligne-matiere { margin-bottom: 12px; padding: 8px 12px; border: 1.5px solid var(--bord); border-radius: 12px; background: var(--carte); }
  .tableau-utilisation tr.ligne-matiere th, .tableau-utilisation tr.ligne-matiere td { border: 0; padding: 6px 0; text-align: left; }
  .tableau-utilisation td.nombre { display: flex; justify-content: space-between; gap: 12px; }
  .tableau-utilisation td.nombre .indic-libelle {
    display: inline; white-space: normal;
    font-weight: 400; font-family: var(--corps); font-size: 1rem;
  }
  .tableau-utilisation td.petit-groupe { padding: 10px 12px; }
}

/* Écriture mathématique : fractions et racines en MathML (maths-ecrites.js). Même taille et même couleur que le texte autour. */
math { font-family: var(--maths); math-style: normal; color: inherit; white-space: normal; margin-inline: .12em; }
mfrac { padding-inline: .06em; }
mfrac mfrac { font-size: max(.88em, 16px); }
mi.droit { text-transform: none; font-style: normal; }
.avec-maths { line-height: var(--maths-interligne); min-width: 0; }   /* min-width : un élément de grille peut rétrécir sous son calcul */
.maths-sonde { position: absolute; left: -9999px; top: 0; visibility: hidden; }
/* Calcul seul sur sa ligne : un seul morceau s'il tient ; sinon un morceau par « = », alignés à gauche ; un morceau trop large défile seul. */
.maths-bloc { display: flex; flex-wrap: wrap; justify-content: center; justify-content: safe center; gap: .4em 1em;
  margin: var(--maths-marge-bloc) 0; max-width: 100%; overflow-x: auto; contain: inline-size; font-size: var(--maths-bloc); line-height: var(--maths-interligne); }
.maths-bloc.plie { flex-direction: column; flex-wrap: nowrap; align-items: flex-start; }   /* un morceau par ligne, chacun commence par « = » */
.maths-bloc:focus-visible { outline: 3px solid var(--etoile); outline-offset: 2px; }
.enonce .maths-bloc { font-size: 1em; }

/* Modifier un enfant (admin) et ajouter un enfant (parent) : maquette docs/design/maquettes/enfants-admin-parent.html */
/* Admin : une ligne d'enfant = texte + bouton « Modifier » (cible 48 px) */
.admin-enfants .enfant-admin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; min-height: 48px; }
.enfant-admin-texte { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.enfant-admin .form-enfant { flex: 1 1 100%; }
.bouton-modifier { min-height: 48px; min-width: 48px; font-size: .95rem; padding: 6px 16px; }

/* Petit formulaire (admin et parent) */
.form-enfant { display: grid; gap: 12px; margin: 8px 0 12px; padding: 14px 16px; background: var(--carte); border: 2px solid var(--encre); border-radius: 12px; }
.form-enfant-titre { margin: 0; font-family: var(--titre); font-weight: 700; font-size: 1.15rem; color: var(--encre); }
.champ-enfant { display: grid; gap: 4px; font-weight: 700; }
.champ-enfant input, .champ-enfant select { min-height: 52px; font-size: 1.1rem; font-weight: 400; width: 100%; }
.champ-enfant .aide-champ { font-weight: 400; }
.champ-enfant.invalide input, .champ-enfant.invalide select { border: 3px solid var(--faux); }
.form-enfant .suppression-message { margin: 0; }
.actions-enfant { display: flex; flex-wrap: wrap; gap: 12px; }
.actions-enfant .bouton { min-height: 52px; flex: 1 1 10rem; }

/* Parent : état « 4 enfants » */
.limite-enfants { margin: 8px 0 0; padding: 14px 16px; background: var(--papier); border: 2px dashed var(--doux); border-radius: 12px; display: grid; gap: 6px; }
.limite-enfants-titre { margin: 0; font-weight: 700; font-size: 1.1rem; }
.limite-enfants p { margin: 0; }

/* Parent : le code, affiché une seule fois */
.code-unique { display: grid; gap: 14px; padding: 18px; background: var(--carte); border: 3px solid var(--encre); border-radius: var(--rayon); }
.code-unique:focus { outline: 3px solid var(--etoile); outline-offset: 3px; }
.code-unique-titre { margin: 0; font-family: var(--titre); font-size: 1.4rem; line-height: 1.2; color: var(--encre); }
.code-unique-etiquette { margin: 0; font-weight: 700; }
.code-unique-valeur {
  display: block; padding: 16px 12px; text-align: center; background: var(--papier); border: 3px dashed var(--encre); border-radius: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; font-size: clamp(1.5rem, 7vw, 2rem); letter-spacing: .06em;
  color: var(--texte); overflow-wrap: anywhere; -webkit-user-select: all; user-select: all;
}
.code-unique .conseil { margin: 0; }
.code-unique .bouton { min-height: 56px; width: 100%; }
.form-enfant { color: var(--texte); }   /* ne reprend pas le rouge ou le jaune de la ligne (.jamais, .ancien) où il est ouvert */
.resultat-enfant:empty { display: none; }

/* ---------- Accès libre : essai sans code, fin de l'essai, avis libre (14 novembre 2026 ; maquette docs/design/maquettes/acces-libre.*) ---------- */

/* Accueil : trois blocs empilés, le bouton principal d'abord */
.accueil { max-width: 30rem; margin: 0; display: grid; gap: 18px; }
.accueil h1 { margin: 0; }
.accueil-texte { margin: 0; font-size: 1.15rem; line-height: 1.55; }
.accueil .bouton, .visiteur .bouton { min-height: 56px; display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.accueil-code { display: grid; gap: 8px; padding-top: 16px; border-top: 2px solid var(--ligne-forte); }
.accueil-code h2 { margin: 0; font-size: 1.2rem; }

/* Choix du visiteur : pays puis classe (boutons-liens, pas de formulaire) */
.visiteur { max-width: 34rem; display: grid; gap: 16px; }
.visiteur h1, .visiteur h2 { margin: 0; }
.visiteur-retour { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--encre); }
.choix-gros { display: grid; gap: 12px; }
.choix-gros a { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 10px 18px; background: var(--carte);
  border: 3px solid var(--encre); border-radius: var(--rayon); font-family: var(--titre); font-weight: 700; font-size: 1.35rem; color: var(--encre); text-decoration: none; }
.choix-gros a:hover { background: var(--ligne); }
.choix-classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.choix-classes a { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 6px 8px; background: var(--carte);
  border: 2px solid var(--encre); border-radius: 12px; font-weight: 700; color: var(--encre); text-decoration: none; text-align: center; }
.choix-classes a:hover { background: var(--ligne); }
.choix-classes.large { grid-template-columns: 1fr; }
.choix-groupe { margin: 8px 0 0; font-weight: 700; color: var(--texte); }
:is(.choix-gros a, .choix-classes a, .ia-verrou, .visiteur-retour):focus-visible { outline: 3px solid var(--etoile); outline-offset: 2px; }

/* Cahier en mode visiteur : bandeau d'essai */
.bandeau-essai { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin: 0 0 14px; padding: 8px 14px;
  background: var(--papier); border: 1.5px dashed var(--doux); border-radius: 12px; color: var(--texte); }
.bandeau-essai-texte { margin: 0; font-size: 1rem; }
.bandeau-essai-texte strong { font-family: var(--chiffres); }
.bandeau-essai a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--encre); }
.bandeau-essai.dernier { border-style: solid; border-color: var(--etoile); background: var(--etoile-fond); }

/* Fonctions d'IA fermées au visiteur : lien-ligne, jamais un bouton grisé muet */
.ia-verrous { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ia-verrou { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; min-height: 56px; padding: 8px 14px;
  background: var(--papier); border: 2px dashed var(--doux); border-radius: 12px; color: var(--texte); text-decoration: none; }
.ia-verrou-nom { font-weight: 700; }
.ia-verrou-note { grid-column: 2; color: var(--doux); font-size: .95rem; }
.ia-verrou-icone { grid-row: 1 / span 2; font-size: 1.4rem; }

/* Fin de l'essai visiteur */
.fin-visiteur { display: grid; gap: 14px; padding: 20px; background: var(--carte); border: 3px solid var(--etoile); border-radius: var(--rayon); }
.fin-visiteur h2 { margin: 0; font-family: var(--titre); font-size: 1.5rem; line-height: 1.2; color: var(--encre); }
.fin-visiteur p { margin: 0; font-size: 1.1rem; line-height: 1.5; }
.fin-visiteur .bouton { min-height: 56px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.fin-visiteur-liens { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fin-visiteur-liens a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--encre); }

/* Fin des 4 semaines : message quand on touche une fonction d'IA (réutilise .bandeau-acces) */
.fin-essai-ia { display: grid; gap: 12px; }
.fin-essai-ia p { margin: 0; font-size: 1.05rem; }
.fin-essai-titre { font-weight: 700; font-size: 1.15rem; }
.fin-essai-ia .bouton { min-height: 52px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.fin-essai-ia .bandeau-lien-secondaire { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; color: var(--encre); }

/* Avis libre */
.avis-intro { max-width: 40rem; }

/* Le visiteur sans code (body.mode-visiteur, posé par ecole.js : pas « visiteur », déjà pris par le choix du pays et de la classe) :
   tout ce qui demande l'IA ou un compte (et les objectifs, séries et niveaux du Coran) est absent, jamais grisé muet */
body.mode-visiteur :is(.tuteur, #ecouter-lecon, #ecouter-enonce, #pas-compris, #autrement, #signaler-lecon, #avis-lecon, #signaler-exercice,
  .professeur, .quiz-coran, #revision-sourate, #coran-jour, #sourate-progres) { display: none; }
.seulement-visiteur { display: none; }
body.mode-visiteur .seulement-visiteur { display: grid; }
.bandeau-fermer { font: inherit; font-weight: 700; color: var(--encre); background: none; border: 0; min-height: 48px; padding: 0 8px; cursor: pointer; }
.bandeau-acces.fin-proche { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.bandeau-acces.fin-proche p { margin: 0; flex: 1 1 18rem; }
.fin-essai-ia { margin-bottom: 16px; }
.fin-visiteur-liens a:focus-visible, .fin-visiteur .bouton:focus-visible, .bandeau-essai a:focus-visible, .fin-essai-ia :is(a, button):focus-visible,
  .bandeau-fermer:focus-visible, .accueil .bouton:focus-visible { outline: 3px solid var(--etoile); outline-offset: 2px; }
.fin-visiteur:focus, .fin-essai-ia:focus, .accueil h1:focus, .visiteur h1:focus { outline: none; }
.accueil .connexion { margin: 0; max-width: none; }
.accueil .connexion .aide { margin: 4px 0; }

/* ---------- Accueil sobre (14 novembre 2026 ; maquette docs/design/maquettes/accueil-sobre.*) ---------- */

/* Page sobre : fond uni (pas de lignes de cahier), une seule couleur d'accent : --encre */
body.sobre { background: var(--papier); }
.sobre .page { padding-top: 40px; }
.accueil-sobre { max-width: 26rem; margin: 0 auto; display: grid; gap: 28px; }
.accueil-sobre h1 { margin: 0; text-align: center; font-size: clamp(2.2rem, 8vw, 3rem); }
.accueil-signature { margin: -18px 0 0; text-align: center; color: var(--encre); font-weight: 700; font-size: 1.15rem; }
.accueil-sobre-phrase { margin: -16px 0 0; text-align: center; color: var(--doux); font-size: 1.15rem; }

/* Choix du pays : deux vraies cases radio (flèches du clavier gratuites), mises en forme de deux pastilles */
.pays-choix { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.pays-choix legend { padding: 0; margin: 0 0 8px; font-weight: 700; }
.pays-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pays-option { position: relative; display: block; }
.pays-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pays-option span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 6px 12px; background: var(--carte);
  border: 2px solid var(--bord); border-radius: 999px; font-weight: 700; color: var(--texte); }
.pays-option input:checked + span { border: 3px solid var(--encre); color: var(--encre); }
.pays-option input:checked + span::before { content: "✓"; }
.pays-option input:focus-visible + span { outline: 3px solid var(--etoile); outline-offset: 2px; }

/* Deux onglets */
.acces-onglets { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 2px solid var(--ligne-forte); }
.acces-onglet { font: inherit; font-weight: 700; font-size: 1.1rem; min-height: 52px; padding: 8px 12px; background: none; color: var(--doux);
  border: 0; border-bottom: 4px solid transparent; margin-bottom: -2px; cursor: pointer; }
.acces-onglet[aria-selected="true"] { color: var(--encre); border-bottom-color: var(--encre); }
.acces-onglet:focus-visible { outline: 3px solid var(--etoile); outline-offset: -3px; border-radius: 8px; }
.acces-panneau { display: grid; gap: 14px; padding-top: 22px; }
.acces-panneau h2 { margin: 0; font-size: 1.25rem; }
.acces-panneau .bouton { min-height: 52px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.acces-panneau .aide { margin: 0; }
.acces-panneau .ligne input { min-height: 52px; }
.acces-gratuit { margin: 0; font-family: var(--titre); font-weight: 700; font-size: 1.5rem; line-height: 1.2; color: var(--texte); }
.acces-gratuit-suite { margin: 0; color: var(--doux); }
.lien-essai { justify-self: center; display: inline-flex; align-items: center; min-height: 48px; padding: 0 8px; font-size: 1rem; color: var(--doux);
  text-decoration: underline; text-underline-offset: 3px; }
.lien-essai:focus-visible { outline: 3px solid var(--etoile); outline-offset: 2px; border-radius: 6px; }
.acces-panneau .message { margin: 0; }
.message.erreur { padding: 10px 14px; border: 2px solid var(--faux); border-radius: 12px; background: var(--faux-fond); color: var(--texte); }
.acces-panneau .bouton.gros { min-height: 56px; }   /* plus précis que « .acces-panneau .bouton » : le bouton d'inscription garde ses 56 px */
.acces-panneau .message:empty { padding: 0; border: 0; background: none; min-height: 0; margin-top: -14px; }   /* l'alerte reste dans la page (lecteurs d'écran), sans cadre vide */
.message.erreur:not(:empty)::before { content: "⚠ "; }
body.sobre .barre { display: none; }   /* l'accueil n'a pas de barre du haut : le nom est déjà le titre */
.accueil-sobre h1:focus { outline: none; }

/* Pied de page de l'accueil (écran de connexion seulement) : les quatre liens légaux, discrets. Pas de mention « ni cookie ni traceur » ici : le cahier pose un cookie de connexion. */
.pied-accueil { margin-top: 28px; padding: 12px 0 20px; border-top: 2px solid var(--ligne-forte); }
.pied-accueil-liens { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 20px; }
.pied-accueil-liens a { display: inline-flex; align-items: center; min-height: 48px; color: var(--encre); font-size: 1rem; font-weight: 600; }
.pied-accueil-note { margin: 0; color: var(--doux); font-size: .9rem; }

/* Écran d'exercice : de la place sous le contenu pour passer au-delà du personnage du tuteur (bouton fixe en bas à droite) */
#probleme-contenu { padding-bottom: 130px; }
.jeune-lecteur #probleme-contenu { padding-bottom: 160px; }

/* Avis sous les leçons (cahier) et « Avis sur les leçons » (admin) : docs/design/avis-sous-les-lecons.md. Aucune nouvelle variable.
   Le bloc du cahier s'appelle .avis-sous-lecon (et non .avis, déjà pris par le questionnaire « Votre avis » du parent). */
/* Cahier : le bloc d'avis, sous l'exemple de la leçon et au-dessus de « Signaler une erreur » (#signaler-lecon) */
.avis-sous-lecon { display: grid; gap: 14px; margin-top: 22px; padding-top: 16px; border-top: 2px dashed var(--bord); min-width: 0; }
.avis-sous-lecon[hidden] { display: none; }
.avis-sous-lecon [hidden] { display: none; }
.avis-titre { margin: 0; font-family: var(--titre); font-weight: 700; font-size: 1.25rem; line-height: 1.25; color: var(--encre); }
.avis-chargement { margin: 0; color: var(--doux); }
.avis-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 10px; }
.avis-option { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 8px 28px 8px 12px;
  cursor: pointer; background: var(--carte); border: 2px solid var(--bord); border-radius: 12px; color: var(--texte); font-weight: 700; font-size: 1.1rem; }
.avis-option input { position: absolute; opacity: 0; }
.avis-option:has(input:checked) { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); background: var(--ligne); color: var(--encre); }
.avis-option:has(input:focus-visible) { outline: 3px solid var(--etoile); outline-offset: 2px; }
.avis-icone { font-size: 1.6rem; line-height: 1; }
.avis-option::after { content: "✓"; position: absolute; top: 6px; right: 10px; visibility: hidden; font-weight: 700; color: var(--encre); }   /* la coche : décor, l'état est porté par le radio */
.avis-option:has(input:checked)::after { visibility: visible; }

.avis-commentaire { display: grid; gap: 8px; }
.avis-commentaire label, .avis-replie summary { font-weight: 700; }
.avis-commentaire .aide { margin: 0; }
.avis-sous-lecon textarea { width: 100%; font: inherit; font-size: 1rem; padding: 10px 12px; border: 1.5px solid var(--champ); border-radius: 12px;
  background: var(--carte); color: var(--texte); resize: vertical; }
.avis-sous-lecon .signaler-compteur { margin: -2px 0 0; }
.avis-prive { margin: 0; color: var(--doux); font-size: .95rem; }
.avis-actions { display: grid; gap: 12px; }
.avis-actions .bouton { min-height: 52px; }
.avis-sous-lecon .message { margin: 0; }

/* Avis déjà donné : calme, ce n'est ni une réussite ni une alerte */
.avis-deja { display: grid; gap: 8px; padding: 12px 14px; background: var(--papier); border: 2px solid var(--bord); border-radius: 12px; }
.avis-deja p { margin: 0; }
.avis-deja-reponse { font-weight: 700; }
.avis-deja-mot { color: var(--texte); overflow-wrap: anywhere; }
.avis-deja .bouton { min-height: 52px; justify-self: start; }
.avis-sous-lecon .signaler-merci, .avis-sous-lecon .indice, .avis-sous-lecon .bandeau-etat { margin: 0; }
.avis-sous-lecon .signaler-merci p, .avis-sous-lecon .indice p { margin: 0; }

/* CP et CE1 (jeune lecteur) : très peu de mots, gros pictogrammes, commentaire replié */
.jeune-lecteur .avis-titre { font-size: 1.5rem; }
.jeune-lecteur .avis-option { flex-direction: column; min-height: 96px; gap: 4px; padding: 10px 12px; font-size: 1.4rem; }
.jeune-lecteur .avis-icone { font-size: 2.6rem; }
.avis-replie summary { display: flex; align-items: center; min-height: 52px; cursor: pointer; color: var(--encre); }
.avis-replie[open] summary { margin-bottom: 8px; }

@media (min-width: 561px) {
  .avis-actions { grid-template-columns: repeat(2, max-content); }
}

/* Admin : la rubrique « Avis sur les leçons » (même style que « Erreurs signalées ») */
.avis-admin .onglet[aria-pressed="true"] { background: var(--encre); color: var(--carte); }
.avis-lecon { display: grid; gap: 10px; margin: 10px 0; }
.avis-lecon-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.avis-lecon h3 { margin: 0; font-family: var(--titre); font-size: 1.15rem; }
.avis-ligne { margin: 0; color: var(--doux); font-size: .95rem; }
.avis-comptes { display: flex; flex-wrap: wrap; gap: 8px; }
.avis-nb { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 2px 14px; border: 1.5px solid var(--encre); border-radius: 999px;
  font-weight: 700; background: var(--carte); color: var(--texte); }
.avis-nb.pas-encore { border-color: var(--etoile); background: var(--etoile-fond); }
.avis-nb strong { font-family: var(--chiffres); font-size: 1.15rem; }
.avis-a-regarder { padding: 2px 10px; border: 1.5px solid var(--faux); border-radius: 999px; background: var(--carte); color: var(--faux); font-size: .85rem; font-weight: 700; }
.avis-commentaires > summary { display: flex; align-items: center; min-height: 48px; font-weight: 700; cursor: pointer; }
.avis-commentaires ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.avis-com { display: grid; gap: 2px; padding: 8px 12px; background: var(--papier); border-left: 4px solid var(--bord); border-radius: 0 8px 8px 0; }
.avis-com-tete { margin: 0; color: var(--doux); font-size: .9rem; }
.avis-com-tete strong { color: var(--texte); }
.avis-com-texte { margin: 0; overflow-wrap: anywhere; }

/* Cibles tactiles : tout bouton fait au moins 44 px de haut (contrôlé par outils/scenario_mobile.py à 360 et 390 px). */
.lien-barre, .onglet, .ecouter, .suggestion, .bouton.petit, .lien { min-height: 44px; }
.lien-barre, .lien, .bouton.petit { display: inline-flex; align-items: center; }
.lien-barre { padding: 4px 8px; }
.ecouter.petit { display: inline-flex; align-items: center; }
/* Un lien au milieu d'une phrase : sa zone de toucher grandit sans déplacer les lignes du texte. */
.mention-verif .lien { min-height: 0; padding: 12px 4px; }

/* Tableau du lundi (admin-lundi.js) : une ligne par chiffre, une colonne par semaine. La colonne des libellés reste collée à gauche
   quand on fait défiler les semaines ; sur petit écran elle est plus étroite ; une phrase dit qu'on peut faire défiler. */
.tableau-lundi { overflow-x: auto; background: var(--carte); border: 1.5px solid var(--bord); border-radius: var(--rayon); }
.tableau-lundi table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 1rem; }
.tableau-lundi th, .tableau-lundi td { padding: 8px 8px; border-bottom: 1px solid var(--ligne); text-align: left; vertical-align: top; }
.tableau-lundi thead th { white-space: nowrap; }
.tableau-lundi tbody th, .tableau-lundi thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--carte); border-right: 1px solid var(--ligne); }
.tableau-lundi tbody th { font-weight: 700; min-width: 11rem; }
.tableau-lundi .semaine-en-cours { display: block; font-weight: 400; font-size: .85rem; color: var(--doux); }
.tableau-lundi td.nombre { text-align: right; font-family: var(--chiffres); white-space: nowrap; }
.tableau-lundi .ligne-sous th { font-weight: 400; padding-left: 24px; color: var(--doux); }
.tableau-lundi .ligne-cle th, .tableau-lundi .ligne-cle td { border-top: 2px solid var(--encre); border-bottom: 2px solid var(--encre); font-weight: 700; }
.utilisation .indice-defile { text-align: center; }
@media (max-width: 700px) {
  .tableau-lundi th, .tableau-lundi td { padding: 6px 8px; }
  .tableau-lundi tbody th { min-width: 0; width: 9rem; font-size: .95rem; }
  .tableau-lundi .ligne-sous th { padding-left: 14px; }
}
