/* ==================================================================
   BAC — feuille commune (public, shell d'admin, composants)
   Apparence reprise de Conversa (neutre, Inter, accent unique), gabarit
   et vocabulaire de Fucone (.carte, .bouton, .pastille, .grille…).
   Mobile d'abord ; aucune couleur en dur : tout vient des jetons.
   ================================================================== */

/* 1. BASE ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-texte); }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.saut-contenu {
  position: absolute; left: 8px; top: -60px; z-index: 1000;
  padding: 10px 14px; background: var(--texte); color: var(--blanc); border-radius: var(--rayon-petit);
}
.saut-contenu:focus { top: 8px; }
.lecteur-seul {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.js .sans-js { display: none; }
.legende { color: var(--texte-3); font-size: .87rem; }

/* 2. PAGES PUBLIQUES ---------------------------------------------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
.entete { background: var(--surface); border-bottom: 1px solid var(--bord); }
.entete-interieur, .pied-interieur, .contenu {
  width: 100%; max-width: 1100px; margin: 0 auto; padding-left: 16px; padding-right: 16px;
}
.entete-interieur { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--texte); font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.marque img { border-radius: 7px; }
.nav-publique { display: flex; gap: 8px; align-items: center; }
.contenu { flex: 1; padding-top: 32px; padding-bottom: 48px; }
.pied { border-top: 1px solid var(--bord); background: var(--surface); color: var(--texte-3); font-size: .87rem; }
.pied-interieur { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 20px; padding-bottom: 20px; }
.pied-interieur p { margin: 0; }
.pied-liens { display: flex; gap: 16px; }
.pied-liens a { color: var(--texte-2); }
.page-seule { max-width: 640px; margin: 64px auto; padding: 0 16px; }
.editorial { max-width: 760px; }
.editorial h2 { margin-top: 1.6em; }

/* Vitrine */
.vitrine-hero { padding: 24px 0 40px; }
.vitrine-hero h1 { font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.1; max-width: 18ch; }
.vitrine-hero h1 em { font-style: normal; color: var(--accent-texte); }
.vitrine-hero .chapo { font-size: 1.08rem; color: var(--texte-2); max-width: 62ch; }
.vitrine-section { padding: 32px 0; border-top: 1px solid var(--bord); }
.etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: etape; }
.etapes li { counter-increment: etape; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px 18px 18px 60px; position: relative; }
.etapes li::before {
  content: counter(etape); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-doux); color: var(--accent-texte); font-weight: 700; display: grid; place-items: center;
}
.etapes strong { display: block; margin-bottom: 4px; }
.faq details { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--texte-2); }

/* Portail : connexion, lien, premier acces. La carte d'action vient en
   PREMIER dans le document ; la grille la place a droite sur grand ecran. */
.portail { display: grid; gap: 24px; align-items: start; max-width: 960px; margin: 0 auto; }
.portail-carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 24px; box-shadow: var(--ombre); }
.portail-carte h1 { font-size: 1.35rem; }
.portail-texte { color: var(--texte-2); }
.portail-carte .champ { margin-bottom: 14px; }
.portail-carte .bouton { width: 100%; justify-content: center; }
.portail-liens { margin-top: 16px; font-size: .9rem; }

