:root {
  --papier: #edf0ec;
  --surface: #f8faf7;
  --encre: #1e2b2a;
  --encre-douce: #4f5f5c;
  --trait: #cdd5cf;
  --pin: #245146;
  --pin-clair: #dce8e3;
  --conforme: #2e8b57;
  --en-cours: #c9931a;
  --a-faire: #c3ccc6;
  --na: #8a9692;
  --alerte: #b3412f;
  --focus: #3346b8;
  --rayon: 10px;
  --titre: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --texte: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #141b1a; --surface: #1c2523; --encre: #e4ebe7; --encre-douce: #a3b1ac;
    --trait: #33403d; --pin: #7fc2ab; --pin-clair: #23332f; --conforme: #4fbf83;
    --en-cours: #e2b244; --a-faire: #3b4845; --na: #6f7d79; --alerte: #e47a66; --focus: #9aa7ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papier); color: var(--encre);
  font: 17px/1.55 var(--texte);
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
h1, h2, h3 { font-family: var(--titre); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--pin); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muet { color: var(--encre-douce); }
.petit { font-size: .88rem; }
[hidden] { display: none !important; }

/* ---------- Barre haute & navigation ---------- */
.barre {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1rem; background: var(--papier);
  border-bottom: 1px solid var(--trait);
}
.marque { font-family: var(--titre); font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--encre); margin-right: auto; }
.nav { display: flex; gap: .25rem; }
.nav a {
  text-decoration: none; color: var(--encre-douce); padding: .45rem .8rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
}
.nav a[aria-current="page"] { background: var(--pin-clair); color: var(--pin); }
.btn-lien { background: none; border: 0; color: var(--encre-douce); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; padding: .3rem; }

@media (max-width: 720px) {
  .barre .nav {
    position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--trait);
    padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
  }
  .nav a { flex: 1; text-align: center; }
}
@media (min-width: 721px) { body { padding-bottom: 0; } }

.hors-ligne {
  background: var(--en-cours); color: #1e1a0e; text-align: center; padding: .4rem 1rem; font-weight: 700; font-size: .9rem;
}

main:focus { outline: none; }
main { max-width: 980px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* ---------- Composants de formulaire ---------- */
label { display: block; font-weight: 700; margin-bottom: .3rem; }
.aide { display: block; font-weight: 400; color: var(--encre-douce); font-size: .88rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--encre); background: var(--surface);
  border: 1.5px solid var(--trait); border-radius: 8px; padding: .6rem .75rem;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pin); outline: none; box-shadow: 0 0 0 3px var(--pin-clair); }
.champ { margin-bottom: 1.1rem; }
.grille-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille-2 { grid-template-columns: 1fr 1fr; } }
.case { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-bottom: .6rem; cursor: pointer; }
.case input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; accent-color: var(--pin); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: 700 1rem var(--texte); border-radius: 8px; padding: .65rem 1.1rem; cursor: pointer;
  border: 1.5px solid var(--pin); background: var(--pin); color: var(--surface); text-decoration: none;
}
.btn.secondaire { background: transparent; color: var(--pin); }
.btn.danger { background: transparent; color: var(--alerte); border-color: transparent; padding-inline: .5rem; }
.btn:disabled { opacity: .55; cursor: progress; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

.bloc { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.25rem; margin-bottom: 1.25rem; }
fieldset.bloc { min-width: 0; }
fieldset.bloc legend { font-family: var(--titre); font-weight: 650; font-size: 1.1rem; padding: 0 .4rem; }

.message { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; border-left: 4px solid var(--pin); background: var(--pin-clair); }
.message.erreur { border-color: var(--alerte); background: color-mix(in srgb, var(--alerte) 12%, var(--surface)); }
.message.attention { border-color: var(--en-cours); background: color-mix(in srgb, var(--en-cours) 14%, var(--surface)); }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--encre); color: var(--papier); padding: .6rem 1.1rem; border-radius: 999px; font-weight: 700;
  z-index: 50; max-width: calc(100vw - 2rem);
}
@media (min-width: 721px) { .toast { bottom: 1.5rem; } }

/* ---------- Écrans d'accès ---------- */
.acces { max-width: 440px; margin: 8vh auto 0; padding: 0 1rem; }
.acces h1 { font-size: 2.2rem; }

/* ---------- Tableau de bord : la frise des indicateurs ---------- */
.entete-tableau { display: grid; gap: 1rem; grid-template-columns: 1fr auto; align-items: end; margin-bottom: 1.25rem; }
.entete-tableau h1 { margin: 0; }
.score { text-align: right; font-family: var(--titre); }
.score strong { display: block; font-size: 3.2rem; line-height: 1; font-weight: 750; color: var(--pin); }
.score span { font-size: .85rem; color: var(--encre-douce); }

