/* =====================================================================
   Driving S'Cool — Permis C
   Thème sombre · violet & vert fluo · Mobile First
   ===================================================================== */

:root {
  /* Fonds */
  --fond:        #0B0A0F;
  --fond-2:      #12101A;
  --surface:     #17141F;
  --surface-2:   #201B2E;
  --bordure:     #2C2540;

  /* Accents */
  --violet:      #7C3AED;
  --violet-clair:#A855F7;
  --violet-sombre:#4C1D95;
  --vert:        #B4FF39;
  --vert-sombre: #7BC91A;
  --menthe:      #38E8C0;
  --rouge:       #FF4D6D;
  --orange:      #FFB020;

  /* Texte */
  --texte:       #F4F2FA;
  --texte-2:     #A79FC0;
  --texte-3:     #6E6689;

  /* Formes */
  --r-s:  10px;
  --r-m:  16px;
  --r-l:  22px;
  --r-xl: 28px;

  --lueur-violet: 0 0 32px rgba(124, 58, 237, .45);
  --lueur-vert:   0 0 28px rgba(180, 255, 57, .35);
  --ombre:        0 8px 28px rgba(0, 0, 0, .55);

  --transition: 260ms cubic-bezier(.22, 1, .36, 1);
  --nav-h: 68px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* L'attribut `hidden` doit toujours l'emporter. Sans cette règle, une classe
   qui fixe un `display` (.calque, .badges-debloques…) rend l'élément visible
   malgré `hidden`, car une règle d'auteur prime sur celle du navigateur. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--fond);
  background-image:
    radial-gradient(900px 500px at 85% -8%,  rgba(124, 58, 237, .22), transparent 62%),
    radial-gradient(700px 420px at 5% 102%, rgba(180, 255, 57, .10), transparent 60%);
  background-attachment: fixed;
  color: var(--texte);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
}

#app {
  position: relative;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  overflow: hidden;
}

/* ---------------------------------------------------------------------
   Vues & transitions SPA
   --------------------------------------------------------------------- */
.vue {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: max(env(safe-area-inset-top), 18px) 18px 0;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.vue.est-visible {
  display: flex;
  animation: vue-entree var(--transition) both;
}

.vue--pleine { padding-bottom: env(safe-area-inset-bottom); }

@keyframes vue-entree {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.defilable {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.defilable::-webkit-scrollbar { width: 0; }

/* ---------------------------------------------------------------------
   Typographie utilitaire
   --------------------------------------------------------------------- */
h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: 750; letter-spacing: -.015em; }
h3 { font-size: 1.05rem; font-weight: 700; }

.surtitre {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--texte-3);
}
.legere  { font-size: .82rem; color: var(--texte-2); }
.titre-section { margin-top: 8px; font-size: .95rem; color: var(--texte-2); }

/* ---------------------------------------------------------------------
   En-têtes
   --------------------------------------------------------------------- */
.entete {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0 16px;
}
.entete--retour { justify-content: flex-start; }
.entete__salut  { font-size: .85rem; color: var(--texte-2); }
.entete__titre  { line-height: 1.2; }

.btn-retour {
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--bordure); border-radius: 50%;
  background: var(--surface); color: var(--texte);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: var(--transition);
}
.btn-retour:active { transform: scale(.92); background: var(--surface-2); }

.btn-icone {
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--bordure); border-radius: 12px;
  background: var(--surface); color: var(--texte-2);
  font-size: 1.05rem; cursor: pointer; transition: var(--transition);
}
.btn-icone:active { transform: scale(.92); }

.pastille-serie {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 15px; border: 1px solid rgba(180, 255, 57, .35);
  border-radius: 999px; cursor: pointer;
  background: rgba(180, 255, 57, .1); color: var(--vert);
  font-size: .88rem; font-weight: 750;
  box-shadow: var(--lueur-vert);
}

/* ---------------------------------------------------------------------
   Boutons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border: none; border-radius: var(--r-m);
  font-family: inherit; font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn--bloc { width: 100%; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }

.btn--primaire {
  background: linear-gradient(135deg, var(--violet-clair), var(--violet));
  color: #fff; box-shadow: var(--lueur-violet);
}
.btn--vert {
  background: var(--vert); color: #0B0A0F; box-shadow: var(--lueur-vert);
}
.btn--fantome {
  background: transparent; color: var(--texte);
  border: 1px solid var(--bordure);
}

.lien-discret {
  align-self: flex-end; padding: 4px 0;
  background: none; border: none; cursor: pointer;
  color: var(--violet-clair); font: inherit; font-size: .84rem; font-weight: 600;
}

/* ---------------------------------------------------------------------
   CONNEXION
   --------------------------------------------------------------------- */
