/* =====================================================================
   invex.css — Écrans propres à INVEX (parcours, leçon, simulateur)
   Utilise uniquement les variables de app.css.
   ===================================================================== */

.num, .surtitre, .grand-chiffre, .carnet, .score { font-family: var(--police-chiffres); font-variant-numeric: tabular-nums; }
.up { color: var(--hausse); }
.dn { color: var(--baisse); }
.surtitre { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.marque-nom { font-family: var(--police-chiffres); font-weight: 700; letter-spacing: .08em; }
.barre-avertissement { margin: auto 12px 12px; font-size: 11px; color: var(--texte-4); line-height: 1.4; }
.source { font-size: 12px; color: var(--texte-3); margin: 0; }
.lecture { font-size: 14px; color: var(--texte-2); margin: 0; }
.consigne { margin: 0 0 4px; color: var(--texte-2); }

/* ---------- Accueil ---------- */
.carte-suivante { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--rayon); background: linear-gradient(135deg, var(--accent-fond), var(--surface)); border: 1px solid var(--bordure-forte); color: inherit; text-decoration: none; margin-bottom: 16px; }
.carte-suivante:hover { border-color: var(--accent); }
.carte-suivante .titre-suivante { font-size: 20px; line-height: 1.25; }
.carte-suivante .bouton { align-self: flex-start; margin-top: 6px; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 22px; }
.tuiles .tuile { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 14px; color: inherit; text-decoration: none; }
.tuiles a.tuile:hover { border-color: var(--accent); }
.tuiles .tuile .icone { color: var(--accent); }

/* ---------- Parcours ---------- */
.numero-niveau { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--rayon-petit); background: var(--accent-fond); color: var(--accent); font-weight: 700; }
.element.ferme { opacity: .62; }
.element.ferme .titre { color: var(--texte-2); }
.niveau-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.niveau-tete .corps { flex: 1; }
.niveau .progression { margin-bottom: 12px; }
.niveau.ferme .niveau-tete { opacity: .75; }
.pastille-module { min-width: 40px; text-align: center; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--surface-2); border-radius: var(--rayon-petit); padding: 4px 6px; }
.pastille-lecon { min-width: 36px; height: 28px; display: grid; place-items: center; font-family: var(--police-chiffres); font-size: 12px; border-radius: var(--rayon-petit); background: var(--surface-2); color: var(--texte-3); flex: none; }
.pastille-lecon.dispo { color: var(--accent); border: 1px solid var(--accent); background: transparent; }
.pastille-lecon.faite { background: var(--accent); color: var(--sur-accent); }
.pastille-lecon .icone { width: 16px; height: 16px; }
.titre-partie-liste { padding: 10px 14px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-3); background: var(--surface-2); }
.element .titre .etiquette { margin-left: 8px; vertical-align: middle; }
.element.epreuve { margin-top: 8px; border-radius: var(--rayon); background: var(--surface); }

/* ---------- Leçon ---------- */
.fil-etapes { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 5; background: var(--fond); padding: 8px 0; }
.fil-etapes li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texte-3); white-space: nowrap; padding: 5px 10px; border-radius: var(--rayon-pilule); border: 1px solid var(--bordure); }
.fil-etapes li span { font-weight: 700; }
.fil-etapes li.actif { color: var(--accent); border-color: var(--accent); }
.fil-etapes li.fait { color: var(--texte-2); background: var(--surface-2); }
.etape-lecon { margin-bottom: 28px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 56px; }
.etape-titre { font-size: 18px; margin: 0; }
.video-lecon { width: 100%; border-radius: var(--rayon); background: #000; aspect-ratio: 16 / 9; }
.video-absente { display: flex; align-items: center; gap: 8px; }
.accroche .texte-riche p:first-child { margin-top: 0; }
.question-accroche { font-weight: 600; color: var(--accent); margin: 0; }
.suivant-etape { align-self: flex-start; }
.graphe { width: 100%; height: 260px; display: block; }
.graphe-marche { height: 340px; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.chiffre { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border-radius: var(--rayon-petit); padding: 8px 10px; }
.chiffre strong { font-size: 17px; }
.chiffre.dn strong { color: var(--baisse); }
.devinette { gap: 10px; margin-bottom: 12px; border: 1px dashed var(--bordure-forte); }
.devinette .onglets { flex-wrap: wrap; }
.resultat-sim { border-left: 3px solid var(--accent); }
.resultat-sim .texte-riche p { margin: 4px 0; }
.choix-qcm { display: flex; flex-direction: column; gap: 6px; }
.bouton.choix { justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 44px; }
.bouton.choix.juste { border-color: var(--hausse); color: var(--hausse); background: var(--hausse-fond); opacity: 1; }
.bouton.choix.faux { border-color: var(--baisse); color: var(--baisse); background: var(--baisse-fond); opacity: 1; }
.a-retenir { margin: 0; padding-left: 34px; display: flex; flex-direction: column; gap: 8px; }
.a-retenir .texte-riche p { margin: 0; }
details.deplier { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 0 14px; margin-top: 8px; }
details.deplier > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--texte-2); }
details.deplier[open] > summary { color: var(--accent); }
details.deplier > .texte-riche, details.deplier > ul, details.deplier > .onglets { padding-bottom: 12px; }
.approfondir h3 { margin: 8px 0 0; font-size: 16px; }
.sources ul { padding-left: 18px; font-size: 13px; color: var(--texte-2); display: flex; flex-direction: column; gap: 6px; }

