/* iProf — feuille de style unique, piste « Doux » : surfaces arrondies, ombres légères, couleur de la matière
   en accent (--accent-base, donnée par la page). Sombre par défaut ; clair si l'enfant le choisit dans « Moi »
   (html[data-theme="clair"], posé par static/js/theme.js avant l'affichage). */
@font-face { font-family: "Sora"; font-weight: 600; font-display: swap; src: url(../fonts/sora-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 800; font-display: swap; src: url(../fonts/sora-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(../fonts/atkinson-hyperlegible-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: italic; font-display: swap; src: url(../fonts/atkinson-hyperlegible-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(../fonts/atkinson-hyperlegible-700-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url(../fonts/jetbrains-mono-500-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap; src: url(../fonts/jetbrains-mono-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Caveat"; font-weight: 600; font-display: swap; src: url(../fonts/caveat-600-normal.woff2) format("woff2"); }

/* ==================================================================== Jetons */
:root {
  /* sombre (par défaut) */
  --fond: #0b0f19;
  --surface: #161c2a;
  --surface-2: #1e2536;
  --texte: #e8ecf6;
  --doux: #9aa5b9;
  --trait: #2a3245;
  --bleu: #8ea6ff;
  --bleu-fort: #4c6ef5;
  --ok: #69db8f;
  --ok-fond: #15301f;
  --ko: #ff8a8a;
  --ko-fond: #3a1a1f;
  --chaud: #ffa94d;
  --surligne: #5a4a10;
  --code-fond: #0f1422;
  --code-texte: #dbe3ee;
  --ombre: 0 1px 2px rgb(0 0 0 / .45), 0 10px 24px rgb(0 0 0 / .35);
  --ombre-forte: 0 14px 34px rgb(0 0 0 / .5);
  --accent-mix: #ffffff;
  --accent-part: 62%;
  --tk-kw: #e690e3; --tk-str: #84d89e; --tk-num: #f2a85e; --tk-com: #7f8a9c; --tk-fn: #8fb2ff; --tk-self: #ff8a7d;
  --rayon: 18px;
  --rayon-petit: 12px;
  --display: "Sora", "Avenir Next", system-ui, sans-serif;
  --corps: "Atkinson Hyperlegible", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --main: "Caveat", "Comic Sans MS", cursive;
  --onglets-h: 64px;
  color-scheme: dark;
}
:root[data-theme="clair"] {
  --fond: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f4f6fb;
  --texte: #0f172a;
  --doux: #5b6578;
  --trait: #dfe4ee;
  --bleu: #3b5bdb;
  --bleu-fort: #3b5bdb;
  --ok: #2b8a3e;
  --ok-fond: #e6f6ea;
  --ko: #c92a2a;
  --ko-fond: #fdeaea;
  --chaud: #e8590c;
  --surligne: #fff1a8;
  --code-fond: #f1f4fa;
  --code-texte: #1b2430;
  --ombre: 0 1px 2px rgb(15 23 42 / .05), 0 6px 18px rgb(15 23 42 / .07);
  --ombre-forte: 0 12px 28px rgb(15 23 42 / .14);
  --accent-mix: #000000;
  --accent-part: 100%;
  --tk-kw: #a1279f; --tk-str: #1b7a39; --tk-num: #b05400; --tk-com: #788396; --tk-fn: #2457c5; --tk-self: #c0392b;
  color-scheme: light;
}
/* L'accent suit la couleur de la matière là où la page la donne (éclaircie en sombre pour rester lisible) */
:root, [style*="--accent-base"] {
  --accent: color-mix(in srgb, var(--accent-base, #4c6ef5) var(--accent-part), var(--accent-mix));
  --accent-doux: color-mix(in srgb, var(--accent) 15%, transparent);
}

/* ==================================================================== Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 17px/1.55 var(--corps); min-height: 100vh; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.wrap {
  max-width: 820px; margin: 0 auto;
  padding-block: max(18px, env(safe-area-inset-top, 0px)) calc(var(--onglets-h) + 28px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
body.sans-onglets .wrap { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
header { display: grid; gap: 6px; margin-bottom: 18px; }
.eyebrow { font: 700 .78rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
h1 { font: 800 clamp(1.8rem, 6.5vw, 2.6rem)/1.1 var(--display); margin: 0; letter-spacing: -.02em; text-wrap: balance; }
.lead { margin: 2px 0 0; color: var(--doux); max-width: 62ch; }
.back { display: inline-flex; align-items: center; gap: 4px; font: 600 .95rem var(--display); color: var(--doux); text-decoration: none; padding: 10px 0; margin: -10px 0 4px; }
.back .ico { width: 18px; height: 18px; }
.muted { color: var(--doux); font-weight: 400; }
.petit { font-size: .85rem; }
.centre { text-align: center; justify-items: center; }
mark { background: var(--surligne); color: inherit; padding: 0 3px; border-radius: 4px; }
:not(pre) > code { font-family: var(--mono); font-size: .88em; background: var(--code-fond); color: var(--code-texte); padding: 1px 6px; border-radius: 6px; }

/* ==================================================================== Barre d'onglets (enfant) */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(10px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid color-mix(in srgb, var(--doux) 18%, transparent);
}
.onglets a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; min-height: 50px; font: 700 .72rem var(--corps); color: var(--doux); text-decoration: none; }
.onglets a[aria-current="page"] { color: var(--bleu); }
.onglets .ico { width: 24px; height: 24px; }
@media (min-width: 900px) {
  .onglets { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 440px; border-radius: 22px; border: 1px solid var(--trait); box-shadow: var(--ombre-forte); padding-bottom: 6px; }
}

/* ==================================================================== Boutons, panneaux, formulaires */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px;
  font: 700 1rem var(--display); color: #fff; background: var(--bleu-fort); border: none; border-radius: 14px;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--surface); color: var(--bleu); box-shadow: var(--ombre); }
.btn.ok { background: #2f9e44; }
.btn.ko { background: #e03131; }
.btn.danger { background: var(--surface); color: var(--ko); box-shadow: var(--ombre); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn .ico { width: 18px; height: 18px; }
.end-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.panel { background: var(--surface); border-radius: 22px; padding: 22px; box-shadow: var(--ombre); }
.titre-panel { font: 700 1.08rem var(--display); margin: 0 0 12px; }
.form-etroit { max-width: 460px; display: grid; gap: 14px; }
.panel form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font: 700 .9rem var(--display); }
input[type=text], input[type=password], input[type=url], input[type=email], input:not([type]), select {
  font: 400 1.05rem var(--corps); padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--trait);
  background: var(--surface-2); color: var(--texte); min-height: 48px; width: 100%;
}
input:focus, select:focus { border-color: var(--bleu); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--bleu) 22%, transparent); }
.msg-ko { color: var(--ko); font-weight: 700; margin: 0; }
.msg-ok { color: var(--ok); font-weight: 700; margin: 0; }
.bandeau-msg { padding: 12px 16px; border-radius: 14px; margin: 0 0 16px; font-weight: 700; }
.bandeau-msg.ok { background: var(--ok-fond); color: var(--ok); }
.bandeau-msg.ko { background: var(--ko-fond); color: var(--ko); }
.choix-radio { display: flex; gap: 8px; align-items: center; font-weight: 600; }

/* ==================================================================== Profils (choix de l'avatar) */
.profils { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin: 26px 0 30px; }
.profils form { margin: 0; }
.profil {
  cursor: pointer; display: grid; justify-items: center; gap: 4px; width: 152px; padding: 20px 10px 16px;
  border-radius: 24px; border: none; background: var(--surface); color: var(--texte); box-shadow: var(--ombre); font: inherit;
  transition: transform .15s ease;
}
.profil:active { transform: scale(.96); }
.profil.actif { box-shadow: 0 0 0 3px var(--bleu), var(--ombre); }
.profil .avatar { font-size: 3.4rem; line-height: 1.1; }
.profil strong { font: 800 1.15rem var(--display); }
.profil small { color: var(--doux); font-weight: 700; }
.lien-parent { display: inline-flex; gap: 6px; align-items: center; color: var(--doux); font: 700 .92rem var(--display); text-decoration: none; padding: 12px; }
.centre-boite { max-width: 480px; margin: 20px auto; }

/* ==================================================================== Accueil enfant */
.acc-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.acc-tete .av-rond { width: 52px; height: 52px; display: grid; place-items: center; font-size: 30px; border-radius: 50%; background: var(--surface); box-shadow: var(--ombre); flex: none; overflow: hidden; }
.acc-tete .av-rond .av-img { width: 100%; height: 100%; box-shadow: none; }
.acc-qui { display: grid; line-height: 1.2; flex: 1; min-width: 0; }
.acc-qui small { color: var(--doux); font-size: .9rem; }
.acc-qui strong { font: 700 1.1rem var(--display); }
.anneau { --p: 0; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(closest-side, var(--fond) 77%, transparent 79%), conic-gradient(var(--bleu) calc(var(--p) * 1%), var(--surface-2) 0); }
.anneau span { font: 700 .72rem var(--corps); }
.serie { display: inline-flex; align-items: center; gap: 3px; font: 800 1rem var(--display); color: var(--chaud); }
.serie .ico { width: 20px; height: 20px; }
.titre-accueil { font: 800 clamp(1.6rem, 6.4vw, 2.2rem)/1.12 var(--display); letter-spacing: -.02em; margin: 6px 0 16px; text-wrap: balance; }
.carte-defi {
  display: grid; gap: 8px; padding: 20px; border-radius: 26px; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #ff922b, #f76707 55%, #e8590c); box-shadow: 0 14px 30px rgb(247 103 7 / .3);
  transition: transform .15s ease;
}
.carte-defi:active { transform: scale(.98); }
.carte-defi .etiq { font: 700 .75rem var(--corps); letter-spacing: .08em; text-transform: uppercase; opacity: .92; }
.carte-defi strong { font: 800 1.3rem/1.2 var(--display); }
.carte-defi .defi-bas { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.carte-defi .btn-mini { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; background: rgb(255 255 255 / .22); }
.carte-defi.fait { background: linear-gradient(135deg, #2b3a55, #1f2a40); box-shadow: var(--ombre); }
:root[data-theme="clair"] .carte-defi.fait { background: linear-gradient(135deg, #e9edf6, #dde3f0); color: var(--texte); }
.rappel { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--ombre); text-decoration: none; color: var(--texte); }
.rappel .rp-quand { font: 700 .72rem var(--corps); text-transform: uppercase; letter-spacing: .05em; padding: 4px 9px; border-radius: 999px; color: var(--accent); background: var(--accent-doux); white-space: nowrap; }
.rappel .rp-txt { flex: 1; min-width: 0; font-size: .95rem; line-height: 1.35; }
.rappel .rp-go { font-weight: 700; color: var(--accent); white-space: nowrap; }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.tuile-accueil { display: grid; gap: 3px; align-content: start; padding: 16px; min-height: 112px; border-radius: 22px; background: var(--surface); box-shadow: var(--ombre); color: var(--texte); text-decoration: none; transition: transform .15s ease; }
.tuile-accueil:active { transform: scale(.97); }
.tuile-accueil .pastille { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: var(--accent); background: var(--accent-doux); margin-bottom: 8px; }
.tuile-accueil strong { font: 700 1rem var(--display); }
.tuile-accueil small { color: var(--doux); font-size: .84rem; line-height: 1.35; }
.niveau-carte { margin-top: 14px; padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--ombre); display: grid; gap: 8px; }
.niveau-carte .ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.niveau-carte strong { font: 700 1rem var(--display); }
.jauge { display: block; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.jauge > span { display: block; height: 100%; border-radius: 999px; background: var(--bleu); }
.jauge.large { width: 100%; }
/* Personnage en pied (avatar image) à côté du titre */
header.avec-perso, .acc-haut.avec-perso { position: relative; padding-right: 96px; }
.perso-pied { position: absolute; right: 0; top: -6px; height: 150px; width: auto; pointer-events: none; user-select: none; filter: drop-shadow(0 6px 12px rgb(0 0 0 / .3)); }
header.avec-perso.compact .perso-pied { height: 120px; }

/* ==================================================================== Mes cours */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.filtre { text-decoration: none; color: var(--doux); background: var(--surface); box-shadow: var(--ombre); border-radius: 999px; padding: 9px 15px; font: 700 .9rem var(--corps); }
.filtre[aria-current="true"] { background: var(--bleu-fort); color: #fff; }
.group { font: 700 .82rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--doux); margin: 26px 0 10px; display: flex; gap: 8px; align-items: center; }
section.matiere { scroll-margin-top: 12px; }
section.matiere .group { color: var(--accent); }
.list { display: grid; gap: 12px; }
.course {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; position: relative;
  text-decoration: none; color: var(--texte); background: var(--surface); border-radius: 20px; padding: 16px 18px 16px 22px;
  box-shadow: var(--ombre); overflow: hidden; transition: transform .15s ease;
}
.course::before { content: ""; position: absolute; inset: 14px auto 14px 0; width: 5px; border-radius: 0 5px 5px 0; background: var(--accent); }
.course:active { transform: scale(.98); }
.course .lvl { grid-column: 2; grid-row: 1; font: 700 .74rem var(--corps); padding: 4px 9px; border-radius: 999px; background: var(--accent-doux); color: var(--accent); white-space: nowrap; align-self: start; }
.course > div { grid-column: 1; grid-row: 1 / span 2; min-width: 0; }
.course h3 { margin: 0 0 2px; font: 700 1.08rem/1.3 var(--display); }
.course p { margin: 0; color: var(--doux); font-size: .92rem; line-height: 1.4; }
.course .go { display: none; }
.course.enfant-carte { grid-template-columns: auto minmax(0, 1fr) auto; }
.course.enfant-carte > div { grid-column: 2; grid-row: 1; }
.course.enfant-carte .avatar { font-size: 2.2rem; }
.course.enfant-carte .go { display: block; color: var(--doux); }
.progres { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; font-size: .8rem; font-weight: 700; }
.tag-ok { color: var(--ok); }
.tag-score { color: var(--accent); }
.tag-new { color: var(--chaud); }
.progres .jauge { width: 90px; height: 7px; display: inline-block; vertical-align: middle; }
.progres .jauge > span { background: var(--accent); }
.erreurs ul { margin: 0; padding-left: 20px; }
.erreurs code { font-size: .85rem; overflow-wrap: anywhere; }
details.autres { margin-top: 30px; }
details.autres > summary { padding: 12px 0; color: var(--doux); cursor: pointer; font: 700 .95rem var(--display); }

/* ==================================================================== Page d'un cours */
.bandeau-cours {
  margin: calc(-1 * max(18px, env(safe-area-inset-top, 0px))) calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 0;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 22px max(18px, env(safe-area-inset-left, 0px));
  color: #fff; border-radius: 0 0 30px 30px;
  background: linear-gradient(160deg, var(--accent-base, #3b5bdb), color-mix(in srgb, var(--accent-base, #3b5bdb) 70%, #000));
  display: grid; gap: 6px;
}
.bandeau-cours .back { color: rgb(255 255 255 / .85); margin-bottom: 0; }
.bandeau-cours .eyebrow { color: rgb(255 255 255 / .85); }
.bandeau-cours h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
.bandeau-cours .lead { color: rgb(255 255 255 / .85); font-size: .95rem; }
.bandeau-cours .progres span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; background: rgb(255 255 255 / .18); color: #fff; }
.bandeau-cours .progres .fait { background: #fff; color: var(--accent-base, #3b5bdb); }
.bandeau-cours .progres .ico { width: 15px; height: 15px; }
@media (min-width: 821px) { .bandeau-cours { margin-inline: 0; border-radius: 0 0 30px 30px; } }
nav.tabs {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: 4px; padding: 4px; margin: 16px 0 22px; border-radius: 16px; background: var(--surface-2);
  box-shadow: 0 6px 16px rgb(0 0 0 / .18);
}
.tab { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; min-height: 46px; border: none; border-radius: 12px; cursor: pointer;
  font: 700 .9rem var(--display); background: transparent; color: var(--doux); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
.tab .ico { width: 18px; height: 18px; }
.tab .lbl-court { display: none; }

/* Fiche */
section.block { margin-bottom: 34px; }
.fiche h2 { font: 700 1.35rem/1.3 var(--display); margin: 0 0 12px; text-wrap: balance; display: flex; align-items: center; gap: 10px; }
.fiche h2 .num { width: 30px; height: 30px; display: inline-grid; place-items: center; flex: none; font: 700 .9rem var(--corps); color: var(--accent); background: var(--accent-doux); border-radius: 50%; }
.fiche h3 { font: 700 1.08rem var(--display); margin: 22px 0 6px; }
.fiche p, .fiche li { max-width: 70ch; }
.fiche p { margin: 0 0 12px; }
.fiche ul, .fiche ol { padding-left: 22px; margin: 0 0 12px; }
.fiche li { margin-bottom: 4px; }
.fiche img { max-width: 100%; height: auto; border-radius: 14px; }
.fiche em { color: var(--accent); }
.fiche strong { color: var(--texte); }
.hand { font-family: var(--main); font-size: 1.5rem; color: var(--accent); line-height: 1.2; }
.boite { background: var(--surface); border-radius: var(--rayon); padding: 14px 18px; margin: 16px 0; box-shadow: var(--ombre); border-left: 4px solid var(--accent); }
.boite > :last-child { margin-bottom: 0; }
.boite .lbl { display: block; margin-bottom: 4px; font: 700 .74rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.boite.attention { border-left-color: var(--ko); }
.boite.attention .lbl { color: var(--ko); }
.boite.astuce { border-left-color: var(--chaud); }
.boite.astuce .lbl { color: var(--chaud); }
.boite.retenir { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.boite.retenir ul { list-style: none; padding-left: 0; display: grid; gap: 6px; }
.boite.retenir li { padding-left: 26px; position: relative; margin: 0; }
.boite.retenir li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.boite.exemple { border-left-style: dashed; }
.code-pair { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); margin: 14px 0; border-radius: 16px; overflow: hidden; background: var(--code-fond); box-shadow: var(--ombre); }
.code-pair.solo { grid-template-columns: minmax(0, 1fr); }
pre.code, pre.out { margin: 0; padding: 14px 16px; font: 500 .9rem/1.6 var(--mono); overflow-x: auto; min-width: 0; color: var(--code-texte); }
pre.code { background: var(--code-fond); }
pre.out { background: color-mix(in srgb, var(--code-fond) 70%, var(--surface)); border-left: 1px solid var(--trait); position: relative; padding-top: 30px; }
.code-pair.solo pre.out { border-left: none; }
pre.out::before { content: "Console"; position: absolute; top: 8px; left: 16px; font: 700 .66rem var(--corps); letter-spacing: .1em; text-transform: uppercase; color: var(--doux); }
.tk-kw { color: var(--tk-kw); font-weight: 700; }
.tk-str { color: var(--tk-str); }
.tk-num { color: var(--tk-num); }
.tk-com { color: var(--tk-com); font-style: italic; }
.tk-fn { color: var(--tk-fn); }
.tk-self { color: var(--tk-self); font-style: italic; }
.tbl-wrap { overflow-x: auto; margin: 12px 0 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--ombre); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font: 700 .74rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--doux); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td strong { color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 14px 0; }
.card { background: var(--surface); border-radius: 16px; padding: 14px 16px; min-width: 0; box-shadow: var(--ombre); }
.card .lbl { font: 700 .74rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--doux); }
.card .big { font: 700 1.05rem var(--display); color: var(--accent); margin: 2px 0 4px; overflow-wrap: anywhere; }
.card .big code { background: none; padding: 0; color: inherit; font-size: .95em; }
.mots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 14px 0; }
.mot { background: var(--surface); border-radius: 14px; padding: 10px 12px; display: grid; box-shadow: var(--ombre); }
.mot .b { font-size: .85rem; color: var(--doux); }
.mot .p { font: 700 1.1rem var(--display); color: var(--accent); }
.mot .f { font-size: .82rem; color: var(--doux); font-style: italic; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pill { background: var(--accent-doux); color: var(--accent); border-radius: 999px; padding: 5px 13px; font-weight: 700; font-size: .95rem; }
.compare { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: baseline; margin: 10px 0 16px; }
.compare .x { color: var(--ko); font-weight: 700; }
.compare .ok { color: var(--ok); font-weight: 700; }
.compare .barre { text-decoration: line-through; text-decoration-color: var(--ko); text-decoration-thickness: 2px; color: var(--doux); }
.uml { display: inline-grid; min-width: 220px; max-width: 100%; border-radius: 12px; background: var(--surface); font: 500 .95rem/1.6 var(--mono); overflow: hidden; box-shadow: var(--ombre); }
.uml > div { padding: 6px 14px; border-top: 1px solid var(--trait); }
.uml > div:first-child { border-top: none; font-weight: 700; text-align: center; background: var(--accent-doux); color: var(--accent); }
.uml > div span { color: var(--doux); font-family: var(--corps); font-size: .8rem; display: block; }
.side { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; margin: 12px 0; }
.side > div:last-child { flex: 1 1 260px; min-width: 0; }
.objs { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.obj { background: var(--surface); border: 1.5px dashed var(--accent); border-radius: 14px; padding: 10px 14px; font: 500 .92rem/1.6 var(--mono); }
.obj b { color: var(--accent); display: block; font-family: var(--display); }
.schema { display: block; width: 100%; max-width: 420px; height: auto; margin: 14px auto; color: var(--texte); }
.q-svg { display: block; width: 100%; max-width: 380px; height: auto; margin: 10px 0 0; color: var(--texte); }

/* Exercices */
.intro-exos { margin-bottom: 22px; }
.exo { background: var(--surface); border-radius: 22px; padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--ombre); }
.exo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fiche .exo h2 { font-size: 1.2rem; margin-bottom: 8px; }
.exo .lvl { font: 700 1rem var(--mono); color: var(--chaud); letter-spacing: .1em; }
details { margin-top: 10px; border-radius: 14px; background: var(--surface-2); }
summary { cursor: pointer; padding: 13px 16px; font: 700 .95rem var(--display); color: var(--accent); list-style-position: inside; }
details.solution summary { color: var(--ok); }
details[open] summary { border-bottom: 1px solid var(--trait); }
.d-body { padding: 12px 16px 4px; }

/* Fractions et limites */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 .12em; font-variant-numeric: tabular-nums; }
.frac .num { border-bottom: 2px solid currentColor; padding: 0 .2em .05em; }
.frac .den { padding: .05em .2em 0; }
.question .frac { font-size: .9em; }
.lim { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; margin: 0 .2em 0 .1em; }
.lim .sous { font-size: .62em; white-space: nowrap; margin-top: .1em; }
.fracs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 18px; margin: 12px 0 16px; }
.frac-fig { margin: 0; display: grid; gap: 4px; }
.frac-fig figcaption { font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.barre-frac { width: 100%; height: auto; display: block; }
.barre-frac .plein { fill: var(--accent); }
.barre-frac .vide { fill: var(--accent-doux); stroke: var(--trait); stroke-width: 1; }

/* ==================================================================== Quiz (moteur static/js/cours.js) */
#game, #flash { scroll-margin-top: 70px; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 20px; }
.mode { text-align: left; cursor: pointer; background: var(--surface-2); color: var(--texte); border: 2px solid transparent; border-radius: 16px; padding: 14px; font: inherit; display: grid; gap: 2px; }
.mode strong { font: 700 1rem var(--display); }
.mode span { color: var(--doux); font-size: .88rem; }
.mode small { color: var(--accent); font-weight: 700; font-size: .8rem; }
.mode[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-doux); }
.hud { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.hud .stat { font: 700 .92rem var(--display); }
.hud .stat span { color: var(--doux); font-weight: 500; }
.streak { color: var(--chaud); }
.bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 18px; }
.bar > div { height: 100%; width: 0; border-radius: 999px; background: var(--accent); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.qtag { font: 700 .74rem var(--corps); letter-spacing: .07em; text-transform: uppercase; color: var(--doux); }
.question { font: 700 clamp(1.2rem, 4.4vw, 1.5rem)/1.35 var(--display); margin: 6px 0 16px; text-wrap: balance; }
.question .gap { display: inline-block; min-width: 3em; border-bottom: 3px solid var(--accent); }
.qcode { border-radius: 14px; margin-bottom: 16px; }
.options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.opt {
  font: 700 1.05rem var(--corps); text-align: left; cursor: pointer; padding: 14px 16px; min-height: 58px; min-width: 0;
  border-radius: 18px; border: 2px solid transparent; background: var(--surface-2); color: var(--texte);
  display: flex; gap: 12px; align-items: center; transition: transform .12s ease, border-color .12s ease;
}
.opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.opt.mono > span:last-child { font: 600 .95rem var(--mono); }
.opt .k { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font: 700 .8rem var(--mono); background: var(--accent-doux); color: var(--accent); }
.opt:active:not(:disabled) { transform: scale(.98); }
.opt.right { border-color: #2f9e44; background: var(--ok-fond); color: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, #2f9e44 22%, transparent); animation: illumine .45s ease-out; }
.opt.wrong { border-color: var(--ko); background: var(--ko-fond); animation: tremble .4s ease; }
.opt:disabled { cursor: default; }
.options.vf { grid-template-columns: 1fr 1fr; }
.options.vf .opt { justify-content: center; font-size: 1.15rem; }
.answer-row { display: flex; gap: 10px; flex-wrap: wrap; }
.answer-row input, .trou { font: 700 1.1rem var(--corps); padding: 12px 14px; border-radius: 14px; border: 2px solid var(--trait); background: var(--surface-2); color: var(--texte); }
.answer-row input { flex: 1 1 220px; min-width: 0; }
.mono-in { font-family: var(--mono) !important; }
input.right { border-color: #2f9e44 !important; background: var(--ok-fond) !important; }
input.wrong { border-color: var(--ko) !important; background: var(--ko-fond) !important; animation: tremble .4s ease; }
.hint { color: var(--doux); font-size: .88rem; margin-top: 8px; }
.texte-trous { font-size: 1.15rem; line-height: 2.4; margin-bottom: 14px; }
.trou { padding: 4px 8px; width: 8em; max-width: 100%; font-size: 1.05rem; min-height: 42px; }
.paires { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.paires .col { display: grid; gap: 8px; align-content: start; }
.tuile { font: 700 1rem var(--corps); cursor: pointer; padding: 10px 12px; min-height: 50px; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2); color: var(--texte); text-align: center; overflow-wrap: anywhere; }
.tuile.sel { border-color: var(--accent); background: var(--accent-doux); }
.tuile.fait { border-color: #2f9e44; background: var(--ok-fond); color: var(--ok); cursor: default; }
.tuile.non { border-color: var(--ko); background: var(--ko-fond); animation: tremble .4s ease; }
.ordre-zone { min-height: 58px; border: 2px dashed var(--trait); border-radius: 16px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.ordre-zone:empty::before { content: "Touche les morceaux dans le bon ordre…"; color: var(--doux); padding: 4px 6px; }
.ordre-reserve { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ordre-reserve .tuile, .ordre-zone .tuile { min-height: 42px; padding: 6px 13px; }
.feedback { margin-top: 16px; border-radius: 18px; padding: 14px 16px; display: grid; gap: 4px; background: var(--surface-2); }
.feedback.ok { background: var(--ok-fond); }
.feedback.ko { background: var(--ko-fond); }
.feedback .t { font: 800 1.1rem var(--display); }
.feedback.ok .t { color: var(--ok); }
.feedback.ko .t { color: var(--ko); }
.next-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.result-score { font: 800 clamp(4rem, 20vw, 6rem)/1 var(--display); letter-spacing: -.04em; color: var(--texte); font-variant-numeric: tabular-nums; text-align: center; margin-top: 10px; }
.result-score small { font-size: .38em; color: var(--doux); letter-spacing: 0; }
.xp-gagne { display: inline-block; border-radius: 999px; padding: 4px 14px; font: 800 1.05rem var(--display); color: var(--chaud); background: color-mix(in srgb, var(--chaud) 16%, transparent); }
.review { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.review li { border-left: 3px solid var(--ko); padding: 4px 0 4px 12px; }
.review .ra { color: var(--ok); font-weight: 700; }
.review .ya { color: var(--ko); text-decoration: line-through; }
.confettis { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confettis i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: tombe 1.8s ease-in forwards; }
#game, #flash { position: relative; overflow: hidden; }
/* Cartes mémoire */
.flash-zone { perspective: 1000px; margin: 14px 0 18px; }
.flash-card { position: relative; width: 100%; min-height: 220px; cursor: pointer; transform-style: preserve-3d; transition: transform .45s ease; border: none; background: none; padding: 0; font: inherit; color: inherit; display: block; }
.flash-card.flip { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 22px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 20px; text-align: center; background: var(--surface-2); }
.flash-face.verso { transform: rotateY(180deg); background: var(--accent-doux); }
.flash-face .grand { font: 800 clamp(1.6rem, 6vw, 2.4rem) var(--display); }
.flash-face.verso .grand { color: var(--accent); }
.flash-face .petit { color: var(--doux); }
.flash-face .tap { position: absolute; bottom: 12px; font-size: .8rem; color: var(--doux); }

@keyframes illumine { 0% { transform: scale(.97); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes tremble { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes tombe { to { transform: translateY(520px) rotate(540deg); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
.pop { animation: pop .25s ease; }

/* ==================================================================== Devoirs */
.maj { margin: -10px 0 14px; color: var(--doux); font-size: .9rem; }
.jour-devoirs { margin-bottom: 10px; }
.jour-devoirs .group { margin-top: 18px; }
.devoir { background: var(--surface); border-radius: 20px; padding: 14px 16px; display: grid; gap: 8px; box-shadow: var(--ombre); }
.devoir.passe { opacity: .7; }
.devoir-tete { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.devoir-tete .mat { font: 700 .9rem var(--corps); color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.devoir-tete .mat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.devoir-texte { white-space: pre-line; line-height: 1.5; font-size: .98rem; }
.tag-interro { color: var(--ko); background: var(--ko-fond); border-radius: 999px; padding: 3px 10px; font: 800 .72rem var(--corps); text-transform: uppercase; letter-spacing: .05em; }
.reviser { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; font: 700 .9rem var(--corps); text-decoration: none; color: var(--accent); background: var(--accent-doux); }
.reviser .ico { width: 16px; height: 16px; }
.devoir form.lier { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.devoir { min-width: 0; grid-template-columns: minmax(0, 1fr); }   /* ne s'élargit jamais au contenu */
.devoir form.lier select { max-width: 100%; width: auto; flex: 1 1 0; min-width: 0; }   /* titre de cours long : tronqué */
.ligne-ia { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 6px 0; }
.ligne-ia > span { min-width: 0; overflow-wrap: anywhere; }
.devoir form.demande { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.panel .devoir { background: var(--surface-2); box-shadow: none; }
.devoir form.demande input[type=text] { flex: 1 1 180px; min-width: 0; width: 100%; }
.devoir form.demande .etat-demande { flex-basis: 100%; margin: 0; overflow-wrap: anywhere; }
.etat-demande.pret, .etat-demande.preprod { color: var(--ok); }
.etat-demande.besoin_infos, .etat-demande.echec { color: var(--chaud); }

/* ==================================================================== Connexion */
.page-connexion { min-height: calc(100vh - 60px); display: grid; align-content: center; justify-items: center; text-align: center; gap: 18px; max-width: 420px; margin: 0 auto; }
.logo-app { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font: 800 36px var(--display); color: #fff; position: relative;
  background: linear-gradient(145deg, #4c6ef5, #2457c5); box-shadow: 0 12px 28px rgb(36 87 197 / .4); }
.logo-app i { position: absolute; top: 11px; right: 11px; width: 13px; height: 13px; border-radius: 50%; background: #f5b70a; }
.page-connexion h1 { font-size: 2.4rem; }
.page-connexion .lead { margin: 0; }
.illu-connexion { width: 230px; max-width: 70%; height: auto; }
.illu-connexion .page { fill: var(--surface); }
.illu-connexion .trait { stroke: var(--trait); stroke-width: 4; stroke-linecap: round; fill: none; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 20px;
  font: 600 1rem var(--corps); border-radius: 999px; background: #fff; color: #1f1f1f; border: 1px solid #747775; text-decoration: none; }
.btn-google:active { transform: scale(.98); }
.page-connexion .note { margin: 0; font-size: .88rem; color: var(--doux); max-width: 32ch; }
.aide-installer { width: 100%; text-align: left; border-radius: 18px; background: var(--surface); box-shadow: var(--ombre); }
.aide-installer summary { color: var(--bleu); }
.aide-installer ol { margin: 0; padding: 10px 18px 16px 36px; color: var(--doux); display: grid; gap: 6px; }
.liens-legaux { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font-size: .85rem; }
.liens-legaux a { color: var(--doux); }

/* ==================================================================== « Moi » */
.moi-tete { display: grid; justify-items: center; gap: 6px; text-align: center; margin-bottom: 18px; }
.moi-tete .avatar { font-size: 4rem; line-height: 1.1; }
.moi-tete .av-img { width: 96px; height: 96px; }
.moi-tete h1 { font-size: 2rem; }
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.chiffres div { background: var(--surface); border-radius: 18px; padding: 12px 10px; display: grid; justify-items: center; text-align: center; box-shadow: var(--ombre); }
.chiffres b { font: 800 1.5rem var(--display); font-variant-numeric: tabular-nums; }
.chiffres small { color: var(--doux); font-size: .78rem; line-height: 1.3; }
.reglage { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.segment { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.segment button { border: none; background: transparent; color: var(--doux); font: 700 .88rem var(--display); padding: 9px 14px; border-radius: 9px; cursor: pointer; min-height: 40px; }
.segment button[aria-pressed="true"] { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
.liste-panel { display: grid; gap: 14px; }

/* ==================================================================== Espace parent */
.entete-parent { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--fond) 86%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--trait); }
.entete-parent .marque { font: 800 1.05rem var(--display); color: var(--texte); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.entete-parent .marque small { color: var(--doux); font-weight: 600; }
.nav-parent { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-parent a, .nav-parent button { font: 700 .9rem var(--display); color: var(--doux); text-decoration: none; padding: 9px 12px; border-radius: 10px; background: none; border: none; cursor: pointer; }
.nav-parent a[aria-current="page"] { color: var(--texte); background: var(--surface); box-shadow: var(--ombre); }
.nav-parent form { margin: 0; }
.menu-parent { display: none; position: relative; }
.menu-parent > summary { list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--surface); color: var(--texte); padding: 0; box-shadow: var(--ombre); }
.menu-parent > summary::-webkit-details-marker { display: none; }
.menu-parent[open] > summary { border-bottom: none; }
.menu-parent .nav-parent { position: absolute; right: 0; top: 52px; min-width: 220px; display: grid; gap: 2px; padding: 8px; border-radius: 18px; background: var(--surface); box-shadow: var(--ombre-forte); }
.menu-parent .nav-parent a, .menu-parent .nav-parent button { text-align: left; padding: 12px 14px; }
.menu-parent { background: none; margin: 0; }
@media (max-width: 760px) { .entete-parent > .nav-parent { display: none; } .menu-parent { display: block; } }
body.parent .wrap { max-width: 980px; padding-top: 20px; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
.p-enfants { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.p-enfants a { padding: 9px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--ombre); color: var(--doux); font: 700 .9rem var(--corps); text-decoration: none; }
.p-enfants a[aria-current="true"] { background: var(--bleu-fort); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: 18px; padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--ombre); }
.kpi .lbl { font: 700 .7rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--doux); }
.kpi b { font: 800 1.7rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.kpi span:last-child { color: var(--doux); font-size: .84rem; }
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.graphes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
@media (max-width: 720px) { .graphes { grid-template-columns: 1fr; } }
.barres { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 170px; align-items: end; }
.barre-col { height: 100%; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: end; gap: 4px; }
.barre-col .barre { width: 70%; max-width: 30px; min-height: 3px; background: var(--bleu); border-radius: 6px 6px 3px 3px; align-self: end; }
.barre-col .val { font: 700 .8rem var(--display); align-self: end; }
.barre-col .jour { font-size: .76rem; color: var(--doux); width: 100%; text-align: center; padding-top: 4px; }
.courbe { width: 100%; height: auto; display: block; }
.courbe .grille { stroke: var(--trait); stroke-width: 1; }
.courbe .axe { fill: var(--doux); font: 600 10px var(--corps); }
.courbe .ligne { fill: none; stroke: var(--bleu); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.courbe .point circle:first-child { fill: var(--bleu); stroke: var(--surface); stroke-width: 2; }
.courbe .point .zone { fill: transparent; stroke: none; cursor: pointer; }
.pct { font-weight: 700; }
.pct.bon { color: var(--ok); }
.pct.moyen { color: var(--chaud); }
.pct.faible { color: var(--ko); }
.liste-themes, .liste-ratees { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.liste-ratees li { display: grid; gap: 2px; border-left: 3px solid var(--ko); padding-left: 12px; }
.jauge-err { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 6px 0 2px; }
.jauge-err > span { display: block; height: 100%; background: var(--ko); border-radius: 999px; }
.liste-ratees .gap, .review .gap { display: inline-block; min-width: 2.2em; border-bottom: 2px solid var(--doux); }
/* Tableau des cours → cartes sur téléphone */
.cours-suivi { display: grid; gap: 10px; }
.cours-suivi .ligne-cours { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.cours-suivi .ligne-cours small { color: var(--doux); }
.cours-suivi .etats { display: flex; gap: 6px 10px; flex-wrap: wrap; font-size: .82rem; color: var(--doux); grid-column: 1 / -1; }
.cours-suivi .etats .oui { color: var(--ok); font-weight: 700; }
.historique { display: grid; gap: 8px; }
.historique .partie { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: .92rem; }
.historique .partie small { color: var(--doux); }
.historique .partie b { font-variant-numeric: tabular-nums; }
.avatars { border: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.avatars legend { font: 700 .9rem var(--display); margin-bottom: 8px; padding: 0; }
.av { cursor: pointer; }
.av input { position: absolute; opacity: 0; pointer-events: none; }
.av span { display: grid; place-items: center; width: 50px; height: 50px; font-size: 1.7rem; border: 2px solid transparent; border-radius: 14px; background: var(--surface-2); }
.av input:checked + span { border-color: var(--bleu); background: color-mix(in srgb, var(--bleu) 16%, var(--surface-2)); }
.av input:focus-visible + span { outline: 3px solid var(--bleu); }
/* Page « Famille » : une fiche dépliable par enfant (profil, compte Google, devoirs en ligne) */
.panel.fiche-famille { margin: 0 0 12px; padding: 0; scroll-margin-top: 80px; }
.fiche-famille > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  font: 400 1rem var(--corps); color: var(--texte); }
.fiche-famille > summary strong { font: 700 1.08rem var(--display); }
.ff-texte { display: grid; gap: 4px; min-width: 0; }
.fiche-famille > summary::-webkit-details-marker { display: none; }
.fiche-famille > summary::after { content: "▾"; margin-left: auto; color: var(--doux); transition: transform .15s ease; }
.fiche-famille[open] > summary::after { transform: rotate(180deg); }
.fiche-famille[open] > summary { border-bottom: 1px solid var(--trait); }
.avatar-mini { width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.5rem; border-radius: 12px; background: var(--surface-2); flex: none; overflow: hidden; }
.avatar-mini .av-img { width: 34px; height: 34px; }
.ff-etats { display: flex; flex-wrap: wrap; gap: 6px; }
.pastille-etat { font: 700 .74rem var(--corps); padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--doux); }
.pastille-etat.ok { background: var(--ok-fond); color: var(--ok); }
.pastille-etat.ko { background: var(--ko-fond); color: var(--ko); }
.pastille-etat.attente { background: color-mix(in srgb, var(--chaud) 16%, transparent); color: var(--chaud); }
.ff-corps { padding: 6px 18px 18px; }
.ff-corps > form, .ff-bloc > form { display: grid; gap: 14px; }
.ff-bloc { padding: 16px 0; border-bottom: 1px solid var(--trait); display: grid; gap: 12px; scroll-margin-top: 80px; }
.ff-bloc > p { margin: 0; }
.ff-titre { font: 700 .82rem var(--corps); letter-spacing: .08em; text-transform: uppercase; color: var(--doux); margin: 0; }
.ff-fin { border-bottom: none; padding-bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ff-fin form { margin: 0; }
.ff-encart { padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--chaud); }
.ff-encart p { margin: 0; }
.ff-synchro { display: flex; align-items: center; gap: 8px; }
.champs-duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.fiche-famille .compte { background: var(--surface-2); box-shadow: none; }
.fiche-famille .compte details { background: var(--surface); }
.fiche-famille .compte details > form { padding: 12px 16px; }
.fiche-famille .bandeau-msg { margin: 0; }
.tag-source { font: 700 .72rem var(--corps); letter-spacing: .06em; text-transform: uppercase; background: color-mix(in srgb, var(--bleu) 16%, transparent); color: var(--bleu); border-radius: 999px; padding: 4px 10px; }
fieldset.champs-source { border: none; padding: 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
fieldset.champs-source[hidden] { display: none; }
.fraicheur { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; margin-bottom: 14px; font-weight: 700; font-size: .92rem; background: var(--ok-fond); color: var(--ok); }
.fraicheur.vieux { background: var(--ko-fond); color: var(--ko); }
/* Comptes */
.comptes { display: grid; gap: 10px; }
.compte { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--ombre); }
.compte .adresse { font-weight: 700; overflow-wrap: anywhere; }
.compte small { color: var(--doux); }
.compte .etiquettes { display: flex; gap: 6px; flex-wrap: wrap; }
.etiquette { font: 700 .72rem var(--corps); text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--doux); }
.etiquette.parent { background: color-mix(in srgb, var(--bleu) 18%, transparent); color: var(--bleu); }
.etiquette.suspendu { background: var(--ko-fond); color: var(--ko); }
.compte details { grid-column: 1 / -1; margin-top: 4px; }
.compte .actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 16px; }
.compte .actions form { margin: 0; }
.compte .actions .btn { min-height: 42px; padding: 9px 14px; font-size: .9rem; }
.journal { display: grid; gap: 6px; font-size: .9rem; }
.journal div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--trait); }
.journal time { color: var(--doux); white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal small { grid-column: 2; color: var(--doux); }
/* Pages de texte (confidentialité, conditions) */
.texte-legal { max-width: 68ch; }
.texte-legal h2 { font: 700 1.15rem var(--display); margin: 26px 0 6px; }
.texte-legal p, .texte-legal li { color: var(--doux); }
.texte-legal strong { color: var(--texte); }

/* ==================================================================== Mobile */
a, button, summary, label, input, select, .flash-card { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:where(input, select, textarea) { font-size: 16px; }
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .modes { grid-template-columns: 1fr; }
  .code-pair { grid-template-columns: minmax(0, 1fr); }
  pre.out { border-left: none; border-top: 1px solid var(--trait); }
  .panel { padding: 16px; border-radius: 20px; }
  .exo { padding: 14px 16px; }
  .tab { flex-direction: column; gap: 2px; font-size: .76rem; padding: 7px 2px; min-height: 54px; }
  .tab .lbl-long { display: none; }
  .tab .lbl-court { display: inline; }
  body[data-vue="quiz"] .bandeau-cours .lead, body[data-vue="cartes"] .bandeau-cours .lead { display: none; }
  .answer-row input { flex-basis: 100%; }
  .answer-row .btn, .next-row .btn, #go, .end-actions .btn { flex: 1 1 auto; }
  #go { width: 100%; }
  .texte-trous { line-height: 2.2; }
  .paires { gap: 8px; }
}
@media (hover: hover) {
  .course:hover, .tuile-accueil:hover, .rappel:hover { transform: translateY(-2px); box-shadow: var(--ombre-forte); }
  .opt:hover:not(:disabled) { border-color: var(--accent); }
  .tab:hover:not([aria-selected="true"]) { color: var(--texte); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* Avatars en image (data/avatars/) : même encombrement que l'emoji, en rond */
.av-img { display: inline-block; width: 1.25em; height: 1.25em; border-radius: 50%; object-fit: cover; vertical-align: middle; background: #fff; }
.profil .av-img { width: 6.5rem; height: 6.5rem; margin-bottom: 4px; box-shadow: 0 0 0 3px var(--surface-2); }
.av span .av-img { width: 42px; height: 42px; }
h1 .av-img, h2 .av-img { width: 1.1em; height: 1.1em; vertical-align: -0.15em; }

/* ==================================================================== Espace parent : accueil et fiche enfant */
.bandeau-parent { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  padding: max(8px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: #3b5bdb; color: #fff; font-size: .88rem; }
.bandeau-parent a { color: #fff; font-weight: 700; white-space: nowrap; }
.tendance { font-size: .72em; font-weight: 700; margin-left: 4px; color: var(--doux); }
.tendance.hausse { color: var(--ok); }
.tendance.baisse { color: var(--ko); }
.cartes-enfants { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; }
.carte-enfant { background: var(--surface); border-radius: 24px; padding: 16px; box-shadow: var(--ombre); display: grid; gap: 12px; align-content: start; }
.ce-tete { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--texte); }
.ce-avatar { width: 52px; height: 52px; display: grid; place-items: center; font-size: 30px; border-radius: 50%; background: var(--surface-2); overflow: hidden; flex: none; }
.ce-avatar .av-img, .ft-avatar .av-img { width: 100%; height: 100%; }
.ce-nom { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.ce-nom strong { font: 700 1.2rem var(--display); }
.ce-nom small { color: var(--doux); }
.ce-tete > .ico { color: var(--doux); }
.ce-alerte { margin: 0; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--chaud) 15%, transparent); color: var(--chaud); font-weight: 700; font-size: .9rem; }
.ce-chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ce-chiffres div { display: grid; text-align: center; padding: 8px 4px; border-radius: 14px; background: var(--surface-2); }
.ce-chiffres b { font: 800 1.1rem var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ce-chiffres small { color: var(--doux); font-size: .72rem; line-height: 1.25; }
.ce-devoir { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: .9rem; line-height: 1.4; }
.ce-devoir .rp-quand { font: 700 .7rem var(--corps); text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-doux); white-space: nowrap; }
.ce-devoir .rp-txt { min-width: 0; }
.ce-plus { margin: -6px 0 0; }
.ce-compte { margin: 0; display: flex; gap: 6px; align-items: center; color: var(--doux); overflow-wrap: anywhere; }
.ce-compte .ico { width: 16px; height: 16px; }
.ce-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ce-actions form { margin: 0; }
.ce-actions .btn { min-height: 42px; padding: 9px 14px; font-size: .9rem; }
.fiche-tete { display: flex; align-items: center; gap: 16px; }
.ft-avatar { width: 76px; height: 76px; display: grid; place-items: center; font-size: 44px; border-radius: 50%; background: var(--surface); box-shadow: var(--ombre); overflow: hidden; flex: none; }
.ft-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.ft-actions form { margin: 0; }
.ft-actions .btn { min-height: 42px; padding: 9px 14px; font-size: .9rem; }
.bilan .kpis { margin-bottom: 0; }
.bilan .kpi { background: var(--surface-2); box-shadow: none; }
.par-matiere { display: grid; gap: 12px; }
.pm-ligne { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 3.5em; gap: 2px 12px; align-items: center; }
.pm-nom { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-jauge { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pm-jauge span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.pm-val { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pm-detail { grid-column: 1 / -1; color: var(--doux); }
@media (max-width: 520px) {
  .ce-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pm-ligne { grid-template-columns: minmax(0, 1fr) 3.5em; }
  .pm-jauge { grid-column: 1 / -1; grid-row: 2; }
  .pm-detail { grid-row: 3; }
}

/* Alertes de l'espace parent (synchro des devoirs, atelier, contrôles sans cours) */
.alertes-parent { list-style: none; margin: 12px auto 0; padding: 0 16px; max-width: 980px; display: grid; gap: 6px; box-sizing: border-box; }
.alertes-parent li a { display: block; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--trait);
  color: var(--texte); text-decoration: none; font-size: 15px; overflow-wrap: anywhere; }
.alertes-parent li.grave a { border-color: var(--chaud); background: color-mix(in srgb, var(--chaud) 14%, var(--surface)); }

/* Accueil enfant : compte à rebours des contrôles */
.compte-rebours { display: grid; gap: 10px; margin-top: 14px; }
.cr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; padding: 12px 14px;
  border-radius: 18px; background: var(--surface); box-shadow: var(--ombre); border: 2px solid transparent; }
.cr.urgent { border-color: var(--chaud); }
.cr.pret { border-color: var(--ok); }
.cr-quand { font: 700 .72rem var(--corps); text-transform: uppercase; letter-spacing: .05em; padding: 4px 9px; border-radius: 999px;
  color: var(--accent); background: var(--accent-doux); white-space: nowrap; align-self: start; }
.cr-txt { min-width: 0; display: grid; gap: 4px; font-size: .95rem; line-height: 1.35; overflow-wrap: anywhere; }
.cr-etat { color: var(--doux); font-size: .88rem; }
.cr.pret .cr-etat { color: var(--ok); font-weight: 700; }
.jauge { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.jauge > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.cr.pret .jauge > span { background: var(--ok); }
.cr-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: flex-end; }
.cr-lien { color: var(--accent); font-weight: 700; text-decoration: none; }
.cr .btn-mini { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--accent);
  color: #fff; font-weight: 700; text-decoration: none; }
