/* mv-masterclass 1.0 (10.10.2026) : composants propres à la masterclass calculatrice.
   Se charge APRÈS mv-charte-1.4.css et n'utilise que ses jetons (décision de Marc du 10.10.2026,
   CLAUDE.md § 7, exception de la masterclass). Racine : <div class="mv-charte mc-app">. */

html, body { margin: 0; background: var(--mv-papier, #FBFAF6); }
.mv-charte.mc-app { max-width: 680px; margin: 0 auto; padding: 0 var(--mv-e-4) 96px; min-height: 100vh; font-size: 17px; }
.mv-charte.mc-app h1 { font-size: 30px; line-height: 1.15; margin: 0 0 var(--mv-e-3); }
.mv-charte.mc-app h2 { font-size: 23px; line-height: 1.25; margin: var(--mv-e-2) 0 var(--mv-e-2); }
.mv-charte.mc-app p { margin: 0 0 var(--mv-e-3); }

/* En-tête collé en haut */
.mc-entete { position: sticky; top: 0; z-index: 20; background: var(--mv-papier); border-bottom: 1px solid var(--mv-filet); padding: var(--mv-e-2) 0 var(--mv-e-2); }
.mc-entete__ligne { display: flex; align-items: center; gap: var(--mv-e-2); }
.mc-entete__titre { flex: 1; font-family: var(--mv-police-titre); font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-entete__pct { font-size: 14px; color: var(--mv-encre-2); font-variant-numeric: tabular-nums; }
.mc-icone-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--mv-filet); border-radius: var(--mv-r-2); background: var(--mv-feuille); color: var(--mv-encre); cursor: pointer; padding: 0; }
.mc-icone-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mc-barre { height: 6px; background: var(--mv-papier-2); border-radius: 3px; margin-top: var(--mv-e-2); overflow: hidden; }
.mc-barre__plein { height: 6px; background: var(--mv-action); border-radius: 3px; transition: width .3s; }
.mc-points { display: flex; gap: 3px; margin-top: 6px; margin-bottom: 10px; }
.mc-point { position: relative; flex: 1; height: 8px; border: 0; border-radius: 2px; background: var(--mv-filet); cursor: pointer; padding: 0; }
/* Zone de toucher (review 10.10 : 24 px ; 04.11.2026 : 44 px de haut, de la barre au filet de l'en-tête, que les 10 px
   sous les points lui laissent ; en largeur, le pas des points, sans empiéter sur le voisin). */
.mc-point::after { content: ""; position: absolute; left: -1.5px; right: -1.5px; top: -18px; bottom: -18px; }
.mc-point--fait { background: var(--mv-verif); }
.mc-point--ici { background: var(--mv-encre); }

/* Cartes et étiquettes */
.mc-carte { background: var(--mv-feuille); border: 1px solid var(--mv-filet); border-radius: var(--mv-r-2); box-shadow: var(--mv-ombre-feuille); padding: var(--mv-e-4) var(--mv-e-4); margin: 0 0 var(--mv-e-3); }
.mc-carte > :last-child { margin-bottom: 0; }
.mc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--mv-e-2); }
.mc-tag { display: inline-block; border: 1px solid var(--mv-filet); border-radius: var(--mv-r-1); padding: 1px 8px; font-size: 14px; color: var(--mv-encre-2); background: var(--mv-feuille); }
.mc-tag--annee { border: 1.5px solid var(--mv-encre); color: var(--mv-encre); font-weight: 700; }
.mc-tag--etape { background: var(--mv-papier-2); }
.mc-situation { font-size: 17px; color: var(--mv-encre); }

