:root {
  --fond: #f5f6f8; --surface: #ffffff; --texte: #1d2330; --doux: #5b6577; --bord: #dde1e8;
  --accent: #1f5fbf; --accent-texte: #ffffff; --danger: #b42318; --succes: #1e7b45; --info: #2a5d9f;
  --admin: #6b2fa3; --etab: #0f766e; --prof: #1f5fbf;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #12151b; --surface: #1b2029; --texte: #e6e9ef; --doux: #9aa4b5; --bord: #2c3340;
          --accent: #6ea3ff; --accent-texte: #0b1220; --danger: #ff7b72; --succes: #56d38a; --info: #7fb2ff;
          --admin: #b98aef; --etab: #4fd1c5; --prof: #6ea3ff; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--fond); color: var(--texte); }
a { color: var(--accent); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.petit { font-size: .8em; word-break: break-all; }
.entete { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 20px;
          background: var(--surface); border-bottom: 3px solid var(--accent); }
.espace-super_admin .entete { border-color: var(--admin); }
.espace-admin_etab .entete { border-color: var(--etab); }
.marque { font-weight: 700; font-size: 1.15em; text-decoration: none; color: var(--texte); }
.badge-role { font-size: .8em; padding: 2px 8px; border-radius: 10px; background: var(--accent); color: var(--accent-texte); }
.badge-role.badge-site-admin { background: var(--admin); }
.badge-role.badge-site-prof { background: var(--prof); }
.espace-admin_etab .badge-role { background: var(--etab); }
.entete nav { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1; }
.entete nav a { text-decoration: none; color: var(--texte); }
.entete nav a:hover { color: var(--accent); }
.contenu { max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px; }
.pied { text-align: center; color: var(--doux); font-size: .8em; padding: 20px; }
h1 { font-size: 1.5em; margin: .3em 0 .6em; }
h2 { font-size: 1.15em; margin: .2em 0 .7em; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; overflow-x: auto; }
.carte.etroite { max-width: 640px; margin: 0 auto 16px; }
.centre { text-align: center; }
.heros { text-align: center; padding: 30px 10px; }
.grille-2, .grille-3, .grille-4 { display: grid; gap: 16px; margin-bottom: 16px; }
.grille-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grille-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grille-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.tuile { background: var(--surface); border: 1px solid var(--bord); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; }
.tuile strong { font-size: 1.4em; }
.tuile-libelle, .note { color: var(--doux); font-size: .85em; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--bord); vertical-align: top; }
th { font-size: .85em; color: var(--doux); font-weight: 600; }
tr.inactif td { opacity: .5; }
.pre { white-space: pre-wrap; }
pre { white-space: pre-wrap; font-size: .85em; }
form label { display: block; margin: 0 0 10px; font-size: .92em; }
input, select, textarea { font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--bord);
                          border-radius: 5px; padding: 6px 8px; width: 100%; margin-top: 3px; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; }
