/* Ginette : mise en page de l'app. Couleurs, typos, espacements et composants viennent du design system de Gégé
   (tokens.css, accent décliné en prune, et composants.css copié tel quel) : ici, seulement l'assemblage des écrans
   et les quelques pièces propres à l'apprentissage (série, niveau, carte du parcours, blocs de leçon, quiz, cartes). */

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; }
a { color: inherit; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
:root { --taille-lecture: 19px; --or: #d9a521; }
[data-theme="dark"] { --or: #e6bb4a; }

/* ---------- Ossature (reprise de Gégé) ---------- */
.app { display: flex; min-height: 100vh; }
.barre-laterale { position: sticky; top: 0; height: 100vh; flex: none; }
.barre-laterale .logo { border-radius: 7px; }
.barre-laterale a { text-decoration: none; }
.barre-laterale .gg-side__brand { color: var(--ink); }
.gg-side__item .pastille { margin-left: auto; }
.contenu { flex: 1; min-width: 0; padding: var(--space-8) var(--space-8) var(--space-16); }
.ecran { max-width: 1040px; margin: 0 auto; display: grid; gap: var(--space-6); min-width: 0; }
.ecran--etroit { max-width: var(--measure); }
.ecran > * { min-width: 0; }
.onglets { display: none; }
.onglets a { text-decoration: none; position: relative; }
.hors-ligne { position: sticky; top: 0; z-index: 30; justify-content: center; }
.gg-tabbar { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 899px) {
  .barre-laterale { display: none; }
  .contenu { padding: var(--space-4) var(--space-4) calc(var(--tabbar) + var(--space-8)); padding-top: max(var(--space-4), env(safe-area-inset-top)); }
  .onglets { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  .page-lecon .onglets { display: none; }
  .page-lecon .contenu { padding-bottom: 110px; }
}

.pastille { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-ink); font: 600 11px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.onglets .pastille { position: absolute; top: 2px; left: calc(50% + 6px); }

/* ---------- En-têtes ---------- */
.tete { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.tete h1 { margin: 4px 0 0; }
.tete .gg-overline { margin: 0; }
h1.display, h1.title-1, h2.title-2 { margin: 0; text-wrap: balance; }
.intro { margin: 0; color: var(--ink-muted); font: var(--text-body); max-width: 62ch; }
.section { display: grid; gap: var(--space-3); }
.section > h2 { margin: 0; }
.lien-accent { color: var(--accent); text-decoration: none; font: var(--text-label); display: inline-flex; align-items: center; gap: 4px; }
a.gg-btn { text-decoration: none; }

/* ---------- Tableau de bord : série, niveau, révisions ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: 6px; text-decoration: none; color: inherit; box-shadow: var(--shadow-1); }
.stat__ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink-muted); }
.stat__n { font: 700 34px/38px var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat__l { font: var(--text-meta); color: var(--ink-muted); }
.stat--serie .stat__ic { background: #fdebd3; color: #b4441c; }
[data-theme="dark"] .stat--serie .stat__ic { background: #3a2a19; color: #f0a35e; }
.stat--serie.is-froid .stat__ic { background: var(--surface-sunken); color: var(--ink-faint); }
.stat--niveau .stat__ic { background: var(--accent-soft); color: var(--accent-strong); }
.stat--dues .stat__ic { background: var(--info-soft); color: var(--info); }
.rail { height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.rail > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width var(--duration-calm) var(--ease-standard); }
@media (max-width: 560px) {
  .stats { gap: var(--space-2); }
  .stat { padding: 12px; }
  .stat__n { font-size: 26px; line-height: 30px; }
  .stat__ic { width: 36px; height: 36px; border-radius: 11px; }
}

/* ---------- Séance du jour (carte héros) ---------- */
.seance { position: relative; overflow: hidden; display: grid; gap: var(--space-4); padding: var(--space-6); border-radius: var(--radius-xl);
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-2); }
.seance::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0) 70%); pointer-events: none; }
.seance .gg-overline { color: inherit; opacity: .85; }
.seance h2 { margin: 0; font: 600 28px/34px var(--font-serif); text-wrap: balance; }
.seance p { margin: 0; opacity: .9; font: var(--text-body); }
.seance__meta { display: flex; gap: var(--space-4); flex-wrap: wrap; font: var(--text-label); opacity: .95; }
.seance__meta span { display: inline-flex; align-items: center; gap: 6px; }
.seance__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.seance .gg-btn--primary { background: var(--accent-ink); color: var(--accent); }
.seance .gg-btn--secondary { background: transparent; color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent-ink) 45%, transparent); }
.seance--vide { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.seance--vide .gg-btn--primary { background: var(--accent); color: var(--accent-ink); }

/* ---------- Cartes de parcours ---------- */
.grille-parcours { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.carte-parcours { display: grid; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); text-decoration: none; color: inherit; transition: transform var(--duration-fast) var(--ease-standard); }
.carte-parcours:active { transform: scale(.985); }
.carte-parcours h3 { margin: 0; font: var(--text-title-2); text-wrap: balance; }
.carte-parcours p { margin: 0; color: var(--ink-muted); font: var(--text-body); }
.etiquette { display: inline-flex; align-items: center; gap: 6px; width: fit-content; height: 26px; padding: 0 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-strong); font: 600 12px/1 var(--font-sans); }
.etiquette--ok { background: var(--success-soft); color: var(--success); }
.etiquette--info { background: var(--info-soft); color: var(--info); }
.etiquette--neutre { background: var(--surface-sunken); color: var(--ink-muted); }
.etiquette--alerte { background: var(--danger-soft); color: var(--danger); }

