/* Sensei — styles. Mobile d'abord, thème clair/sombre. */

:root {
  --vert: #58cc02; --vert-ombre: #46a302; --vert-clair: #d7ffb8;
  --rouge: #ff4b4b; --rouge-ombre: #d33131; --rouge-clair: #ffdfe0;
  --bleu: #1cb0f6; --bleu-ombre: #1899d6; --bleu-clair: #ddf4ff;
  --or: #ffc800; --orange: #ff9600;
  --fond: #ffffff; --fond-2: #f7f7f7; --carte: #ffffff;
  --texte: #3c3c3c; --texte-2: #777777; --bord: #e5e5e5;
  --verrou: #e5e5e5; --verrou-ombre: #c8c8c8;
  --rayon: 16px;
  --police: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "DejaVu Sans Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #131f24; --fond-2: #1a2a31; --carte: #1a2a31;
    --texte: #f1f7fb; --texte-2: #a3b3bc; --bord: #37464f;
    --verrou: #37464f; --verrou-ombre: #263239;
    --vert-clair: #1f3b12; --rouge-clair: #3f1d1f; --bleu-clair: #12334a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #131f24; --fond-2: #1a2a31; --carte: #1a2a31;
  --texte: #f1f7fb; --texte-2: #a3b3bc; --bord: #37464f;
  --verrou: #37464f; --verrou-ombre: #263239;
  --vert-clair: #1f3b12; --rouge-clair: #3f1d1f; --bleu-clair: #12334a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police); }
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--bleu); }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 8px; top: 8px; z-index: 99; background: var(--carte); padding: 8px; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }

/* ---------- Chargement ---------- */
.chargement { min-height: 100dvh; display: grid; place-content: center; text-align: center; padding: 24px; gap: 8px; }
.logo-grand { font-size: 72px; animation: rebond 1.2s infinite ease-in-out; }
@keyframes rebond { 50% { transform: translateY(-10px); } }

/* ---------- En-tête et barre d'état ---------- */
.entete { position: sticky; top: 0; z-index: 10; background: var(--fond); border-bottom: 2px solid var(--bord);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.logo { font-weight: 900; font-size: 20px; color: var(--vert); letter-spacing: -.3px; }
.etat { display: flex; align-items: center; gap: 14px; font-weight: 800; font-size: 15px; }
.etat-objectif { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texte-2); }
.objectif-barre { width: 64px; height: 10px; border-radius: 99px; background: var(--bord); overflow: hidden; display: inline-block; }
.objectif-rempli { display: block; height: 100%; background: var(--or); border-radius: 99px; transition: width .4s; }

/* ---------- Page et navigation ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.navigation { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--fond);
  border-top: 2px solid var(--bord); padding-bottom: env(safe-area-inset-bottom); }
.onglet { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px;
  text-decoration: none; color: var(--texte-2); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.onglet-icone { font-size: 24px; }
.onglet.actif { color: var(--bleu); }
.onglet.actif .onglet-icone { filter: drop-shadow(0 0 0 var(--bleu)); transform: scale(1.1); }
@media (min-width: 900px) {
  .navigation { top: 0; bottom: 0; right: auto; width: 220px; flex-direction: column; border-top: 0; border-right: 2px solid var(--bord); padding-top: 90px; }
  .onglet { flex: 0; flex-direction: row; gap: 12px; font-size: 15px; padding: 14px 20px; }
  .entete, .page { margin-left: 220px; }
  .page { padding-bottom: 40px; }
}

.bonjour { font-size: 18px; font-weight: 800; margin: 4px 0 8px; }
.section-titre { font-size: 20px; font-weight: 900; margin: 24px 0 12px; }
.note, .vide { color: var(--texte-2); font-size: 14px; }
.retour { display: inline-block; margin-top: 4px; font-weight: 800; text-decoration: none; }

/* ---------- Boutons ---------- */
.btn { border: 0; border-radius: var(--rayon); padding: 14px 20px; font-weight: 900; font-size: 16px; text-transform: uppercase;
  letter-spacing: .5px; cursor: pointer; width: 100%; transition: transform .05s, box-shadow .05s; min-height: 50px; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: none !important; }