/* ---------- Simulations ---------- */
.sim { gap: 12px; }
.sim-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.grand-chiffre { font-size: 26px; font-weight: 700; line-height: 1.1; }
.sim-commandes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sim-commandes .onglets { margin-left: auto; }
.alerte-sim { border: 1px solid var(--baisse); background: var(--baisse-fond); color: var(--texte); border-radius: var(--rayon-petit); padding: 10px 12px; font-size: 14px; }
.alerte-sim.pos { border-color: var(--hausse); background: var(--hausse-fond); }

.ecran-marche { display: flex; flex-direction: column; gap: 12px; }
.ecran-marche > .progression { margin: 0; }
.marche-grille { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.marche-principal { display: flex; flex-direction: column; gap: 10px; }
.marche-cote .carte-surface { gap: 6px; }
.marche-bas .carte-surface { gap: 8px; }
.carnet { width: 100%; border-collapse: collapse; font-size: 12px; }
.carnet td { padding: 2px 4px; position: relative; }
.carnet td.q { text-align: right; }
.carnet .barre-carnet { position: absolute; right: 0; top: 2px; bottom: 2px; opacity: .18; border-radius: 2px; }
.carnet .barre-carnet.dn { background: var(--baisse); }
.carnet .barre-carnet.up { background: var(--hausse); }
.carnet .ecart { text-align: center; color: var(--texte-3); border-top: 1px dashed var(--bordure); border-bottom: 1px dashed var(--bordure); }
.actu { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.news { display: flex; gap: 8px; font-size: 13px; padding-left: 8px; border-left: 2px solid var(--hausse); }
.news.neg { border-left-color: var(--baisse); }
.news b { color: var(--texte-3); font-weight: 400; min-width: 34px; }
.acteurs > div { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.acteurs .b { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.acteurs .b i { display: block; height: 100%; background: var(--info); }
.jauge { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--baisse), var(--alerte) 50%, var(--hausse)); }
.jauge i { position: absolute; top: -3px; width: 4px; height: 16px; border-radius: 2px; background: var(--texte); }
.rangee-ordre { display: flex; gap: 6px; }
.rangee-ordre .saisie { flex: 1; min-width: 0; }
.retour-ordre { margin: 0; color: var(--texte-2); }
.consigne-cas { margin-bottom: 12px; }
.score { font-size: 40px; font-weight: 700; color: var(--accent); }

/* ---------- Bienvenue ---------- */
.bienvenue-tete { text-align: center; margin: 24px auto 18px; max-width: 560px; }
.logo-bienvenue { width: 72px; height: 72px; border-radius: 16px; }
.page-bienvenue .bienvenue { max-width: 560px; margin: 0 auto; gap: 12px; }
.choix-cartes { display: flex; flex-direction: column; gap: 8px; }
.carte-choix { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; }
.carte-choix[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-fond); }
.groupe-modules { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.groupe-modules legend { color: var(--accent); margin-bottom: 4px; }

/* ---------- Administration ---------- */
textarea.saisie.code { font-family: var(--police-chiffres); font-size: 12px; min-height: 260px; }
.voile-plein { align-items: stretch; }
.panneau-large { width: min(1100px, 96vw); max-height: 94vh; overflow-y: auto; }
.fermer-apercu { position: sticky; top: 0; z-index: 3; background: var(--surface); }

/* ---------- Journal ---------- */
.entree-journal p { margin: 0; }

@media (max-width: 900px) {
  .marche-grille { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .graphe-marche { height: 280px; }
  .acteurs > div { grid-template-columns: 120px 1fr; }
  .sim-commandes .onglets { margin-left: 0; }
  .carte-suivante .titre-suivante { font-size: 18px; }
}