/* ---------- Carte du parcours (chemin de leçons) ---------- */
.carte-tete { display: grid; grid-template-columns: 1fr auto; gap: var(--space-6); align-items: center; }
.anneau { position: relative; width: 132px; height: 132px; }
.anneau svg { transform: rotate(-90deg); }
.anneau circle { fill: none; stroke-width: 12; }
.anneau .bg { stroke: var(--surface-sunken); }
.anneau .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset var(--duration-calm) var(--ease-standard); }
.anneau__txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anneau__txt b { font: 700 30px/32px var(--font-sans); font-variant-numeric: tabular-nums; }
.anneau__txt span { font: var(--text-meta); color: var(--ink-muted); }
@media (max-width: 560px) { .carte-tete { grid-template-columns: 1fr; } .anneau { width: 108px; height: 108px; } }

.module { display: grid; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.module__tete { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.module__tete h2 { margin: 2px 0 0; font: var(--text-title-2); }
.module__tete p { margin: 4px 0 0; color: var(--ink-muted); font: var(--text-body); }
.badge-module { flex: none; display: grid; justify-items: center; gap: 4px; width: 84px; text-align: center; font: 600 11px/14px var(--font-sans); color: var(--ink-faint); }
.badge-module__disque { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink-faint); border: 2px dashed var(--line-strong); }
.badge-module.is-on { color: var(--ink); }
.badge-module.is-on .badge-module__disque { background: var(--or); color: #3a2a05; border: 0; box-shadow: 0 4px 14px color-mix(in srgb, var(--or) 45%, transparent); }
.chemin { list-style: none; margin: 0; padding: 0; display: grid; }
.etape { display: grid; grid-template-columns: 56px 1fr; gap: var(--space-3); align-items: center; position: relative; }
.etape + .etape { margin-top: 6px; }
.etape::before { content: ""; position: absolute; left: 27px; top: -10px; height: 14px; width: 2px; background: var(--line); }
.etape:first-child::before { display: none; }
.etape__noeud { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-sunken); color: var(--ink-muted);
  border: 2px solid var(--line); font: 700 18px/1 var(--font-sans); }
.etape.is-terminee .etape__noeud { background: var(--success); border-color: var(--success); color: #fff; }
[data-theme="dark"] .etape.is-terminee .etape__noeud { color: #0d1a12; }
.etape.is-a_revoir .etape__noeud { background: var(--or); border-color: var(--or); color: #3a2a05; }
.etape.is-sautee .etape__noeud { border-style: dashed; color: var(--ink-faint); }
.etape.is-prochaine .etape__noeud { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 6px var(--accent-soft); }
.etape a { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); min-height: 64px; padding: 10px 14px; border-radius: var(--radius-md);
  text-decoration: none; color: inherit; }
.etape a:hover { background: var(--surface-sunken); }
.etape__t { font: var(--text-headline); display: block; }
.etape__s { font: var(--text-meta); color: var(--ink-muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* ---------- Maîtrise ---------- */
.maitrise { display: grid; gap: var(--space-3); }
.competence { display: grid; gap: 6px; }
.competence__l { display: flex; justify-content: space-between; gap: var(--space-3); font: var(--text-label); }
.competence__l span:last-child { color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.competence .rail > i { background: var(--accent); }
.competence.is-solide .rail > i, .competence.is-maitrise .rail > i { background: var(--success); }

/* ---------- Leçon ---------- */
.barre-lecon { display: flex; align-items: center; gap: var(--space-3); position: sticky; top: 0; z-index: 10; padding: 10px 0; margin: -10px 0 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.barre-lecon .rail { flex: 1; height: 6px; }
.barre-lecon a { text-decoration: none; }
.objectif { display: grid; gap: 6px; padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent-strong); }
.objectif p { margin: 0; font: 600 17px/25px var(--font-serif); }
.bloc { display: grid; gap: var(--space-3); scroll-margin-top: 70px; }
.bloc > h2 { margin: 0; font: var(--text-title-2); }
.gg-read { font-size: var(--taille-lecture); line-height: 1.63; font-family: var(--font-serif); }
.gg-read p { margin: 0 0 1em; }
.gg-read p:last-child { margin-bottom: 0; }
.gg-read h3, .gg-read h4 { font: var(--text-title-2); margin: 1.3em 0 .4em; }
.gg-read ul, .gg-read ol { margin: 0 0 1em; padding-left: 1.3em; }
.gg-read li + li { margin-top: .3em; }
.gg-read blockquote { margin: 0 0 1em; padding-left: 1em; border-left: 3px solid var(--line-strong); color: var(--ink-muted); }
.gg-read code { font: 500 .86em/1 ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-sunken); padding: 2px 6px; border-radius: 6px; }
.gg-read pre { margin: 0 0 1em; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-sunken); overflow-x: auto; }
.gg-read pre code { background: none; padding: 0; font-size: 14px; line-height: 1.55; white-space: pre; }
.gg-read a { color: var(--accent); }
.gg-read strong { font-weight: 600; }
.gg-mark { cursor: pointer; }
.figure { margin: 0; display: grid; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.figure figcaption { font: var(--text-meta); color: var(--ink-muted); }
.figure .schema svg, .figure .graphique { width: 100%; height: auto; display: block; }
/* schémas des parcours (SVG intégrés) : classes sv-* posées par le moteur de création, couleurs du thème */
.schema svg text { font-family: var(--font-sans); }
.schema .sv-titre { fill: var(--ink); font: 600 15px var(--font-sans); }
.schema .sv-ink { fill: var(--ink); }
.schema .sv-muet { fill: var(--ink-muted); }
.schema .sv-inverse { fill: var(--accent-ink); }
.schema .sv-fond { fill: var(--surface-sunken); }
.schema .sv-carte { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.schema .sv-accent { fill: var(--accent); }
.schema .sv-accent-doux { fill: var(--accent-soft); }
.schema .sv-accent-trait { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.schema .sv-info-doux { fill: var(--info-soft); }
.schema .sv-succes-doux { fill: var(--success-soft); }
.schema .sv-alerte-doux { fill: var(--danger-soft); }
.schema .sv-surligne { fill: var(--highlight); }
.schema .sv-trait { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.schema .sv-pointille { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 5 5; }
.schema .sv-fleche { fill: none; stroke: var(--ink-muted); stroke-width: 2; }
.schema .sv-pointe { fill: var(--ink-muted); }
.graphique .grille { stroke: var(--line); stroke-width: 1; }
.graphique .axe, .graphique .titre-axe, .graphique .valeur { fill: var(--ink-muted); font: 500 12px var(--font-sans); }
.graphique .valeur { fill: var(--ink); font-weight: 600; }
.graphique .titre-axe { font-weight: 600; }
.legende-series { display: flex; gap: var(--space-4); flex-wrap: wrap; font: var(--text-meta); color: var(--ink-muted); }
.legende-series span { display: inline-flex; align-items: center; gap: 6px; }
.legende-series i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.mermaid-src { margin: 0; white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, monospace; color: var(--ink-muted); }
.mermaid { display: flex; justify-content: center; }
.mermaid svg { max-width: min(100%, 560px); max-height: 520px; width: auto; height: auto; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.video iframe, .video button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video button { cursor: pointer; padding: 0; background: #000 center / cover no-repeat; display: grid; place-items: center; }
.video button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.video button .lire { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-2); }
.encadre { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-sunken); }
.encadre .gg-read { font-size: 17px; line-height: 1.55; }
.encadre__ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); color: var(--ink-muted); }
.encadre--astuce .encadre__ic { color: var(--success); background: var(--success-soft); }
.encadre--attention .encadre__ic { color: var(--danger); background: var(--danger-soft); }
.encadre--exemple .encadre__ic { color: var(--info); background: var(--info-soft); }
.encadre--a-retenir { background: var(--accent-soft); }
.encadre--a-retenir .encadre__ic { color: var(--accent-strong); }
.encadre h3 { margin: 0 0 4px; font: var(--text-headline); }

.exercice { display: grid; gap: var(--space-3); padding: var(--space-5); border-radius: var(--radius-lg); border: 2px solid var(--accent-soft); background: var(--surface); }
.exercice textarea, .champ, .grand-champ { width: 100%; font: 400 16px/24px var(--font-sans); color: var(--ink); background: var(--surface-sunken); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 12px 14px; resize: vertical; }
.exercice textarea { min-height: 180px; }
.materiau { margin: 0; max-height: 260px; overflow: auto; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-sunken); font: 13px/1.55 ui-monospace, Menlo, monospace; white-space: pre-wrap; }
.criteres { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.criteres label { display: flex; gap: 10px; align-items: flex-start; font: var(--text-body); cursor: pointer; }
.criteres input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
details.corrige summary { cursor: pointer; font: var(--text-label); color: var(--accent); }
details.corrige[open] summary { margin-bottom: var(--space-2); }

/* ---------- Quiz ---------- */
.quiz { display: grid; gap: var(--space-5); padding: var(--space-5); border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.question { display: grid; gap: var(--space-3); border: 0; margin: 0; padding: 0; min-width: 0; }
.question legend { padding: 0; font: 600 18px/26px var(--font-serif); margin-bottom: var(--space-3); }
.question legend .num { display: block; font: var(--text-overline); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 4px; }
.choix { display: grid; gap: var(--space-2); }
.choix label { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border-radius: var(--radius-md); border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; font: 500 16px/22px var(--font-sans); transition: border-color var(--duration-fast), background-color var(--duration-fast); }
.choix label:hover { border-color: var(--line-strong); }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix .lettre { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-sunken); font: 700 13px/1 var(--font-sans); color: var(--ink-muted); }
.choix input:checked + label, .choix label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choix label:has(input:checked) .lettre { background: var(--accent); color: var(--accent-ink); }
.choix input:focus-visible + .lettre { outline: 2px solid var(--accent); outline-offset: 2px; }
.question.is-corrigee .choix label { cursor: default; }
/* après correction : plus spécifique que l'état « coché » ci-dessus */
.question.is-corrigee .choix label.is-bonne { border-color: var(--success); background: var(--success-soft); }
.question.is-corrigee .choix label.is-bonne .lettre { background: var(--success); color: var(--surface); }
.question.is-corrigee .choix label.is-fausse { border-color: var(--danger); background: var(--danger-soft); }
.question.is-corrigee .choix label.is-fausse .lettre { background: var(--danger); color: var(--surface); }
.explication { margin: 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-sunken); font: var(--text-body); }
.explication b { display: block; margin-bottom: 2px; }
.resultat { display: grid; justify-items: center; text-align: center; gap: var(--space-2); padding: var(--space-6) var(--space-4); border-radius: var(--radius-xl);
  background: var(--accent-soft); color: var(--accent-strong); }
.resultat b { font: 700 48px/52px var(--font-sans); font-variant-numeric: tabular-nums; }
.resultat p { margin: 0; font: var(--text-body); color: var(--ink); max-width: 44ch; }
.resultat.is-a-revoir { background: color-mix(in srgb, var(--or) 22%, var(--surface)); color: var(--ink); }
.gain { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--or); color: #3a2a05; font: 700 14px/1 var(--font-sans); }

/* ---------- Points clés, sources ---------- */
.points-cles { display: grid; gap: var(--space-2); counter-reset: pc; list-style: none; margin: 0; padding: 0; }
.points-cles li { counter-increment: pc; display: grid; grid-template-columns: 36px 1fr; gap: var(--space-3); align-items: start; font: 500 16px/24px var(--font-sans); }
.points-cles li::before { content: counter(pc); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 700 15px/1 var(--font-sans); }
.liste-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.liste-sources a { color: var(--accent); text-decoration: none; font: var(--text-label); }
.liste-sources span { display: block; font: var(--text-meta); color: var(--ink-muted); }

/* ---------- Navigation de leçon (bas d'écran) ---------- */
.navigation-lecon { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.barre-flottante { display: none; }
@media (max-width: 899px) {
  .barre-flottante { display: flex; position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 25; }
}

/* ---------- Surlignage (bulle) ---------- */
.gg-pop { position: absolute; }
.gg-pop button { color: var(--paper); }
.feuille-note { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; background: var(--scrim); }
.feuille-note > div { width: min(560px, 100%); display: grid; gap: var(--space-3); padding: var(--space-5); padding-bottom: max(var(--space-5), env(safe-area-inset-bottom));
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-3); }
@media (min-width: 900px) { .feuille-note { place-items: center; } .feuille-note > div { border-radius: var(--radius-xl); } }
.feuille-note blockquote { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--highlight); font: 400 15px/22px var(--font-serif); max-height: 140px; overflow: auto; }
.feuille-note .actions { display: flex; justify-content: flex-end; gap: var(--space-2); }

/* ---------- Révisions ---------- */
.revision { display: grid; gap: var(--space-4); }
.carte-memo { min-height: 280px; display: grid; align-content: center; gap: var(--space-4); padding: var(--space-8) var(--space-6); border-radius: var(--radius-xl);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); text-align: center; }
.carte-memo .recto { margin: 0; font: 600 23px/31px var(--font-serif); text-wrap: balance; }
.carte-memo .verso { margin: 0; padding-top: var(--space-4); border-top: 1px dashed var(--line-strong); font: 400 18px/28px var(--font-serif); color: var(--ink); text-wrap: pretty; }
.carte-memo .gg-meta { justify-content: center; }
.notes-fsrs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.notes-fsrs button { display: grid; gap: 2px; justify-items: center; padding: 12px 6px; min-height: 64px; border-radius: var(--radius-md); border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; font: 600 15px/20px var(--font-sans); color: var(--ink); }
.notes-fsrs button small { font: 500 12px/16px var(--font-sans); color: var(--ink-muted); }
.notes-fsrs button[data-note="1"] { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.notes-fsrs button[data-note="3"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.notes-fsrs button:active { transform: scale(.97); }
.compteur-revision { display: flex; align-items: center; gap: var(--space-3); }
.compteur-revision .rail { flex: 1; }

/* ---------- Progrès ---------- */
.frise { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: 4px; max-width: 360px; }
.frise i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-sunken); }
.frise i.n1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-sunken)); }
.frise i.n2 { background: color-mix(in srgb, var(--accent) 60%, var(--surface-sunken)); }
.frise i.n3 { background: var(--accent); }
.frise i.aujourdhui { outline: 2px solid var(--ink); outline-offset: 1px; }
.vitrine { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-4); }
.vitrine .badge-module { width: auto; font-size: 13px; line-height: 17px; }
.vitrine .badge-module__disque { width: 72px; height: 72px; }
.bloc-carte { padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: var(--space-4); }
.bloc-carte > h2 { margin: 0; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-3); }
.chiffres div { display: grid; gap: 2px; }
.chiffres b { font: 700 28px/32px var(--font-sans); font-variant-numeric: tabular-nums; }
.chiffres span { font: var(--text-meta); color: var(--ink-muted); }

