/* Classeur — feuille de style unique. Téléphone d'abord, thème clair/sombre selon le système. */
:root {
  --fond: #f6f5fb;
  --carte: #ffffff;
  --carte-2: #fbfbfe;
  --texte: #1c1b2e;
  --doux: #6b6a82;
  --ligne: #e7e5f1;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-doux: #eef0ff;
  --sur-accent: #ffffff;
  --ok: #15803d;
  --attention: #b45309;
  --attention-doux: #fff7e6;
  --erreur: #dc2626;
  --erreur-doux: #fdecec;
  --surligne: #fff2a8;
  --ombre: 0 1px 2px rgba(25, 20, 60, .06), 0 6px 20px rgba(25, 20, 60, .06);
  --ombre-forte: 0 10px 30px rgba(40, 30, 110, .28);
  --rayon: 16px;
  --rayon-petit: 10px;
  --haut-barre: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f1020;
    --carte: #1a1b2f;
    --carte-2: #202138;
    --texte: #ececf6;
    --doux: #a2a2bb;
    --ligne: #2d2e48;
    --accent: #8c8dff;
    --accent-2: #b28cff;
    --accent-doux: #25264b;
    --sur-accent: #0f1020;
    --ok: #4ade80;
    --attention: #fbbf24;
    --attention-doux: #33290f;
    --erreur: #f87171;
    --erreur-doux: #3a1a1f;
    --surligne: #5b4b00;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- barre du haut ---------- */
.barre {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  height: calc(var(--haut-barre) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0;
  background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--ligne);
}
.barre h1 {
  flex: 1; margin: 0; font-size: 18px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.barre .logo { font-size: 22px; padding: 0 6px 0 8px; }
.barre .actions { display: flex; gap: 2px; }
.icone-bouton {
  display: inline-grid; place-items: center;
  min-width: 42px; height: 42px; padding: 0 8px;
  border: 0; border-radius: 12px; background: transparent;
  font-size: 20px; color: var(--texte); cursor: pointer;
}
.icone-bouton:hover, .icone-bouton:focus-visible { background: var(--accent-doux); outline: none; }
.retour { font-size: 30px; line-height: 1; padding-bottom: 4px; }

main { max-width: 780px; margin: 0 auto; padding: 14px 16px 24px; outline: none; }
h2.section {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--doux); margin: 26px 4px 10px;
}
h2.section:first-child { margin-top: 8px; }
.doux { color: var(--doux); }
.petit { font-size: 14px; }
.centre { text-align: center; }

/* ---------- cartes ---------- */
.carte {
  background: var(--carte); border: 1px solid var(--ligne);
  border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 16px;
}
.carte + .carte { margin-top: 12px; }

/* ---------- boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px;
  border: 0; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 650; cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, .25);
  transition: transform .08s ease, opacity .15s;
}
@media (prefers-color-scheme: dark) { .bouton { color: #0f1020; } }
.bouton:active { transform: scale(.98); }
.bouton:disabled { opacity: .5; cursor: default; box-shadow: none; }
.bouton.secondaire {
  background: var(--carte); color: var(--texte);
  border: 1px solid var(--ligne); box-shadow: none;
}
.bouton.danger { background: var(--erreur-doux); color: var(--erreur); box-shadow: none; }
.bouton.plein { width: 100%; }
.bouton.gros { min-height: 56px; font-size: 17px; border-radius: 16px; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; }
.rangee > .bouton { flex: 1 1 auto; }

/* bouton flottant « photographier un cours » */
.fab {
  position: fixed; z-index: 30;
  right: max(18px, calc((100vw - 780px) / 2 + 18px));
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 10px;
  height: 60px; padding: 0 22px 0 18px;
  border: 0; border-radius: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: var(--ombre-forte); cursor: pointer;
}
@media (prefers-color-scheme: dark) { .fab { color: #0f1020; } }
.fab .ico { font-size: 24px; }
.fab:active { transform: scale(.97); }

/* ---------- bandeaux ---------- */
#bandeaux { max-width: 780px; margin: 0 auto; padding: 0 16px; }
.bandeau {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px; padding: 10px 14px;
  border-radius: 12px; font-size: 14px;
  background: var(--accent-doux); color: var(--texte);
}
.bandeau.attention { background: var(--attention-doux); }
.bandeau.erreur { background: var(--erreur-doux); }
.bandeau .texte { flex: 1; }
.bandeau button { border: 0; background: none; color: var(--accent); font-weight: 650; cursor: pointer; padding: 4px; }

/* pastille d'état du PC */
.pc { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--doux); }
.pc::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; }
.pc.en-ligne::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.pc.probleme::before { background: #f59e0b; }
.ligne-etat { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 2px 4px 0; }

/* ---------- matières ---------- */
.grille-matieres { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 620px) { .grille-matieres { grid-template-columns: repeat(3, 1fr); } }
.matiere {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  min-height: 118px; padding: 14px 14px 12px;
  background: var(--carte); border: 1px solid var(--ligne);
  border-radius: var(--rayon); box-shadow: var(--ombre);
  color: var(--texte); overflow: hidden;
}
.matiere::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--c, var(--accent));
}
.matiere::after {
  content: ""; position: absolute; right: -30px; bottom: -30px; width: 90px; height: 90px;
  border-radius: 50%; background: var(--c, var(--accent)); opacity: .08;
}
.matiere-icone { font-size: 28px; line-height: 1.2; }
.matiere-nom { font-weight: 700; font-size: 17px; line-height: 1.25; }
.matiere-meta { font-size: 13px; color: var(--doux); }
.matiere-eval {
  align-self: flex-start; margin-top: 6px; padding: 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 650; background: var(--attention-doux); color: var(--attention);
}
.matiere.ajouter {
  align-items: center; justify-content: center; text-align: center;
  border-style: dashed; box-shadow: none; background: transparent; color: var(--doux);
}
.matiere.ajouter::before, .matiere.ajouter::after { display: none; }
.pastille-matiere {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
  color: color-mix(in srgb, var(--c, var(--accent)) 80%, var(--texte));
}
.entete-matiere {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  border-radius: var(--rayon);
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 18%, var(--carte)), var(--carte));
  border: 1px solid var(--ligne);
}
.entete-matiere .grande-icone { font-size: 40px; }
.entete-matiere h2 { margin: 0; font-size: 22px; }