/* 3. SHELL APPLICATIF (regle 11) ---------------------------------- */
.appli { min-height: 100vh; }
.barre-laterale { background: var(--surface); border-bottom: 1px solid var(--bord); }
.bascule-menu { position: absolute; opacity: 0; pointer-events: none; }
.barre-tete { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.burger { display: inline-flex; flex-direction: column; gap: 4px; padding: 10px; cursor: pointer; border-radius: var(--rayon-petit); }
.burger-trait { display: block; width: 20px; height: 2px; background: var(--texte); border-radius: 2px; }
.bascule-menu:focus-visible ~ .barre-tete .burger { outline: 3px solid var(--accent); }
.nav-appli { display: none; padding: 0 12px 12px; }
.bascule-menu:checked ~ .nav-appli { display: block; }
.nav-groupe { margin-bottom: 14px; }
.nav-titre { margin: 0 0 4px; padding: 0 10px; color: var(--texte-3); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.nav-appli a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--rayon-petit);
  color: var(--texte-2); text-decoration: none; font-weight: 500; white-space: nowrap;
}
.nav-appli a:hover { background: var(--survol); color: var(--texte); }
.nav-appli a[aria-current="page"] { background: var(--texte); color: var(--blanc); }
.icone { flex: none; }
.barre-laterale-pied { display: none; }
.appli-entete {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--bord);
}
.appli-entete-fil { margin: 0; color: var(--texte-3); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appli-contenu { padding: 24px 16px 64px; }

@media (min-width: 900px) {
  .appli { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .barre-laterale {
    position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
    border-bottom: 0; border-right: 1px solid var(--bord);
  }
  .burger { display: none; }
  .nav-appli { display: block; flex: 1; }
  .barre-laterale-pied { display: block; padding: 12px 22px; color: var(--texte-3); font-size: .8rem; border-top: 1px solid var(--bord); }
  .barre-laterale-pied p { margin: 0; }
  .appli-entete { padding: 0 32px; }
  .appli-contenu { padding: 32px 32px 80px; }
}

/* Menu du compte */
.menu-compte { position: relative; }
.menu-compte summary {
  list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--rayon-petit);
  cursor: pointer; font-size: .9rem; color: var(--texte-2);
}
.menu-compte summary::-webkit-details-marker { display: none; }
.menu-compte summary:hover { background: var(--survol); }
.menu-compte-pastille {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-doux); color: var(--accent-texte); font-weight: 700; font-size: .78rem;
}
.menu-compte-panneau {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; z-index: 60; padding: 6px;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-haute);
}
.menu-compte-qui { margin: 0; padding: 10px; border-bottom: 1px solid var(--bord); font-size: .82rem; color: var(--texte-3); }
.menu-compte-qui strong { display: block; color: var(--texte); font-size: .9rem; }
.menu-compte-panneau a, .menu-compte-bouton {
  display: block; width: 100%; padding: 9px 10px; border: 0; background: none; text-align: left;
  color: var(--texte); text-decoration: none; font: inherit; font-size: .9rem; border-radius: var(--rayon-petit); cursor: pointer;
}
.menu-compte-panneau a:hover, .menu-compte-bouton:hover { background: var(--survol); }
.form-ligne { display: inline-block; margin: 0; }
.menu-compte .form-ligne { display: block; }
@media (max-width: 520px) { .menu-compte-nom { display: none; } }