/* ---------- Formulaires (profil, demande, diagnostic) ---------- */
.formulaire { display: grid; gap: var(--space-5); }
.q { display: grid; gap: var(--space-2); border: 0; margin: 0; padding: 0; min-width: 0; }
.q legend, .q > label { font: var(--text-headline); padding: 0; margin-bottom: 6px; }
.q .aide { font: var(--text-meta); color: var(--ink-muted); margin: -2px 0 4px; }
.puces { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.puces input { position: absolute; opacity: 0; pointer-events: none; }
.puces label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong);
  background: var(--surface); font: var(--text-label); cursor: pointer; transition: background-color var(--duration-fast), color var(--duration-fast); }
.puces label:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.puces label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.grand-champ { font: 500 22px/30px var(--font-serif); padding: 18px 20px; border-radius: var(--radius-lg); min-height: 72px; }
.suggestions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.suggestions button { border: 1px dashed var(--line-strong); background: none; border-radius: var(--radius-pill); padding: 8px 14px; font: var(--text-label); color: var(--ink-muted); cursor: pointer; }
.pas-a-pas { display: flex; gap: 6px; }
.pas-a-pas i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-sunken); }
.pas-a-pas i.is-on { background: var(--accent); }
.plan-propose { display: grid; gap: var(--space-3); }
.plan-propose .gg-row label { display: flex; align-items: center; gap: 8px; font: var(--text-meta); color: var(--ink-muted); cursor: pointer; white-space: nowrap; }
.plan-propose input { accent-color: var(--accent); width: 18px; height: 18px; }
.commande { display: flex; align-items: center; gap: var(--space-2); padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-sunken); font: 13px/1.5 ui-monospace, Menlo, monospace; overflow-x: auto; white-space: nowrap; }