/* ---------- listes de cours ---------- */
.liste { display: flex; flex-direction: column; gap: 10px; }
.ligne-cours {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; padding-right: 12px;
  background: var(--carte); border: 1px solid var(--ligne);
  border-radius: 14px; color: var(--texte);
}
.ligne-cours .vignette {
  flex: none; width: 56px; height: 72px; border-radius: 8px;
  object-fit: cover; background: var(--carte-2); border: 1px solid var(--ligne);
  display: grid; place-items: center; font-size: 22px;
}
.ligne-texte { flex: 1; min-width: 0; }
.ligne-titre { font-weight: 650; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ligne-meta { font-size: 13px; color: var(--doux); margin-top: 2px; }
.ligne-apercu { font-size: 13px; color: var(--doux); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mois { font-size: 13px; font-weight: 650; color: var(--doux); margin: 14px 4px 2px; text-transform: capitalize; }

.badge {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap;
  background: var(--accent-doux); color: var(--accent);
}
.badge.attente, .badge.envoi { background: var(--attention-doux); color: var(--attention); }
.badge.erreur { background: var(--erreur-doux); color: var(--erreur); }
.badge.analyse::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- évals ---------- */
.carte-eval {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--carte); border: 1px solid var(--ligne); border-left: 5px solid var(--c, var(--accent));
  border-radius: 14px; color: var(--texte);
}
.compte {
  flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px;
  background: var(--accent-doux); color: var(--accent); font-weight: 800; line-height: 1.05; text-align: center;
}
.compte small { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.compte.proche { background: var(--erreur-doux); color: var(--erreur); }

/* ---------- vue d'un cours ---------- */
.titre-page { font-size: 24px; line-height: 1.25; margin: 6px 0 8px; }
.meta-page { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--doux); font-size: 14px; }
.onglets {
  position: sticky; top: calc(var(--haut-barre) + env(safe-area-inset-top)); z-index: 10;
  display: flex; gap: 4px; margin: 16px -16px 14px; padding: 8px 16px;
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  overflow-x: auto; scrollbar-width: none;
}
.onglets::-webkit-scrollbar { display: none; }
.onglet {
  flex: none; padding: 8px 14px; border: 1px solid var(--ligne); border-radius: 99px;
  background: var(--carte); cursor: pointer; font-size: 15px; font-weight: 600; color: var(--doux);
}
.onglet.actif { background: var(--texte); color: var(--fond); border-color: var(--texte); }

.essentiel {
  background: linear-gradient(135deg, var(--accent-doux), var(--carte));
  border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px 16px;
}
.essentiel h3 { margin: 0 0 6px; font-size: 15px; }
.essentiel ul { margin: 0; padding-left: 20px; }
.essentiel li { margin: 5px 0; }
.a-verifier { background: var(--attention-doux); border-radius: var(--rayon); padding: 12px 16px; margin-top: 14px; }
.a-verifier h3 { margin: 0 0 4px; font-size: 15px; color: var(--attention); }
.a-verifier ul { margin: 0; padding-left: 20px; font-size: 15px; }
.notions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.notion { padding: 3px 10px; border-radius: 99px; background: var(--carte-2); border: 1px solid var(--ligne); font-size: 13px; }

.etat-attente { text-align: center; padding: 26px 18px; }
.etat-attente .gros-emoji { font-size: 44px; }
.etat-attente h3 { margin: 8px 0 4px; }
.sablier { display: inline-block; animation: tourne 2.4s ease-in-out infinite; }
@keyframes tourne { 0%, 40% { transform: rotate(0); } 60%, 100% { transform: rotate(180deg); } }

/* questions : réponse cachée jusqu'au toucher */
.question {
  background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; margin-bottom: 10px;
}
.question summary {
  list-style: none; display: flex; gap: 10px; padding: 14px; cursor: pointer; font-weight: 600;
}
.question summary::-webkit-details-marker { display: none; }
.question .num {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-doux); color: var(--accent); font-size: 13px; font-weight: 800;
}
.question .voir { margin-left: auto; flex: none; font-size: 13px; color: var(--accent); font-weight: 600; }
.question[open] .voir { display: none; }
.question .reponse { padding: 0 14px 14px 50px; color: var(--texte); border-top: 1px dashed var(--ligne); padding-top: 10px; }