/* 4. TITRES, INTRODUCTION, CARTES, GRILLES ------------------------ */
.titre-page { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.titre-page h1 { margin: 0; }
.fil-ariane { font-size: .87rem; color: var(--texte-3); margin-bottom: 8px; }
.fil-ariane a { color: var(--texte-2); }
.introduction { color: var(--texte-2); margin-bottom: 20px; }
.introduction p:last-child { margin-bottom: 0; }

.carte {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 20px; margin-bottom: 20px; box-shadow: var(--ombre);
}
.carte > h2:first-child { font-size: 1.05rem; }
.carte > h2:not(:first-child) { margin-top: 24px; }
.carte-accent { border-color: var(--accent); background: var(--accent-doux); }
.grille-1-1, .grille-1-2, .grille-2-1, .grille-3 { display: grid; gap: 20px; }
.grille-1-1 > .carte, .grille-1-2 > .carte, .grille-2-1 > .carte, .grille-3 > .carte { margin-bottom: 0; }
@media (min-width: 900px) {
  .grille-1-1 { grid-template-columns: 1fr 1fr; }
  .grille-1-2 { grid-template-columns: 1fr 2fr; }
  .grille-2-1 { grid-template-columns: 2fr 1fr; }
  .grille-3 { grid-template-columns: repeat(3, 1fr); }
}
.bloc { margin-bottom: 24px; }

.chiffre { display: block; text-decoration: none; color: inherit; }
.chiffre-valeur { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; color: var(--texte); font-variant-numeric: tabular-nums; }
.chiffre-libelle { color: var(--texte-3); font-size: .9rem; }
a.chiffre:hover .chiffre-valeur { color: var(--accent-texte); }

/* 5. BOUTONS ET TONS (regle 11c) ---------------------------------- */
.bouton {
  --ton: var(--accent); --ton-fonce: var(--accent-fonce); --ton-doux: var(--accent-doux); --encre: var(--accent-encre);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--ton); border-radius: var(--rayon-petit); background: var(--ton); color: var(--encre);
  font: inherit; font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.bouton:hover { background: var(--ton-fonce); border-color: var(--ton-fonce); }
.bouton-secondaire { background: var(--surface); color: var(--texte); border-color: var(--bord-fort); }
.bouton-secondaire:hover { background: var(--survol); border-color: var(--bord-fort); }
.bouton-discret { background: none; border-color: transparent; color: var(--texte-2); }
.bouton-discret:hover { background: var(--survol); border-color: transparent; }
.bouton-petit { min-height: 32px; padding: 4px 10px; font-size: .82rem; }
.bouton-vert   { --ton: var(--ton-vert);   --ton-fonce: var(--ton-vert-fonce);   --ton-doux: var(--ton-vert-doux);   --encre: var(--blanc); }
.bouton-bleu   { --ton: var(--ton-bleu);   --ton-fonce: var(--ton-bleu-fonce);   --ton-doux: var(--ton-bleu-doux);   --encre: var(--blanc); }
.bouton-rouge  { --ton: var(--ton-rouge);  --ton-fonce: var(--ton-rouge-fonce);  --ton-doux: var(--ton-rouge-doux);  --encre: var(--blanc); }
.bouton-jaune  { --ton: var(--ton-jaune);  --ton-fonce: var(--ton-jaune-fonce);  --ton-doux: var(--ton-jaune-doux);  --encre: var(--blanc); }
.bouton-orange { --ton: var(--ton-orange); --ton-fonce: var(--ton-orange-fonce); --ton-doux: var(--ton-orange-doux); --encre: var(--blanc); }
.bouton-gris   { --ton: var(--ton-gris);   --ton-fonce: var(--ton-gris-fonce);   --ton-doux: var(--ton-gris-doux);   --encre: var(--blanc); }
.bouton-contour { background: var(--ton-doux); color: var(--ton); }
.bouton-contour:hover { background: var(--ton); color: var(--encre); }
.lien-bouton { border: 0; background: none; padding: 0; color: var(--accent-texte); font: inherit; text-decoration: underline; cursor: pointer; }
.actions-formulaire { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

/* 6. PASTILLES ------------------------------------------------------ */
.pastille {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.pastille-vert  { background: var(--succes-fond); color: var(--succes); border-color: var(--succes-bord); }
.pastille-rouge { background: var(--danger-fond); color: var(--danger); border-color: var(--danger-bord); }
.pastille-jaune { background: var(--alerte-fond); color: var(--alerte); border-color: var(--alerte-bord); }
.pastille-bleu  { background: var(--info-fond);   color: var(--info);   border-color: var(--info-bord); }
.pastille-gris  { background: var(--survol);      color: var(--texte-2); border-color: var(--bord); }

/* 7. FORMULAIRES ---------------------------------------------------- */
.saisie { max-width: 720px; }
.champ { margin-bottom: 16px; }
.champ label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .9rem; }
.champ input, .champ select, .champ textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--bord-fort); border-radius: var(--rayon-petit);
  background: var(--surface); color: var(--texte); font: inherit;
}
.champ textarea { min-height: 120px; resize: vertical; }
.champ input:focus-visible, .champ select:focus-visible, .champ textarea:focus-visible { outline: 3px solid var(--accent-doux); border-color: var(--accent); }
.champ input[type="color"] { width: 80px; padding: 4px; }
.aide { margin: 6px 0 0; color: var(--texte-3); font-size: .84rem; }
.case { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.case input { width: 20px; height: 20px; margin-top: 2px; }

/* 8. MESSAGES ------------------------------------------------------- */
.message { padding: 12px 16px; border-radius: var(--rayon-petit); border: 1px solid; margin-bottom: 18px; }
.message-ok     { background: var(--succes-fond); border-color: var(--succes-bord); color: var(--succes); }
.message-erreur { background: var(--danger-fond); border-color: var(--danger-bord); color: var(--danger); }
.message-info   { background: var(--info-fond);   border-color: var(--info-bord);   color: var(--info); }
.message:focus { outline: none; }

/* 9. PAGE-LISTE (regle 11 e/f) ------------------------------------- */
.barre-outils {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; margin-bottom: 16px; border-top: 1px solid var(--bord); border-bottom: 1px solid var(--bord);
}
.outils-gauche, .outils-droite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.outils-recherche, .outils-taille { display: flex; align-items: center; gap: 6px; margin: 0; }
.outils-recherche input, .outils-taille select {
  min-height: 40px; padding: 7px 10px; border: 1px solid var(--bord-fort); border-radius: var(--rayon-petit); font: inherit; background: var(--surface);
}
.outils-recherche input { width: min(260px, 60vw); }
.outils-taille label { font-size: .87rem; color: var(--texte-3); }
.outils-aide { position: relative; }
.outils-aide summary { list-style: none; }
.outils-aide summary::-webkit-details-marker { display: none; }
.outils-aide-contenu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: min(380px, 90vw); padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-haute); font-size: .9rem;
}