.frise {
  display: grid; gap: 6px; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .9rem; margin-bottom: .6rem;
}
.frise-critere { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.frise-critere > a.etiquette {
  font-family: var(--titre); font-weight: 700; font-size: .8rem; color: var(--encre-douce);
  text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid var(--trait); margin-bottom: 2px;
}
.frise-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); gap: 4px; }
.cellule {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 6px;
  font: 700 .78rem var(--titre); text-decoration: none; color: var(--encre);
  background: var(--a-faire);
}
.cellule.conforme { background: var(--conforme); color: #fff; }
.cellule.en_cours { background: var(--en-cours); color: #1e1a0e; }
.cellule.non_applicable {
  background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--na) 35%, transparent) 4px 6px);
  color: var(--na); box-shadow: inset 0 0 0 1px var(--trait);
}
@media (max-width: 720px) {
  .frise { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .frise { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.legende { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .85rem; color: var(--encre-douce); margin-bottom: 1.75rem; }
.legende span::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; background: var(--a-faire); }
.legende .l-conforme::before { background: var(--conforme); }
.legende .l-en_cours::before { background: var(--en-cours); }
.legende .l-na::before { background: repeating-linear-gradient(135deg, transparent 0 2px, var(--na) 2px 3px); box-shadow: inset 0 0 0 1px var(--trait); }

.filtres { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtres button {
  font: 700 .88rem var(--texte); border: 1.5px solid var(--trait); background: transparent; color: var(--encre-douce);
  border-radius: 999px; padding: .35rem .8rem; cursor: pointer;
}
.filtres button[aria-pressed="true"] { border-color: var(--pin); color: var(--pin); background: var(--pin-clair); }

.critere { margin-bottom: 2rem; scroll-margin-top: 4.5rem; }
.critere-titre { display: grid; grid-template-columns: auto 1fr; gap: .2rem .9rem; align-items: baseline; margin-bottom: .6rem; }
.critere-titre .num { font: 750 2.4rem/1 var(--titre); color: var(--pin); grid-row: span 2; }
.critere-titre h2 { margin: 0; font-size: 1.05rem; }

.ligne {
  display: grid; grid-template-columns: 3rem 1fr auto; gap: .9rem; align-items: center;
  padding: .8rem .9rem; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--trait); border-radius: 8px; margin-bottom: 6px;
  border-left: 5px solid var(--a-faire);
}
.ligne:hover { border-color: var(--pin); border-left-color: inherit; }
.ligne.conforme { border-left-color: var(--conforme); }
.ligne.en_cours { border-left-color: var(--en-cours); }
.ligne.non_applicable { border-left-color: var(--na); opacity: .72; }
.ligne .n { font: 750 1.5rem var(--titre); text-align: center; color: var(--encre-douce); }
.ligne .t { min-width: 0; }
.ligne .t p { margin: 0; }
.puces { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.puce { font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--papier); color: var(--encre-douce); border: 1px solid var(--trait); }
.puce.evol { border-color: var(--focus); color: var(--focus); }
.puce.ne { border-color: var(--pin); color: var(--pin); }
.statut { font-size: .82rem; font-weight: 700; white-space: nowrap; color: var(--encre-douce); }
@media (max-width: 560px) {
  .ligne { grid-template-columns: 2.2rem 1fr; }
  .ligne .statut { grid-column: 2; }
}

/* ---------- Fiche indicateur ---------- */
.fil { font-size: .92rem; margin-bottom: 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.fiche-entete { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start; margin-bottom: 1.25rem; }
.gros-num {
  font: 800 5rem/0.85 var(--titre); color: transparent; -webkit-text-stroke: 2px var(--pin);
  min-width: 2ch; text-align: center;
}
@supports not (-webkit-text-stroke: 2px red) { .gros-num { color: var(--pin); } }
.fiche-entete h1 { font-size: 1.5rem; }
.evolution { border-left: 4px solid var(--focus); background: color-mix(in srgb, var(--focus) 9%, var(--surface)); padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; }

.segments { display: grid; grid-template-columns: repeat(4, 1fr); border: 1.5px solid var(--trait); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.segments label { margin: 0; font-weight: 700; text-align: center; padding: .7rem .3rem; cursor: pointer; font-size: .92rem; border-right: 1px solid var(--trait); }
.segments label:last-child { border-right: 0; }
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.segments label:has(input:checked) { background: var(--pin-clair); color: var(--pin); }
.segments label.s-conforme:has(input:checked) { background: var(--conforme); color: #fff; }
.segments label.s-en_cours:has(input:checked) { background: var(--en-cours); color: #1e1a0e; }
@media (max-width: 520px) { .segments { grid-template-columns: 1fr 1fr; } .segments label:nth-child(2) { border-right: 0; } .segments label:nth-child(-n+2) { border-bottom: 1px solid var(--trait); } }

details.ajout { margin-top: 1rem; }
details.ajout > summary { list-style: none; width: fit-content; margin-bottom: 1rem; }
details.ajout > summary::-webkit-details-marker { display: none; }
details.ajout[open] > summary { display: none; }
.depot { border: 2px dashed var(--trait); border-radius: var(--rayon); padding: 1rem; margin-bottom: 1rem; }
.depot.survol { border-color: var(--pin); background: var(--pin-clair); }

.preuve { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; padding: .85rem 0; border-top: 1px solid var(--trait); }
.preuve:first-child { border-top: 0; }
.preuve .meta { font-size: .82rem; color: var(--encre-douce); }
.preuve .outils { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.vide { text-align: center; padding: 1.25rem; color: var(--encre-douce); }

/* ---------- Dossier imprimable ---------- */
.dossier .couverture { border-bottom: 3px solid var(--encre); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.dossier table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .92rem; margin-bottom: 1.5rem; }
.dossier th, .dossier td { text-align: left; vertical-align: top; padding: .5rem .4rem; border-bottom: 1px solid var(--trait); }
.dossier th { font-family: var(--titre); }
.dossier .hash { font-size: .75rem; color: var(--encre-douce); word-break: break-all; }

@media print {
  :root { --papier: #fff; --surface: #fff; --encre: #000; --trait: #bbb; }
  .barre, .hors-ligne, .no-print, .toast { display: none !important; }
  body { padding: 0; font-size: 11pt; }
  main { max-width: none; padding: 0; }
  .dossier section { break-inside: avoid-page; }
  a { color: inherit; text-decoration: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .frise .cellule { transition: transform .12s; }
  .frise .cellule:hover { transform: scale(1.12); }
}

/* ---------- Ajustements petits écrans ---------- */
@media (max-width: 720px) {
  .nav a { white-space: nowrap; font-size: .88rem; padding: .5rem .35rem; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.6rem; }
  .entete-tableau { grid-template-columns: 1fr; gap: .5rem; }
  .score { text-align: left; display: flex; align-items: baseline; gap: .6rem; }
  .score strong { font-size: 2.4rem; display: inline; }
  .preuve { grid-template-columns: 1fr; }
  .preuve .outils { justify-content: flex-start; }
  .gros-num { font-size: 3.4rem; }
  .dossier table, .dossier tbody, .dossier tr, .dossier td { display: block; width: auto; }
  .dossier colgroup, .dossier thead { display: none; }
  .dossier tr { border-bottom: 1px solid var(--trait); padding: .5rem 0; }
  .dossier td { border: 0; padding: .15rem 0; }
}

/* ---------- Comptes et administration ---------- */
.lien-compte { color: var(--encre-douce); font-weight: 700; font-size: .92rem; text-decoration: none; padding: .45rem .6rem; border-radius: 999px; }
.lien-compte[aria-current="page"] { background: var(--pin-clair); color: var(--pin); }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.acces > p { margin-top: 1rem; }
.acces .actions a { font-size: .95rem; }
.table-defile { overflow-x: auto; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); }
.table-admin { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 760px; }
.table-admin th, .table-admin td { text-align: left; vertical-align: top; padding: .7rem .8rem; border-bottom: 1px solid var(--trait); }
.table-admin th { font-family: var(--titre); font-weight: 650; background: var(--papier); }
.table-admin tr:last-child td { border-bottom: 0; }
.table-admin tr.suspendu td { background: color-mix(in srgb, var(--alerte) 6%, transparent); }
.outils-admin { white-space: nowrap; text-align: right; }

/* ---------- Bandeau d'abonnement ---------- */
.bandeau { background: color-mix(in srgb, var(--en-cours) 22%, var(--surface)); padding: .55rem 1rem; text-align: center; font-weight: 700; font-size: .92rem; }
.bandeau.alerte { background: color-mix(in srgb, var(--alerte) 18%, var(--surface)); }

/* ---------- En-têtes et utilitaires ---------- */
.entete-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.entete-page h1 { margin: 0; }
.label-like { font-weight: 700; margin: 0 0 .5rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.danger-texte { color: var(--alerte); }
.ligne-champ { display: flex; gap: .6rem; }
.ligne-champ input { flex: 1; }
.nouvelle label { margin-bottom: .5rem; }

/* ---------- Catalogue ---------- */
.ligne.formation .n { font: 700 .85rem var(--titre); }
.ligne.formation.publiee { border-left-color: var(--conforme); }
.ligne.formation.brouillon { border-left-color: var(--en-cours); }
.ligne.formation.archivee { border-left-color: var(--na); opacity: .7; }

.edition { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  main:has(.edition) { max-width: 1180px; }
  .edition { grid-template-columns: minmax(0, 1fr) 290px; }
  .edition-cote { position: sticky; top: 4.5rem; }
}
.statut-fiche { border-top: 5px solid var(--en-cours); }
.statut-fiche.publiee { border-top-color: var(--conforme); }
.statut-fiche.archivee { border-top-color: var(--na); }
.etiquette-statut { font: 750 1.3rem var(--titre); margin: 0 0 .4rem; }
.manque { margin: 0 0 1rem; padding-left: 1.2rem; font-size: .9rem; color: var(--encre-douce); }
.pile { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.pile .btn-lien { text-align: left; padding: .35rem 0; }

.module { border: 1px solid var(--trait); border-radius: 8px; padding: .7rem; margin-bottom: .6rem; background: var(--papier); }
.module-tete { display: flex; gap: .4rem; align-items: center; margin-bottom: .5rem; }
.module-tete input[data-m="titre"] { flex: 1; font-weight: 700; }
.module-tete .court { width: 4.2rem; flex: none; text-align: center; }
.module-num { font: 750 1.1rem var(--titre); color: var(--pin); min-width: 1.4rem; text-align: center; }
.module textarea { min-height: 3.2rem; margin-bottom: .4rem; }
.btn-icone { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 6px; border: 1.5px solid var(--trait); background: var(--surface); color: var(--encre-douce); cursor: pointer; font-size: .95rem; }
.btn-icone:hover { border-color: var(--pin); color: var(--pin); }
.btn-icone.danger:hover { border-color: var(--alerte); color: var(--alerte); }

/* ---------- Équipe ---------- */
.liste-membres { padding: 0 1.25rem; }
.membre { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--trait); flex-wrap: wrap; }
.membre:first-child { border-top: 0; }
.membre .outils { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.membre select { width: auto; padding: .4rem .6rem; }
.puce.attente { border-color: var(--en-cours); color: color-mix(in srgb, var(--en-cours) 70%, var(--encre)); }

/* ---------- Compte et abonnement ---------- */
.raccourcis { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.25rem; }
.raccourci { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: inherit; margin: 0; }
.raccourci:hover { border-color: var(--pin); }
.etat-abo { border-left: 5px solid var(--conforme); }
.etat-abo.bloque { border-left-color: var(--alerte); }
.formules { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 1rem; }
.formule { background: var(--surface); border: 1.5px solid var(--trait); border-radius: var(--rayon); padding: 1.25rem; display: flex; flex-direction: column; gap: .4rem; }
.formule.courante { border-color: var(--pin); background: var(--pin-clair); }
.formule h3 { margin: 0; }
.formule .prix { font: 750 1.6rem var(--titre); color: var(--pin); margin: 0; }
.formule .btn { margin-top: auto; }

/* ---------- Explications et guide ---------- */
.comprendre { border-left: 5px solid var(--pin); }
.comprendre h2 { font-size: 1.15rem; }
.comprendre h3 { font-size: .98rem; margin: 1rem 0 .3rem; }
.comprendre ul, .guide-ind ul { margin: 0 0 .5rem; padding-left: 1.2rem; }
.officiel summary, .explication-critere summary { cursor: pointer; font-weight: 700; color: var(--pin); }
.explication-critere { margin: -.2rem 0 .8rem 3.3rem; font-size: .95rem; }
.explication-critere p { margin: .4rem 0 0; color: var(--encre-douce); max-width: 70ch; }
.sans-marge { margin: 0; }
.guide .intro-guide p { max-width: 75ch; }
.guide .sommaire ol { margin: 0; padding-left: 1.2rem; }
.guide .sommaire li { margin: .2rem 0; }
.guide-critere { margin: 2.5rem 0 1rem; scroll-margin-top: 4.5rem; }
.guide-critere > h2 { display: flex; gap: .8rem; align-items: baseline; font-size: 1.35rem; }
.guide-critere > h2 .num { font: 750 2.4rem/1 var(--titre); color: var(--pin); }
.guide-critere .chapeau { font-size: 1.05rem; max-width: 75ch; }
.guide-ind { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.1rem 1.25rem; margin-bottom: .75rem; }
.guide-ind.hors { opacity: .6; }
.guide-ind h3 { display: flex; gap: .6rem; align-items: baseline; margin-bottom: .3rem; }
.guide-num { font: 750 1.3rem var(--titre); color: var(--pin); min-width: 1.8rem; }
.guide-ind p { max-width: 75ch; }
@media print { .guide-ind { break-inside: avoid; } .guide-critere { break-before: page; } }

/* ---------- Navigation : défilement horizontal sur petit écran ---------- */
@media (max-width: 720px) {
  .barre .nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: .1rem; }
  .barre .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  .nav a { padding: .45rem .55rem; font-size: .9rem; }
}

/* ---------- Registres ---------- */
.intro-page { max-width: 75ch; }
.groupe-registres { margin-top: 1.75rem; font-size: 1.05rem; color: var(--encre-douce); }
.cartes-registres { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.carte-registre { display: flex; flex-direction: column; gap: .4rem; text-decoration: none; color: inherit; margin: 0; }
.carte-registre:hover { border-color: var(--pin); }
.carte-tete { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.compteur { font: 750 1.4rem var(--titre); color: var(--pin); }
.aide-registre { border-left: 5px solid var(--pin); }
.aide-registre p { max-width: 75ch; }
.aide-inline { font-weight: 400; color: var(--encre-douce); font-size: .82rem; }
.ajout-registre > summary { list-style: none; width: fit-content; }
.ajout-registre > summary::-webkit-details-marker { display: none; }
.ajout-registre[open] > summary { margin-bottom: 1rem; }
.grille-registre { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille-registre { grid-template-columns: 1fr 1fr; } .grille-registre .champ-large { grid-column: 1 / -1; } }
.table-registre { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table-registre th, .table-registre td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
.table-registre th { font-family: var(--titre); background: var(--papier); }
.table-registre tbody tr { cursor: pointer; }
.table-registre tbody tr:hover td { background: var(--pin-clair); }
.table-registre tr:last-child td { border-bottom: 0; }
.criticite { display: inline-block; min-width: 2rem; text-align: center; font-weight: 700; border-radius: 6px; padding: .05rem .4rem; }
.criticite.basse { background: color-mix(in srgb, var(--conforme) 20%, var(--surface)); }
.criticite.moyenne { background: color-mix(in srgb, var(--en-cours) 30%, var(--surface)); }
.criticite.haute { background: color-mix(in srgb, var(--alerte) 25%, var(--surface)); }
.sous-registre details > summary { list-style: none; width: fit-content; margin-top: .75rem; }
.sous-registre details > summary::-webkit-details-marker { display: none; }
.ligne-enfant { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; padding: .6rem 0; border-top: 1px solid var(--trait); text-decoration: none; color: inherit; }
.ligne-enfant:hover { color: var(--pin); }
.ligne-enfant span:first-child { font-weight: 700; }

/* ---------- Sessions ---------- */
.ligne.session.planifiee, .ligne.session.confirmee { border-left-color: var(--en-cours); }
.ligne.session.en_cours { border-left-color: var(--pin); }
.ligne.session.terminee { border-left-color: var(--conforme); }
.ligne.session.annulee, .ligne.stagiaire.annulee, .ligne.stagiaire.abandon { border-left-color: var(--na); opacity: .7; }
.ligne.stagiaire { grid-template-columns: 1fr auto; border-left-color: var(--pin); }
.ligne.stagiaire.terminee { border-left-color: var(--conforme); }
.puce.ok { border-color: var(--conforme); color: color-mix(in srgb, var(--conforme) 75%, var(--encre)); }
.puce.manque { border-color: var(--en-cours); color: color-mix(in srgb, var(--en-cours) 70%, var(--encre)); }
.statut-select { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.statut-select select { width: auto; }
.creneaux { display: flex; flex-direction: column; gap: .2rem; margin-bottom: 1rem; }
.creneaux input[type=time] { width: auto; padding: .3rem .4rem; }
.creneaux .case { align-items: center; flex-wrap: wrap; }
.cartes-docs { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.carte-doc { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: inherit; margin: 0; padding: .9rem 1rem; }
.carte-doc:hover { border-color: var(--pin); }
.envoi { border-top: 1px solid var(--trait); padding: .6rem 0; }
.envoi summary { cursor: pointer; }
.envoi-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--trait); }
.ajout-stagiaire > summary, section details > summary.btn-lien { list-style: none; width: fit-content; margin-top: .75rem; cursor: pointer; }
.ajout-stagiaire > summary::-webkit-details-marker { display: none; }
.liens { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.liens li { display: grid; grid-template-columns: minmax(8rem, auto) 1fr; gap: .5rem; align-items: center; }
.liens input { font-size: .82rem; padding: .35rem .5rem; }
.reponse { padding: .6rem 0; border-top: 1px solid var(--trait); }
.reponse:first-child { border-top: 0; }
.reponse p { margin: 0 0 .2rem; }
.periode { align-items: center; flex-wrap: wrap; }
.periode input { width: auto; }
.q-reglages { flex-wrap: wrap; align-items: center; margin-bottom: .4rem; }
.q-reglages select { width: auto; }
.q-reglages .case { margin: 0; }

/* ---------- Émargement ---------- */
.titre-emarg { font-size: 1.5rem; }
.titre-emarg .muet { font-size: 1.05rem; font-weight: 600; }
.liste-emarg { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.5rem; }
.carte-emarg { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--trait); border-left: 6px solid var(--a-faire); border-radius: 10px; padding: .9rem 1rem; }
.carte-emarg.present, .carte-emarg.retard, .carte-emarg.depart_anticipe { border-left-color: var(--conforme); }
.carte-emarg.absent, .carte-emarg.excuse { border-left-color: var(--alerte); }
.carte-emarg.exclu { opacity: .55; }
.emarg-nom { display: flex; flex-direction: column; font-size: 1.1rem; }
.emarg-actions { display: flex; gap: .5rem; align-items: center; }
.emarg-actions .btn { min-width: 7.5rem; min-height: 3rem; font-size: 1.05rem; }
.emarg-actions select { width: auto; }
.modale-fond { position: fixed; inset: 0; background: rgb(0 0 0 / .55); z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modale { background: var(--surface); border-radius: 14px; padding: 1.25rem; width: min(680px, 100%); }
.pad { display: block; width: 100%; height: 230px; background: #fff; border: 2px dashed var(--trait); border-radius: 10px; touch-action: none; margin-bottom: 1rem; cursor: crosshair; }
.acces.large { max-width: 680px; }

/* ---------- Questionnaire public ---------- */
.questionnaire-public .q-public legend { font-weight: 700; font-family: var(--texte); font-size: 1.02rem; padding: 0 .3rem; }
.choix { display: flex; flex-wrap: wrap; gap: .5rem; }
.choix.vertical { flex-direction: column; }
.choix label { margin: 0; font-weight: 400; cursor: pointer; }
.choix input { position: absolute; opacity: 0; }
.choix span { display: inline-block; padding: .55rem 1rem; border: 1.5px solid var(--trait); border-radius: 999px; background: var(--surface); }
.choix.vertical span { border-radius: 8px; width: 100%; }
.choix.notes span { min-width: 3rem; text-align: center; font-weight: 700; }
.choix input:checked + span { border-color: var(--pin); background: var(--pin-clair); color: var(--pin); font-weight: 700; }
.choix input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.echelle-leg { display: flex; justify-content: space-between; max-width: 18rem; margin: .3rem 0 0; }

/* ---------- Documents imprimables ---------- */
.documents { display: flex; flex-direction: column; gap: 1.5rem; }
.page-doc { background: #fff; color: #111; padding: 2.2rem 2.4rem; border: 1px solid var(--trait); border-radius: 6px; font-size: .95rem; line-height: 1.5; max-width: 800px; }
.page-doc h2 { font-size: 1.02rem; margin: 1.1rem 0 .3rem; }
.page-doc p { margin: 0 0 .6rem; }
.doc-entete { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #111; padding-bottom: .8rem; margin-bottom: 1.4rem; font-size: .88rem; }
.doc-entete > div:last-child { text-align: right; }
.doc-titre { font-size: 1.5rem; margin: 0 0 .4rem; }
.doc-dest { text-align: right; margin-bottom: 1.5rem; }
.doc-table { width: 100%; border-collapse: collapse; margin: .8rem 0 1.2rem; }
.doc-table th, .doc-table td { border: 1px solid #999; padding: .45rem .6rem; text-align: left; vertical-align: middle; }
.cell-sig { width: 45%; height: 3.6rem; }
.cell-sig img { max-height: 3.2rem; max-width: 100%; }
.doc-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.5rem; }
.zone-sig { height: 5rem; border-bottom: 1px solid #999; margin-top: .4rem; }
.zone-sig img { max-height: 4.6rem; }
@media print {
  body:has(.documents) main > *:not(.documents):not(.editeur-modele) { display: none; }
  .editeur-modele { display: block !important; }
  .apercu-modele { display: block !important; }
  mark.a-completer { background: none !important; border-bottom: 1px dotted #555; color: transparent; padding: 0 2.5em; }
  .documents { gap: 0; }
  .page-doc { border: 0; padding: 0; max-width: none; break-after: page; }
  .page-doc:last-child { break-after: auto; }
}

/* ---------- Modèles ---------- */
.sommaire-params { cursor: pointer; }
.cartes-modeles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.carte-modele { display: flex; flex-direction: column; gap: .45rem; text-decoration: none; color: inherit; margin: 0; border-top: 4px solid var(--a-faire); }
.carte-modele:hover { border-color: var(--pin); }
.carte-modele.brouillon, .carte-modele.modifie { border-top-color: var(--en-cours); }
.carte-modele.valide { border-top-color: var(--conforme); }
.etat-modele { font-size: .82rem; font-weight: 700; color: var(--encre-douce); white-space: nowrap; }
mark.a-completer { background: color-mix(in srgb, var(--en-cours) 38%, #fff); color: #1e1a0e; border-radius: 3px; padding: 0 .2em; }
main:has(.editeur-modele) { max-width: 1320px; }
.onglets-editeur { display: flex; gap: .3rem; margin-bottom: .6rem; }
.editeur-modele { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) {
  .editeur-modele { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .onglets-editeur { display: none; }
  .apercu-modele { position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow: auto; }
}
@media (max-width: 999px) {
  .editeur-modele[data-vue="apercu"] > section:first-child .zone-texte,
  .editeur-modele[data-vue="apercu"] > section:first-child .aide-syntaxe,
  .editeur-modele[data-vue="apercu"] > section:first-child .actions,
  .editeur-modele[data-vue="apercu"] > section:first-child .options-modele { display: none; }
  .editeur-modele:not([data-vue="apercu"]) .apercu-modele { display: none; }
}

.onglets-editeur button { font: 700 .92rem var(--texte); border: 1.5px solid var(--trait); background: transparent; color: var(--encre-douce); border-radius: 999px; padding: .4rem 1rem; cursor: pointer; }
.onglets-editeur button[aria-selected="true"] { border-color: var(--pin); background: var(--pin-clair); color: var(--pin); }
.zone-texte { min-height: 60vh; font: .92rem/1.6 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; tab-size: 2; }
.aide-syntaxe code { background: var(--papier); padding: 0 .25em; border-radius: 3px; }
.options-modele { margin-top: 1rem; }
.options-modele summary { cursor: pointer; }
.versions { padding-left: 1.2rem; margin: .3rem 0 0; }
.page-doc h1 { font-size: 1.45rem; margin: 0 0 .8rem; }
.page-doc h3 { font-size: .98rem; margin: .9rem 0 .3rem; }
.page-doc ul, .page-doc ol { margin: 0 0 .7rem; padding-left: 1.3rem; }
.page-doc li { margin-bottom: .2rem; }
.page-doc table { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; font-size: .9rem; }
.page-doc th, .page-doc td { border: 1px solid #999; padding: .35rem .5rem; text-align: left; vertical-align: top; }
.page-doc th { background: #f1f1f1; }

/* ---------- Bilans de compétences ---------- */
.ligne.bilan.a_venir { border-left-color: var(--en-cours); }
.ligne.bilan.en_cours { border-left-color: var(--pin); }
.ligne.bilan.termine { border-left-color: var(--conforme); }
.ligne.bilan.abandonne, .ligne.bilan.annule { border-left-color: var(--na); opacity: .75; }
.ligne.bilan .n { font: 700 .82rem var(--titre); }
.puce.alerte { border-color: var(--alerte); color: var(--alerte); }

.entete-bilan { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.entete-bilan h1 { margin: 0 0 .2rem; }
.etiquette-bilan { font: 700 .85rem var(--texte); padding: .3rem .8rem; border-radius: 999px; background: var(--pin-clair); color: var(--pin); white-space: nowrap; }
.etiquette-bilan.a_venir { background: color-mix(in srgb, var(--en-cours) 22%, var(--surface)); color: color-mix(in srgb, var(--en-cours) 60%, var(--encre)); }
.etiquette-bilan.termine { background: var(--conforme); color: #fff; }
.etiquette-bilan.abandonne, .etiquette-bilan.annule { background: var(--papier); color: var(--encre-douce); border: 1px solid var(--trait); }

/* Les trois phases */
.phases-bilan { list-style: none; padding: 0; margin: 0 0 .9rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; counter-reset: none; }
.phases-bilan li { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; background: var(--surface); border: 1px solid var(--trait); font-weight: 700; font-size: .92rem; color: var(--encre-douce); }
.phases-bilan li:first-child { border-radius: 8px 0 0 8px; }
.phases-bilan li:last-child { border-radius: 0 8px 8px 0; }
.phase-num { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid currentColor; font: 750 .85rem var(--titre); flex: none; }
.phases-bilan li.courante { background: var(--pin-clair); color: var(--pin); border-color: var(--pin); }
.phases-bilan li.faite { color: var(--conforme); }
.phases-bilan li.faite .phase-num { background: var(--conforme); border-color: var(--conforme); color: #fff; }
@media (max-width: 520px) { .phases-bilan li { flex-direction: column; text-align: center; gap: .25rem; font-size: .8rem; padding: .5rem .3rem; } }

/* Jauge des 24 heures */
.jauge-24 { margin-bottom: 1.25rem; }
.jauge-piste { position: relative; height: 14px; border-radius: 999px; background: var(--trait); overflow: visible; }
.jauge-piste span { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; }
.j-plan { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--pin) 45%, transparent) 0 5px, color-mix(in srgb, var(--pin) 25%, transparent) 5px 10px); }
.j-fait { background: var(--pin); }
.j-prevue { width: 3px; top: -4px !important; bottom: -4px !important; background: var(--encre); border-radius: 2px !important; transform: translateX(-1.5px); }
.jauge-legende { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; font-size: .85rem; color: var(--encre-douce); margin-top: .45rem; }
.jauge-legende strong { color: var(--encre); font-family: var(--titre); font-size: 1.05rem; }

/* Onglets du dossier */
.onglets-bilan { display: flex; gap: .3rem; margin: 1.25rem 0 1rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--trait); }
.onglets-bilan button { font: 700 .95rem var(--texte); border: 0; border-bottom: 3px solid transparent; background: none; color: var(--encre-douce); padding: .55rem .8rem; cursor: pointer; white-space: nowrap; }
.onglets-bilan button[aria-selected="true"] { color: var(--pin); border-bottom-color: var(--pin); }

/* Conformité légale */
.conformite { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .conformite { grid-template-columns: 1fr 1fr; } }
.conformite li { display: grid; grid-template-columns: 1.6rem 1fr; gap: .6rem; padding: .55rem 0; border-top: 1px solid var(--trait); }
.conformite .coche { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; border: 2px solid var(--a-faire); font-weight: 800; font-size: .85rem; margin-top: .1rem; }
.conformite li.ok .coche { background: var(--conforme); border-color: var(--conforme); color: #fff; }
.conformite li.manque .coche { border-color: var(--en-cours); }

.demarrage .etape-doc { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: .9rem 0; border-top: 1px solid var(--trait); }
.demarrage .etape-doc > div:first-child { flex: 1 1 22rem; }
.demarrage .etape-doc h3 { margin-bottom: .2rem; }
.demarrage .etape-doc.faite h3::after { content: " ✓"; color: var(--conforme); }
.texte-consentement { background: var(--papier); border-radius: 8px; padding: .8rem 1rem; margin: .5rem 0 1rem; font-size: .93rem; max-height: 22rem; overflow: auto; }
.texte-consentement ul { padding-left: 1.2rem; margin: .3rem 0 0; }
.texte-consentement li { margin-bottom: .3rem; }
.page-doc .texte-consentement { max-height: none; background: none; padding: 0; font-size: inherit; }

.table-seances tr.annulee td, .table-seances tr.absence td { color: var(--encre-douce); text-decoration: line-through; text-decoration-color: var(--trait); }
.table-seances td .btn { padding: .4rem .8rem; font-size: .9rem; }
.puce.phase-preliminaire { border-color: var(--en-cours); }
.puce.phase-investigation { border-color: var(--focus); }
.puce.phase-conclusions { border-color: var(--conforme); }
.ajout-seance > summary { list-style: none; width: fit-content; margin-top: 1rem; cursor: pointer; }
.ajout-seance > summary::-webkit-details-marker { display: none; }

/* Notes privées : visuellement à part */
.notes-privees { border: 1.5px dashed color-mix(in srgb, var(--alerte) 55%, var(--trait));
  background: repeating-linear-gradient(135deg, var(--surface) 0 18px, color-mix(in srgb, var(--alerte) 3%, var(--surface)) 18px 36px); }
.cadenas { display: inline-block; font: 700 .78rem var(--texte); color: var(--alerte); border: 1px solid currentColor; border-radius: 999px; padding: .1rem .55rem; vertical-align: middle; margin-left: .3rem; }
.cadenas::before { content: "🔒 "; }
.note-options select { width: auto; flex: 1; }
.note-options .btn { flex: none; }
.liste-notes { margin-top: 1rem; }
.note { border-top: 1px solid var(--trait); padding: .8rem 0; }
.note header { display: flex; flex-wrap: wrap; gap: .2rem .5rem; align-items: center; margin-bottom: .3rem; }
.note header .outils { margin-left: auto; }
.note-texte { white-space: normal; }

.pieces { list-style: none; padding: 0; margin: 0 0 1rem; }
.pieces li { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--trait); }
.pieces li:first-child { border-top: 0; }
.pieces .case { margin: 0; }
.piece-form { flex-wrap: wrap; align-items: center; }
.piece-form .retour { flex-basis: 100%; }
.piece-form input[type=file] { flex: 1 1 14rem; font: inherit; font-size: .9rem; }
.piece-form input[type=text] { flex: 1 1 10rem; }
.piece-form select { width: auto; }
.conservation { padding-left: 1.2rem; }
.doc-signatures.trois { grid-template-columns: 1fr 1fr 1fr; gap: 1.2rem; }
.horodatage { display: block; color: #555; }

/* Espace du bénéficiaire */
.entete-benef { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .75rem; }
.entete-benef h1 { margin: 0; }
.tache { background: var(--surface); border: 1px solid var(--trait); border-left: 6px solid var(--en-cours); border-radius: var(--rayon); padding: 1.1rem 1.25rem; margin-bottom: .8rem; }
.tache h3 { margin-bottom: .3rem; }
.rdvs { list-style: none; padding: 0; margin: 0; }
.rdv { display: grid; grid-template-columns: 6.5rem 1fr; gap: .8rem; padding: .75rem 0; border-top: 1px solid var(--trait); }
.rdv:first-child { border-top: 0; }
.rdv-date { display: flex; flex-direction: column; font-size: .9rem; }
.rdv-date strong { font-family: var(--titre); font-size: 1rem; }
.rdv.fait .rdv-date strong::after { content: " ✓"; color: var(--conforme); }
.rdv.absence { opacity: .65; }
.rdv p { margin: .35rem 0 0; }
.accord { border-left: 4px solid var(--trait); padding-left: .8rem; margin-bottom: 1rem; }
.accord.actif { border-left-color: var(--conforme); }
@media print { .entete-benef, .tache { display: none; } }
.ligne.bilan .puces { align-items: center; }
.ligne.bilan .puce { white-space: nowrap; }
@media (min-width: 721px) and (max-width: 1100px) {
  .barre .nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .barre .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; white-space: nowrap; }
}
.accord .btn-lien { text-align: left; }