/* Zone machine : consigne collée au-dessus de l'écran */
.mc-machine { display: flex; flex-direction: column; align-items: center; margin: 0 0 var(--mv-e-3); }
.mc-consigne { position: sticky; top: var(--mc-entete-h, 76px); z-index: 5; width: 100%; background: var(--mv-encre); color: #FFFFFF; border-radius: var(--mv-r-2); padding: var(--mv-e-3) var(--mv-e-4); margin: 0 0 var(--mv-e-3); font-size: 16px; line-height: 1.45; box-shadow: var(--mv-ombre-feuille); }
.mc-consigne strong { color: #FFFFFF; }
.mc-consigne .katex { color: #FFFFFF; }
/* La touche ON/AC (58 × 32) : une zone de toucher invisible de 58 × 44, dans les marges qui l'entourent (04.11.2026). */
.ti30-on { position: relative; }
.ti30-on::after { content: ""; position: absolute; left: -2px; right: -2px; top: -8px; bottom: -8px; }
.mc-reset { margin-top: var(--mv-e-2); background: transparent; border: 1px dashed var(--mv-filet-champ); color: var(--mv-encre-2); border-radius: var(--mv-r-2); min-height: 44px; padding: 6px 14px; font-size: 15px; cursor: pointer; }

/* Séquence de touches */
.mc-seq { display: flex; flex-wrap: wrap; gap: 4px; margin: var(--mv-e-2) 0 0; }
.mc-touche { display: inline-block; background: #3E5368; color: #FFFFFF; border: 2px solid transparent; border-radius: var(--mv-r-1); padding: 2px 8px; font: 700 14px/1.3 "Courier New", monospace; }
.mc-touche--fait { background: var(--mv-verif); }
.mc-touche--ici { background: var(--mv-surligneur); color: var(--mv-encre); border-color: var(--mv-encre); }
.mc-ecran { font: 700 16px/1.3 "Courier New", monospace; white-space: nowrap; }

/* Retours */
.mc-retro { display: flex; gap: var(--mv-e-2); align-items: flex-start; margin-top: var(--mv-e-2); padding: var(--mv-e-2) var(--mv-e-3); border-radius: var(--mv-r-2); font-size: 15.5px; line-height: 1.45; }
.mc-retro svg { width: 20px; height: 20px; flex: none; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mc-retro--ok { background: var(--mv-verif-doux); color: var(--mv-verif); }
.mc-retro--err { background: var(--mv-correction-doux); color: var(--mv-correction); }
.mc-retro--info { background: var(--mv-papier-2); color: var(--mv-encre); }
.mc-retro b { color: inherit; }
.mc-consigne .mc-retro--ok { background: var(--mv-verif-doux); }
.mc-consigne .mc-retro--err { background: var(--mv-correction-doux); }
.mc-consigne .mc-retro--info { background: var(--mv-papier-2); }

/* Questions */
.mc-question { margin: 0 0 var(--mv-e-3); }
.mc-question__q { font-weight: 600; margin: 0 0 var(--mv-e-2); }
.mc-option { display: block; width: 100%; text-align: left; min-height: 48px; background: var(--mv-feuille); border: 1.5px solid var(--mv-filet-champ); border-radius: var(--mv-r-2); padding: 10px 14px; margin: 0 0 var(--mv-e-2); font-size: 16px; color: var(--mv-encre); cursor: pointer; }
.mc-option:hover { background: var(--mv-surligneur-doux); }
.mc-option--seq { font: 700 15px/1.4 "Courier New", monospace; }
.mc-option--juste { border-color: var(--mv-verif); background: var(--mv-verif-doux); }
.mc-option--faux { border-color: var(--mv-correction); background: var(--mv-correction-doux); }
.mc-option[disabled] { cursor: default; }
.mc-champs { display: flex; flex-wrap: wrap; gap: var(--mv-e-2); align-items: center; margin: 0 0 var(--mv-e-2); }
.mc-champ { min-height: 48px; width: 9em; border: 1.5px solid var(--mv-filet-champ); border-radius: var(--mv-r-2); padding: 8px 12px; font-size: 17px; background: var(--mv-feuille); color: var(--mv-encre); }
.mc-champ--court { width: 5em; }
.mc-select { min-height: 48px; border: 1.5px solid var(--mv-filet-champ); border-radius: var(--mv-r-2); padding: 8px 10px; font-size: 16px; background: var(--mv-feuille); color: var(--mv-encre); }
.mc-ordre { list-style: none; padding: 0; margin: 0 0 var(--mv-e-2); }
.mc-ordre li { display: flex; align-items: center; gap: var(--mv-e-2); background: var(--mv-feuille); border: 1px solid var(--mv-filet); border-radius: var(--mv-r-2); padding: 6px 8px 6px 12px; margin: 0 0 6px; }
.mc-ordre li span { flex: 1; }
.mc-ordre button { flex-shrink: 0; width: 44px; height: 44px; border: 1px solid var(--mv-filet-champ); border-radius: var(--mv-r-2); background: var(--mv-papier); color: var(--mv-encre); cursor: pointer; font-size: 18px; }

/* Case à cocher dessinée (déclaratif : encre, jamais vert) */
.mc-case { display: flex; gap: var(--mv-e-3); align-items: flex-start; cursor: pointer; }
.mc-case input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mc-case__boite { flex: none; width: 26px; height: 26px; border: 2px solid var(--mv-encre); border-radius: var(--mv-r-1); background: var(--mv-feuille); position: relative; margin-top: 1px; }
.mc-case input:checked + .mc-case__boite::after { content: ""; position: absolute; left: 7px; top: 2px; width: 7px; height: 13px; border: solid var(--mv-encre); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.mc-case input:focus-visible + .mc-case__boite { outline: 3px solid var(--mv-focus); outline-offset: 2px; }

/* Liste de vérification */
.mc-verifs { list-style: none; padding: 0; margin: 0; }
.mc-verifs li { display: flex; gap: var(--mv-e-3); align-items: flex-start; padding: 6px 0; }
.mc-verifs li.mc-plus-tard { opacity: .55; }
.mc-etat { flex: none; width: 22px; height: 22px; border: 2px solid var(--mv-filet-champ); border-radius: 50%; margin-top: 2px; position: relative; }
.mc-etat--ici { border-color: var(--mv-encre); background: var(--mv-surligneur-doux); }
.mc-etat--fait { border-color: var(--mv-verif); background: var(--mv-verif); }
.mc-etat--fait::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #FFFFFF; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

/* Comparaison piège / bonne séquence */
.mc-duo { display: grid; grid-template-columns: 1fr; gap: var(--mv-e-2); }
@media (min-width: 560px) { .mc-duo { grid-template-columns: 1fr 1fr; } }

/* Choix de l'année */
.mc-annees { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--mv-e-2); margin: var(--mv-e-2) 0 var(--mv-e-3); }
.mc-annee { min-height: 56px; border: 1.5px solid var(--mv-encre); border-radius: var(--mv-r-2); background: var(--mv-feuille); color: var(--mv-encre); font-family: var(--mv-police-titre); font-weight: 700; font-size: 20px; cursor: pointer; }
.mc-annee[aria-pressed="true"] { background: var(--mv-encre); color: #FFFFFF; }

/* Actions, pied fixe */
.mc-actions { display: flex; flex-wrap: wrap; gap: var(--mv-e-2); justify-content: center; margin: var(--mv-e-4) 0; }
/* Le pied est opaque (04.11.2026) : à 97 %, le bouton bleu passé dessous se voyait entre « Précédent » et « Suivant ». */
.mc-pied { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--mv-papier); border-top: 1px solid var(--mv-filet); padding: var(--mv-e-2) var(--mv-e-4); }
.mc-pied__dedans { max-width: 680px; margin: 0 auto; display: flex; justify-content: space-between; gap: var(--mv-e-2); }
.mv-charte .mc-pied .mv-btn { min-width: 128px; }
.mv-charte .mv-btn[disabled] { opacity: .45; cursor: default; }

/* Sommaire */
.mc-voile { position: fixed; inset: 0; z-index: 30; background: rgba(16, 42, 67, .45); }
.mc-sommaire { position: absolute; top: 0; left: 0; bottom: 0; width: min(320px, 88vw); background: var(--mv-feuille); padding: var(--mv-e-4); overflow-y: auto; }
.mc-sommaire__groupe { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mv-encre-2); margin: var(--mv-e-4) 0 var(--mv-e-1); }
.mc-sommaire button { display: flex; gap: var(--mv-e-2); align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; padding: 8px 4px; font-size: 15.5px; color: var(--mv-encre); cursor: pointer; border-radius: var(--mv-r-1); }
.mc-sommaire button:hover { background: var(--mv-surligneur-doux); }
.mc-sommaire .mc-etat { width: 18px; height: 18px; }
.mc-sommaire .mc-etat--fait::after { left: 4px; top: 1px; width: 4px; height: 8px; }

/* Bilan */
.mc-score { font-family: var(--mv-police-titre); font-weight: 700; font-size: 48px; line-height: 1; font-variant-numeric: tabular-nums; }
.mc-demarche { margin: var(--mv-e-2) 0 0; padding-left: 1.3em; }

/* 16 px de marge latérale à toutes les largeurs (04.11.2026, plus haut : .mv-charte.mc-app, .mc-pied), comme Douze et
   Quatre : mesuré à 320, 390, 412 et 600 px. */
@media (max-width: 400px) {
  .mv-charte.mc-app { font-size: 16.5px; }
  .mc-carte { padding: var(--mv-e-3); }
  .mc-annee { font-size: 18px; }
  .mv-charte .mc-pied .mv-btn { min-width: 0; flex: 1; padding: 12px 10px; }
}
@media (prefers-reduced-motion: reduce) { .mc-barre__plein { transition: none; } }

/* review du code (10.10.2026) : en-tête du sommaire avec bouton Fermer ; titres d'écran focalisables sans anneau parasite */
.mc-sommaire__tete { display: flex; align-items: center; justify-content: space-between; gap: var(--mv-e-2); }
.mc-sommaire__tete .mc-sommaire__groupe { margin: 0; }
.mc-app [tabindex="-1"]:focus { outline: none; }

/* Masterclass calculatrice, lot 1.2 (03.11.2026) : L'AFFICHEUR RESTE EN VUE. Sur téléphone, la calculatrice est plus
   haute que la place laissée entre l'en-tête et la consigne collés en haut et le pied fixe en bas : en descendant vers
   les dernières rangées, l'afficheur passait sous la consigne (recette de Marc sur iPhone). Il se colle maintenant
   sous elle (--mc-consigne-h, mesurée par Machine), et les touches glissent dessous ; il reprend sa place quand on
   remonte, et suit la calculatrice quand elle sort de l'écran. Le même afficheur, pas une copie : un lecteur d'écran
   ne le lit qu'une fois. Le cadre de 6 px, couleur du boîtier, cache les touches qui passent dessous ; à sa place,
   il se confond avec le boîtier. Dans « touche par touche », sans consigne ni en-tête collé, il se colle en haut.
   Voir bancs/afficheur.js. */
.mc-machine .ti30-ecran { position: sticky; top: calc(var(--mc-entete-h, 0px) + var(--mc-consigne-h, 0px)); z-index: 4; outline: 6px solid #3C4146; }
/* Au clavier, la touche qui reçoit le focus est amenée sous l'afficheur collé (90 px : sa hauteur, son cadre et la
   marge), et au-dessus du pied fixe, au lieu du bord de l'écran. */
.mc-machine .ti30-ecran ~ div button { scroll-margin-top: calc(var(--mc-entete-h, 0px) + var(--mc-consigne-h, 0px) + 90px); scroll-margin-bottom: 80px; }
/* L'en-tête aminci quand on descend (App, masterclass-app-v3.js) : la barre et les points se cachent, 28 px rendus. */
.mc-entete--mince .mc-barre, .mc-entete--mince .mc-points { display: none; }

/* Finitions du 05.11.2026 (prompt Cowork de 13 h 50).
   La calculatrice et son bouton « Réinitialiser » sont enveloppés (Machine) : centrés comme avant sous 1000 px. Au
   clavier (F8), la calculatrice prend le focus : un anneau le montre. */
.mc-machine__colonne, .mc-machine__calc { display: flex; flex-direction: column; align-items: center; width: 100%; }
.ti30-calc:focus { outline: none; }
.ti30-calc:focus-visible { outline: 3px solid var(--mv-focus); outline-offset: 3px; }

/* F7, LA VUE ORDINATEUR : à partir de 1000 px, dans une mission et dans la vérification, le texte à gauche (la colonne
   de 680 px d'avant), la calculatrice à droite (316 px), sa colonne aussi haute que l'écran de la mission ; la barre
   de retour et le pied suivent la largeur. Sur un
   écran assez haut pour la tenir entière (880 px), la calculatrice et son bouton restent en vue en entier ; plus bas,
   c'est l'afficheur qui reste en vue, collé sous l'en-tête, comme au téléphone. Rien ne change sous 1000 px. */
@media (min-width: 1000px) {
  .mc-vue-machine .mv-charte.mc-app { max-width: 1060px; }
  .mc-vue-machine .cq-barre { max-width: 1060px; }
  .mc-vue-machine .mc-pied__dedans { max-width: 1028px; }
  .mc-vue-machine .mc-app > main > div:first-child { position: relative; padding-right: 344px; min-height: 724px; }
  .mc-vue-machine .mc-machine__colonne { position: absolute; top: 0; right: 0; bottom: 0; width: 316px; }
  .mc-vue-machine .mc-machine .ti30-ecran { top: calc(var(--mc-entete-h, 0px) + 8px); }
  .mc-vue-machine .mc-machine .ti30-ecran ~ div button { scroll-margin-top: calc(var(--mc-entete-h, 0px) + 100px); }
}
@media (min-width: 1000px) and (min-height: 880px) {
  .mc-vue-machine .mc-machine__calc { position: sticky; top: calc(var(--mc-entete-h, 76px) + 12px); }
}