.tableau-defilant { overflow-x: auto; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.tableau-donnees { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; font-size: .9rem; }
.tableau-donnees th, .tableau-donnees td {
  padding: 10px 12px; border-bottom: 1px solid var(--bord); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tableau-donnees thead th { background: var(--survol); color: var(--texte-2); font-weight: 600; font-size: .82rem; }
.tableau-donnees tbody tr:last-child td { border-bottom: 0; }
.tableau-donnees tbody tr:hover { background: var(--survol); }
.tableau-donnees .nombre { text-align: right; font-variant-numeric: tabular-nums; }
.tri { color: inherit; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.tri.est-actif { color: var(--texte); }
.tri-fleche { color: var(--texte-3); font-size: .8em; }
.col-actions, .tableau-donnees td.actions { text-align: right; overflow: visible; }
/* Les actions : de vrais boutons, cote a cote, sur une seule ligne. Le
   <form> de suppression est un element de bloc : inline-block sur lui. */
.actions > a, .actions > form, .actions > button { display: inline-block; vertical-align: middle; margin-left: 3px; }
.actions .bouton-petit { padding: 4px 8px; }
.actions .bouton { background: var(--survol); border-color: var(--bord); color: var(--texte); }
.actions .bouton:hover { background: var(--bord); }
.actions .bouton-rouge { background: var(--ton-rouge-doux); border-color: var(--danger-bord); color: var(--ton-rouge); }
.l-actions { width: 250px; }
.l-6 { width: 6%; } .l-8 { width: 8%; } .l-10 { width: 10%; } .l-12 { width: 12%; } .l-16 { width: 16%; } .l-20 { width: 20%; } .l-24 { width: 24%; } .l-30 { width: 30%; }
.vide { padding: 32px; text-align: center; color: var(--texte-3); }

.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.pagination-compte { margin: 0; color: var(--texte-3); font-size: .87rem; font-variant-numeric: tabular-nums; }
.pagination-pages { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.pagination-lien {
  display: inline-block; min-width: 36px; padding: 6px 10px; text-align: center; border: 1px solid var(--bord);
  border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte-2); text-decoration: none; font-size: .87rem;
}
.pagination-lien.est-actif { background: var(--texte); color: var(--blanc); border-color: var(--texte); }
.pagination-lien.est-inerte { color: var(--texte-3); opacity: .55; }
.pagination-saut { padding: 6px 4px; color: var(--texte-3); }

/* 10. MODAL --------------------------------------------------------- */
.modal { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-haute); }
.modal::backdrop { background: var(--voile); }
.modal-corps { padding: 22px 22px 8px; }
.modal-cible { font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 20px; }

/* 11. COURS : listes, photos, etat --------------------------------- */
.liste-cours { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.vignette-cours {
  display: block; padding: 18px; border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--bord);
  border-top: 5px solid var(--mat, var(--accent)); color: inherit; text-decoration: none; box-shadow: var(--ombre);
}
.vignette-cours:hover { border-color: var(--mat, var(--accent)); }
.vignette-cours h3, .vignette-cours h4 { margin-bottom: 4px; font-size: 1.02rem; }
.vignette-cours p { margin: 0; color: var(--texte-3); font-size: .87rem; }
.matiere-titre { margin: 28px 0 12px; color: var(--mat, var(--texte)); }

.photos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 0 0 16px; padding: 0; list-style: none; }
.photos li { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-petit); overflow: hidden; }
.photos img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--survol); }
.photo-pied { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; font-size: .8rem; color: var(--texte-3); }
.depot { border: 2px dashed var(--bord-fort); border-radius: var(--rayon); padding: 18px; background: var(--surface); }
.depot input[type="file"] { width: 100%; }
.depot-etat { margin-top: 10px; }
.depot-etat progress { width: 100%; height: 10px; }
.liste-verification { list-style: none; padding: 0; margin: 0; }
.liste-verification li { padding: 10px 0; border-bottom: 1px solid var(--bord); }
.liste-verification li:last-child { border-bottom: 0; }
details.correction { border: 1px solid var(--bord); border-radius: var(--rayon-petit); margin-bottom: 10px; background: var(--surface); }
details.correction summary { padding: 12px 14px; cursor: pointer; font-weight: 600; }
details.correction .contenu-cours { padding: 0 16px 16px; }
.enonce { padding: 12px 14px; background: var(--survol); border-radius: var(--rayon-petit); margin-bottom: 10px; }
.etat-generation { display: flex; align-items: center; gap: 12px; }
.etat-generation progress { flex: 1; height: 8px; }