/* pages */
.pages-cours { display: flex; flex-direction: column; gap: 14px; }
.page-cours { background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; overflow: hidden; }
.page-cours img { display: block; width: 100%; cursor: zoom-in; background: var(--carte-2); min-height: 120px; }
.page-cours .pied { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 14px; font-size: 14px; color: var(--doux); }
.page-cours .pied .espace { flex: 1; }

/* ---------- capture ---------- */
.puces { display: flex; gap: 8px; flex-wrap: wrap; }
.puce {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 99px; border: 1.5px solid var(--ligne);
  background: var(--carte); cursor: pointer; font-weight: 600; font-size: 15px;
}
.puce.choisie { border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--carte)); }
.puce.nouvelle { border-style: dashed; color: var(--doux); }
.grille-pages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 620px) { .grille-pages { grid-template-columns: repeat(4, 1fr); } }
.tuile-page {
  position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
  background: var(--carte-2); border: 1px solid var(--ligne);
}
.tuile-page img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s; }
.tuile-page .numero {
  position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 12px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.tuile-page .outils {
  position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between;
  padding: 4px; background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}
.tuile-page .outils button {
  width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .88);
  color: #111; font-size: 16px; cursor: pointer; display: grid; place-items: center;
}
.tuile-ajout {
  aspect-ratio: 3 / 4; border-radius: 12px; border: 2px dashed var(--accent);
  background: var(--accent-doux); color: var(--accent); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-weight: 650; font-size: 14px; text-align: center; padding: 6px;
}
.tuile-ajout .ico { font-size: 30px; }
.zone-vide {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 30px 16px; border-radius: var(--rayon); border: 2px dashed var(--accent);
  background: var(--accent-doux); color: var(--accent); cursor: pointer; width: 100%;
  font-weight: 700; font-size: 17px;
}
.zone-vide .ico { font-size: 44px; }