.btn:disabled { background: var(--verrou) !important; color: var(--texte-2) !important; box-shadow: 0 4px 0 var(--verrou-ombre) !important; cursor: not-allowed; }
.btn-principal { background: var(--vert); color: #fff; box-shadow: 0 4px 0 var(--vert-ombre); }
.btn-danger { background: var(--rouge); color: #fff; box-shadow: 0 4px 0 var(--rouge-ombre); }
.btn-secondaire { background: var(--carte); color: var(--bleu); border: 2px solid var(--bord); box-shadow: 0 4px 0 var(--bord); }
.btn-lien { background: none; color: var(--texte-2); width: auto; box-shadow: none; }
.btn-petit { width: auto; min-height: 0; padding: 8px 14px; font-size: 13px; }
.btn-icone { background: none; border: 0; font-size: 24px; color: var(--texte-2); cursor: pointer; padding: 4px 8px; }
.boutons-ligne { display: grid; gap: 14px; }

/* ---------- Unités et chemin de leçons ---------- */
.unite { margin: 0 0 16px; border-radius: var(--rayon); overflow: hidden; border: 2px solid var(--bord); background: var(--carte); }
.unite-entete { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  background: var(--couleur); color: #fff; }
.unite-entete::-webkit-details-marker { display: none; }
.unite-icone { font-size: 30px; }
.unite-titres { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.unite-titre { font-weight: 900; font-size: 17px; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.unite-progres { font-size: 13px; font-weight: 700; opacity: .9; }
.unite-jauge { width: 54px; height: 8px; background: rgba(255,255,255,.35); border-radius: 99px; overflow: hidden; }
.unite-jauge span { display: block; height: 100%; background: #fff; }
.chemin { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 8px 28px; }
.etape { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 200px; text-align: center; }
.noeud { width: 72px; height: 66px; border-radius: 50%; border: 0; font-size: 26px; font-weight: 900; color: #fff; cursor: pointer;
  background: var(--couleur); box-shadow: 0 7px 0 rgba(0,0,0,.25); transition: transform .06s; }
.noeud:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.noeud-faite { background: var(--or); box-shadow: 0 7px 0 #e0a800; }
.noeud-courante { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { outline: 0 solid transparent; } 50% { outline: 8px solid color-mix(in srgb, var(--couleur) 30%, transparent); } }
.noeud-verrouillee { background: var(--verrou); color: var(--texte-2); box-shadow: 0 7px 0 var(--verrou-ombre); cursor: not-allowed; font-size: 22px; }
.etape-titre { font-size: 13px; font-weight: 800; color: var(--texte-2); }
.etape-etoiles { color: var(--or); font-size: 14px; letter-spacing: 2px; }

/* ---------- Cartes génériques ---------- */
.carte-action { background: var(--carte); border: 2px solid var(--bord); border-radius: var(--rayon); padding: 16px; margin-bottom: 14px; }
.carte-action h3 { margin: 0 0 6px; font-size: 17px; }
.carte-action p { margin: 0 0 12px; }
.reglages { display: grid; gap: 4px; }
.reglage { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-weight: 700; }
.reglage .champ { max-width: 60%; }
.select { border: 2px solid var(--bord); border-radius: 12px; padding: 8px; background: var(--fond-2); max-width: 55%; }
.switch { appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--bord); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch:checked { background: var(--vert); }
.switch:checked::after { left: 23px; }
.liens { display: grid; gap: 12px; font-weight: 800; }
.liens a { text-decoration: none; }
.source-bloc { border-top: 1px solid var(--bord); padding-top: 10px; margin-top: 10px; overflow-wrap: anywhere; }
.source-titre { font-weight: 800; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 14px; margin: 6px 0; }
dt { color: var(--texte-2); }
dd { margin: 0; }
.faibles { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.faibles li { display: grid; grid-template-columns: 1fr 90px 44px; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.faible-barre { height: 12px; background: var(--bord); border-radius: 99px; overflow: hidden; }
.faible-barre span { display: block; height: 100%; }
.faible-barre .rouge { background: var(--rouge); } .faible-barre .orange { background: var(--orange); } .faible-barre .vert { background: var(--vert); }
.faible-pct { text-align: right; }
.diag { padding-left: 18px; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.bandeau-maj { position: fixed; left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 30; background: var(--carte);
  border: 2px solid var(--bord); border-radius: var(--rayon); padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; box-shadow: 0 6px 20px rgba(0,0,0,.15); }

/* ---------- Session (leçon) ---------- */
.session { min-height: 100dvh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.sess-haut { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 12px) 16px 8px; }
.barre { flex: 1; height: 16px; background: var(--bord); border-radius: 99px; overflow: hidden; }
.barre-rempli { height: 100%; width: 0; background: var(--vert); border-radius: 99px; transition: width .35s ease;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), inset 0 4px 0 rgba(255,255,255,.3); }
.sess-coeurs { font-weight: 900; color: var(--rouge); min-width: 44px; text-align: right; }
.sess-corps { flex: 1; padding: 16px; overflow-y: auto; }
.sess-pied { position: sticky; bottom: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--fond);
  border-top: 2px solid var(--bord); display: flex; flex-direction: column; gap: 10px; }
.sess-pied:has(.btn-lien) { flex-direction: row; align-items: center; }
.sess-pied:has(.btn-lien) .btn-lien { flex: none; padding-left: 4px; padding-right: 4px; }
.sess-pied:has(.btn-lien) .btn-principal { flex: 1; width: auto; }

.carte-cours { background: var(--carte); border: 2px solid var(--bord); border-radius: 20px; padding: 20px; margin-top: 12px; animation: entree .25s ease; }
@keyframes entree { from { opacity: 0; transform: translateY(8px); } }
.badge-cours { display: inline-block; padding: 6px 12px; border-radius: 99px; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; background: var(--bleu-clair); color: var(--bleu); }
.badge-retenir { background: var(--vert-clair); color: var(--vert-ombre); }
.badge-astuce { background: #fff4cc; color: #b07800; }
:root[data-theme="dark"] .badge-astuce { background: #3a3110; color: var(--or); }
.cours-texte { font-size: 19px; line-height: 1.5; white-space: pre-line; margin: 16px 0 8px; }
.liste-retenir { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.liste-retenir li { border-left: 4px solid var(--vert); padding-left: 12px; }
.retenir-q { font-size: 14px; color: var(--texte-2); font-weight: 700; }
.retenir-r { font-size: 16px; font-weight: 800; white-space: pre-wrap; font-family: inherit; }
.cours-pos { text-align: right; color: var(--texte-2); font-size: 13px; margin: 8px 0 0; }
.source { font-size: 13px; color: var(--texte-2); margin-top: 14px; }

.exercice { animation: entree .2s ease; }
.consigne { color: var(--texte-2); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin: 4px 0; }
.question { font-size: 22px; line-height: 1.35; margin: 0 0 20px; overflow-wrap: anywhere; }
.options { display: grid; gap: 12px; }
.options-vf { grid-template-columns: 1fr 1fr; }
.option { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; min-height: 56px; border-radius: var(--rayon);
  background: var(--carte); border: 2px solid var(--bord); box-shadow: 0 4px 0 var(--bord); font-size: 17px; font-weight: 700; cursor: pointer; overflow-wrap: anywhere; }
.option-vf { justify-content: center; font-weight: 900; font-size: 18px; }
.option:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--bord); }
.option-num { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--bord); display: grid; place-items: center; font-size: 13px; color: var(--texte-2); }
.option.choisie { border-color: var(--bleu); background: var(--bleu-clair); box-shadow: 0 4px 0 var(--bleu-ombre); color: var(--bleu); }
.option.juste, .puce.juste, .champ.juste { border-color: var(--vert); background: var(--vert-clair); color: var(--vert-ombre); box-shadow: 0 4px 0 var(--vert); }
.option.fausse, .champ.fausse { border-color: var(--rouge); background: var(--rouge-clair); color: var(--rouge-ombre); box-shadow: 0 4px 0 var(--rouge); }
.option:disabled { cursor: default; }
.proposition { font-size: 18px; background: var(--fond-2); border-radius: 12px; padding: 12px 14px; margin: -8px 0 16px; overflow-wrap: anywhere; }

.champ { width: 100%; padding: 14px 16px; font-size: 18px; border-radius: var(--rayon); border: 2px solid var(--bord); background: var(--fond-2); font-family: var(--mono); }
.champ:focus { border-color: var(--bleu); outline: none; }

.ordre-reponse { min-height: 64px; border-bottom: 2px solid var(--bord); padding: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-bottom: 18px; }
.ordre-reponse.juste { border-color: var(--vert); } .ordre-reponse.fausse { border-color: var(--rouge); }
.ordre-vide { color: var(--texte-2); font-size: 14px; padding-top: 10px; }
.ordre-reserve { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.puce { border: 2px solid var(--bord); background: var(--carte); border-radius: 12px; box-shadow: 0 3px 0 var(--bord); padding: 10px 12px; font-weight: 700; font-size: 15px; cursor: pointer; overflow-wrap: anywhere; text-align: left; }
.puce:disabled:not(.juste) { opacity: .35; box-shadow: none; }
.puce.choisie { border-color: var(--bleu); background: var(--bleu-clair); color: var(--bleu); }
.puce-placee { font-family: inherit; }
.paires { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paires .col { display: grid; gap: 10px; align-content: start; }
.puce-paire { min-height: 56px; font-size: 14px; }
.puce.juste { opacity: .55; }
.secoue { animation: secoue .4s; border-color: var(--rouge) !important; }
@keyframes secoue { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.carte-flash { display: grid; gap: 14px; }
.carte-dos { font-family: var(--mono); font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-x: auto; background: var(--fond-2); border: 2px solid var(--bord); border-radius: var(--rayon); padding: 14px; margin: 0; animation: entree .2s; }
.carte-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.carte-actions:has(> :only-child) { grid-template-columns: 1fr; }

.feedback { border-radius: var(--rayon); padding: 12px 14px; animation: entree .2s; overflow-wrap: anywhere; max-height: 40dvh; overflow-y: auto; }
.feedback p { margin: 4px 0; }
.fb-ok { background: var(--vert-clair); color: var(--vert-ombre); }
.fb-ko { background: var(--rouge-clair); color: var(--rouge-ombre); }
.fb-titre { font-weight: 900; font-size: 19px; }
.fb-explication { color: var(--texte); white-space: pre-line; font-size: 15px; }
.fb-note { font-size: 13px; opacity: .85; }
.fb-signalement { background: #fff4cc; color: #7a5300; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
:root[data-theme="dark"] .fb-signalement { background: #3a3110; color: var(--or); }

.fin { text-align: center; padding-top: 24px; animation: entree .3s; }
.fin-emoji { font-size: 84px; }
.fin h2 { font-size: 26px; margin: 8px 0 18px; color: var(--or); }
.fin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; margin: 12px 0; }
.tuile { border: 2px solid var(--bord); border-radius: var(--rayon); overflow: hidden; background: var(--carte); text-align: center; }
.tuile-titre { font-size: 12px; font-weight: 900; text-transform: uppercase; padding: 6px; background: var(--fond-2); color: var(--texte-2); }
.tuile-valeur { font-size: 22px; font-weight: 900; padding: 10px 6px; }
.fin-objectif { font-weight: 800; color: var(--texte-2); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-astuce { background: #3a3110; color: var(--or); }
  :root:not([data-theme="light"]) .fb-signalement { background: #3a3110; color: var(--or); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.reglage .champ { font-family: inherit; }

/* ---------- Bilan des erreurs (fin de leçon) ---------- */
.bilan { text-align: left; margin-top: 20px; }
.bilan h3 { font-size: 18px; margin: 0 0 10px; }
.bilan-item { border: 2px solid var(--bord); border-left: 6px solid var(--rouge); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; background: var(--carte); overflow-wrap: anywhere; }
.bilan-item p { margin: 4px 0; }
.bilan-q { font-weight: 800; }
.bilan-ta { color: var(--rouge-ombre); }
.bilan-ta span { text-decoration: line-through; }
.bilan-bonne { color: var(--vert-ombre); }
.bilan-expl { font-size: 15px; white-space: pre-line; }
.bilan-paires { margin: 4px 0; padding-left: 18px; font-size: 14px; }
.bilan-parfait { font-weight: 800; color: var(--vert-ombre); }
.revoir-cours { text-align: left; margin-top: 8px; border: 2px solid var(--bord); border-radius: 14px; padding: 10px 14px; }
.revoir-cours summary { font-weight: 900; cursor: pointer; }
.revoir-carte { border-top: 1px solid var(--bord); padding-top: 10px; margin-top: 10px; }
.cours-texte.petit { font-size: 16px; margin: 8px 0; }
.fin .carte-dos { text-align: left; }

/* ---------- Signaler une question ---------- */
.btn-signaler { background: none; border: 0; padding: 6px 0 0; margin-top: 4px; font: inherit; font-size: 13px; font-weight: 800; color: inherit; opacity: .75; cursor: pointer; text-decoration: underline; }
.zone-copie { font-size: 13px; resize: vertical; margin-bottom: 12px; }
.ordre-reponse .puce-placee:disabled { opacity: 1; }

/* ---------- Fenêtre de signalement ---------- */
.sig-voile { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; animation: entree .15s; }
.sig-boite { background: var(--fond); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.25); }
@media (min-width: 640px) { .sig-voile { align-items: center; } .sig-boite { border-radius: 20px; } }
.sig-boite h2 { margin: 0 0 10px; font-size: 20px; }
.sig-question { font-weight: 800; margin: 0 0 2px; overflow-wrap: anywhere; }
.sig-motifs { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.sig-motifs legend { font-weight: 900; margin-bottom: 8px; }
.sig-motif { display: flex; align-items: center; gap: 10px; border: 2px solid var(--bord); border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; }
.sig-motif:has(input:checked) { border-color: var(--bleu); background: var(--bleu-clair); color: var(--bleu); }
.sig-motif input { width: 20px; height: 20px; accent-color: var(--bleu); flex: none; }
.sig-commentaire { font-family: inherit; font-size: 16px; resize: vertical; }
.sig-pied { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.sig-pied .btn-principal { flex: 1; width: auto; }
.sig-pied .btn-secondaire { flex: 1; width: auto; font-size: 13px; }
.sig-ok { font-weight: 800; color: var(--vert-ombre); font-size: 17px; }
.sig-attente { font-weight: 800; color: #b07800; }
.boutons-ligne-mini { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- v0.12 : feedback « Ta réponse / Bonne réponse / Pourquoi ? / À retenir » ----------
   Styles volontairement minimaux : la direction visuelle (design chill/mobile) les reprendra. */
.fb-ta { color: var(--rouge-ombre); }
.fb-ta-valeur { text-decoration: line-through; }
.fb-reponse { color: var(--vert-ombre); }
.fb-pourquoi, .fb-retenir { border-radius: 10px; padding: 8px 10px; margin-top: 8px; background: var(--carte); color: var(--texte); }
.fb-retenir { border-left: 4px solid var(--or); white-space: pre-line; }
.fb-etiquette { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; color: var(--texte-2); margin: 0 0 2px !important; }
.fb-retenir-texte { font-weight: 700; margin: 0 !important; }

/* ---------- v0.12 : mode Examen ---------- */
.carte-examen .reglages { margin-bottom: 12px; }
.exam-infos { font-weight: 900; font-size: 14px; color: var(--texte-2); white-space: nowrap; }
.exam-chrono-fin { color: var(--rouge); }
.exam-actions { display: flex; align-items: center; gap: 12px; }
.exam-actions .btn-principal { flex: 1; width: auto; }
.exam-sous-titre { text-align: left; font-size: 18px; margin: 20px 0 10px; }
.exam-themes { text-align: left; }
.session-examen .sess-pied { gap: 10px; }

/* ========================================================================== */
/* Sensei v0.13 — skin Premium / Chill                                        */
/* Le moteur pédagogique reste celui de Claude v0.12.0.                       */
/* ========================================================================== */

:root {
  --accent: #ff405e;
  --accent-2: #ff7187;
  --violet: #8b5cf6;
  --cyan: #2f8cff;
  --turquoise: #21d0a2;
  --ambre: #f6aa2a;
  --ombre-premium: 0 14px 34px rgba(15, 23, 42, .10);
  --ombre-premium-dark: 0 18px 42px rgba(0, 0, 0, .28);
  --rayon: 20px;
}

:root[data-theme="light"] {
  --fond: #f4f7fb;
  --fond-2: #edf2f8;
  --carte: #ffffff;
  --texte: #172033;
  --texte-2: #68748a;
  --bord: #dce4ef;
  --verrou: #e9eef5;
  --verrou-ombre: #d2dae6;
  --vert: #21b985;
  --vert-ombre: #13805c;
  --vert-clair: #ddf8ee;
  --rouge: #f34f67;
  --rouge-ombre: #b92c43;
  --rouge-clair: #ffe4e9;
  --bleu: #2f8cff;
  --bleu-ombre: #1d67c1;
  --bleu-clair: #e3f0ff;
  --or: #f2a820;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --fond: #07111f;
  --fond-2: #0a1728;
  --carte: #0e1c30;
  --texte: #f5f7fb;
  --texte-2: #9aa8bd;
  --bord: #1d3150;
  --verrou: #18273c;
  --verrou-ombre: #101d2d;
  --vert: #27d5a0;
  --vert-ombre: #0f8866;
  --vert-clair: #0b342a;
  --rouge: #ff4965;
  --rouge-ombre: #c52d46;
  --rouge-clair: #3c1720;
  --bleu: #3296ff;
  --bleu-ombre: #1564bc;
  --bleu-clair: #0d2d50;
  --or: #ffb636;
  color-scheme: dark;
}

html, body {
  background:
    radial-gradient(circle at 85% -10%, color-mix(in srgb, var(--violet) 18%, transparent), transparent 38%),
    radial-gradient(circle at -10% 22%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 34%),
    var(--fond);
  color: var(--texte);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background-image: linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000, transparent 65%);
  z-index: -1;
}

/* En-tête Sensei */
.entete {
  background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid color-mix(in srgb, var(--bord) 74%, transparent);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 9px;
  gap: 8px;
}
.entete-ligne { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.marque { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.logo { color: inherit; font-size: 28px; line-height: 1; font-weight: 950; letter-spacing: -1.3px; }
.logo-sen { color: var(--texte); }
.logo-sei { color: var(--accent); }
.signature { color: var(--texte-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-rapide {
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--bord);
  background: color-mix(in srgb, var(--carte) 84%, transparent); color: var(--texte);
  box-shadow: 0 8px 20px rgba(0,0,0,.12); cursor: pointer; font-size: 20px;
}
.etat { gap: 10px; font-size: 13px; }
.etat-item { background: var(--fond-2); border: 1px solid var(--bord); border-radius: 999px; padding: 4px 9px; }
.etat-objectif { gap: 7px; }
.objectif-barre { width: 72px; height: 7px; background: var(--fond-2); }
.objectif-rempli { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* Page et navigation */
.page { max-width: 720px; padding: 18px 16px calc(94px + env(safe-area-inset-bottom)); }
.navigation {
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--bord);
  padding: 4px 4px env(safe-area-inset-bottom);
}
.onglet {
  min-width: 0; gap: 1px; padding: 7px 1px 8px; color: var(--texte-2);
  font-size: 9.5px; text-transform: none; letter-spacing: 0; font-weight: 750;
}
.onglet-icone {
  width: 28px; height: 25px; display: grid; place-items: center; font-size: 19px; font-weight: 900;
  border-radius: 9px; line-height: 1;
}
.onglet.actif { color: var(--accent); }
.onglet.actif .onglet-icone { background: color-mix(in srgb, var(--accent) 16%, transparent); transform: none; }
.onglet-libelle { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

@media (min-width: 900px) {
  .navigation { width: 230px; padding: 100px 10px 20px; }
  .onglet { font-size: 14px; padding: 12px 14px; gap: 10px; border-radius: 14px; }
  .onglet-icone { width: 32px; }
  .entete, .page { margin-left: 230px; }
}

.page-intro { margin: 2px 0 18px; }
.page-intro h1 { margin: 0 0 5px; font-size: clamp(28px, 8vw, 36px); letter-spacing: -.8px; }
.page-intro p { margin: 0; color: var(--texte-2); line-height: 1.45; }
.section-titre { font-size: 19px; letter-spacing: -.3px; }

/* Accueil */
.hero-sensei {
  position: relative; min-height: 205px; overflow: hidden; display: grid; grid-template-columns: 1.15fr .85fr;
  align-items: center; border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--bord)); border-radius: 28px;
  padding: 22px 18px 18px; margin-bottom: 15px;
  background:
    radial-gradient(circle at 82% 28%, rgba(255,64,94,.28), transparent 35%),
    linear-gradient(135deg, color-mix(in srgb, var(--carte) 90%, #07111f), color-mix(in srgb, var(--carte) 86%, #51152b));
  box-shadow: var(--ombre-premium-dark);
}
.hero-sensei::after {
  content: ""; position: absolute; inset: auto -12% -48% 34%; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,75,96,.22), transparent 66%); pointer-events: none;
}
.hero-texte { z-index: 1; min-width: 0; }
.hero-kicker { color: var(--accent-2) !important; text-transform: uppercase; letter-spacing: .08em; font-size: 11px !important; font-weight: 900; }
.hero-texte h1 { font-size: clamp(26px, 8vw, 39px); line-height: 1.04; margin: 5px 0 10px; letter-spacing: -1px; }
.hero-texte p { color: var(--texte-2); margin: 0; line-height: 1.45; font-size: 14px; }
.hero-mascotte { width: 150px; max-width: 45vw; aspect-ratio: 1; object-fit: cover; border-radius: 32px; justify-self: end; z-index: 1; box-shadow: 0 15px 35px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12); }

.progression-premium, .reprendre, .objectif-jour {
  border: 1px solid var(--bord); background: color-mix(in srgb, var(--carte) 92%, transparent); border-radius: 22px;
  box-shadow: var(--ombre-premium); padding: 16px; margin-bottom: 14px;
}
:root[data-theme="dark"] .progression-premium,
:root[data-theme="dark"] .reprendre,
:root[data-theme="dark"] .objectif-jour { box-shadow: var(--ombre-premium-dark); }
.progression-ligne { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.progression-ligne strong { font-size: 17px; }
.progression-ligne span { color: var(--texte-2); font-size: 13px; }
.progression-barre { height: 9px; background: var(--fond-2); border-radius: 99px; overflow: hidden; }
.progression-barre span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 42%, transparent); }
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.dash-stat { min-width: 0; text-align: center; border-radius: 16px; padding: 12px 7px; border: 1px solid var(--bord); background: var(--fond-2); }
.dash-stat strong { display: block; font-size: 20px; }
.dash-stat span { display: block; color: var(--texte-2); font-size: 11px; margin-top: 2px; }
.stat-cours strong { color: #ff687b; } .stat-exos strong { color: #2ed1a4; } .stat-cartes strong { color: #a97bff; }

.reprendre { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.reprendre > div { min-width: 0; display: grid; gap: 2px; }
.reprendre-label { color: var(--accent); text-transform: uppercase; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.reprendre strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reprendre small { color: var(--texte-2); }
.btn-rond { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--bord)); background: color-mix(in srgb, var(--accent) 14%, var(--carte)); color: var(--accent); font-size: 28px; line-height: 1; cursor: pointer; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.dash-action {
  min-height: 148px; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  text-decoration: none; color: #fff; border-radius: 22px; padding: 16px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.20); box-shadow: 0 14px 28px rgba(0,0,0,.20);
}
.dash-action::after { content: ""; position: absolute; width: 120px; height: 120px; right: -50px; bottom: -45px; border-radius: 50%; background: rgba(255,255,255,.10); }
.dash-action-icone { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 25px; font-weight: 900; background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.dash-action-corps { display: grid; gap: 5px; z-index: 1; }
.dash-action-corps strong { font-size: 20px; }
.dash-action-corps span { font-size: 12.5px; opacity: .84; line-height: 1.35; }
.dash-action-fleche { position: absolute; right: 14px; bottom: 13px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.18); font-size: 26px; z-index: 1; }
.action-bleue { background: linear-gradient(145deg, #0b5fca, #0a2e6c); }
.action-rouge { background: linear-gradient(145deg, #d93452, #6c1730); }
.action-violette { background: linear-gradient(145deg, #7b35dc, #38106f); }
.action-verte { background: linear-gradient(145deg, #0c9c75, #07583f); }
.action-or { background: linear-gradient(145deg, #cc8518, #74430b); grid-column: 1 / -1; min-height: 105px; }
.action-or .dash-action-corps { max-width: 75%; }

.objectif-jour { display: flex; align-items: center; gap: 12px; }
.objectif-jour-icone { flex: none; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 25px; color: #fff; background: linear-gradient(145deg, #f43b5c, #c81d3e); }
.objectif-jour-corps { flex: 1; min-width: 0; display: grid; gap: 2px; }
.objectif-jour-corps span { color: var(--texte-2); font-size: 12px; }
.mini-barre { margin-top: 4px; height: 5px; border-radius: 99px; background: var(--fond-2); overflow: hidden; }
.mini-barre span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.objectif-cta { flex: none; text-decoration: none; color: #fff; font-weight: 850; font-size: 13px; border-radius: 999px; padding: 11px 15px; background: linear-gradient(90deg, #ed2e4e, #ff5570); }

/* Cartes, boutons et exercices : moins « jouet », plus premium */
.carte-action, .unite, .cours-unite, .tuile, .option, .puce, .carte-cours, .bilan-item {
  border-width: 1px;
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
}
:root[data-theme="dark"] .carte-action,
:root[data-theme="dark"] .unite,
:root[data-theme="dark"] .cours-unite,
:root[data-theme="dark"] .tuile,
:root[data-theme="dark"] .option,
:root[data-theme="dark"] .puce,
:root[data-theme="dark"] .carte-cours { box-shadow: 0 12px 28px rgba(0,0,0,.20); }
.carte-action { background: color-mix(in srgb, var(--carte) 96%, transparent); }
.btn { border-radius: 15px; text-transform: none; letter-spacing: 0; min-height: 48px; transition: transform .12s ease, filter .12s ease; }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn-principal { background: linear-gradient(100deg, var(--accent), var(--accent-2)); box-shadow: 0 9px 22px color-mix(in srgb, var(--accent) 23%, transparent); }
.btn-secondaire { box-shadow: none; background: var(--fond-2); }
.btn-danger { box-shadow: none; }
.option, .puce { box-shadow: none; }
.option:active:not(:disabled) { transform: scale(.99); box-shadow: none; }

/* Parcours */
.unite { border-color: var(--bord); background: color-mix(in srgb, var(--carte) 94%, transparent); }
.unite-entete { background: linear-gradient(120deg, color-mix(in srgb, var(--couleur) 82%, #07111f), color-mix(in srgb, var(--couleur) 48%, #07111f)); padding: 16px; }
.unite-icone { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.13); font-size: 24px; }
.noeud { width: 66px; height: 61px; box-shadow: 0 8px 18px color-mix(in srgb, var(--couleur) 26%, rgba(0,0,0,.25)); border: 1px solid rgba(255,255,255,.12); }
.noeud:active:not(:disabled) { transform: scale(.96); box-shadow: none; }
.noeud-faite { background: linear-gradient(135deg, #ffc044, #e89016); }
.noeud-verrouillee { box-shadow: none; }

/* Bibliothèque de cours */
.cours-unite { border: 1px solid var(--bord); border-radius: 22px; background: var(--carte); overflow: hidden; margin: 0 0 14px; }
.cours-unite-titre { display: flex; gap: 12px; align-items: center; padding: 15px 16px; border-bottom: 1px solid var(--bord); background: linear-gradient(90deg, color-mix(in srgb, var(--couleur) 18%, var(--carte)), var(--carte)); }
.cours-unite-icone { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--couleur) 18%, transparent); font-size: 23px; }
.cours-unite-titre > div { display: grid; gap: 2px; }
.cours-unite-titre strong { font-size: 16px; }
.cours-unite-titre small { color: var(--texte-2); }
.liste-lecons { display: grid; }
.ligne-lecon { width: 100%; display: grid; grid-template-columns: 36px 1fr 24px; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; background: transparent; color: var(--texte); border: 0; border-bottom: 1px solid var(--bord); cursor: pointer; }
.ligne-lecon:last-child { border-bottom: 0; }
.ligne-lecon:disabled { opacity: .45; cursor: not-allowed; }
.ligne-lecon-etat { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--fond-2); color: var(--bleu); font-weight: 900; }
.ligne-lecon.terminee .ligne-lecon-etat { color: #fff; background: var(--vert); }
.ligne-lecon-texte { min-width: 0; display: grid; gap: 2px; }
.ligne-lecon-texte strong { font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ligne-lecon-texte small { color: var(--texte-2); }
.ligne-lecon-fleche { color: var(--texte-2); font-size: 24px; }

/* Révisions / examen */
.review-grid { display: grid; gap: 12px; }
.review-violet { border-left: 4px solid var(--violet); }
.review-rouge { border-left: 4px solid var(--accent); }
.premium-examen { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 18px; }
.examen-icone { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; background: linear-gradient(145deg, #ff4662, #d31e3d); color: #fff; font-size: 28px; font-weight: 950; }
.examen-contenu { min-width: 0; }
.examen-contenu h3 { font-size: 21px; }
.examen-contenu .btn { margin-top: 12px; }

/* Profil */
.profil-entete { display: flex; align-items: center; gap: 16px; border: 1px solid var(--bord); border-radius: 24px; background: var(--carte); padding: 16px; box-shadow: var(--ombre-premium); }
.profil-avatar { width: 76px; height: 76px; object-fit: cover; border-radius: 22px; border: 1px solid var(--bord); display: block; }
.profil-avatar-bloc { flex: 0 0 auto; display: grid; justify-items: center; gap: 7px; }
.profil-avatar-bouton { position: relative; appearance: none; border: 0; padding: 0; background: transparent; border-radius: 24px; cursor: pointer; }
.profil-avatar-bouton:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: 3px; }
.profil-avatar-camera { position: absolute; right: -5px; bottom: -5px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: white; border: 3px solid var(--carte); box-shadow: 0 6px 16px rgba(0,0,0,.28); font-size: 14px; }
.profil-avatar-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.lien-bouton { appearance: none; border: 0; background: transparent; color: var(--accent); padding: 2px 4px; font: inherit; font-size: 11px; font-weight: 850; cursor: pointer; }
.lien-bouton.danger { color: var(--rouge, #ff5c72); }
.profil-photo-note { margin: 7px 0 0; color: var(--texte-2); font-size: 11px; line-height: 1.35; }
.profil-identite { flex: 1; min-width: 0; }
.profil-label { display: block; color: var(--texte-2); font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.profil-identite .champ { max-width: none; font-family: inherit; font-size: 17px; padding: 10px 12px; }
.profil-stats { margin-top: 12px; }
.a-propos-marque { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.a-propos-marque strong { font-size: 24px; letter-spacing: -.6px; }
.a-propos-marque span { color: var(--texte-2); font-size: 12px; }
.by-oni { margin: 8px 0 0 !important; color: var(--accent); font-weight: 900; letter-spacing: .04em; }

/* Sessions plein écran */
.session { background: var(--fond); }
.sess-haut, .sess-pied { background: color-mix(in srgb, var(--fond) 92%, transparent); backdrop-filter: blur(16px); border-color: var(--bord); }
.barre { background: var(--fond-2); }
.barre-rempli { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.feedback { border: 1px solid color-mix(in srgb, currentColor 22%, transparent); }

/* Chargement */
.chargement-mascotte { width: 112px; height: 112px; object-fit: cover; border-radius: 30px; margin: 0 auto 8px; box-shadow: 0 18px 40px rgba(0,0,0,.28); }

/* Petits écrans */
@media (max-width: 390px) {
  .signature { max-width: 230px; }
  .hero-sensei { min-height: 188px; padding: 18px 14px; }
  .hero-mascotte { width: 125px; }
  .hero-texte h1 { font-size: 26px; }
  .dash-action { min-height: 138px; padding: 14px; }
  .dash-action-corps strong { font-size: 18px; }
  .onglet { font-size: 8.7px; }
  .premium-examen { grid-template-columns: 1fr; }
  .examen-icone { width: 48px; height: 48px; }
}

@media (min-width: 560px) {
  .dash-grid { grid-template-columns: repeat(4, 1fr); }
  .action-or { grid-column: span 2; }
  .dash-action { min-height: 164px; }
}


/* ---------- v0.13.1 : navigation mobile et ergonomie téléphone ---------- */
html { min-height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100svh; overscroll-behavior-y: contain; }
button, a, input, select { touch-action: manipulation; }
input, select, textarea { font-size: 16px; }

.entete-gauche { min-width: 0; display: flex; align-items: center; gap: 10px; }
.retour-app {
  flex: none; min-width: 44px; height: 44px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--bord); border-radius: 14px; background: color-mix(in srgb, var(--carte) 90%, transparent);
  color: var(--texte); box-shadow: 0 6px 18px rgba(0,0,0,.10); font-weight: 850; cursor: pointer;
}
.retour-app > span:first-child { font-size: 31px; line-height: 1; transform: translateY(-1px); }
.retour-app-texte { font-size: 12px; }
.retour-app:active { transform: scale(.96); }

.session { width: 100%; min-height: 100svh; height: 100dvh; overflow: hidden; }
.sess-corps { min-height: 0; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }
.sess-haut { flex: none; }
.sess-pied { flex: none; max-height: 48dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sess-haut .btn-icone { min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.ligne-lecon { min-height: 56px; }
.btn-rond, .theme-rapide { min-width: 44px; min-height: 44px; }
.onglet { min-height: 58px; }

@media (max-width: 430px) {
  .entete { padding-left: 12px; padding-right: 12px; }
  .entete-ligne { gap: 9px; }
  .entete-gauche { gap: 8px; }
  .retour-app { width: 42px; min-width: 42px; height: 42px; padding: 0; border-radius: 13px; }
  .retour-app-texte { display: none; }
  .logo { font-size: 25px; }
  .signature { max-width: 190px; font-size: 10px; }
  .theme-rapide { width: 40px; height: 40px; min-width: 40px; min-height: 40px; border-radius: 13px; }
  .etat { gap: 7px; font-size: 12px; }
  .etat-item { padding: 4px 8px; }
  .objectif-barre { width: clamp(48px, 16vw, 68px); }
  .objectif-texte { font-size: 10px; }

  .page { width: 100%; padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .page-intro { margin-bottom: 14px; }
  .page-intro h1 { font-size: clamp(26px, 8vw, 32px); }
  .section-titre { margin: 20px 0 10px; }

  .hero-sensei { min-height: 174px; grid-template-columns: minmax(0, 1fr) 112px; padding: 16px 13px; border-radius: 22px; }
  .hero-mascotte { width: 112px; max-width: 34vw; border-radius: 25px; }
  .hero-texte h1 { font-size: clamp(23px, 7vw, 29px); margin-bottom: 8px; }
  .hero-texte p { font-size: 12.5px; }
  .hero-kicker { font-size: 9.5px !important; }

  .progression-premium, .reprendre, .objectif-jour { border-radius: 18px; padding: 13px; margin-bottom: 11px; }
  .progression-ligne strong { font-size: 15px; }
  .dash-stats { gap: 7px; margin-top: 11px; }
  .dash-stat { padding: 10px 5px; border-radius: 13px; }
  .dash-stat strong { font-size: 18px; }
  .dash-stat span { font-size: 10px; }

  .dash-grid { gap: 9px; margin: 11px 0; }
  .dash-action { min-height: 124px; padding: 12px; border-radius: 18px; gap: 7px; }
  .dash-action-icone { width: 40px; height: 40px; border-radius: 12px; font-size: 21px; }
  .dash-action-corps strong { font-size: 17px; }
  .dash-action-corps span { font-size: 11px; line-height: 1.3; }
  .dash-action-fleche { right: 10px; bottom: 10px; width: 31px; height: 31px; font-size: 23px; }
  .action-or { min-height: 92px; }

  .objectif-jour { gap: 9px; }
  .objectif-jour-icone { width: 42px; height: 42px; border-radius: 13px; font-size: 22px; }
  .objectif-cta { padding: 10px 12px; font-size: 12px; }

  .navigation { padding-left: max(2px, env(safe-area-inset-left)); padding-right: max(2px, env(safe-area-inset-right)); }
  .onglet { padding: 6px 0 7px; font-size: 8.4px; }
  .onglet-icone { width: 26px; height: 24px; font-size: 18px; }

  .unite-entete { padding: 13px; gap: 9px; }
  .unite-icone { width: 39px; height: 39px; border-radius: 12px; font-size: 21px; }
  .unite-titre { font-size: 15px; }
  .unite-progres { font-size: 11px; }
  .chemin { padding: 20px 6px 24px; gap: 16px; }
  .noeud { width: 61px; height: 57px; }

  .cours-unite { border-radius: 18px; margin-bottom: 11px; }
  .cours-unite-titre { padding: 13px; }
  .ligne-lecon { grid-template-columns: 34px minmax(0,1fr) 20px; padding: 10px 11px; gap: 8px; }

  .carte-action { padding: 14px; border-radius: 18px; }
  .btn { min-height: 46px; padding: 12px 14px; font-size: 15px; }
  .reglage { align-items: flex-start; gap: 8px; }
  .reglage .champ, .select { max-width: 58%; }

  .profil-entete { padding: 13px; gap: 12px; border-radius: 19px; }
  .profil-avatar { width: 62px; height: 62px; border-radius: 18px; }
  .profil-avatar-camera { width: 27px; height: 27px; font-size: 12px; right: -4px; bottom: -4px; }
  .profil-identite .champ { width: 100%; }

  .sess-haut { padding: calc(env(safe-area-inset-top) + 8px) 10px 7px; gap: 8px; }
  .sess-corps { padding: 13px 12px; }
  .sess-pied { padding: 11px 12px calc(11px + env(safe-area-inset-bottom)); gap: 9px; }
  .question { font-size: clamp(20px, 6vw, 26px); line-height: 1.18; }
  .carte-cours, .exercice { max-width: 100%; }
}

@media (max-width: 350px) {
  .signature { display: none; }
  .hero-sensei { grid-template-columns: 1fr 94px; }
  .hero-mascotte { width: 94px; }
  .dash-action-corps span { display: none; }
  .dash-action { min-height: 106px; }
  .objectif-jour { flex-wrap: wrap; }
  .objectif-cta { width: 100%; text-align: center; }
  .onglet { font-size: 7.6px; }
}

@media (min-width: 900px) {
  .retour-app { display: none; }
}

/* ---------- Sensei v0.13.2 : sélecteurs premium Android ---------- */
.reglages { gap: 0; }
.reglage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(142px, 48%);
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 8px 0;
}
.reglage > span:first-child { min-width: 0; line-height: 1.25; }

.choix-bouton {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid color-mix(in srgb, var(--bleu) 30%, var(--bord));
  border-radius: 14px;
  padding: 9px 11px 9px 13px;
  background: color-mix(in srgb, var(--fond-2) 93%, var(--bleu) 7%);
  color: var(--texte);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.choix-bouton:active { transform: scale(.985); }
.choix-bouton-valeur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix-bouton-chevron { color: var(--texte-2); font-size: 18px; flex: none; transform: translateY(-1px); }

.choix-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(2, 7, 18, .08);
  opacity: 0;
  transition: opacity .14s ease, background .14s ease;
}
.choix-overlay.ouvert { opacity: 1; background: rgba(2, 7, 18, .68); backdrop-filter: blur(5px); }
.choix-feuille {
  width: min(100%, 520px);
  max-height: min(72dvh, 560px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--bleu) 32%, var(--bord));
  border-radius: 25px;
  padding: 7px 12px 13px;
  background: color-mix(in srgb, var(--carte) 97%, var(--bleu) 3%);
  color: var(--texte);
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  transform: translateY(24px) scale(.985);
  transition: transform .16s ease;
}
.choix-overlay.ouvert .choix-feuille { transform: translateY(0) scale(1); }
.choix-poignee { width: 42px; height: 4px; border-radius: 99px; background: var(--bord); margin: 2px auto 8px; }
.choix-entete { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 3px 8px 7px; }
.choix-entete strong { font-size: 18px; }
.choix-fermer {
  width: 38px; height: 38px; border: 0; border-radius: 12px;
  background: var(--fond-2); color: var(--texte-2); font-size: 27px; line-height: 1; cursor: pointer;
}
.choix-liste { overflow-y: auto; max-height: calc(min(72dvh, 560px) - 70px); display: grid; gap: 7px; padding: 2px; }
.choix-option {
  width: 100%; min-height: 54px; border: 1px solid var(--bord); border-radius: 16px;
  padding: 12px 13px; background: var(--fond-2); color: var(--texte);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; font-weight: 750; cursor: pointer;
}
.choix-option.actif {
  border-color: color-mix(in srgb, var(--bleu) 72%, #fff 8%);
  background: color-mix(in srgb, var(--bleu) 15%, var(--fond-2));
}
.choix-radio {
  width: 27px; height: 27px; flex: none; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid var(--bord);
  color: #fff; font-size: 15px; font-weight: 900;
}
.choix-option.actif .choix-radio { background: var(--bleu); border-color: var(--bleu); }

.premium-examen .reglages { margin: 4px 0 14px; }
.premium-examen .btn-principal { width: 100%; margin-top: 2px; }

@media (max-width: 390px) {
  .reglage { grid-template-columns: minmax(0, .9fr) minmax(138px, 1.1fr); gap: 9px; }
  .choix-bouton { padding-left: 10px; padding-right: 9px; font-size: 14px; }
}

@media (max-width: 340px) {
  .reglage { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
  .choix-bouton { width: 100%; }
}

/* ---------- v0.15 : packs de cours ---------- */
.pack-bandeau { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px 14px; border-radius: 18px; text-decoration: none; color: var(--texte); background: var(--carte); border: 2px solid var(--bord); }
.pack-bandeau-icone { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 22px; border-radius: 12px; background: color-mix(in srgb, var(--bord) 60%, transparent); }
.pack-bandeau-texte { display: grid; gap: 2px; flex: 1; min-width: 0; }
.pack-bandeau-texte small { color: var(--texte-2); font-size: 12px; }
.pack-bandeau-texte strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-bandeau-action { font-weight: 800; font-size: 14px; color: var(--texte-2); white-space: nowrap; }
.carte-pack.pack-actif { border-color: #58cc02; }
.pack-etat { font-weight: 800; color: #58cc02; align-self: center; padding: 8px 4px; }

/* ---------- v0.15.1-dev : changement rapide de pack dans l'en-tête ---------- */
.entete-actions { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.pack-rapide {
  height: 42px; max-width: 170px; min-width: 0; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--bord); border-radius: 14px; background: color-mix(in srgb, var(--carte) 84%, transparent);
  color: var(--texte); box-shadow: 0 8px 20px rgba(0,0,0,.12); cursor: pointer; font: inherit; font-weight: 850;
}
.pack-rapide:active { transform: scale(.97); }
.pack-rapide-icone { flex: none; font-size: 18px; line-height: 1; }
.pack-rapide-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.pack-rapide-chevron { flex: none; color: var(--texte-2); font-size: 13px; transform: translateY(-1px); }

.pack-rapide-overlay {
  position: fixed; inset: 0; z-index: 5000; display: flex; align-items: flex-end; justify-content: center;
  padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); opacity: 0; background: rgba(2,7,18,0);
  transition: opacity .16s ease, background .16s ease;
}
.pack-rapide-overlay.ouvert { opacity: 1; background: rgba(2,7,18,.68); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.pack-rapide-feuille {
  width: min(520px, 100%); max-height: min(72dvh, 620px); display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px 12px; border: 1px solid var(--bord); border-radius: 24px; background: var(--fond-2); color: var(--texte);
  box-shadow: 0 24px 70px rgba(0,0,0,.42); transform: translateY(18px) scale(.985); transition: transform .16s ease;
}
.pack-rapide-overlay.ouvert .pack-rapide-feuille { transform: translateY(0) scale(1); }
.pack-rapide-poignee { width: 42px; height: 4px; border-radius: 99px; background: var(--bord); margin: 0 auto 2px; }
.pack-rapide-titre { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pack-rapide-titre > div { min-width: 0; display: grid; gap: 1px; }
.pack-rapide-titre small { color: var(--texte-2); font-size: 11px; }
.pack-rapide-titre strong { font-size: 18px; }
.pack-rapide-fermer { width: 40px; height: 40px; flex: none; border: 1px solid var(--bord); border-radius: 13px; background: var(--carte); color: var(--texte); font-size: 25px; cursor: pointer; }
.pack-rapide-liste { min-height: 70px; overflow-y: auto; display: grid; gap: 7px; padding: 1px; -webkit-overflow-scrolling: touch; }
.pack-rapide-option {
  width: 100%; min-height: 60px; display: flex; align-items: center; gap: 11px; padding: 9px 11px; text-align: left;
  border: 1px solid var(--bord); border-radius: 16px; background: var(--carte); color: var(--texte); cursor: pointer;
}
.pack-rapide-option.actif { border-color: color-mix(in srgb, var(--bleu) 72%, var(--bord)); background: color-mix(in srgb, var(--bleu) 10%, var(--carte)); }
.pack-rapide-option-icone { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--fond-2); font-size: 21px; }
.pack-rapide-option-texte { min-width: 0; flex: 1; display: grid; gap: 2px; }
.pack-rapide-option-texte strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-rapide-option-texte small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texte-2); font-size: 11px; }
.pack-rapide-option-etat { flex: none; color: var(--bleu); font-size: 20px; font-weight: 900; }
.pack-rapide-gerer { min-height: 44px; border: 1px solid var(--bord); border-radius: 14px; background: transparent; color: var(--bleu); font-weight: 850; cursor: pointer; }

@media (max-width: 430px) {
  .entete-actions { gap: 6px; }
  .pack-rapide { height: 40px; max-width: 105px; padding: 0 8px; gap: 5px; border-radius: 13px; }
  .pack-rapide-icone { font-size: 16px; }
  .pack-rapide-nom { font-size: 10.5px; }
  .pack-rapide-chevron { font-size: 11px; }
}

@media (max-width: 360px) {
  .signature { max-width: 115px; }
  .pack-rapide { width: 40px; min-width: 40px; padding: 0; justify-content: center; }
  .pack-rapide-nom, .pack-rapide-chevron { display: none; }
}

/* ---------- Illustrations de Sensei (édition publique) ---------- */
.sprite { display: block; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.fb-entete { display: flex; align-items: center; gap: 10px; }
.fb-entete .fb-titre { margin: 0; }
.sprite-fb { width: 52px; flex: none; margin: -6px 0 -4px -4px; animation: sprite-pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.sprite-fin { width: 170px; max-width: 46vw; margin: 0 auto 4px; animation: sprite-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.cours-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sprite-cours { width: 74px; margin: -14px -6px -18px 0; flex: none; }
.intro-bienvenue { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
.intro-bienvenue h1, .intro-bienvenue p { grid-column: 1; }
.sprite-bienvenue { grid-column: 2; grid-row: 1 / span 2; width: 104px; }
@keyframes sprite-pop { from { transform: scale(.6) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sprite-fb, .sprite-fin { animation: none; } }
@media (max-width: 360px) { .sprite-bienvenue { width: 80px; } .sprite-fb { width: 44px; } }