/* Page d'envoi : deux gros boutons, pensés pour le pouce */
.depot-boutons { display: grid; gap: 10px; }
@media (min-width: 640px) { .depot-boutons { grid-template-columns: 1fr 1fr; } }
.bouton-grand { min-height: 56px; font-size: 1rem; width: 100%; }
.champ-cache { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.champ-cache:focus-visible + .bouton, .bouton:has(+ .champ-cache:focus-visible) { outline: 3px solid var(--accent); }
.liste-envois { list-style: none; margin: 0; padding: 0; }
.liste-envois > li { padding: 12px 0; border-bottom: 1px solid var(--bord); }
.liste-envois > li:last-child { border-bottom: 0; }
.liste-envois p { margin: 0 0 4px; }
.liste-envois ul { margin: 4px 0 0; padding-left: 18px; }

/* Vitrine : les cours en libre accès */
.cours-libres .liste-cours { margin-bottom: 8px; }

/* Application installee (PWA) : barre d'onglets au pouce, sur telephone */
.barre-app { display: none; }
@media (max-width: 899px) {
  .barre-app {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--bord);
  }
  .barre-app a {
    display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
    color: var(--texte-3); text-decoration: none; font-size: .72rem; font-weight: 600; border-radius: var(--rayon-petit);
  }
  .barre-app a[aria-current="page"] { color: var(--accent-texte); background: var(--accent-doux); }
  .barre-app a.onglet-envoyer { color: var(--accent-encre); background: var(--accent); }
  .barre-app a.onglet-envoyer[aria-current="page"] { background: var(--accent-fonce); color: var(--accent-encre); }
  .appli-contenu { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
.appli-installee .barre-tete { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.encart-appli ol { padding-left: 20px; margin: 0; }
.liste-hors-ligne { text-align: left; }

/* 12. VISITE GUIDEE (regle 12, reprise de Fucone) ------------------ */
.visite-halo { position: fixed; z-index: 900; border-radius: var(--rayon-petit); box-shadow: 0 0 0 9999px var(--voile); pointer-events: none; transition: top 180ms ease, left 180ms ease, width 180ms ease, height 180ms ease; }
.visite-halo-vide { top: 50%; left: 50%; width: 0; height: 0; }
.visite-bulle { position: fixed; z-index: 901; width: min(340px, calc(100vw - 32px)); padding: 18px 20px; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre-haute); }
.visite-bulle h2 { margin-bottom: 8px; font-size: 1.05rem; padding-right: 48px; }
.visite-texte { margin: 0; color: var(--texte-2); font-size: .9rem; line-height: 1.6; }
.visite-fleche { position: absolute; width: 12px; height: 12px; border-top: 1px solid var(--bord); border-left: 1px solid var(--bord); background: var(--surface); transform: rotate(45deg); }
.visite-fleche-gauche { top: 22px; left: -7px; }
.visite-fleche-droite { top: 22px; right: -7px; transform: rotate(225deg); }
.visite-fleche-haut { top: -7px; left: 26px; }
.visite-fleche-bas { bottom: -7px; left: 26px; transform: rotate(225deg); }
.visite-pied { display: flex; gap: 8px; align-items: center; padding-top: 14px; border-top: 1px solid var(--bord); margin-top: 16px; }
.visite-compteur { min-width: 44px; margin-right: auto; color: var(--texte-3); font-size: .78rem; font-variant-numeric: tabular-nums; }
.visite-passer { position: absolute; top: 10px; right: 12px; padding: 4px 6px; border: 0; background: none; color: var(--texte-3); font: inherit; font-size: .78rem; text-decoration: underline; cursor: pointer; }
.visite-cible { position: relative; z-index: 899; }
[data-visite-scenario][hidden], [data-visite-auto][hidden] { display: none; }
@media (max-width: 639px) {
  .visite-bulle { left: 16px !important; right: 16px; bottom: 16px; top: auto !important; width: auto; }
  .visite-fleche { display: none; }
}

/* Tableau de bord : les grandes lignes */
.grandes-lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: gl; }
@media (min-width: 900px) { .grandes-lignes { grid-template-columns: 1fr 1fr; } }
.grandes-lignes li { counter-increment: gl; position: relative; padding: 16px 16px 16px 56px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.grandes-lignes li::before { content: counter(gl); position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-doux); color: var(--accent-texte); font-weight: 700; display: grid; place-items: center; font-size: .85rem; }
.grandes-lignes h3 { margin-bottom: 4px; }
.grandes-lignes p { margin: 0 0 6px; color: var(--texte-2); font-size: .92rem; }

/* Configuration : echantillons */
.echantillons { display: flex; flex-wrap: wrap; gap: 8px; }

/* Page hors ligne */
.hors-ligne { text-align: center; }

@media (min-width: 640px) {
  .portail--duo { grid-template-columns: 1fr 1fr; }
  .portail--duo .portail-carte { order: 2; }
  .portail--duo .portail-texte { order: 1; }
  .contenu { padding-top: 48px; }
  .etapes { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .entete-interieur, .pied-interieur, .contenu { padding-left: 32px; padding-right: 32px; }
}

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