/* ---------- formulaires ---------- */
label.etiquette { display: block; font-weight: 650; margin: 18px 2px 8px; }
.champ {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--ligne); background: var(--carte);
  outline: none; transition: border-color .15s;
}
.champ:focus { border-color: var(--accent); }
textarea.champ { resize: vertical; min-height: 90px; line-height: 1.45; }
.avec-micro { position: relative; }
.avec-micro .champ { padding-right: 52px; }
.micro {
  position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: var(--accent-doux); cursor: pointer; font-size: 18px;
}
.micro.actif { background: var(--erreur); animation: pulse 1s infinite; }
.aide { font-size: 13px; color: var(--doux); margin: 6px 2px 0; }
.coches { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 320px; overflow: auto; }
.coche { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--carte-2); }
.coche input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- markdown ---------- */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h2 { font-size: 21px; margin: 22px 0 8px; }
.md h3 { font-size: 18px; margin: 20px 0 6px; color: var(--accent); }
.md h4, .md h5, .md h6 { font-size: 16px; margin: 16px 0 4px; }
.md p { margin: 8px 0; }
.md ul, .md ol { padding-left: 22px; margin: 8px 0; }
.md li { margin: 3px 0; }
.md blockquote { margin: 10px 0; padding: 4px 14px; border-left: 4px solid var(--accent); background: var(--accent-doux); border-radius: 0 10px 10px 0; }
.md hr { border: 0; border-top: 2px dashed var(--ligne); margin: 20px 0; }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--carte-2); border: 1px solid var(--ligne); padding: 1px 5px; border-radius: 6px; }
.md pre { background: var(--carte-2); border: 1px solid var(--ligne); border-radius: 10px; padding: 12px; overflow-x: auto; }
.md pre code { border: 0; padding: 0; background: none; }
.md mark { background: var(--surligne); color: inherit; padding: 0 2px; border-radius: 3px; }
.md .tableau { overflow-x: auto; margin: 10px 0; }
.md table { border-collapse: collapse; min-width: 100%; font-size: 15px; }
.md th, .md td { border: 1px solid var(--ligne); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--carte-2); }
.illisible { text-decoration: underline wavy var(--erreur); color: var(--erreur); font-style: italic; }
.schema { display: inline-block; padding: 1px 8px; border-radius: 8px; background: var(--carte-2); border: 1px dashed var(--ligne); font-style: italic; color: var(--doux); }
.texte-note { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; }

/* plan de révision */
.plan { display: flex; flex-direction: column; gap: 8px; }
.etape { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--carte); border: 1px solid var(--ligne); cursor: pointer; }
.etape input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--ok); flex: none; }
.etape .quand { font-weight: 700; font-size: 14px; color: var(--accent); }
.etape.faite { opacity: .55; }
.etape.faite .quoi { text-decoration: line-through; }
.a-revoir { display: flex; flex-direction: column; gap: 8px; }
.a-revoir a { display: block; padding: 12px 14px; border-radius: 12px; background: var(--carte); border: 1px solid var(--ligne); color: var(--texte); }
.a-revoir .rang { font-weight: 800; color: var(--accent); margin-right: 6px; }
.a-revoir .pourquoi { display: block; font-size: 14px; color: var(--doux); margin-top: 3px; }
.liste-simple { margin: 0; padding-left: 20px; }
.liste-simple li { margin: 6px 0; }

