/* L'outil du cours de C · les trois vues (lot 2, 14/10/26), d'après la maquette du 13/10.
   Sans dépendance externe ; servi avec Content-Security-Policy: default-src 'self'. */
:root {
  --fond: #eef1f5;
  --carte: #ffffff;
  --texte: #0f172a;
  --doux: #475569;
  --bord: #cbd5e1;
  --accent: #1d4ed8;
  --accent-texte: #ffffff;
  --accent-doux: #e6edfc;
  --sondage: #c2410c;
  --sondage-doux: #fff3e8;
  --ok: #15803d;
  --ok-doux: #e5f6eb;
  --alerte: #b91c1c;
  --alerte-doux: #fdeaea;
  --code-fond: #f1f5f9;
  --cache-fond: repeating-linear-gradient(-45deg, #f8fafc 0 8px, #eef2f7 8px 16px);
  --ombre: 0 1px 2px rgba(15, 23, 42, .08), 0 2px 8px rgba(15, 23, 42, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0b0f17;
    --carte: #151b26;
    --texte: #f1f5f9;
    --doux: #a8b3c4;
    --bord: #2c3646;
    --accent: #7ea6ff;
    --accent-texte: #0b0f17;
    --accent-doux: #1a2540;
    --sondage: #fb923c;
    --sondage-doux: #2a1b10;
    --ok: #4ade80;
    --ok-doux: #10261a;
    --alerte: #f87171;
    --alerte-doux: #2c1416;
    --code-fond: #0e131c;
    --cache-fond: repeating-linear-gradient(-45deg, #171e2a 0 8px, #1b2331 8px 16px);
    --ombre: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --fond: #0b0f17;
    --carte: #151b26;
    --texte: #f1f5f9;
    --doux: #a8b3c4;
    --bord: #2c3646;
    --accent: #7ea6ff;
    --accent-texte: #0b0f17;
    --accent-doux: #1a2540;
    --sondage: #fb923c;
    --sondage-doux: #2a1b10;
    --ok: #4ade80;
    --ok-doux: #10261a;
    --alerte: #f87171;
    --alerte-doux: #2c1416;
    --code-fond: #0e131c;
    --cache-fond: repeating-linear-gradient(-45deg, #171e2a 0 8px, #1b2331 8px 16px);
    --ombre: none;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond);
  color: var(--texte);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; background: var(--code-fond); padding: .05em .3em; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: .5em 1em; border-radius: 12px;
  border: 1.5px solid var(--bord); background: var(--carte); cursor: pointer;
  font-weight: 600; text-align: center; line-height: 1.2;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.plein { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.btn.vert { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.rouge { background: var(--alerte); color: #fff; border-color: var(--alerte); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.vert, :root:not([data-theme="light"]) .btn.rouge { color: #0b0f17; } }
:root[data-theme="dark"] .btn.vert, :root[data-theme="dark"] .btn.rouge { color: #0b0f17; }
.btn.petit { min-height: 36px; padding: .25em .7em; font-size: .9em; border-radius: 9px; }
.btn.large { width: 100%; }
.btn.lien { border: 0; background: none; color: var(--accent); padding: 0 .2em; min-height: 32px; font-weight: 600; }
.rangee { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rangee > .btn { flex: 1 1 auto; }

/* ---------- vues ---------- */
.vue { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--fond); position: relative; }
.defile { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; min-height: 0; -webkit-overflow-scrolling: touch; }
.barre {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--carte); border-bottom: 1px solid var(--bord); min-height: 52px;
}
.barre .titre { font-weight: 700; flex: 1; min-width: 0; line-height: 1.25; }
.barre .titre small { display: block; font-weight: 500; color: var(--doux); font-size: .8em; }
.puce { display: inline-block; padding: .1em .55em; border-radius: 999px; font-size: .8em; font-weight: 700; background: var(--accent-doux); color: var(--accent); white-space: nowrap; }
.puce.vert { background: var(--ok-doux); color: var(--ok); }
.puce.rouge { background: var(--alerte-doux); color: var(--alerte); }
.puce.orange { background: var(--sondage-doux); color: var(--sondage); }
.page { padding: 12px 16px 28px; max-width: 760px; margin: 0 auto; }

.onglets { display: grid; background: var(--carte); border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom); }
.onglets.six { grid-template-columns: repeat(6, 1fr); }
.onglets.trois { grid-template-columns: repeat(3, 1fr); }
.onglets.sept { grid-template-columns: repeat(7, 1fr); }
.onglets.sept button { font-size: 10.5px; letter-spacing: -.02em; overflow: hidden; }
.onglets.huit { grid-template-columns: repeat(8, 1fr); }        /* l'onglet Révision, 09/11 */
.onglets.huit button { font-size: 9.5px; letter-spacing: -.03em; overflow: hidden; padding-left: 0; padding-right: 0; }
.onglets button {
  border: 0; background: none; cursor: pointer; padding: 6px 2px 8px; min-height: 58px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11.5px; letter-spacing: -.01em; color: var(--doux); position: relative; line-height: 1.15;
}
.onglets.trois button { font-size: 14px; }
.onglets button .ico { font-size: 20px; line-height: 1; }
.onglets button.actif { color: var(--accent); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }
.badge { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--alerte); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.badge.point { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 7px; right: calc(50% - 16px); }

/* ---------- contenu de fiche ---------- */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 14px 16px; margin: 12px 0; box-shadow: var(--ombre); }
.carte > :first-child { margin-top: 0; }
.carte > :last-child { margin-bottom: 0; }
.partie-titre { margin: 22px 0 4px; font-size: 1.25em; line-height: 1.25; }
.partie-titre .romain { color: var(--doux); }
.partie-intro { color: var(--doux); margin: 0 0 8px; }
.etape { scroll-margin-top: 8px; }
.vue-etudiant .page.deroule { padding-bottom: 50vh; }
.etape.courante { border: 2px solid var(--accent); }
.etape-tete { display: flex; align-items: flex-start; gap: 8px; width: 100%; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.etape-tete h3 { margin: 0; font-size: 1.08em; line-height: 1.3; flex: 1; }
.etape-tete .num { color: var(--doux); font-variant-numeric: tabular-nums; }
.etape-corps { margin-top: 10px; }
.etape-corps p, .etape-corps ul, .etape-corps ol { margin: .6em 0; }
.etape-corps ul, .etape-corps ol { padding-left: 1.3em; }
.etape-corps li { margin: .3em 0; }
.etape-corps img { border-radius: 10px; border: 1px solid var(--bord); margin: .6em 0; background: #fff; }
.repli { color: var(--doux); font-size: .9em; }

.bloc-code { position: relative; margin: .8em 0; }
.bloc-code pre {
  margin: 0; padding: 12px 12px 12px; padding-top: 44px; background: var(--code-fond); border: 1px solid var(--bord); border-radius: 10px;
  white-space: pre-wrap; word-break: break-word; font: 14px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.bloc-code .copier { position: absolute; top: 6px; right: 6px; }
.bloc-code .etiquette { position: absolute; top: 12px; left: 12px; font-size: 12px; color: var(--doux); font-weight: 600; }

.revele { border-left: 4px solid var(--ok); background: var(--ok-doux); padding: 8px 12px; border-radius: 0 10px 10px 0; margin: .8em 0; }
.revele .marque { font-size: .78em; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .04em; display: block; }
.cache-prof { border: 1.5px dashed var(--bord); background: var(--cache-fond); padding: 8px 12px; border-radius: 10px; margin: .8em 0; color: var(--doux); }
.cache-prof .marque { font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; display: block; }
.secours { border: 2px solid var(--sondage); border-radius: 12px; padding: 8px; margin: .8em 0; }
.secours .marque { font-size: .8em; font-weight: 700; color: var(--sondage); }

.indice { border: 1.5px solid var(--bord); background: var(--carte); border-radius: 8px; padding: .15em .6em; cursor: pointer; font-weight: 600; min-height: 36px; }
.indice-texte { background: var(--accent-doux); padding: .1em .3em; border-radius: 4px; }

/* sondage */
.sondage { background: var(--sondage-doux); border: 1.5px solid color-mix(in srgb, var(--sondage) 35%, transparent); border-radius: 14px; padding: 12px; margin: .8em 0; }
.sondage .etat { font-size: .88em; font-weight: 600; color: var(--sondage); margin: 0 0 8px; }
.sondage .question { margin: 10px 0 4px; font-weight: 600; }
.sondage .question .n { color: var(--sondage); margin-right: .3em; }
.options { display: grid; gap: 8px; }
.option {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; min-height: 52px;
  padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--bord); background: var(--carte); cursor: pointer; font-weight: 500;
}
.option .l { font-weight: 800; color: var(--sondage); min-width: 1.2em; }
.option.choisie { border-color: var(--sondage); box-shadow: inset 0 0 0 1.5px var(--sondage); }
.option.choisie::after { content: "✓"; margin-left: auto; color: var(--sondage); font-weight: 800; }
.option:disabled { cursor: default; opacity: .7; }
.option.choisie:disabled { opacity: 1; }
.resultat { display: grid; grid-template-columns: 1.6em 1fr auto; align-items: center; gap: 4px 8px; margin: 6px 0; }
.resultat .l { font-weight: 800; color: var(--sondage); }
.resultat .barre-fond { grid-column: 2 / 4; height: 10px; background: color-mix(in srgb, var(--sondage) 15%, transparent); border-radius: 6px; overflow: hidden; }
.resultat .barre-pleine { height: 100%; background: var(--sondage); border-radius: 6px; }
.resultat .pct { font-weight: 800; font-variant-numeric: tabular-nums; }
.resultat.mien .t::after { content: " · votre vote"; color: var(--doux); font-weight: 500; font-size: .85em; }

/* réponse libre */
.libre { border: 1.5px solid var(--bord); border-radius: 12px; padding: 10px 12px; margin: .8em 0; background: var(--carte); }
.libre label { font-weight: 600; display: block; margin-bottom: 6px; }
textarea, input[type=text] {
  width: 100%; border: 1.5px solid var(--bord); border-radius: 10px; padding: 10px 12px; background: var(--carte); min-height: 48px;
}
textarea { resize: vertical; min-height: 76px; }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.envoyes { margin: 8px 0 0; padding: 0; list-style: none; font-size: .92em; color: var(--doux); }
.envoyes li::before { content: "✓ envoyé · "; color: var(--ok); font-weight: 600; }
.case { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.case input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.case small { display: block; color: var(--doux); }

/* questions */
.q { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 12px 14px; margin: 10px 0; box-shadow: var(--ombre); }
.q-tete { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .88em; color: var(--doux); }
.q-tete .qui { font-weight: 700; color: var(--texte); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.q-tete .anon { font-style: italic; font-weight: 600; color: var(--doux); }
.q-texte { margin: 6px 0 8px; white-space: pre-wrap; }
.q-pied { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.like { min-height: 44px; border-radius: 22px; padding: 0 14px; border: 1.5px solid var(--bord); background: var(--carte); cursor: pointer; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.like.aime { border-color: var(--alerte); color: var(--alerte); background: var(--alerte-doux); }
.like:disabled { cursor: default; }
.comms { border-top: 1px solid var(--bord); margin-top: 10px; padding-top: 6px; }
.comm { padding: 6px 0; border-bottom: 1px dashed var(--bord); font-size: .94em; }
.comm b { font-size: .9em; }
.section-titre { font-size: 1em; margin: 18px 0 6px; color: var(--doux); text-transform: uppercase; letter-spacing: .05em; }

/* minuteur bandeau (étudiant) */
.bandeau-minuteur { background: var(--accent); color: var(--accent-texte); padding: 6px 16px; font-weight: 700; display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.bandeau-minuteur.fini { background: var(--alerte); color: #fff; }

/* connexion */
.connexion { padding: 24px 16px; max-width: 460px; margin: 0 auto; }
.connexion h1 { font-size: 1.45em; margin: 0 0 4px; line-height: 1.2; }
.connexion .champ { margin: 14px 0; }
.connexion .champ label { display: block; font-weight: 600; margin-bottom: 4px; }
.connexion .btn.large + .btn.large { margin-top: 10px; }
.gardé { font-size: .9em; color: var(--doux); background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; margin-top: 16px; }

.factice { border: 2px dashed var(--sondage); border-radius: 14px; padding: 12px 14px; background: var(--sondage-doux); }
.factice .tampon { display: inline-block; font-weight: 800; color: var(--sondage); letter-spacing: .06em; text-transform: uppercase; font-size: .85em; }

/* ---------- télécommande ---------- */
.vue-prof .barre { flex-wrap: wrap; gap: 6px 10px; }
.ecart { font-weight: 800; font-variant-numeric: tabular-nums; }
.nav-prof { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin: 12px 0; }
.nav-prof .btn { min-height: 64px; font-size: 1.05em; }
.aller { display: flex; gap: 8px; }
.aller input { flex: 1; min-width: 0; }
.panneau { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.panneau h4 .btn { white-space: nowrap; flex: none; }
.panneau h4 { margin: 0 0 8px; font-size: .95em; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chiffre-minuteur { font-size: 2.4em; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.chiffre-minuteur.fini { color: var(--alerte); }
.apercu-secours img { max-height: 120px; width: auto; border-radius: 8px; border: 1px solid var(--bord); }
.libres-liste { list-style: none; padding: 0; margin: 0; }
.libres-liste li { padding: 6px 0; border-bottom: 1px dashed var(--bord); }
.libres-liste li b { font-size: .88em; color: var(--doux); display: block; }
.anti h4 { text-transform: none; letter-spacing: 0; color: var(--texte); }
.anti ul { padding-left: 1.1em; margin: .3em 0; }
.anti li { margin: .25em 0; }
.anti li.ici { background: var(--accent-doux); border-radius: 8px; padding: 2px 6px; margin-left: -6px; }
.anti p { margin: .4em 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; scrollbar-width: thin; }
.chips button { flex: none; min-height: 40px; border-radius: 20px; padding: 0 12px; border: 1.5px solid var(--bord); background: var(--carte); cursor: pointer; font-weight: 600; font-size: .9em; }
.chips button.actif { border-color: var(--accent); color: var(--accent); background: var(--accent-doux); }
.mini { font-size: .85em; color: var(--doux); }
.simu { border-style: dashed; }

/* ---------- PC projeté ---------- */
.vue-projection { container-type: inline-size; background: var(--fond); }
.vue-projection .proj-haut {
  display: flex; align-items: center; gap: 1.5cqw; padding: .8cqw 2cqw; font-size: 1.35cqw; color: var(--doux);
  border-bottom: 1px solid var(--bord); background: var(--carte);
}
.vue-projection .proj-haut b { color: var(--texte); }
.vue-projection .proj-haut .droite { margin-left: auto; display: flex; gap: 1.5cqw; align-items: center; }
.vue-projection .proj-haut button { font-size: 1.1cqw; min-height: 0; padding: .3cqw .8cqw; }
.proj-corps { flex: 1; display: flex; min-height: 0; }
.proj-etape { flex: 1; min-width: 0; padding: 1.6cqw 3cqw 2cqw; font-size: 2.05cqw; line-height: 1.4; }
.proj-etape h2 { font-size: 3.3cqw; margin: 0 0 1.2cqw; line-height: 1.15; }
.proj-etape h2 .num { color: var(--doux); }
.proj-etape .partie { font-size: 1.4cqw; color: var(--doux); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3cqw; }
.proj-etape p, .proj-etape ul, .proj-etape ol { margin: .7cqw 0; }
.proj-etape img { max-height: 64cqw; max-height: min(64cqw, 72vh); width: auto; margin: 1cqw auto; border-radius: .6cqw; border: 1px solid var(--bord); background: #fff; }
.proj-etape .images-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5cqw; }
.proj-etape .images-2 img { max-height: none; width: 100%; }
.proj-etape .bloc-code pre { font-size: 1.45cqw; padding: 1cqw; padding-top: 1cqw; }
.proj-etape .bloc-code .copier, .proj-etape .bloc-code .etiquette { display: none; }
.proj-etape .sondage { padding: 1.4cqw 1.8cqw; border-radius: 1.2cqw; }
.proj-etape .sondage .etat { font-size: 1.6cqw; margin-bottom: .6cqw; }
.proj-etape .options { grid-template-columns: repeat(auto-fit, minmax(18cqw, 1fr)); gap: 1cqw; }
.proj-etape .option { min-height: 0; padding: .7cqw 1.2cqw; border-radius: 1cqw; font-size: 2cqw; cursor: default; }
.proj-etape .resultat { grid-template-columns: 3cqw 1fr auto; gap: .3cqw 1cqw; margin: .8cqw 0; font-size: 2.2cqw; }
.proj-etape .resultat .pct { font-size: 4.2cqw; line-height: 1; }
.proj-etape .resultat .barre-fond { height: 1.3cqw; border-radius: .7cqw; }
.proj-etape .libre textarea, .proj-etape .libre button { display: none; }
.proj-etape .libre { border-width: 2px; }
.proj-etape .q { padding: 1cqw 1.4cqw; margin: .8cqw 0; }
.proj-etape .q-tete { font-size: 1.4cqw; }
.proj-etape .q-texte { font-size: 2.2cqw; margin: .3cqw 0; }
.proj-etape .like { min-height: 0; font-size: 1.6cqw; padding: .2cqw 1cqw; }
.proj-etape .revele .marque, .proj-etape .secours .marque { font-size: 1.2cqw; }
.gros-compte { font-size: 6cqw; font-weight: 800; line-height: 1; color: var(--sondage); font-variant-numeric: tabular-nums; }
.proj-minuteur {
  flex: 0 0 34cqw; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-texte); padding: 2cqw;
}
.proj-minuteur .chiffre { white-space: nowrap; font-size: 12cqw; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.proj-minuteur .legende { font-size: 2cqw; font-weight: 600; opacity: .9; margin-top: 1cqw; text-align: center; }
.proj-minuteur.fini { background: var(--alerte); color: #fff; }
.proj-qr { flex: 1; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4cqw; padding: 3cqw 5cqw; }
.proj-qr svg { width: 32cqw; height: 32cqw; background: #fff; padding: 1.2cqw; border-radius: 1cqw; }
.proj-qr h2 { font-size: 4.2cqw; margin: 0 0 1cqw; line-height: 1.1; }
.proj-qr p { font-size: 2.2cqw; margin: .8cqw 0; }
.proj-qr .adresse { font-family: ui-monospace, Consolas, monospace; font-size: 2cqw; background: var(--carte); border: 1px solid var(--bord); padding: .4cqw 1cqw; border-radius: .6cqw; display: inline-block; }
.proj-qr .compte { font-size: 5cqw; font-weight: 800; color: var(--accent); }

/* ---------- PC projeté : une seule chose à la fois, sans défilement (13/10) ---------- */
.proj-etape { display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.proj-diapo { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.proj-diapo img { max-width: 100%; max-height: min(64cqw, 82vh); width: auto; height: auto; margin: 0; }
.proj-votes { position: absolute; right: 1cqw; bottom: 1cqw; background: var(--sondage); color: var(--accent-texte); font-weight: 800; font-size: 2.4cqw; padding: .5cqw 1.4cqw; border-radius: 1cqw; font-variant-numeric: tabular-nums; }
.proj-titre { margin: auto; text-align: center; }
.proj-titre h2 { font-size: 5cqw; line-height: 1.15; text-wrap: balance; }
.proj-titre p { font-size: 2.4cqw; color: var(--doux); }
.proj-outil { overflow: hidden; }
/* la télécommande montre ce qui est à l'écran */
.a-l-ecran { margin: 10px 0; }
.vignette { container-type: inline-size; border: 1px solid var(--bord); border-radius: 10px; background: var(--fond); max-height: 200px; overflow: hidden; display: flex; justify-content: center; padding: 6px; font-size: 9px; }
.vignette .proj-diapo img { max-height: 180px; }
.vignette .proj-titre h2 { font-size: 16px; margin: 4px 0; }
.vignette .proj-titre .partie, .vignette .proj-titre p { font-size: 11px; margin: 0; }
.vignette .proj-votes { font-size: 11px; padding: 2px 6px; }
.vignette-texte { border: 1px dashed var(--bord); border-radius: 10px; padding: 10px; text-align: center; color: var(--doux); }
/* un sondage à plusieurs questions : côte à côte, pour tenir dans l'écran */
.proj-outil .q-blocs { display: grid; gap: 2.5cqw; align-items: start; }
.proj-outil .q-blocs.n2 { grid-template-columns: 1fr 1fr; }
.proj-outil .q-blocs.n3, .proj-outil .q-blocs.n4 { grid-template-columns: repeat(3, 1fr); }
.proj-outil .q-blocs.n2 .options, .proj-outil .q-blocs.n3 .options, .proj-outil .q-blocs.n4 .options { grid-template-columns: 1fr; }
.proj-outil .q-blocs.n3 .resultat .pct, .proj-outil .q-blocs.n4 .resultat .pct { font-size: 3.2cqw; }

/* ======================================================================
   Les vraies pages (lot 2, 14/10) : ce que la maquette n'avait pas.
   ====================================================================== */
.chargement { padding: 24px 16px; color: var(--doux); }
.gras { font-weight: 700; }
.serre { margin: 2px 0 8px; }
.espace { margin-top: 10px; }
.centre { text-align: center; }
.attenue { opacity: .6; }
.erreur { color: var(--alerte); font-weight: 600; margin: 8px 0; }
.rangee.entre { justify-content: space-between; }
.rangee.espace { margin-top: 10px; }
.hors-seance { background: var(--accent-doux); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
body.hors-ligne::before {
  content: "Connexion perdue : nouvelle tentative chaque seconde…"; position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  background: var(--alerte); color: #fff; text-align: center; font-weight: 700; padding: 4px 8px; font-size: .9em;
}
.avis {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px);
  background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--ombre);
}
.avis.alerte { background: var(--alerte); color: #fff; }
.avis.ok { background: var(--ok); color: #fff; }

/* l'entrée : le groupe, choisi, jamais prérempli */
fieldset.groupes { border: 0; padding: 0; margin: 14px 0; min-width: 0; }
fieldset.groupes legend { font-weight: 600; margin-bottom: 4px; padding: 0; }
.choix-groupes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choix-groupe { min-height: 56px; font-size: 1.05em; }

/* le markdown des fiches */
.etape-corps h4, .etape-corps h5 { margin: .9em 0 .3em; }
.etape-corps blockquote, .partie-intro blockquote { margin: .6em 0; padding: 4px 12px; border-left: 4px solid var(--bord); color: var(--doux); }
.encart { border-left: 4px solid var(--accent); background: var(--accent-doux); border-radius: 0 10px 10px 0; padding: 8px 12px; margin: .8em 0; }
.encart-titre { font-weight: 700; }
.encart > p:first-of-type { margin-top: .3em; }
.tableau { overflow-x: auto; margin: .8em 0; }
.tableau table { border-collapse: collapse; font-size: .92em; }
.tableau th, .tableau td { border: 1px solid var(--bord); padding: 4px 8px; text-align: left; vertical-align: top; }
.partie-intro p { margin: 0 0 6px; }
.indice-bloc { margin: .6em 0; }
.indice-texte { display: block; margin-top: 6px; padding: 6px 10px; border-radius: 8px; }
.like.fixe { cursor: default; }

/* bandeau du détour (étudiant) */
.bandeau-detour { background: var(--sondage); color: var(--accent-texte); padding: 6px 16px; font-weight: 700; }
/* bandeau de la mesure (étudiant), montré une fois (lot 7) */
.bandeau-mesure { background: var(--carte); border-bottom: 1px solid var(--bord); padding: 8px 16px; display: flex; gap: 12px; align-items: center; }
.bandeau-mesure p { margin: 0; font-size: .9em; flex: 1; }

/* ---------- le PC projeté, en plein écran ---------- */
body.mode-projection { overflow: hidden; }
body.mode-projection #app { height: 100vh; }
@supports (height: 100dvh) { body.mode-projection #app { height: 100dvh; } }
.vue-projection { height: 100%; overflow: hidden; }
.proj-principal { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.proj-principal .proj-etape { flex: 1; min-height: 0; }
.proj-bandeau {
  background: var(--sondage); color: var(--accent-texte); font-weight: 800; font-size: 2.2cqw; padding: .6cqw 2cqw; text-align: center;
}
.gros-compte .unite { font-size: .4em; }
.proj-outil > h2 { font-size: 3cqw; margin: 0 0 1cqw; }
.proj-libre h2 { font-size: 4cqw; font-weight: 700; white-space: pre-wrap; }
.proj-libre .partie { font-size: 2cqw; text-transform: none; letter-spacing: 0; }
.proj-qr { grid-template-columns: 1fr; text-align: center; }
.proj-qr .adresse { font-size: 4cqw; padding: .8cqw 2cqw; }
.proj-qr h2 { font-size: 5cqw; }
.proj-qr p { font-size: 2.6cqw; }

/* ---------- la télécommande ---------- */
.vignette { position: relative; }
.vignette .proj-etape { padding: 4px; font-size: 9px; width: 100%; max-height: 188px; }
.vignette .proj-qr { padding: 6px; gap: 4px; }
.vignette .proj-qr h2 { font-size: 15px; margin: 0; }
.vignette .proj-qr p { font-size: 10px; margin: 2px 0; }
.vignette .proj-qr .adresse { font-size: 10px; }
.vignette .proj-qr .compte { font-size: 14px; }
.vignette .proj-outil h2 { font-size: 12px; }
.vignette .proj-libre h2 { font-size: 14px; }
.vignette-minuteur, .vignette-bandeau {
  position: absolute; top: 6px; padding: 2px 8px; border-radius: 8px; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
}
.vignette-minuteur { right: 6px; background: var(--accent); color: var(--accent-texte); }
.vignette-minuteur.fini { background: var(--alerte); color: #fff; }
.vignette-bandeau { left: 6px; background: var(--sondage); color: var(--accent-texte); }
.revenir { min-height: 64px; font-size: 1.15em; margin-top: 12px; }

/* « La suite » : ce que « Suivant » montrera, à faire glisser du doigt (répétitions du 19/10 et du 22/10) */
.suite { margin: 12px 0; }
.suite-tete { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.suite-bande {
  display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; padding-bottom: 6px; align-items: flex-start;
}
.suite-carte {
  flex: 0 0 82%; scroll-snap-align: start; min-width: 0; background: var(--carte); border: 1px solid var(--bord);
  border-radius: 12px; padding: 8px;
}
.suite-carte.cachee .vignette { border-style: dashed; }
.suite-carte .vignette { max-height: 170px; }
.suite-carte .vignette .proj-diapo img { max-height: 150px; }
.suite-partie { font-size: .8em; font-weight: 700; color: var(--accent); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .03em; }
.vignette-rang {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 7px; border-radius: 8px; font-size: 12px; font-weight: 800;
  background: var(--texte); color: var(--fond); opacity: .8;
}
.suite-legende { font-size: .88em; margin: 6px 0 2px; line-height: 1.3; }
.suite-marques { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.suite-anti { font-size: .82em; color: var(--doux); max-height: 12em; overflow-y: auto; border-top: 1px solid var(--bord); margin-top: 6px; padding-top: 4px; }
.suite-anti ul { margin: 0; padding-left: 1.1em; }
.suite-anti li { margin: 1px 0; }
.trouvees { list-style: none; padding: 0; margin: 0; }
.trouvee {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px dashed var(--bord);
  padding: 8px 0; cursor: pointer; min-height: 56px;
}
.trouvee img { width: 96px; height: 54px; object-fit: contain; flex: none; border: 1px solid var(--bord); border-radius: 6px; background: #fff; }
.trouvee .sans-vignette { width: 96px; flex: none; text-align: center; color: var(--doux); }
.prochain .etape-corps, .prochain p { margin: .2em 0; }
.prochain img { max-height: 90px; width: auto; }
.resume { font-weight: 600; margin: 0 0 8px; }
.liste-seances { margin: 0 0 8px; padding-left: 1.2em; }
.sessions { list-style: none; padding: 0; margin: 0; }
.sessions li { padding: 10px 0; border-bottom: 1px dashed var(--bord); }
.session-nom { margin-bottom: 6px; }
.appareils { list-style: none; padding: 0; margin: 0; }
.appareils li { padding: 8px 0; border-bottom: 1px dashed var(--bord); }
.appareils .rangee { margin-top: 6px; }
.appareils.attention li { padding: 6px 0 6px 8px; border-left: 4px solid transparent; }
.appareils.attention li.att-rouge { border-left-color: var(--alerte); background: var(--alerte-doux); }
.appareils.attention li.att-orange { border-left-color: var(--sondage); background: var(--sondage-doux); }
.appareils.attention li.att-vert { border-left-color: var(--ok); }
.appareils.attention li.att-gris { opacity: .6; }
.appareils .pastille { font-size: 1.05em; }
.libre-ligne { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.libre-ligne > span:first-child { white-space: pre-wrap; flex: 1; min-width: 0; }
.libre-ligne .btn { flex: none; }
.q-pied .droite { margin-left: auto; }

/* une vue seule (téléphone) : la hauteur de l'écran, les onglets en bas */
body.mode-seul #app { height: 100vh; }
@supports (height: 100dvh) { body.mode-seul #app { height: 100dvh; } }
body.mode-seul .vue-etudiant, body.mode-seul .vue-prof { max-width: 620px; margin: 0 auto; border-left: 1px solid var(--bord); border-right: 1px solid var(--bord); }

/* la diapo projetée prend toute la place qu'on lui laisse, sans jamais déborder */
.proj-etape > .proj-diapo { width: 100%; }
.proj-etape > .proj-diapo img { width: 100%; height: 100%; max-height: none; object-fit: contain; border: 0; background: transparent; }
.vignette .proj-etape > .proj-diapo img { height: auto; max-height: 180px; }
.proj-outil .intitule { font-size: 2.3cqw; font-weight: 700; margin: .4cqw 0 1cqw; line-height: 1.3; }
.vignette .proj-outil .intitule { font-size: 10px; }

/* ---------- corrections de la répétition de R1 (14/10) ---------- */
/* n° 2 : le geste de l'étape en tête, en grand */
.action { margin: 4px 0 12px; }
.btn.action { min-height: 64px; font-size: 1.15em; }
.btn.sondage-btn { background: var(--sondage); color: #fff; border-color: var(--sondage); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.sondage-btn { color: #0b0f17; } }
:root[data-theme="dark"] .btn.sondage-btn { color: #0b0f17; }
.action-questions { background: var(--carte); border: 2px solid var(--accent); border-radius: 14px; padding: 10px 12px; }
.action-questions .q-texte { font-size: 1.1em; font-weight: 600; margin: 6px 0; white-space: pre-wrap; }
.action-questions .rangee { margin-top: 8px; }
.action-questions .rangee .btn { min-height: 56px; }
.ecran-boutons { margin-top: 8px; }
/* n° 1 : « Fermer la séance » tout en bas, loin du pouce, même quand la page est courte */
.panneau.seance-fin { margin-top: 45vh; }
/* n° 9 : une question projetée à la fois */
.proj-question h2 { font-size: 4.2cqw; white-space: pre-wrap; text-wrap: balance; }
.proj-question .partie { font-size: 1.9cqw; text-transform: none; letter-spacing: 0; }
.proj-question p .like { display: inline; font-weight: 800; color: var(--alerte); border: 0; padding: 0; background: none; }
.vignette .proj-question h2 { font-size: 14px; }
/* n° 5 : les liens de l'étape, ouverts du PC projeté dans un nouvel onglet */
.vue-projection { position: relative; }
.proj-liens {
  position: absolute; top: 3.4cqw; right: 2cqw; z-index: 5; max-width: 46cqw; background: var(--carte);
  border: 1px solid var(--bord); border-radius: 1cqw; box-shadow: var(--ombre); padding: .8cqw 1.4cqw; font-size: 1.3cqw;
}
.proj-liens p { margin: 0 0 .5cqw; font-size: 1cqw; color: var(--doux); }
.proj-liens ul { margin: 0; padding-left: 1.4cqw; }
.proj-liens li { margin: .4cqw 0; }
.proj-liens li.ici a { font-weight: 700; }
.proj-liens small { color: var(--doux); }

/* le glisser (lot 4, 15/10) : une ligne par carte, les lettres des cases ; la grille des résultats */
.glisser .cases { display: flex; flex-wrap: wrap; gap: .3em .9em; margin: .3em 0 .6em; font-size: .92em; color: var(--doux); }
.glisser .cases b { color: var(--sondage); }
.carte-glisser { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4em .6em; padding: .45em 0; border-top: 1px solid var(--bord); }
.carte-glisser .carte-texte { flex: 1 1 13em; min-width: 0; }
.carte-glisser .n, .grille-glisser .n { font-weight: 800; color: var(--sondage); }
.carte-glisser .lettres { display: flex; gap: .3em; flex: 0 0 auto; }
.option.lettre { min-width: 2.4em; min-height: 2.4em; padding: 0; justify-content: center; font-weight: 800; }
.option.lettre.choisie::after { content: none; }
.grille-glisser { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.grille-glisser th { color: var(--sondage); font-weight: 800; padding: .2em .4em; }
.grille-glisser td { border-top: 1px solid var(--bord); padding: .3em .4em; }
.grille-glisser .pct-g { text-align: center; color: var(--doux); white-space: nowrap; }
.grille-glisser .pct-g.fort { color: var(--texte); font-weight: 800; background: var(--sondage-doux); }
.grille-glisser .pct-g.mien { box-shadow: inset 0 0 0 2px var(--sondage); }
.proj-outil .glisser { font-size: 2.1cqw; }
.liste-ia { margin: 6px 0; padding-left: 20px; }
.liste-ia li { margin: 4px 0; }

/* l'onglet Notes (lot 10, 26/10) : une page qui défile, des blocs, l'encre par-dessus ; la feuille reste
   blanche, même en thème sombre, comme le PDF */
body.mode-seul .vue-etudiant.large { max-width: 1140px; }
.page.notes { max-width: 1080px; }
.note-carte .rangee { margin-top: 8px; }
.notes-tete { display: flex; gap: 8px; align-items: center; margin: 4px 0 8px; }
.note-titre { flex: 1; min-width: 0; font: inherit; font-weight: 700; font-size: 1.1em; padding: 6px 10px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); color: var(--texte); }
.notes-outils {
  position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
  background: var(--fond); padding: 6px 0; border-bottom: 1px solid var(--bord); margin-bottom: 10px;
}
.notes-outils .groupe { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.notes-outils .outil {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 44px; min-height: 44px; padding: 2px 6px; border: 1px solid var(--bord); border-radius: 10px;
  background: var(--carte); color: var(--texte); cursor: pointer; font-size: 11px; line-height: 1.1;
}
.notes-outils .outil .ico { font-size: 18px; }
.notes-outils .outil.actif { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); font-weight: 700; }
.notes-outils .outil:disabled { opacity: .4; cursor: default; }
.notes-outils .outil.ep, .notes-outils .outil.coul { min-width: 38px; min-height: 38px; }
.point-ep { display: inline-block; border-radius: 50%; }
.pastille-coul { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--doux); }
.feuille {
  position: relative; container-type: inline-size; background: #ffffff; color: #0f172a; color-scheme: light;
  border: 1px solid var(--bord); border-radius: 6px; padding: 0; min-height: 40vh; box-shadow: var(--ombre);
}
.feuille.dessin { touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.feuille.outil-gomme { cursor: cell; }
.feuille .encre { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; z-index: 2; }
.bloc { position: relative; margin: 0; padding: 1.6cqw 2.2cqw; }
.bloc-diapo .diapo { display: block; width: 100%; height: auto; border: 1px solid #cbd5e1; border-radius: 4px; background: #f8fafc; }
.bloc-diapo .legende { font-size: max(11px, 1.3cqw); color: #64748b; margin-top: .4em; }
.bloc-espace { background-image: radial-gradient(#e2e8f0 1px, transparent 1px); background-size: 3cqw 3cqw; min-height: 60px; }
.bloc-texte textarea {
  display: block; width: 100%; resize: none; overflow: hidden; border: 0; outline: none; background: transparent; color: #0f172a;
  font: 400 max(14px, 1.9cqw) / 1.45 system-ui, -apple-system, "Segoe UI", sans-serif; padding: .2em 0; min-height: 1.9em;
}
.bloc-texte textarea::placeholder { color: #94a3b8; }
.feuille:not(.dessin) .bloc-texte textarea:focus { background: #f8fafc; }
.bloc-ctrl { position: absolute; top: 4px; right: 4px; display: flex; gap: 2px; z-index: 3; opacity: .35; }
.bloc:hover .bloc-ctrl, .bloc:focus-within .bloc-ctrl { opacity: 1; }
.bloc-ctrl button { width: 28px; height: 28px; border: 1px solid #cbd5e1; border-radius: 6px; background: #ffffffe6; color: #334155; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.notes-ajouter { margin: 10px 0 4px; flex-wrap: wrap; }
.notes-selecteur { position: fixed; inset: 0; z-index: 20; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; }
.notes-selecteur .fenetre { background: var(--carte); color: var(--texte); border-radius: 14px; width: min(980px, 100%); max-height: 92vh; overflow: auto; padding: 12px 16px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.notes-selecteur h4 { margin: 14px 0 6px; }
.selecteur-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: -12px; background: var(--carte); padding: 4px 0 8px; z-index: 1; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.vignette-diapo { padding: 0; border: 2px solid var(--bord); border-radius: 8px; background: #fff; cursor: pointer; overflow: hidden; }
.vignette-diapo:hover, .vignette-diapo:focus-visible { border-color: var(--accent); }
.vignette-diapo img { display: block; width: 100%; height: auto; }

/* l'onglet Révision (09/11) : revision.js */
.rev-etiquette { font-size: .78em; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); margin: 10px 0 4px; }
.rev-etiquette:first-child { margin-top: 0; }
.rev-choix { display: flex; flex-wrap: wrap; gap: 6px; }
.rev-case { display: flex; align-items: center; gap: 6px; margin: 12px 0 4px; }
.rev-tirer { margin-top: 10px; }
.rev-bilan, .rev-theme, .rev-avertir { color: var(--doux); font-size: .9em; }
.rev-bilan { margin: 8px 0 0; }
.rev-avertir { border-left: 3px solid var(--sondage); padding-left: 8px; }
.rev-theme { margin-top: 2px; }
.rev-reponse { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border: 1.5px solid var(--bord); border-radius: 10px; background: var(--fond); color: var(--texte); resize: vertical; margin: 6px 0; }
.rev-piste { margin: .6em 0; padding: 6px 10px; border-left: 3px solid var(--accent); }
.rev-piste.piege { border-left-color: var(--alerte); }
.rev-piste > :first-child { margin-top: 0; }
.rev-suite { margin-top: 6px; }
.rev-marque { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 4px; }
.rev-suivante { margin-top: 10px; }
.rev-liste summary { cursor: pointer; font-weight: 600; }
.rev-numeros { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rev-numeros .btn { min-width: 52px; }