/* ---------- Notes ---------- */
.note-item { display: grid; gap: 6px; padding: 14px 16px; }
.note-item + .note-item { border-top: 1px solid var(--line); }
.note-item q { quotes: none; font: 400 16px/25px var(--font-serif); background: var(--highlight); padding: 1px 3px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.note-item p { margin: 0; font: var(--text-body); color: var(--ink-muted); }
.note-item .gg-meta button { border: 0; background: none; color: var(--ink-muted); cursor: pointer; padding: 4px; display: inline-flex; }

/* ---------- Toasts (repris de Gégé) ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toasts .gg-toast { pointer-events: auto; }
@media (max-width: 899px) { .toasts { bottom: calc(var(--tabbar) + 12px); } .page-lecon .toasts { bottom: 90px; } }

/* ---------- Connexion (reprise de Gégé) ---------- */
.page-connexion { min-height: 100dvh; display: grid; place-items: center; background: var(--paper); }
.connexion { width: min(360px, calc(100vw - 32px)); display: grid; justify-items: center; gap: var(--space-4); padding: var(--space-8) 0; }
.connexion__marque { border-radius: 16px; }
.connexion__titre { font: 600 28px/34px var(--font-serif); color: var(--ink); margin: 0; }
.connexion__form { width: 100%; display: grid; gap: var(--space-3); }
.connexion__champ { height: 52px; padding: 0 16px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 400 17px/22px var(--font-sans); }
.connexion__champ:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.connexion__erreur { margin: 0; color: var(--danger); font: 500 14px/20px var(--font-sans); }
.deconnexion { margin: 10px 0 0; }
.deconnexion button { border: 0; background: none; padding: 0; color: var(--ink-muted); font: var(--text-meta); cursor: pointer; text-decoration: underline; }

/* ---------- Fête (fin de leçon, badge) ---------- */
@keyframes ginette-saut { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.saute { animation: ginette-saut var(--duration-slow) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .saute, .gg-done__ring { animation: none; } .rail > i, .anneau .fg { transition: none; } }
.vide { display: grid; justify-items: center; gap: var(--space-3); text-align: center; padding: var(--space-8) var(--space-4); color: var(--ink-muted); }
.vide h2 { margin: 0; color: var(--ink); font: var(--text-title-2); }
.erreurs { margin: 0; padding-left: 1.2em; font: 13px/1.5 ui-monospace, Menlo, monospace; color: var(--danger); }