/* recherche */
.resultat { display: block; padding: 12px 14px; background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; color: var(--texte); }
.resultat + .resultat { margin-top: 10px; }
.resultat .extrait { font-size: 14px; color: var(--doux); margin-top: 4px; }
.resultat mark { background: var(--surligne); color: var(--texte); border-radius: 3px; }

/* accueil vide */
.bienvenue { text-align: center; padding: 34px 20px; }
.bienvenue .gros-emoji { font-size: 56px; }
.etapes-bienvenue { text-align: left; max-width: 360px; margin: 18px auto 22px; padding: 0; list-style: none; }
.etapes-bienvenue li { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; }
.etapes-bienvenue b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--sur-accent); font-size: 14px; }

/* connexion */
.connexion { max-width: 380px; margin: 9vh auto 0; text-align: center; }
.connexion .logo-grand { width: 96px; height: 96px; border-radius: 24px; box-shadow: var(--ombre-forte); }
.connexion h2 { margin: 16px 0 4px; font-size: 26px; }

/* ---------- fenêtres ---------- */
.modale-fond {
  position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 25, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: apparait .15s ease;
}
@media (min-width: 620px) { .modale-fond { align-items: center; } }
.modale {
  width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
  background: var(--carte); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--ombre-forte); animation: monte .2s ease;
}
@media (min-width: 620px) { .modale { border-radius: 22px; } }
.modale h3 { margin: 2px 4px 12px; font-size: 18px; }
.feuille-actions { display: flex; flex-direction: column; margin-bottom: 12px; }
.feuille-action {
  display: flex; align-items: center; gap: 12px; padding: 14px 12px; border: 0; border-radius: 12px;
  background: none; text-align: left; font-size: 16px; font-weight: 550; cursor: pointer;
}
.feuille-action:hover { background: var(--accent-doux); }
.feuille-action.danger { color: var(--erreur); }
@keyframes apparait { from { opacity: 0; } }
@keyframes monte { from { transform: translateY(30px); opacity: .6; } }
.couleurs { display: flex; flex-wrap: wrap; gap: 10px; }
.couleur { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; background: var(--c); }
.couleur.choisie { border-color: var(--texte); }

/* visionneuse de page */
.visionneuse { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.visionneuse .haut { display: flex; align-items: center; justify-content: space-between; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; color: #fff; }
.visionneuse .haut button { color: #fff; }
.visionneuse .cadre { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; }
.visionneuse img { width: 100%; max-width: 1100px; cursor: zoom-in; }
.visionneuse.zoom img { width: 220%; max-width: none; cursor: zoom-out; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 70;
  transform: translateX(-50%); max-width: min(92vw, 520px);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 14px; background: #1c1b2e; color: #fff;
  box-shadow: var(--ombre-forte); font-size: 15px; animation: monte .2s ease;
}
.toast button { border: 0; background: none; color: #a5b4fc; font-weight: 700; cursor: pointer; padding: 2px; }

.chargement { padding: 60px 0; text-align: center; color: var(--doux); }
.vide { padding: 24px 12px; text-align: center; color: var(--doux); }
.erreur-vue { padding: 30px 16px; text-align: center; }

/* ---------- impression ---------- */
@media print {
  :root { --fond: #fff; --carte: #fff; --texte: #000; --doux: #444; --ligne: #ccc; --accent: #312e81; --accent-doux: #f1f1ff; color-scheme: light; }
  body { padding: 0; background: #fff; }
  .barre, .fab, .onglets, #bandeaux, .toast, .pas-imprimer, .bouton, .icone-bouton { display: none !important; }
  main { max-width: none; padding: 0; }
  .question { break-inside: avoid; }
  .question .reponse { display: block !important; }
  .question .voir { display: none; }
  .imprimer-tout [data-panneau] { display: block !important; }
  .page-cours { break-inside: avoid; }
  a { color: inherit; }
}