.auth {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: 34px; padding: 24px 4px; overflow-y: auto;
}
.auth__marque { text-align: center; }
.logo {
  width: 76px; height: 76px; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 2.2rem;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--violet), var(--violet-sombre));
  box-shadow: var(--lueur-violet);
}
.auth__marque h1 { background: linear-gradient(100deg, #fff 35%, var(--vert));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__accroche { margin-top: 6px; color: var(--texte-2); font-size: .95rem; }
.auth__accroche strong { color: var(--vert); }

.auth__form { display: flex; flex-direction: column; gap: 14px; }

.champ { display: flex; flex-direction: column; gap: 7px; }
.champ__label { font-size: .82rem; font-weight: 600; color: var(--texte-2); }
.champ input {
  padding: 15px 16px; border: 1px solid var(--bordure); border-radius: var(--r-m);
  background: var(--surface); color: var(--texte);
  font-family: inherit; font-size: 1rem; transition: var(--transition);
}
.champ input::placeholder { color: var(--texte-3); }
.champ input:focus {
  outline: none; border-color: var(--violet-clair);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .22);
}

.champ-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Sans `min-width: 0`, un enfant de grille conserve sa largeur intrinsèque
   (`min-width: auto`) : la taille par défaut d'un <input> élargit alors la
   colonne au-delà de sa part de 1fr et le champ déborde de l'écran. */
.champ-duo > .champ { min-width: 0; }
.champ input, .champ select { min-width: 0; width: 100%; }

.champ__aide { font-size: .74rem; color: var(--texte-3); }

.champ select {
  padding: 15px 16px; border: 1px solid var(--bordure); border-radius: var(--r-m);
  background: var(--surface); color: var(--texte);
  font-family: inherit; font-size: 1rem; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--texte-2) 50%),
                    linear-gradient(135deg, var(--texte-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.champ select:focus {
  outline: none; border-color: var(--violet-clair);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .22);
}

.separateur {
  display: flex; align-items: center; gap: 12px;
  color: var(--texte-3); font-size: .8rem; margin: 2px 0;
}
.separateur::before, .separateur::after {
  content: ''; flex: 1; height: 1px; background: var(--bordure);
}

.auth__pied { text-align: center; font-size: .85rem; color: var(--texte-2); }

.message {
  padding: 11px 14px; border-radius: var(--r-s);
  font-size: .85rem; text-align: center;
  background: rgba(255, 77, 109, .12); color: var(--rouge);
  border: 1px solid rgba(255, 77, 109, .3);
}
.message.est-succes {
  background: rgba(180, 255, 57, .12); color: var(--vert);
  border-color: rgba(180, 255, 57, .32);
}

/* ---------------------------------------------------------------------
   Cartes
   --------------------------------------------------------------------- */
.carte {
  padding: 18px; border: 1px solid var(--bordure); border-radius: var(--r-l);
  background: var(--surface); box-shadow: var(--ombre);
}

.carte--objectif {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, .3), rgba(23, 20, 31, .95));
  border-color: rgba(168, 85, 247, .38);
}
.carte--objectif__texte { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.carte--objectif__badge {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center; font-size: 1.7rem;
  border-radius: 18px; background: rgba(180, 255, 57, .12);
  box-shadow: var(--lueur-vert);
}

.carte--reprendre { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.carte--reprendre h3 { margin: 3px 0; }

.carte--lien {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; cursor: pointer;
  color: inherit; font-family: inherit;
}
.carte--lien div { flex: 1; }
.chevron { font-size: 1.6rem; color: var(--texte-3); }

.carte--niveau { display: flex; flex-direction: column; gap: 9px; }

.carte--conseil {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(135deg, rgba(180, 255, 57, .12), rgba(23, 20, 31, .9));
  border-color: rgba(180, 255, 57, .3);
}
.carte--conseil__icone { font-size: 1.5rem; }
.carte--conseil div { display: flex; flex-direction: column; gap: 5px; }

.carte--chrono { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.chrono__actions { display: flex; gap: 10px; width: 100%; }
.chrono__actions .btn { flex: 1; }

.carte--preparation { display: flex; align-items: center; gap: 18px; }
.carte--preparation__anneau {
  width: 82px; height: 82px; flex: none;
  display: grid; place-items: center; place-content: center;
  border-radius: 50%; font-weight: 800;
  background: conic-gradient(var(--vert) var(--avancement, 0%), var(--surface-2) 0);
  position: relative;
}
.carte--preparation__anneau::after {
  content: ''; position: absolute; inset: 8px;
  border-radius: 50%; background: var(--surface);
}
.carte--preparation__anneau strong,
.carte--preparation__anneau span { position: relative; z-index: 1; }
.carte--preparation__anneau strong { font-size: 1.5rem; }
.carte--preparation__anneau span { font-size: .75rem; color: var(--texte-2); }
.carte--preparation > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }

/* ---------------------------------------------------------------------
   Jauges
   --------------------------------------------------------------------- */
.jauge {
  height: 9px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2);
}
.jauge--fine { height: 6px; }
.jauge__barre {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--violet-clair), var(--vert));
  transition: width 500ms cubic-bezier(.22, 1, .36, 1);
}

