/* Contrôle de gestion · ALPAGA — thème « tournée du stagiaire » */
:root {
  --creme: #f7f2e8; --papier: #fffdf8; --encre: #1f2a33; --gris: #5d6b75; --trait: #e3dccd;
  --sapin: #2f7d4f; --ciel: #2d6fa3; --rouge: #c2412d; --noir: #4a3566; --or: #b8862b; --bois: #7a5232;
  --ok: #2f7d4f; --ok-bg: #e5f3ea; --ko: #b3261e; --ko-bg: #fbe9e7; --moy: #b7791f; --moy-bg: #fdf3e1;
  --rayon: 14px; --ombre: 0 1px 2px rgba(31,42,51,.06), 0 6px 18px rgba(31,42,51,.07);
  --titre: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, Cambria, serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, Calibri, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--encre); font: 16px/1.55 var(--texte); }
a { color: var(--ciel); }
h1, h2, h3 { font-family: var(--titre); line-height: 1.2; margin: .2em 0 .5em; }
h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h4 { margin: 1em 0 .4em; font-size: 1rem; }
code { background: #efe8da; padding: 0 .3em; border-radius: 4px; }
mark { background: #fff1b8; padding: 0 .15em; border-radius: 3px; }
[hidden] { display: none !important; }
.petit { font-size: .88rem; color: var(--gris); }
.grand { font-size: 2.2rem; font-family: var(--titre); font-weight: 700; margin: .1em 0; }

/* ---------------------------------------------------------------- en-tête */
.bandeau { background: linear-gradient(180deg, #e8f0f5 0%, #dce7ee 100%); position: relative; }
.bandeau-in { max-width: 1180px; margin: 0 auto; padding: 14px 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.marque { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--encre); }
.marque span { display: flex; flex-direction: column; }
.marque strong { font-family: var(--titre); font-size: 1.2rem; }
.marque small { color: var(--gris); }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--encre); padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.7); font-size: .93rem; }
.nav a:hover { background: #fff; }
.montagnes { display: block; width: 100%; height: 56px; margin-top: -10px; }
.page { max-width: 1180px; margin: 0 auto; padding: 18px 20px 40px; }
.pied { max-width: 1180px; margin: 0 auto; padding: 18px 20px 40px; color: var(--gris); font-size: .85rem; border-top: 1px solid var(--trait); }
.pied .cas { font-style: italic; }

/* ---------------------------------------------------------------- composants */
.carte { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px 20px; box-shadow: var(--ombre); margin: 16px 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #c9bfae; background: #fff; color: var(--encre); padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .08s, background .15s; }
.btn:hover { background: #f4efe5; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primaire { background: var(--encre); border-color: var(--encre); color: #fff; }
.btn.primaire:hover { background: #33424e; }
.btn.discret { background: transparent; border-color: transparent; color: var(--gris); }
.btn.discret:hover { background: #efe8da; }
.btn.mini-btn { padding: 5px 10px; font-size: .85rem; }
.boutons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.boutons form { margin: 0; }
.info { background: #e6f0f8; border-left: 4px solid var(--ciel); padding: 10px 14px; border-radius: 8px; }
.alerte { background: var(--ko-bg); border-left: 4px solid var(--ko); padding: 10px 14px; border-radius: 8px; color: #6d1a14; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid #c9bfae; border-radius: 10px; padding: 8px 10px; background: #fff; max-width: 100%; }
input:focus, select:focus, .trou:focus, button:focus-visible, a:focus-visible { outline: 3px solid #9cc3e4; outline-offset: 1px; }
label { display: inline-flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; }
.form-ligne { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-pile { display: flex; flex-direction: column; gap: 12px; }
.form-pile label, .form-pile select, .form-pile input { width: 100%; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.deux-colonnes .carte { margin: 0; }
.code-saisie { text-transform: uppercase; letter-spacing: .2em; font-weight: 700; width: 10em; }
.ariane { font-size: .88rem; color: var(--gris); margin-bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.ariane a { color: var(--gris); }
.jauge { height: 10px; background: #ece4d5; border-radius: 999px; overflow: hidden; margin: 6px 0; }
.jauge span { display: block; height: 100%; background: linear-gradient(90deg, var(--sapin), var(--ciel)); border-radius: 999px; }
.cadenas { color: var(--gris); font-size: .9rem; }

table.donnees { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: .94rem; background: #fff; }
table.donnees th, table.donnees td { border: 1px solid var(--trait); padding: 7px 9px; text-align: left; vertical-align: top; }
table.donnees th { background: #f2ece0; font-weight: 700; }
.tableau-defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------- accueil */
.hero { display: flex; gap: 20px; align-items: center; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 18px 22px; box-shadow: var(--ombre); }
.hero p { margin: .3em 0; }
.titre-section { margin-top: 28px; }
.grille-stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.station { display: flex; gap: 14px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); }
.station h3 { font-size: 1.08rem; margin: .1em 0 .3em; }
.station p { margin: .25em 0 .6em; font-size: .93rem; }
.station-num { flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--encre); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--titre); font-size: 1.3rem; font-weight: 700; }
.station-seance { text-transform: uppercase; letter-spacing: .06em; font-size: .76rem; color: var(--gris); font-weight: 700; margin: 0; }
.station.fermee { opacity: .62; }
.station.fermee .station-num { background: #9aa5ad; }
.station.dujour { border: 2px solid var(--or); box-shadow: 0 0 0 4px rgba(217,164,65,.18), var(--ombre); }
.regles ul { margin: 0; padding-left: 1.2em; }
.regles li { margin: .3em 0; }

/* consentement */
.modale-fond { position: fixed; inset: 0; background: rgba(31,42,51,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modale { background: var(--papier); border-radius: 18px; max-width: 560px; width: 100%; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 92vh; overflow: auto; }

/* ---------------------------------------------------------------- séance */
.tete-station .contexte p { margin: .4em 0; }
.rappel { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; border-left: 6px solid var(--or); }
.rappel:hover { background: #fffaf0; }
.rappel-icone { font-size: 2rem; }
.pistes { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 10px; }
.piste { display: flex; gap: 14px; align-items: center; background: var(--papier); border: 1px solid var(--trait); border-left: 8px solid var(--c, #999); border-radius: var(--rayon); padding: 12px 16px; box-shadow: var(--ombre); }
.piste-txt { flex: 1; display: flex; flex-direction: column; }
.piste-verte { --c: var(--sapin); } .piste-bleue { --c: var(--ciel); } .piste-rouge { --c: var(--rouge); } .piste-noire { --c: var(--noir); } .piste-refuge { --c: var(--or); }
.piste.verrou { opacity: .6; }

/* rappel de cours */
.defs { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.def { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px 18px; box-shadow: var(--ombre); }
.def h2 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.def-num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--sapin); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; font-family: var(--texte); }
.def-corps p, .def-ex p, .def-vig p { margin: .3em 0; }
.def-ex, .def-vig { margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: .94rem; }
.def-ex { background: #eef5fb; }
.def-vig { background: var(--moy-bg); }
.etiq { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); margin-bottom: 2px; }
.methode ol { padding-left: 1.3em; }

/* ---------------------------------------------------------------- pistes et questions */
.tete-piste { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.tete-piste > div { flex: 1; }
.intro-piste { background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 18px; margin: 10px 0 18px; }
.intro-piste table.donnees { font-size: .9rem; }
.questions { display: flex; flex-direction: column; gap: 18px; }
.q { background: var(--papier); border: 1px solid var(--trait); border-top: 5px solid var(--c, var(--encre)); border-radius: var(--rayon); padding: 16px 20px; box-shadow: var(--ombre); }
.couleur-verte { --c: var(--sapin); } .couleur-bleue { --c: var(--ciel); } .couleur-rouge { --c: var(--rouge); } .couleur-noire { --c: var(--noir); } .couleur-refuge { --c: var(--or); }
.q-tete { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.q-num { font-family: var(--titre); font-weight: 700; font-size: 1.1rem; }
.q-type { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; background: #efe8da; padding: 2px 8px; border-radius: 999px; }
.q-pts { margin-left: auto; font-weight: 700; color: var(--gris); }
.enonce p { margin: .4em 0; }
.consigne { font-size: .84rem; color: var(--gris); margin: .5em 0; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.indice { background: var(--moy-bg); border-radius: 10px; padding: 8px 12px; margin-top: 10px; }
.indice p { display: inline; margin: 0; }

.gabarit { line-height: 2.5; font-size: 1.02rem; }
.trou { display: inline-flex; align-items: center; min-width: 9em; min-height: 2.1em; vertical-align: middle; border: 2px dashed #b9ad97; border-radius: 10px; padding: 1px 4px; margin: 2px 2px; background: #fbf8f1; cursor: pointer; line-height: 1.3; }
.trou.survol { border-color: var(--ciel); background: #eef5fb; }
.trou.plein { border-style: solid; border-color: #c9bfae; background: #fff; }
.banque { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; background: #f3eee3; border-radius: 12px; min-height: 52px; }
.bloc { border: 1px solid #b9ad97; background: #fff; border-radius: 9px; padding: 6px 10px; font: inherit; font-size: .95rem; cursor: grab; text-align: left; color: var(--encre); line-height: 1.3; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.bloc.choisi { outline: 3px solid var(--or); background: #fff8e6; }
.bloc.glisse { opacity: .5; }
.trou .bloc { box-shadow: none; border-color: transparent; padding: 3px 6px; }
.trou.ok { border-color: var(--ok) !important; background: var(--ok-bg) !important; }
.trou.ko { border-color: var(--ko) !important; background: var(--ko-bg) !important; }
.figee .bloc { cursor: default; }
.figee .banque { opacity: .55; }

.ordre { list-style: decimal inside; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ordre li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #c9bfae; border-radius: 10px; padding: 8px 10px; cursor: grab; counter-increment: o; }
.ordre li::before { content: counter(o); font-weight: 800; color: var(--gris); min-width: 1.2em; }
.ordre { counter-reset: o; list-style: none; }
.ordre-txt { flex: 1; }
.ordre-btns { display: flex; gap: 4px; }
.mini { border: 1px solid #c9bfae; background: #f7f2e8; border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: .8rem; }
.ordre li.ok { border-color: var(--ok); background: var(--ok-bg); }
.ordre li.ko { border-color: var(--ko); background: var(--ko-bg); }
.figee .ordre-btns { display: none; }

.saisie { width: 100%; max-width: 420px; }
.saisie.nombre { max-width: 220px; text-align: right; font-variant-numeric: tabular-nums; }
.saisie-unite { display: inline-flex; align-items: center; gap: 6px; }
.unite { font-weight: 700; color: var(--gris); }
input.ok, select.ok { border-color: var(--ok); background: var(--ok-bg); }
input.ko, select.ko { border-color: var(--ko); background: var(--ko-bg); }
.option { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; background: #fff; border: 1px solid #c9bfae; border-radius: 10px; padding: 9px 12px; margin: 6px 0; cursor: pointer; font-size: 1rem; }
.option input { margin-top: 4px; }
.option.ok { border-color: var(--ok); background: var(--ok-bg); }
.option.ko { border-color: var(--ko); background: var(--ko-bg); }
.saisie-tableau td { min-width: 7em; }
.saisie-tableau select { width: 100%; min-width: 9em; }
.cellule { width: 100%; min-width: 7em; text-align: right; }

.retour { margin-top: 14px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--trait); }
.retour.tout-bon { background: var(--ok-bg); border-color: #b9dcc6; }
.retour.en-partie { background: var(--moy-bg); border-color: #efd7a9; }
.retour.rate { background: var(--ko-bg); border-color: #f0c2bc; }
.verdict { margin: 0 0 6px; }
.explication p { margin: .35em 0; }
.solution summary { cursor: pointer; font-weight: 700; margin-top: 6px; }
.syllo { padding-left: 1.2em; }
.bilan-piste { text-align: center; border-top: 6px solid var(--or); }

/* syllogisme */
.situation { background: #f3eee3; border-radius: 12px; padding: 10px 14px; }
.situation h4 { margin-top: 0; }
.decisions { display: flex; flex-wrap: wrap; gap: 8px; }
.decisions .option { margin: 0; }
.syllogisme { display: flex; flex-direction: column; gap: 10px; }
.ligne-syllo { display: grid; grid-template-columns: 210px 1fr; gap: 10px; align-items: center; }
.etiq-syllo { font-weight: 700; font-size: .92rem; }
.case-syllo { width: 100%; min-height: 3em; display: flex; }
.case-syllo .bloc { width: 100%; }
.refuge-grille { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 18px; align-items: start; }
.dossier { position: sticky; top: 12px; background: var(--papier); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; max-height: calc(100vh - 24px); overflow: auto; box-shadow: var(--ombre); }
.extrait { border-left: 4px solid var(--or); padding: 4px 0 4px 12px; margin: 10px 0 16px; }
.extrait h3 { font-size: 1rem; }
.extrait ul { padding-left: 1.1em; margin: .3em 0; font-size: .92rem; }
.source { font-size: .8rem; color: var(--gris); font-style: italic; margin: .3em 0 0; }

/* ---------------------------------------------------------------- certificat */
.certificat { background: #fff; max-width: 820px; margin: 10px auto; padding: 14px; border-radius: 6px; box-shadow: var(--ombre); }
.cert-bord { border: 3px double var(--bois); padding: 26px 30px; background: radial-gradient(circle at 50% 0%, #fffdf6, #fbf6ea); }
.cert-tete { display: flex; align-items: center; gap: 16px; justify-content: space-between; text-align: center; }
.cert-tete h1 { font-size: 2.1rem; margin: .1em 0; }
.cert-sur { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--bois); margin: 0; }
.cert-sous { margin: 0; color: var(--gris); }
.cert-attribue { text-align: center; font-size: 1.05rem; margin: 18px 0; line-height: 1.7; }
.cert-centre { display: flex; gap: 28px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 10px 0 16px; }
.cert-insigne { text-align: center; }
.cert-palier { font-family: var(--titre); font-weight: 700; font-size: 1.15rem; margin: .3em 0; }
.cert-note { min-width: 260px; }
.cert-note small { font-size: 1rem; color: var(--gris); }
.echelle { list-style: none; display: flex; gap: 4px; padding: 0; margin: 8px 0 0; font-size: .74rem; flex-wrap: wrap; }
.echelle li { padding: 2px 6px; border-radius: 999px; background: #eee6d6; color: var(--gris); }
.echelle li.actif { background: var(--encre); color: #fff; font-weight: 700; }
.cert-conseil { border-top: 1px solid var(--trait); padding-top: 10px; }
.cert-conseil h2 { font-size: 1.1rem; }
.cert-pied { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--trait); padding-top: 10px; margin-top: 14px; font-size: .82rem; color: var(--gris); }

/* ---------------------------------------------------------------- espace prof */
.connexion { max-width: 560px; margin: 30px auto; }
.liste-seances .code, .code-geant { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .15em; }
.actions-ligne { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions-ligne form { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.pastille { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.pastille.en_cours { background: var(--ok-bg); color: var(--ok); }
.pastille.a_venir { background: #e6f0f8; color: var(--ciel); }
.pastille.terminee { background: #eee; color: var(--gris); }
.tete-seance { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.code-bloc { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.code-geant { font-size: 2.6rem; font-weight: 800; color: var(--encre); }
.projection { position: fixed; inset: 0; background: var(--encre); color: #fff; z-index: 100; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.projection p { font-size: 1.8rem; margin: .2em; }
.proj-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2.2rem !important; color: #ffe7a8; word-break: break-all; }
.proj-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: clamp(4rem, 16vw, 11rem) !important; font-weight: 800; letter-spacing: .15em; }
.projection .petit { color: #b8c4cc; font-size: 1rem !important; }
.barre-outils { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.chiffre { display: flex; flex-direction: column; margin: 0; }
.chiffre strong { font-size: 2rem; font-family: var(--titre); }
.barre { display: inline-block; width: 90px; height: 9px; border-radius: 999px; background: #ece4d5; vertical-align: middle; overflow: hidden; }
.barre span { display: block; height: 100%; }
.barre.bon span { background: var(--ok); } .barre.moyen span { background: var(--moy); } .barre.faible span { background: var(--ko); } .barre.neutre span { background: #bbb; }
.puce { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.puce.verte { background: var(--sapin); } .puce.bleue { background: var(--ciel); } .puce.rouge { background: var(--rouge); } .puce.noire { background: var(--noir); } .puce.refuge { background: var(--or); }
.stats-questions .ligne-q { cursor: pointer; }
.stats-questions .ligne-q:hover { background: #faf6ee; }
.stats-questions .libelle { max-width: 520px; }
.detail-el { font-size: .88rem; }
.detail-el .attendu { color: var(--ok); font-weight: 600; }
.erreurs { margin: 0; padding-left: 1em; }
.erreurs .nb { font-weight: 800; color: var(--ko); }
.stat-rapide { margin-left: auto; font-size: .8rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #eee; }
.stat-rapide.bon { background: var(--ok-bg); color: var(--ok); } .stat-rapide.moyen { background: var(--moy-bg); color: var(--moy); } .stat-rapide.faible { background: var(--ko-bg); color: var(--ko); }
.stat-rapide:empty { display: none; }
.q-prof .q-pts { margin-left: 0; }
.bloc-piste { margin: 22px 0; }
.bloc-piste > h2 { display: flex; align-items: center; gap: 8px; border-bottom: 3px solid var(--c, #999); padding-bottom: 6px; }
.q-prof { background: var(--papier); border: 1px solid var(--trait); border-left: 6px solid var(--c, #999); border-radius: var(--rayon); padding: 14px 18px; margin: 12px 0; box-shadow: var(--ombre); }
.reponse-prof { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--ok-bg); border: 1px solid #b9dcc6; }
.reponse-prof h4 { margin: .2em 0; }
.stats-q { margin-top: 10px; }
.trou-vide { display: inline-block; min-width: 4.5em; border-bottom: 2px solid var(--gris); text-align: center; color: var(--gris); font-size: .8rem; font-weight: 800; }
.banque.statique .bloc { cursor: default; }
.options-statiques { padding-left: 1.2em; }
.ordre.statique li { cursor: default; }
.ordre.statique li::before { content: '•'; }
.phrases { font-size: .92rem; }
.intro-prof summary { cursor: pointer; font-weight: 700; color: var(--gris); }
.dossier-prof { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
body.sans-stats .stats-q, body.sans-stats .stat-rapide { display: none; }
body.projection-on { font-size: 21px; }
body.projection-on .bandeau, body.projection-on .pied, body.projection-on .tete-correction { display: none; }
body.projection-on .page { max-width: 1500px; }
body.projection-on .stats-q { display: none; }
body.projection-on .q-prof { box-shadow: none; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 820px) {
  .deux-colonnes, .refuge-grille { grid-template-columns: 1fr; }
  .dossier { position: static; max-height: none; }
  .ligne-syllo { grid-template-columns: 1fr; gap: 4px; }
  .chiffres { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .chiffre strong { font-size: 1.4rem; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .page { padding: 12px 12px 30px; }
  .hero { flex-direction: column; text-align: center; padding: 14px; }
  .hero svg { width: 80px; height: 80px; }
  .marque svg { width: 40px; height: 40px; }
  .marque small { display: none; }
  .q { padding: 14px; }
  .trou { min-width: 6.5em; }
  .piste { flex-wrap: wrap; }
  .piste .btn { width: 100%; justify-content: center; }
  .cert-tete { flex-direction: column; }
  .cert-bord { padding: 16px; }
  .grille-stations, .defs { grid-template-columns: 1fr; }
  .actions .btn { flex: 1; justify-content: center; }
  .btn { white-space: nowrap; }
}

/* ---------------------------------------------------------------- impression du certificat (A4) */
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff; }
  .bandeau, .pied, .ariane, .no-print, .nav { display: none !important; }
  .page { padding: 0; max-width: none; }
  .certificat { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .certificat, .cert-bord { break-inside: avoid; page-break-inside: avoid; }
  .cert-bord { padding: 12mm 12mm; height: 262mm; box-sizing: border-box; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
  .cert-centre { flex-wrap: nowrap; }
  .cert-attribue { margin: 5mm 0; line-height: 1.55; }
  .cert-pied { flex-direction: column; gap: 2px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------------------------------------------------------- tournée du stagiaire */
.etape { background: #eef5fb; border-left: 5px solid var(--ciel); border-radius: 10px; padding: 8px 14px; margin: 8px 0; }
.etape p { margin: .2em 0; }
.mission { margin: 8px 0; font-weight: 600; }
.mission .etiq { margin-right: 6px; }
.lieu { margin: 0 0 .3em !important; }
.recompense { margin-top: 10px; font-weight: 600; }
.rappel-contexte { background: var(--papier); border: 1px dashed #c9bfae; border-radius: var(--rayon); padding: 8px 16px; margin: 10px 0; }
.rappel-contexte summary { cursor: pointer; font-weight: 700; color: var(--gris); }
.rappel-contexte[open] summary { margin-bottom: 6px; }

/* QR code de séance */
.qr svg { display: block; width: 100%; height: 100%; }
.qr-petit { width: 150px; height: 150px; background: #fff; border-radius: 8px; padding: 4px; }
.proj-grille { display: flex; gap: 6vw; align-items: center; justify-content: center; flex-wrap: wrap; }
.proj-qr { text-align: center; }
.qr-grand { width: min(62vh, 42vw); height: min(62vh, 42vw); background: #fff; border-radius: 16px; padding: 10px; margin: 0 auto; }
.proj-qr p { font-size: 1.3rem !important; color: #b8c4cc; }
.proj-texte { text-align: center; }
.proj-fermer { position: absolute; bottom: 14px; left: 0; right: 0; }
.projection .proj-code { font-size: clamp(3rem, 9vw, 7rem) !important; }
.projection .proj-url { font-size: 1.6rem !important; }

/* code personnel de reprise */
.code-perso { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: #fff8e6; border: 1px solid #efd7a9; border-radius: 12px; padding: 8px 14px; margin: 0 0 14px; }
.code-perso-icone { font-size: 1.3rem; }
.code-perso-valeur { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .12em; font-size: 1.08em; background: #fff; border: 1px dashed #b8862b; border-radius: 6px; padding: 1px 7px; }
.etat-code { font-size: .8rem; color: var(--gris); margin-left: 4px; }
.etat-code.ok { color: var(--ok); font-weight: 700; }
.code-perso .petit { flex-basis: 100%; }
.code-perso-saisie { width: 11em; }
.reprise .deux-colonnes { align-items: end; }
@media print { .code-perso { display: none !important; } }