input[type=file] { padding: 4px; }
input.court { width: 90px; } input.tres-court { width: 55px; }
label.choix { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
label.choix select, label.choix input.court { width: auto; }
fieldset { border: 1px solid var(--bord); border-radius: 6px; margin: 0 0 14px; padding: 10px 14px; }
legend { font-weight: 600; padding: 0 6px; }
.ligne { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ligne > label { flex: 1; min-width: 140px; }
.ligne > label.large { flex: 3; }
.ligne > input { flex: 1; width: auto; }
.bouton, button { font: inherit; cursor: pointer; border-radius: 6px; padding: 7px 14px; border: 1px solid var(--accent);
                  background: var(--accent); color: var(--accent-texte); text-decoration: none; display: inline-block; }
.bouton.secondaire { background: transparent; color: var(--accent); }
.bouton.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.lien { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
form.en-ligne { display: inline; }
form.deconnexion button { background: none; border: none; color: var(--doux); padding: 0; }
.alerte { border-radius: 6px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.alerte ul { margin: 0; padding-left: 18px; }
.alerte-erreur { border-color: var(--danger); color: var(--danger); }
.alerte-succes { border-color: var(--succes); color: var(--succes); }
.alerte-info { border-color: var(--info); color: var(--info); }
.alerte-attention { border: 2px solid #b7791f; color: #8a5a10; background: #fff7e6; }
@media (prefers-color-scheme: dark) { .alerte-attention { color: #f0b85a; background: #2a2112; } }
/* Copies à vérifier (nom mal déchiffré, copie peu lisible, copie vierge) : alerte bien visible */
.alerte-a-verifier { border: 3px solid #c0392b; border-left-width: 10px; color: #7b1d12; background: #fdecea; font-size: 1.02rem; }
.alerte-a-verifier ul { margin: .4rem 0 .4rem 1.2rem; }
/* Vérification d'une copie par le professeur : notes modifiables question par question */
.question-notes h2 { font-size: 1.05rem; }
.question-modifiee { border-left: 4px solid var(--accent); }
pre.transcription { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fond); border: 1px solid var(--bord); padding: 8px 10px; border-radius: 6px; max-height: 16rem; overflow: auto; }
.champs-notes { gap: 16px; flex-wrap: wrap; }
.refus-corrections { margin-top: 12px; }
.refus-corrections summary { cursor: pointer; font-weight: 600; }
.ligne-a-verifier td { background: #fdecea; }
.etiquette-a-verifier { display: inline-block; margin-top: .2rem; padding: .05rem .45rem; border-radius: 4px; background: #c0392b; color: #fff; font-weight: 700; font-size: .8rem; }
/* Colonne « Rapports » des résultats : une icône par fichier (libellé en infobulle) */
.icones-rapports { display: inline-flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.legende-icones { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; align-items: center; }
.legende-icones span { display: inline-flex; align-items: center; gap: .3rem; }
.legende-icones .icone-fichier { width: 20px; height: 20px; color: #444; }
.lien-icone { display: inline-flex; padding: 2px; border-radius: 4px; color: #444; line-height: 0; }
.lien-icone:hover, .lien-icone:focus-visible { background: rgba(0, 0, 0, .08); outline: 2px solid #2b579a; outline-offset: 1px; }
@media (prefers-color-scheme: dark) { .lien-icone { color: #ccc; } .lien-icone:hover { background: rgba(255, 255, 255, .12); } }
[hidden] { display: none !important; }
/* Montant libre à créditer : largeur juste suffisante pour « 999,99 » */
/* Vue « Résultats » d'un lot : onglets */
.onglets { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid #1a5276; margin: 1rem 0 0; }
.onglet { padding: .55rem 1rem; border: 1px solid #c8d3dc; border-bottom: none; border-radius: 6px 6px 0 0;
  background: #eef2f5; color: #1a5276; text-decoration: none; font-weight: 600; }
.onglet:hover, .onglet:focus-visible { background: #dde7ef; }
.onglet.actif { background: #1a5276; color: #fff; border-color: #1a5276; }
.panneau-onglet { border-top-left-radius: 0; margin-top: 0; }
.pages-fiche { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.pages-fiche figure { margin: 0; }
.pages-fiche img { width: 100%; height: auto; border: 1px solid #ccc; border-radius: 4px; background: #fff; }
.pages-fiche figcaption { font-size: .85rem; color: #666; text-align: center; }
/* Barème : copie vierge et zones où les points sont attribués */
.titre-zones { margin-top: 1.2rem; }
.copie-vierge { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 1rem; }
.copie-vierge figure { margin: 0; scroll-margin-top: 1rem; }
.copie-vierge figcaption { font-size: .85rem; color: var(--doux); text-align: center; }
.copie-vierge-page { position: relative; border: 1px solid var(--bord); border-radius: 4px; overflow: hidden; background: #fff; }
.copie-vierge-page img { display: block; width: 100%; height: auto; }
.zone-bareme { position: absolute; left: 0; right: 0; border: 2px solid var(--zc); background: color-mix(in srgb, var(--zc) 12%, transparent);
  border-radius: 3px; box-sizing: border-box; }
.zone-bareme span { position: absolute; top: 2px; right: 4px; font-size: .75rem; font-weight: 600; line-height: 1.3;
  padding: 0 5px; border-radius: 3px; background: var(--zc); color: #fff; white-space: nowrap; }
.zone-bareme.etiquette-gauche span { right: auto; left: 4px; }
.zone-bareme.sans-reponse { border-style: dashed; }
.zone-bareme.zone-active { background: color-mix(in srgb, var(--zc) 30%, transparent); z-index: 2; }
.zone-c0 { --zc: #1f5fbf; } .zone-c1 { --zc: #c2410c; } .zone-c2 { --zc: #15803d; } .zone-c3 { --zc: #9333ea; }
.zone-c4 { --zc: #b91c1c; } .zone-c5 { --zc: #0e7490; } .zone-c6 { --zc: #a16207; } .zone-c7 { --zc: #be185d; }
/* Barème proposé : sujet vierge à gauche (cases notées), barème à droite */
.plan-bareme { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.plan-sujet { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto; padding-right: 4px; }
.page-sujet { margin: 0 0 12px; }
.page-sujet figcaption { font-size: .85rem; color: var(--doux); text-align: center; }
.page-sujet-cadre { position: relative; border: 1px solid var(--bord); border-radius: 4px; overflow: hidden; background: #fff;
  touch-action: none; user-select: none; }
.page-sujet-cadre img { display: block; width: 100%; height: auto; pointer-events: none; }
.plan-sujet.placement .page-sujet-cadre { cursor: crosshair; outline: 2px dashed var(--accent); }
.case-sujet { position: absolute; border: 2px solid var(--zc); background: color-mix(in srgb, var(--zc) 14%, transparent);
  border-radius: 2px; box-sizing: border-box; cursor: move; }
.case-sujet span { position: absolute; left: 0; bottom: 100%; font-size: .68rem; font-weight: 600; line-height: 1.25; padding: 0 3px;
  border-radius: 2px 2px 0 0; background: var(--zc); color: #fff; white-space: nowrap; pointer-events: none; }
.case-sujet .poignee { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; border-radius: 2px;
  background: var(--zc); cursor: nwse-resize; }
.case-sujet.zone-active, .case-sujet:hover { background: color-mix(in srgb, var(--zc) 32%, transparent); z-index: 3; }
.cases-question { margin-top: 10px; border-left: 4px solid var(--zc); padding-left: 10px; }
.cases-titre { margin: 0 0 4px; }
.table-cases { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table-cases thead tr, .table-cases tr.ligne-case { display: grid; gap: 4px 6px; align-items: start;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) 4.8em 6.8em auto; }
.table-cases th { font-weight: 600; text-align: left; font-size: .78rem; color: var(--doux); }
.table-cases th:nth-child(5), .table-cases th:nth-child(6) { display: none; }
.table-cases tr.ligne-case { padding: 5px 4px; border-radius: 4px; }
.table-cases tr.ligne-case + tr.ligne-case { border-top: 1px dashed var(--bord); }
.table-cases td { padding: 0; }
.table-cases td:nth-child(5) { grid-column: 1 / 5; grid-row: 2; }
.table-cases td:nth-child(6) { grid-column: 5; grid-row: 1 / 3; display: flex; flex-direction: column; gap: 2px; }
.table-cases input, .table-cases select, .table-cases textarea { width: 100%; box-sizing: border-box; }
.table-cases textarea { min-height: 2.2em; resize: vertical; }
.table-cases tr.zone-active { background: color-mix(in srgb, var(--zc) 16%, transparent); }
.actions-case { white-space: nowrap; }
.plan-bareme .q-entete { grid-template-columns: 80px 64px minmax(0, 1fr) 76px 76px; }
.plan-bareme .q-entete .q-cases { grid-column: 1 / -1; display: flex; gap: 16px; }
.plan-bareme .q-textes { grid-template-columns: 1fr; }
.question-bareme input[readonly] { background: var(--fond); color: var(--doux); }
.controle-exercices { margin: 8px 0 12px; border-collapse: collapse; }
.controle-exercices caption { text-align: left; font-weight: 600; margin-bottom: 4px; }
.controle-exercices th, .controle-exercices td { padding: 3px 10px; border-bottom: 1px solid var(--bord); text-align: left; }
.controle-exercices tr.ecart td { color: var(--danger); }
.cases-lecture { margin: 6px 0 0; padding-left: 1.1em; font-size: .9em; }
@media (max-width: 900px) {
  .plan-bareme { grid-template-columns: 1fr; }
  .plan-sujet { position: static; max-height: none; }
  .table-cases thead { display: none; }
  .table-cases tr.ligne-case { grid-template-columns: 1fr 1fr; }
  .table-cases td:nth-child(5) { grid-column: 1 / -1; grid-row: auto; }
  .table-cases td:nth-child(6) { grid-column: 1 / -1; grid-row: auto; flex-direction: row; }
}
table.bareme-zones tr.zone-active td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.liste-telechargements { list-style: none; padding: 0; display: grid; gap: .5rem; }
.liste-telechargements li { display: flex; align-items: center; gap: .5rem; }
.liste-telechargements .icone-fichier { width: 22px; height: 22px; color: #444; }
.icone-zip { display: inline-block; width: 22px; font-size: .6rem; font-weight: 700; text-align: center; border: 1.4px solid #444; border-radius: 3px; }
@media (prefers-color-scheme: dark) {
  .onglet { background: #1f2a33; color: #cfe3f2; border-color: #33424f; }
  .onglet.actif { background: #2e6b98; color: #fff; }
}
/* Page Crédits : colonne de droite (remboursement, consommation par mois, facturation) */
.colonne-cartes { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.colonne-cartes > .carte { margin: 0; }
.colonne-cartes table { font-size: .85rem; }
.colonne-cartes th, .colonne-cartes td { padding-left: 4px; padding-right: 4px; }
.colonne-cartes td:first-child, .colonne-cartes td:nth-child(2) { white-space: nowrap; }
.ligne-remboursement td { color: #922b21; }
@media (prefers-color-scheme: dark) { .ligne-remboursement td { color: #f1948a; } }
.ligne-credit { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.ligne-credit .credit-libre { margin: 6px 0; }
.ligne-credit > form.en-ligne { margin: 6px 0; }
input.champ-montant { width: 9ch; min-width: 0; box-sizing: content-box; padding-right: .4rem; }   /* l'attribut hidden l'emporte sur les display des composants */
/* Mon compte : enseignement à gauche ; identité et facturation à droite. Sur petit écran : identité d'abord */
.compte-grille h1.titre-carte { font-size: 1.25rem; margin-top: 0; }
.compte-grille { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.compte-gauche { grid-column: 1; grid-row: 1; }
.compte-droite { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 1rem; }
.compte-grille .carte { margin: 0; min-width: 0; }
.compte-grille dd { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 900px) {
  .compte-grille { grid-template-columns: minmax(0, 1fr); }
  .compte-gauche, .compte-droite { grid-column: 1; grid-row: auto; }
}
.choix-niveaux, .choix-facture { border: 1px solid #ccc; border-radius: 6px; padding: .5rem .9rem; margin: .6rem 0; }
.choix-niveaux .choix, .choix-facture .choix { margin: .25rem 0; }
.choix-niveaux input, .choix-facture input { width: auto; }
.groupes-niveaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .6rem 1.2rem; }
.groupe-niveaux strong { display: block; margin: .2rem 0 .1rem; font-size: .95rem; }
.groupe-niveaux label.choix { flex-wrap: nowrap; align-items: flex-start; gap: 6px; }
.groupe-niveaux label.choix input { margin-top: .25em; flex: none; }
.validation-lot fieldset { border: 1px solid #ccc; border-radius: 6px; padding: .5rem .9rem; margin: .6rem 0; }
.validation-lot .choix { margin-right: 1.2rem; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .alerte-a-verifier { color: #ffb4a8; background: #3a1714; }
  .ligne-a-verifier td { background: #2e1513; }
}
.etiquette { font-size: .7em; vertical-align: middle; padding: 2px 7px; border-radius: 9px; border: 1px solid var(--bord); color: var(--doux); }
.statut { font-size: .82em; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--bord); white-space: nowrap; }
.statut-en_attente, .statut-en_cours_de_traitement, .statut-bareme_en_generation { border-color: var(--info); color: var(--info); }
.statut-en_attente_validation_admin, .statut-bareme_a_valider { border-color: #b7791f; color: #b7791f; }
.statut-valide, .statut-valide_et_purge { border-color: var(--succes); color: var(--succes); }
.statut-echec { border-color: var(--danger); color: var(--danger); }
.lis { font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.lis-ok { color: var(--succes); } .lis-moyen { color: #b7791f; } .lis-bas { color: var(--danger); }
.erreur { color: var(--danger); }
.cle { font-size: 1.1em; letter-spacing: 1px; }
.selection { user-select: all; }
.filtres a { margin-right: 12px; } .filtres a.actif { font-weight: 700; text-decoration: none; }
.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.fiche dt { color: var(--doux); } .fiche dd { margin: 0; }
.bareme textarea { min-width: 260px; }
.guide h2 { margin-top: 1.4em; }
.sommaire { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
/* Guide : sommaire toujours visible en haut de l'écran ; un titre atteint par le sommaire s'affiche juste dessous
   (--haut-sommaire : hauteur réelle du sommaire, mise à jour par app.js). La carte ne fait pas défiler son contenu,
   sinon le sommaire ne pourrait pas rester collé à l'écran. */
.carte.guide { overflow: visible; }
.guide .sommaire { position: sticky; top: 0; z-index: 5; margin: 0 -18px 10px; padding: 10px 18px;
                   background: var(--surface); border-bottom: 1px solid var(--bord); }
.guide [id] { scroll-margin-top: calc(var(--haut-sommaire, 4.5rem) + 16px); }
.guide .telechargements { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 8px 0 14px; }
details summary { cursor: pointer; }

/* Dépôt de fichiers : glisser-déposer ou recherche sur l'ordinateur */
.depot { position: relative; border: 2px dashed var(--bord); border-radius: 8px; padding: 18px; margin: 8px 0;
  text-align: center; background: var(--surface); transition: border-color .15s, background .15s; }
.depot.survol { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.depot > input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.depot p { margin: 0; }
.depot-liste { list-style: none; padding: 0; margin: 8px 0 0; text-align: left; font-size: .9em; }
.depot-liste li { padding: 2px 0; border-bottom: 1px solid var(--bord); }
.depot-liste li.refuse { color: var(--danger); }
label.lien { color: var(--accent); text-decoration: underline; cursor: pointer; display: inline; }
label.case { display: block; margin: 4px 0; }
label.case.en-ligne { display: inline-block; margin-right: 16px; }
label.case input { width: auto; margin-right: 6px; }
table.resume-fiche th { text-align: left; white-space: nowrap; padding-right: 12px; vertical-align: top; }
form.fiche fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
.retrait { margin-left: 26px; }
.aide-bareme { font-size: .9em; margin-bottom: 8px; }
.aide-bareme p { margin: 0 0 4px; } .aide-bareme ul { margin: 0 0 6px; padding-left: 20px; }
tr.inactif td { opacity: .55; }

/* Corrections : différence mise en relief et notes */
.diff-correct { color: #1e8449; }
.diff-faux { color: #c0392b; text-decoration: line-through; }
.diff-manquant { color: #d35400; font-weight: bold; }
.diff-superflu { color: #808080; font-style: italic; }
/* Points d'attention (réponses en puces) */
.puce { margin: 0 0 2px 0; }
.puce-titre { font-style: italic; margin-top: 3px; }
.puce-notation { font-size: 85%; font-style: italic; color: #555; margin-top: 3px; }
.puce-autre { color: #666; }
.note-detail { font-size: 80%; margin-top: 4px; color: #333; }
.puce-commentaire { font-size: 85%; margin-top: 3px; }
table.correction td { vertical-align: top; font-size: .9em; }
table.correction tr.partie td { background: #1a5276; color: #fff; font-weight: bold; text-align: center; }
table.correction tr.total td { background: #d6eaf8; font-weight: bold; }
td.note-bien { background: #d5f5e3; } td.note-moyen { background: #fdebd0; } td.note-faible { background: #fadbd8; }
table.matrice td, table.matrice th { text-align: center; white-space: nowrap; }
tr.choisi td { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.bandeau-role { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
fieldset.inutilise { opacity: .55; }
.negatif { color: var(--danger); font-weight: bold; }

/* Cases à cocher des identifiants (inscription dans un groupe) */
.cases { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-bottom: .6rem; }
.cases .case { display: inline-flex; align-items: center; gap: .3rem; font-weight: normal; }

/* Abonnement : historique des crédits et factures */
.defilement { overflow-x: auto; }
td.nombre, th.nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.credit-plus { color: var(--succes); font-weight: 600; }
td.credit-moins { color: var(--danger); }
.facture { position: relative; max-width: 800px; margin: 0 auto; }
.facture-entete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.facture-emetteur { text-align: right; }
.facture-client { margin: 16px 0; }
.facture tfoot th, .facture tfoot td { border-top: 1px solid var(--bord); }
/* Franchise de TVA : mention art. 293 B du CGI, lisible sous le total (obligatoire sur facture et avoir) */
.mention-tva { text-align: right; margin: 8px 0 0; }
.filigrane { text-align: center; font-weight: 700; color: var(--danger); border: 2px dashed var(--danger);
             padding: 4px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .05em; }
@media print {
  .entete, .pied, .pas-imprimer { display: none !important; }
  body { background: #fff; color: #000; }
  .carte { border: none; box-shadow: none; }
}
.filtre-periode { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 16px; }
.option-24h { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--succes); border-radius: 6px; align-items: flex-start; }

/* Page d'un lot : contenu à gauche, avancement du lot (étapes) à droite */
.lot-grille { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.lot-etapes { position: sticky; top: 12px; font-size: .9em; }
.lot-etapes h2 { margin-top: 0; }
.lot-etapes ol { list-style: none; margin: 0; padding: 0; }
.etape { position: relative; padding: 0 0 12px 22px; border-left: 2px solid var(--bord); margin-left: 7px; }
.etape:last-child { border-left-color: transparent; }
.etape::before { content: ""; position: absolute; left: -8px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
                 background: var(--surface); border: 2px solid var(--bord); }
.etape-titre { font-weight: 600; }
.etape-etat { font-size: .78em; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--bord); color: var(--doux); white-space: nowrap; }
.etape-detail { display: block; color: var(--doux); white-space: pre-line; }
.etape-anomalies { margin: 4px 0 0; padding-left: 16px; color: var(--danger); }
.etape-fait::before { background: var(--succes); border-color: var(--succes); }
.etape-fait .etape-etat { border-color: var(--succes); color: var(--succes); }
.etape-en_cours::before { background: var(--info); border-color: var(--info);
                          animation: etape-bat 1.6s ease-in-out infinite; animation-delay: var(--pouls-decalage, 0ms); }
/* Onde qui part du point : la phase en cours « vit ». --pouls-decalage (app.js) cale l'animation sur l'horloge,
   pour qu'elle ne reparte pas de zéro à chaque rechargement automatique de la page. */
.etape-en_cours::after { content: ""; position: absolute; left: -8px; top: 3px; width: 12px; height: 12px;
                         border-radius: 50%; border: 2px solid var(--info); pointer-events: none;
                         animation: etape-onde 1.6s ease-out infinite; animation-delay: var(--pouls-decalage, 0ms); }
@keyframes etape-bat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes etape-onde { 0% { transform: scale(1); opacity: .75; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .etape-en_cours::before { animation: none; }
  .etape-en_cours::after { display: none; }
}
.etape-en_cours .etape-etat { border-color: var(--info); color: var(--info); }
.etape-a_faire::before { border-color: #b7791f; }
.etape-a_faire .etape-etat { border-color: #b7791f; color: #b7791f; }
.etape-avertissement::before { background: #e0a800; border-color: #e0a800; }
.etape-avertissement .etape-etat { border-color: #b7791f; color: #8a5a10; background: #fff7d6; }
.etape-avertissement .etape-anomalies { color: #8a5a10; }
.etape-anomalies a { color: inherit; font-weight: 600; }
.etape-anomalies a::after { content: " →"; }
@media (prefers-color-scheme: dark) {
  .etape-avertissement .etape-etat { color: #f0c75a; background: #2a2412; }
  .etape-avertissement .etape-anomalies { color: #f0c75a; }
}
.etape-anomalie::before { background: var(--danger); border-color: var(--danger); }
.etape-anomalie .etape-etat { border-color: var(--danger); color: var(--danger); }
.etape-attente, .etape-facultatif { opacity: .75; }
@media (max-width: 900px) {
  .lot-grille { grid-template-columns: 1fr; }
  .lot-etapes { position: static; order: -1; }
}

/* Barème modifiable : une fiche par question (lisible sans défilement horizontal) */
.bareme-liste { display: grid; gap: 12px; margin-bottom: 12px; }
.question-bareme { border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px; background: var(--fond); }
.question-bareme input, .question-bareme textarea { background: var(--surface); }
.question-bareme label { margin: 0; }
.q-entete { display: grid; grid-template-columns: 90px 70px minmax(160px, 1fr) 90px 90px auto; gap: 10px; align-items: end; }
.q-cases { display: flex; flex-direction: column; gap: 2px; font-size: .88em; white-space: nowrap; }
.q-cases label.case { margin: 0; }
.q-textes { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 8px; }
.q-textes textarea { resize: vertical; min-height: 4.5em; }
@media (max-width: 760px) {
  .q-entete { grid-template-columns: 1fr 1fr; }
  .q-intitule, .q-cases { grid-column: 1 / -1; }
  .q-cases { flex-direction: row; gap: 16px; }
  .q-textes { grid-template-columns: 1fr; }
}

/* Page du barème : avancement en bandeau compact au-dessus du contenu */
.lot-grille.une-colonne { grid-template-columns: 1fr; }
.lot-grille.une-colonne .lot-etapes { position: static; order: -1; }
.lot-etapes.horizontal { padding: 10px 14px; }
.lot-etapes.horizontal h2 { font-size: 1em; margin: 0 0 6px; }
.lot-etapes.horizontal ol { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.lot-etapes.horizontal .etape { border-left: none; margin: 0; padding: 0 0 0 16px; }
.lot-etapes.horizontal .etape::before { left: 0; top: 5px; width: 8px; height: 8px; }
.lot-etapes.horizontal .etape-titre { font-weight: 500; }
.lot-etapes.horizontal > .etape-anomalies { margin-top: 6px; }
.lot-etapes.horizontal > .etape-anomalies:empty { display: none; }
.lot-etapes.horizontal > .etape-anomalies li.avertissement { color: #8a5a10; }
@media (prefers-color-scheme: dark) { .lot-etapes.horizontal > .etape-anomalies li.avertissement { color: #f0c75a; } }
.lot-etapes.horizontal .etape-resume { margin: 6px 0 0; }

/* Étiquettes et cartes d'une classe : planches A4 au millimètre (aperçu réduit à l'écran) */
.encadre-rgpd ul { margin: 6px 0 0; padding-left: 20px; }
.encadre-rgpd li { margin-bottom: 4px; }
.choix-format .case, .page-etiquettes fieldset .case { display: flex; gap: 8px; align-items: baseline; margin: 4px 0; }
.page-etiquettes fieldset { border: 1px solid var(--bord); border-radius: 6px; margin: 0 0 12px; padding: 8px 12px; }
.table-etiquettes input[type="text"] { width: 100%; min-width: 9em; }
.planches-etiquettes { display: flex; flex-wrap: wrap; gap: 16px; }
.planche-etiquettes { page: planche-etiquettes; box-sizing: border-box; width: 210mm; height: 297mm; overflow: hidden;
  padding: var(--haut) 0 0 var(--gauche); display: grid; align-content: start;
  grid-template-columns: repeat(var(--cols), var(--l)); grid-auto-rows: var(--h);
  column-gap: var(--ecart-h); row-gap: var(--ecart-v); background: #fff; color: #000;
  font-family: Arial, "Helvetica Neue", sans-serif; }
@media screen {
  .planche-etiquettes { zoom: .5; border: 1px solid var(--bord); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
  /* Repères d'écran (non imprimés) : contour pointillé de chaque emplacement */
  .etiquette-eleve { outline: 1px dashed #bbb; outline-offset: -1px; }
}
.etiquette-eleve { box-sizing: border-box; overflow: hidden; padding: 2.5mm 3.5mm; display: flex; flex-direction: column;
  justify-content: center; gap: .6mm; text-align: center; line-height: 1.15; }
.etiquette-eleve.vide { visibility: hidden; }
.etiq-haut { font-size: 7pt; color: #444; white-space: nowrap; overflow: hidden; }
.etiq-nom { font-size: 12pt; font-weight: bold; white-space: nowrap; overflow: hidden; }
.etiq-prenom { font-size: 11pt; white-space: nowrap; overflow: hidden; }
.etiq-a-remplir { font-size: 9pt; text-align: left; border-bottom: .2mm solid #555; padding-top: 1.5mm; }
.etiq-code { font: bold 14pt/1.1 "Consolas", "Courier New", monospace; letter-spacing: .06em; margin-top: .8mm;
  border: .3mm solid #000; border-radius: 1.5mm; padding: .6mm 1.5mm; align-self: center; }
.etiq-consigne { font-size: 6pt; color: #444; }
.etiquette-eleve.grande .etiq-nom { font-size: 15pt; }
.etiquette-eleve.grande .etiq-prenom { font-size: 13pt; }
.etiquette-eleve.grande .etiq-code { font-size: 17pt; }
.etiquette-eleve.grande .etiq-consigne { font-size: 7pt; }
@media print {
  body:has(.planches-etiquettes) main > :not(.page-etiquettes),
  .page-etiquettes .ecran-seul { display: none !important; }
  body:has(.planches-etiquettes) main.contenu, body:has(.planches-etiquettes) .contenu { max-width: none; margin: 0; padding: 0; }
  .planches-etiquettes { display: block; }
  .planche-etiquettes { break-after: page; zoom: 1; border: none; box-shadow: none; }
  .planche-etiquettes:last-child { break-after: auto; }
  .etiquette-eleve { outline: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.decoupe-laser summary { cursor: pointer; }
.decoupe-laser summary h2 { display: inline; }
.grille-laser { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; align-items: end; margin-top: 10px; }
.limite-effacement { display: inline-block; font-size: .82em; color: var(--doux); white-space: nowrap; padding: 1px 6px; border: 1px solid var(--bord); border-radius: 10px; vertical-align: middle; }
/* Phase de développement : mises en garde en bandes verticales sur les bords de la page */
.bande-test { position: fixed; top: 0; bottom: 0; z-index: 50; width: 26px; display: flex; align-items: center;
  justify-content: center; background: var(--danger); color: #fff; font-size: 12px; line-height: 1;
  writing-mode: vertical-rl; white-space: nowrap; overflow: hidden; letter-spacing: .02em; }
.bande-test-gauche { left: 0; transform: rotate(180deg); }
.bande-test-droite { right: 0; }
body.avec-bandes-test { padding-left: 26px; padding-right: 26px; }
@media (prefers-color-scheme: dark) { .bande-test { color: #12151b; } }
@media print { .bande-test { display: none !important; } body.avec-bandes-test { padding: 0; } }

/* Accueil : mention d'outil d'aide fondé sur l'IA */
.heros-texte .mention-ia { margin-top: .9rem; max-width: 40rem; font-size: .85rem; }

/* Crédits : barre des pages acquises, achat par achat (rampe ordinale bleue validée, clair et sombre) */
.repartition-pages { --seg-utilisees: #c9ced8; --seg-remboursees: #e3e6ec; --seg-trait: #8a93a3;
  --rampe-0: #86b6ef; --rampe-1: #5598e7; --rampe-2: #2a78d6; --rampe-3: #1c5cab; --rampe-4: #0d366b;
  --rampe-offertes: #cde2fb; --rampe-offertes-trait: #86b6ef; }
@media (prefers-color-scheme: dark) {
  .repartition-pages { --seg-utilisees: #3a4250; --seg-remboursees: #2c3340; --seg-trait: #6b7587;
    --rampe-0: #184f95; --rampe-1: #256abf; --rampe-2: #3987e5; --rampe-3: #6da7ec; --rampe-4: #b7d3f6;
    --rampe-offertes: #1c2a3e; --rampe-offertes-trait: #3987e5; }
}
.barre-pages { display: block; width: 100%; height: 32px; border-radius: 4px; background: var(--fond); }
.barre-pages rect { stroke: var(--surface); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.barre-pages pattern rect { stroke: none; }
.seg-utilisees { fill: var(--seg-utilisees); background: var(--seg-utilisees); }
.seg-remboursees { fill: var(--seg-remboursees); background: var(--seg-remboursees); }
.hachure-fond { fill: var(--seg-remboursees); }
.hachure-trait { stroke: var(--seg-trait); stroke-width: 3; }
.rampe-offertes { fill: var(--rampe-offertes); }
.hachure-trait-offertes { stroke: var(--rampe-offertes-trait); stroke-width: 3; }
.rampe-0 { fill: var(--rampe-0); background: var(--rampe-0); }
.rampe-1 { fill: var(--rampe-1); background: var(--rampe-1); }
.rampe-2 { fill: var(--rampe-2); background: var(--rampe-2); }
.rampe-3 { fill: var(--rampe-3); background: var(--rampe-3); }
.rampe-4 { fill: var(--rampe-4); background: var(--rampe-4); }
.barre-echelle { display: flex; justify-content: space-between; font-size: .8rem; color: var(--doux); margin-top: .2rem; }
.legende-pages { list-style: none; padding: 0; margin: .6rem 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.pastille { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; vertical-align: -.12rem;
  margin-right: .35rem; border: 1px solid var(--bord); }
.pastille-reservees { background: repeating-linear-gradient(45deg, var(--seg-remboursees) 0 3px, var(--seg-trait) 3px 5px); }
.pastille-offertes { background: repeating-linear-gradient(135deg, var(--rampe-offertes) 0 3px, var(--rampe-offertes-trait) 3px 5px); }
.pastille-restantes { background: linear-gradient(90deg, var(--rampe-0), var(--rampe-4)); }
.table-achats tr.achat-epuise td { color: var(--doux); }
.table-achats td:first-child, .table-achats td.nombre { white-space: nowrap; }
.apercu-credit { margin: .5rem 0; padding: .5rem .75rem; border-left: 3px solid var(--accent); background: var(--fond); border-radius: 4px; }
/* Crédits : boutons des tranches, de même largeur, alignés en grille */
.boutons-tranches { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .5rem; margin: .5rem 0 1rem; }
.boutons-tranches form { margin: 0; display: block; }
.boutons-tranches .bouton { width: 100%; text-align: center; font-variant-numeric: tabular-nums; }
/* Administration : simulateur de rentabilité */
.formulaire-rentabilite fieldset { border: 1px solid var(--bord); border-radius: 8px; margin: 0 0 1rem; padding: .5rem 1rem 1rem; }
.formulaire-rentabilite legend { font-weight: 600; padding: 0 .4rem; }
.champs-rentabilite { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: .4rem 1.2rem; }
.champs-rentabilite label { display: flex; flex-direction: column; justify-content: space-between; gap: .25rem; margin: 0; }
.champs-rentabilite input, .formulaire-rentabilite td input { max-width: 10rem; margin: 0; }
.formulaire-rentabilite td { vertical-align: middle; }
.preselections { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.bouton.petit { padding: .2rem .55rem; font-size: .85rem; }
.valeur-negative { color: var(--danger); }
.compte-annee tr.total th, .compte-annee tr.total td { border-top: 2px solid var(--bord); }
tr.ligne-courante td { font-weight: 600; }
.comparaison-statut { margin-top: 0; }
.rubrique-autre-statut { margin: .6rem 0; }
.rubrique-autre-statut summary { cursor: pointer; font-weight: 600; padding: .3rem 0; }
/* Essai fermé : bandeau sur tout le site public */
.bandeau-essai { margin: 0 0 1rem; padding: .5rem .9rem; border-radius: 6px; border: 1px solid var(--info);
  background: var(--surface); color: var(--texte); font-size: .9rem; }

/* Montants convertis en euros (page Moteur IA) : nombre et symbole sur la même ligne */
[data-usd] { white-space: nowrap; }