/* ---------------------------------------------------------------------
   Grille des modes
   --------------------------------------------------------------------- */
.grille-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.mode {
  display: flex; flex-direction: column; gap: 5px;
  padding: 18px 16px; min-height: 128px;
  border: 1px solid var(--bordure); border-radius: var(--r-l);
  background: var(--surface); color: var(--texte);
  font-family: inherit; text-align: left; cursor: pointer;
  transition: var(--transition);
}
.mode:active { transform: scale(.96); border-color: var(--violet-clair); }
.mode__icone { font-size: 1.6rem; margin-bottom: 4px; }
.mode__titre { font-weight: 700; font-size: .96rem; }
.mode__desc  { font-size: .78rem; color: var(--texte-2); }

.mode--accent {
  background: linear-gradient(150deg, rgba(124, 58, 237, .32), var(--surface));
  border-color: rgba(168, 85, 247, .45);
}

/* Liste des thèmes */
.ligne-theme {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 16px 18px;
  border: 1px solid var(--bordure); border-radius: var(--r-l);
  background: var(--surface); color: inherit;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: var(--transition);
}
.ligne-theme:active { transform: scale(.98); }
.ligne-theme__icone { font-size: 1.6rem; }
.ligne-theme__corps { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ligne-theme__titre { font-weight: 700; }

/* ---------------------------------------------------------------------
   QCM
   --------------------------------------------------------------------- */
.qcm__entete {
  display: flex; align-items: center; gap: 14px;
  padding: max(env(safe-area-inset-top), 16px) 0 16px;
}
.qcm__progres { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.chrono {
  padding: 8px 14px; border-radius: var(--r-s);
  background: var(--surface-2); color: var(--vert);
  font-variant-numeric: tabular-nums; font-weight: 750; font-size: .95rem;
  border: 1px solid var(--bordure);
}
.chrono--grand {
  font-size: 2.6rem; padding: 12px 26px; letter-spacing: .02em;
  background: transparent; border: none; box-shadow: none;
}
.chrono.est-urgent { color: var(--rouge); border-color: rgba(255, 77, 109, .45);
  animation: pulsation 1s ease-in-out infinite; }
@keyframes pulsation { 50% { opacity: .55; } }

.qcm__corps { gap: 16px; }

.qcm__illustration {
  height: 178px; flex: none;
  border-radius: var(--r-l); overflow: hidden;
  display: grid; place-items: center; font-size: 3.6rem;
  background: linear-gradient(135deg, var(--surface-2), var(--fond-2));
  border: 1px solid var(--bordure);
}
.qcm__illustration img { width: 100%; height: 100%; object-fit: cover; }

.qcm__enonce  { font-size: 1.15rem; line-height: 1.4; }
.qcm__consigne { font-size: .78rem; color: var(--texte-3); margin-top: -8px; }

.qcm__choix { display: flex; flex-direction: column; gap: 11px; }

.choix {
  display: flex; align-items: center; gap: 13px;
  padding: 16px 17px;
  border: 1.5px solid var(--bordure); border-radius: var(--r-m);
  background: var(--surface); color: var(--texte);
  font-family: inherit; font-size: .96rem; text-align: left; cursor: pointer;
  transition: var(--transition);
}
.choix__lettre {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center; border-radius: 9px;
  background: var(--surface-2); color: var(--texte-2);
  font-weight: 750; font-size: .85rem; text-transform: uppercase;
}
.choix.est-choisi {
  border-color: var(--violet-clair); background: rgba(124, 58, 237, .16);
}
.choix.est-choisi .choix__lettre { background: var(--violet); color: #fff; }

.choix.est-juste {
  border-color: var(--vert); background: rgba(180, 255, 57, .13);
}
.choix.est-juste .choix__lettre { background: var(--vert); color: #0B0A0F; }
.choix.est-faux {
  border-color: var(--rouge); background: rgba(255, 77, 109, .12);
}
.choix.est-faux .choix__lettre { background: var(--rouge); color: #fff; }
.choix:disabled { cursor: default; }

.qcm__pied { padding: 12px 0 max(env(safe-area-inset-bottom), 16px); }

/* ---------------------------------------------------------------------
   Pop-up d'explication (feuille glissante)
   --------------------------------------------------------------------- */
.calque {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: flex-end;
  background: rgba(5, 4, 9, .74);
  backdrop-filter: blur(5px);
  animation: fondu 200ms ease both;
}
@keyframes fondu { from { opacity: 0; } }

.feuille {
  width: 100%; max-height: 82%; overflow-y: auto;
  display: flex; flex-direction: column; gap: 13px;
  padding: 12px 20px max(env(safe-area-inset-bottom), 22px);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--fond-2);
  border-top: 1px solid var(--bordure);
  animation: montee 320ms cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes montee { from { transform: translateY(100%); } }

.feuille__poignee {
  width: 42px; height: 4px; margin: 2px auto 8px;
  border-radius: 999px; background: var(--bordure);
}
.feuille__titre { color: var(--texte-2); font-size: .9rem; }
.feuille__texte { color: var(--texte); font-size: .95rem; line-height: 1.62; }

.verdict {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; font-weight: 750; font-size: .9rem;
}
.verdict.est-juste { background: rgba(180, 255, 57, .16); color: var(--vert); }
.verdict.est-faux  { background: rgba(255, 77, 109, .16); color: var(--rouge); }

/* ---------------------------------------------------------------------
   RÉSULTATS
   --------------------------------------------------------------------- */
.resultats {
  align-items: center; text-align: center;
  padding: 34px 4px max(env(safe-area-inset-bottom), 24px);
  gap: 16px;
}
.resultats__emoji { font-size: 3.4rem; animation: rebond 700ms cubic-bezier(.22, 1.6, .36, 1) both; }
@keyframes rebond { from { transform: scale(0) rotate(-25deg); } }
.resultats__titre { background: linear-gradient(100deg, #fff, var(--vert));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.resultats__soustitre { color: var(--texte-2); font-size: .9rem; }

.anneau { position: relative; width: 168px; height: 168px; margin: 6px 0; }
.anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.anneau__fond   { stroke: var(--surface-2); }
.anneau__valeur {
  stroke: url(#degrade-anneau) var(--vert);
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 900ms cubic-bezier(.22, 1, .36, 1);
  filter: drop-shadow(0 0 8px rgba(180, 255, 57, .55));
}
.anneau__centre {
  position: absolute; inset: 0;
  display: grid; place-items: center; place-content: center;
}
.anneau__centre strong { font-size: 2.7rem; font-weight: 800; }
.anneau__centre span   { color: var(--texte-2); font-size: .85rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; width: 100%; }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 15px 8px;
  border: 1px solid var(--bordure); border-radius: var(--r-m); background: var(--surface);
}
.stat strong { font-size: 1.5rem; font-weight: 800; }
.stat span   { font-size: .74rem; color: var(--texte-2); }
.stat--juste  strong { color: var(--vert); }
.stat--faux   strong { color: var(--rouge); }
.stat--points strong { color: var(--violet-clair); }

.bandeau-seuil {
  width: 100%; padding: 15px; border-radius: var(--r-m);
  font-size: .88rem; font-weight: 650;
  border: 1px solid var(--bordure); background: var(--surface);
}
.bandeau-seuil.est-reussi {
  color: var(--vert); border-color: rgba(180, 255, 57, .35);
  background: rgba(180, 255, 57, .1);
}
.bandeau-seuil.est-echoue {
  color: var(--rouge); border-color: rgba(255, 77, 109, .35);
  background: rgba(255, 77, 109, .1);
}

.badges-debloques { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.badges-debloques__liste { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.badge-jeton {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px; border-radius: 999px;
  border: 1px solid rgba(180, 255, 57, .35);
  background: rgba(180, 255, 57, .1); color: var(--vert);
  font-weight: 700; font-size: .86rem;
  animation: rebond 520ms cubic-bezier(.22, 1.6, .36, 1) both;
}

.resultats__actions { width: 100%; display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }

/* ---------------------------------------------------------------------
   PLATEAU — catalogue des épreuves
   --------------------------------------------------------------------- */
.groupe-epreuves { display: flex; flex-direction: column; gap: 11px; margin-bottom: 18px; }

.epreuve {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 15px 17px;
  border: 1px solid var(--bordure); border-radius: var(--r-m);
  background: var(--surface); color: inherit;
  font-family: inherit; text-align: left; cursor: pointer;
  transition: var(--transition);
}
.epreuve:active { transform: scale(.98); }
.epreuve__icone { font-size: 1.35rem; }
.epreuve__corps { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.epreuve__titre { font-weight: 650; font-size: .93rem; }
.epreuve__valeur { font-size: .78rem; font-weight: 750; color: var(--vert); }

/* ---------------------------------------------------------------------
   PROFIL — vitrine de badges
   --------------------------------------------------------------------- */
.vitrine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.badge {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; text-align: center;
  border: 1px solid var(--bordure); border-radius: var(--r-m);
  background: var(--surface);
}
.badge__icone { font-size: 1.9rem; }
.badge__nom { font-size: .74rem; font-weight: 700; line-height: 1.25; }
.badge.est-obtenu {
  border-color: rgba(180, 255, 57, .38);
  background: rgba(180, 255, 57, .09);
  box-shadow: var(--lueur-vert);
}
.badge.est-verrouille { opacity: .34; filter: grayscale(1); }

/* ---------------------------------------------------------------------
   COACH IA
   --------------------------------------------------------------------- */
.onglets {
  display: flex; gap: 5px; padding: 5px; margin-bottom: 14px;
  border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--bordure);
}
.onglet {
  flex: 1; padding: 10px; border: none; border-radius: 11px;
  background: transparent; color: var(--texte-2);
  font-family: inherit; font-size: .88rem; font-weight: 650; cursor: pointer;
  transition: var(--transition);
}
.onglet.est-actif { background: var(--violet); color: #fff; }

.panneau { display: none; flex: 1; flex-direction: column; min-height: 0; }
.panneau.est-actif { display: flex; }

.chat { gap: 11px; padding-bottom: 12px; }

.bulle {
  max-width: 86%; padding: 13px 16px;
  border-radius: 18px; font-size: .92rem; line-height: 1.55;
  animation: vue-entree 240ms both;
  white-space: pre-wrap;
}
.bulle--coach {
  align-self: flex-start; border-bottom-left-radius: 6px;
  background: var(--surface); border: 1px solid var(--bordure);
}
.bulle--user {
  align-self: flex-end; border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, var(--violet-clair), var(--violet)); color: #fff;
}
.bulle--saisie { display: flex; gap: 5px; align-self: flex-start; padding: 15px 18px; }
.bulle--saisie i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--texte-3);
  animation: saisie 1.2s infinite;
}
.bulle--saisie i:nth-child(2) { animation-delay: .18s; }
.bulle--saisie i:nth-child(3) { animation-delay: .36s; }
@keyframes saisie { 0%, 60%, 100% { opacity: .3; transform: translateY(0); }
                    30% { opacity: 1; transform: translateY(-4px); } }

.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.puce {
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--bordure); background: var(--surface-2);
  color: var(--texte-2); font-family: inherit; font-size: .8rem;
  transition: var(--transition);
}
.puce:active { transform: scale(.95); border-color: var(--violet-clair); }

.chat__saisie {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 0 max(env(safe-area-inset-bottom), 12px);
}
.chat__saisie input {
  flex: 1; padding: 14px 17px;
  border: 1px solid var(--bordure); border-radius: 999px;
  background: var(--surface); color: var(--texte);
  font-family: inherit; font-size: .95rem;
}
.chat__saisie input:focus { outline: none; border-color: var(--violet-clair); }
.btn-envoi {
  width: 46px; height: 46px; flex: none;
  border: none; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--violet-clair), var(--violet));
  color: #fff; font-size: 1.25rem; box-shadow: var(--lueur-violet);
  transition: var(--transition);
}
.btn-envoi:active { transform: scale(.9); }

/* Fiches officielles de l'interrogation orale */
.fiches__intro { margin-bottom: 12px; }

.fiche {
  border: 1px solid var(--bordure); border-radius: var(--r-l);
  background: var(--surface); overflow: hidden;
  transition: var(--transition);
  margin-bottom: 12px;
}

.fiche__entete {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 15px 17px;
  background: none; border: none; cursor: pointer;
  color: inherit; font-family: inherit; text-align: left;
  transition: var(--transition);
}
.fiche__entete:active { background: var(--surface-2); }

.fiche__numero {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; font-weight: 800; font-size: .9rem;
  background: linear-gradient(135deg, var(--violet-clair), var(--violet));
  color: #fff;
}

.fiche__titre-bloc { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.fiche__titre { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.fiche__resume { font-size: .78rem; color: var(--texte-2); }

.fiche__chevron {
  font-size: 1.2rem; color: var(--texte-3);
  transition: transform var(--transition);
}
.fiche.est-ouverte .fiche__chevron { transform: rotate(90deg); color: var(--vert); }
.fiche.est-ouverte { border-color: rgba(180, 255, 57, .3); }

.fiche__corps {
  padding: 0 17px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.fiche__section { display: flex; flex-direction: column; gap: 4px; }
.fiche__section-titre {
  font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--vert);
}
.fiche__section-contenu {
  font-size: .88rem; line-height: 1.55; color: var(--texte);
}

/* Plan de révision */
.jour {
  padding: 16px 18px; border-radius: var(--r-l);
  border: 1px solid var(--bordure); background: var(--surface);
  display: flex; flex-direction: column; gap: 10px;
}
.jour--aujourdhui {
  border-color: rgba(180, 255, 57, .38);
  background: linear-gradient(135deg, rgba(180, 255, 57, .1), var(--surface));
}
.jour__entete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.jour__titre { font-weight: 750; }
.jour__duree { font-size: .78rem; color: var(--texte-2); }
.jour__taches { display: flex; flex-direction: column; gap: 8px; }
.tache {
  display: flex; align-items: center; gap: 10px;
  font-size: .88rem; color: var(--texte-2);
}
.tache__puce {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center; border-radius: 6px; font-size: .7rem;
  background: var(--surface-2); color: var(--vert);
}

/* ---------------------------------------------------------------------
   Barre de navigation
   --------------------------------------------------------------------- */
.barre-nav {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; align-items: stretch;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(11, 10, 15, .9);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--bordure);
}
.barre-nav.est-visible { display: flex; }

.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  border: none; background: none; cursor: pointer;
  color: var(--texte-3); font-family: inherit; font-size: .66rem; font-weight: 600;
  transition: var(--transition);
}
.nav-item__icone { font-size: 1.25rem; transition: var(--transition); }
.nav-item.est-actif { color: var(--vert); }
.nav-item.est-actif .nav-item__icone { transform: translateY(-2px) scale(1.12); }

/* ---------------------------------------------------------------------
   Toast
   --------------------------------------------------------------------- */
.toast {
  position: absolute; left: 50%; bottom: calc(var(--nav-h) + 22px); z-index: 90;
  transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--bordure);
  color: var(--texte); font-size: .86rem; font-weight: 600;
  box-shadow: var(--ombre); white-space: nowrap;
  animation: vue-entree 260ms both;
}

/* ---------------------------------------------------------------------
   Écrans larges — on garde le cadre mobile centré
   --------------------------------------------------------------------- */
@media (min-width: 560px) {
  body { padding: 22px 0; }
  #app {
    height: min(920px, calc(100dvh - 44px));
    border-radius: 32px; overflow: hidden;
    border: 1px solid var(--bordure);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
