/* Pompadour : un outil de cabinet, sobre et lisible. Charte de campagne : bleu #06158C (titres, boutons, liens),
   rouge #FE0106 en accent rare (marqueurs [À COMPLÉTER], actions destructrices), orange #EF8239 pour « en cours ».
   Le rouge et l'orange de la charte ne servent jamais de couleur de texte sur fond clair (contraste insuffisant) :
   le texte prend leurs teintes foncées. Polices servies par le site (CSP 'self'). */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url("/fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bleu: #06158C;
  --bleu-fonce: #040D5C;
  --bleu-pale: #E7E9F6;
  --bleu-tres-pale: #F3F4FB;
  --rouge: #FE0106;
  --rouge-texte: #B00005;
  --rouge-pale: #FFEDED;
  --orange: #EF8239;
  --orange-texte: #8A3A06;
  --orange-pale: #FDEEE3;
  --encre: #1B1F3B;
  --encre-2: #555B70;
  --fond: #F4F5F9;
  --surface: #FFFFFF;
  --filet: #E1E4EE;
  --filet-champ: #B9BFD1;
  --ombre: 0 1px 2px rgba(16, 24, 64, .05), 0 1px 3px rgba(16, 24, 64, .04);
  --rayon: .5rem;
  --rayon-carte: .75rem;
  --corps: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --largeur: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font: 400 .9375rem/1.55 var(--corps);
  color: var(--encre);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}
body.corps-large { --largeur: 1480px; }
h1, h2, h3 { margin: 0; color: var(--bleu); line-height: 1.25; }
h1 { font-size: 1.625rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.125rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--bleu); text-underline-offset: .15em; }
a:hover { color: var(--bleu-fonce); }
img { max-width: 100%; }
[hidden] { display: none !important; }

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

.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.evitement {
  position: absolute; left: 1rem; top: -3rem; z-index: 20; padding: .5rem 1rem;
  background: var(--bleu); color: #fff; border-radius: var(--rayon); font-weight: 700;
}
.evitement:focus { top: .5rem; color: #fff; }

/* ---- barre du haut ---- */

.barre { background: var(--surface); border-top: 3px solid var(--bleu); border-bottom: 1px solid var(--filet); }
.barre-interieur {
  max-width: var(--largeur); margin: 0 auto; padding: 0 1.5rem; min-height: 3.75rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.marque { display: inline-flex; align-items: center; gap: .625rem; text-decoration: none; color: var(--bleu); font-weight: 800; font-size: 1.125rem; letter-spacing: -.01em; flex: none; }
.marque img { display: block; border-radius: 7px; }
.navigation { flex: 1; display: flex; align-items: center; gap: 1rem; min-width: 0; }
.navigation-liens { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.navigation-liens a {
  display: block; padding: .5rem .75rem; border-radius: var(--rayon); color: var(--encre);
  text-decoration: none; font-weight: 600; font-size: .9375rem;
}
.navigation-liens a:hover { background: var(--bleu-tres-pale); color: var(--bleu); }
.navigation-liens a.actif { color: var(--bleu); background: var(--bleu-pale); }
.navigation-compte { display: flex; align-items: center; gap: .75rem; flex: none; }
.qui { color: var(--encre-2); font-size: .875rem; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-message { color: var(--rouge-texte); font-size: .8125rem; }
.barre-message:empty { display: none; }
.menu-bouton { display: none; }

@media (max-width: 860px) {
  .barre-interieur { flex-wrap: wrap; gap: 0 1rem; padding: 0 1rem; }
  .menu-bouton {
    display: inline-flex; align-items: center; margin-left: auto; min-height: 2.75rem; padding: .375rem .875rem;
    font: 600 .9375rem var(--corps); color: var(--bleu); background: #fff; border: 1px solid var(--filet-champ);
    border-radius: var(--rayon); cursor: pointer;
  }
  .menu-bouton[hidden] { display: none; }
  .menu-bouton::after { content: ""; width: .5rem; height: .5rem; margin-left: .5rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
  .barre.ouverte .menu-bouton::after { transform: translateY(2px) rotate(-135deg); }
  .navigation { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: .5rem; padding: .5rem 0 1rem; }
  .barre.ouverte .navigation { display: flex; }
  .navigation-liens { flex-direction: column; }
  .navigation-liens a { padding: .75rem; }
  .navigation-compte { justify-content: space-between; padding: .75rem .75rem 0; border-top: 1px solid var(--filet); }
}

/* ---- page ---- */

.page { display: block; max-width: var(--largeur); margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.page:focus { outline: none; }
.page-moyenne { max-width: 760px; }
.page-etroite { max-width: 30rem; padding-top: 3rem; }
.page-large { max-width: var(--largeur); }
.chapeau { margin-top: .5rem; color: var(--encre-2); max-width: 46rem; }
.entete-page { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.retour { margin-bottom: 1rem; font-size: .9375rem; }
.retour a { font-weight: 600; text-decoration: none; }
.retour a:hover { text-decoration: underline; }
.page > h1 + .chapeau { margin-bottom: 1.5rem; }

.carte { background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon-carte); box-shadow: var(--ombre); padding: 1.5rem; }
.carte + .carte, .carte + .lecture-colonnes, .lecture-colonnes + .carte { margin-top: 1.25rem; }
.carte > h2 { margin-bottom: .5rem; }
.aide { color: var(--encre-2); font-size: .8125rem; margin-top: .375rem; }
.aide-bloc { color: var(--encre-2); margin-bottom: 1rem; max-width: 46rem; }
.requis { color: var(--encre-2); font-weight: 500; font-size: .8125rem; }

/* ---- boutons ---- */

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem; min-height: 2.75rem;
  padding: .5rem 1.125rem; font: 700 .9375rem/1.2 var(--corps); color: var(--bleu); background: #fff;
  border: 1px solid var(--filet-champ); border-radius: var(--rayon); cursor: pointer; text-decoration: none; text-align: center;
}
.bouton:hover { border-color: var(--bleu); color: var(--bleu); background: var(--bleu-tres-pale); }
.bouton.principal { color: #fff; background: var(--bleu); border-color: var(--bleu); }
.bouton.principal:hover { background: var(--bleu-fonce); border-color: var(--bleu-fonce); color: #fff; }
.bouton.danger { color: var(--rouge-texte); border-color: #E9A3A5; }
.bouton.danger:hover { background: var(--rouge-pale); border-color: var(--rouge-texte); color: var(--rouge-texte); }
.bouton.danger.plein { color: #fff; background: var(--rouge-texte); border-color: var(--rouge-texte); }
.bouton.danger.plein:hover { background: #8E0004; border-color: #8E0004; }
.bouton.petit { min-height: 2.25rem; padding: .375rem .875rem; font-size: .875rem; }
.bouton.large { width: 100%; }
.bouton:disabled, .bouton.inactif { opacity: .5; cursor: not-allowed; }
.bouton.principal.inactif:hover { background: var(--bleu); }
.bouton-lien {
  padding: .25rem 0; font: 600 .9375rem var(--corps); color: var(--bleu); background: none; border: 0;
  cursor: pointer; text-decoration: underline; text-underline-offset: .15em; text-align: left;
}
.bouton-lien.petit { font-size: .875rem; }
.bouton-lien.danger { color: var(--rouge-texte); }
.bouton-lien:disabled { opacity: .5; cursor: not-allowed; }
.sortie { color: var(--encre-2); text-decoration: none; font-size: .875rem; white-space: nowrap; }
.sortie:hover { color: var(--bleu); text-decoration: underline; }
.bouton-icone {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: none;
  font: 700 1rem var(--corps); color: var(--bleu); background: #fff; border: 1px solid var(--filet-champ);
  border-radius: var(--rayon); cursor: pointer;
}
.bouton-icone:hover:not(:disabled) { background: var(--bleu-tres-pale); border-color: var(--bleu); }
.bouton-icone:disabled { opacity: .35; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .625rem; align-items: center; margin-top: 1.25rem; }
/* Bouton de téléchargement Word et son message d'erreur, juste dessous. */
.word { display: inline-flex; flex-direction: column; align-items: stretch; gap: .25rem; max-width: 100%; }
.word-erreur { color: var(--rouge-texte); font-size: .8125rem; font-weight: 600; max-width: 18rem; }
.word-erreur:empty { display: none; }
.word .bouton:disabled { cursor: progress; }

/* ---- champs ---- */

.champ { margin-bottom: 1.125rem; }
.champ > label, .formulaire-ligne label { display: block; font-weight: 700; font-size: .875rem; margin-bottom: .375rem; color: var(--encre); }
input[type=text], input[type=email], input[type=search], input[type=date], select, textarea {
  display: block; width: 100%; min-height: 2.75rem; padding: .5625rem .75rem; font: 400 1rem/1.45 var(--corps);
  color: var(--encre); background: #fff; border: 1px solid var(--filet-champ); border-radius: var(--rayon);
}
textarea { resize: vertical; field-sizing: content; min-height: 4.5rem; max-height: 28rem; }
select { appearance: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(6, 21, 140, .2); }
input:disabled, select:disabled, textarea:disabled { background: var(--fond); cursor: not-allowed; }
[aria-invalid="true"] { border-color: var(--rouge-texte) !important; box-shadow: 0 0 0 1px var(--rouge-texte); }
.erreur-champ { color: var(--rouge-texte); font-size: .8125rem; font-weight: 600; margin-top: .375rem; }
.erreur-champ:empty { display: none; }
.champ-court { max-width: 15rem; }
.compteur { color: var(--encre-2); font-size: .75rem; margin-top: .25rem; text-align: right; }
.compteur-plein { color: var(--rouge-texte); font-weight: 700; }
input[type=checkbox] { width: 1.125rem; height: 1.125rem; margin: .125rem 0 0; accent-color: var(--bleu); flex: none; }
.case { display: flex; gap: .75rem; align-items: flex-start; padding: .875rem 1rem; border: 1px solid var(--filet); border-radius: var(--rayon); background: var(--bleu-tres-pale); cursor: pointer; margin-bottom: 1rem; }
.case strong { display: block; color: var(--encre); }
.case .aide { display: block; margin-top: .125rem; }
.formulaire-ligne { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; margin-bottom: 1rem; }
.formulaire-ligne .champ { margin-bottom: 0; flex: 1 1 14rem; }
.formulaire-ligne .champ-bouton { flex: 0 0 auto; }

/* ---- messages et états ---- */

.message { margin-top: 1rem; padding: .75rem 1rem; border-radius: var(--rayon); border-left: 4px solid var(--bleu); background: var(--bleu-tres-pale); color: var(--encre); }
.message:empty { display: none; }
.message-succes { border-left-color: var(--bleu); background: var(--bleu-pale); color: var(--bleu-fonce); font-weight: 600; }
.message-erreur { border-left-color: var(--rouge); background: var(--rouge-pale); color: var(--rouge-texte); font-weight: 600; }
.page > .message { margin: 0 0 1.25rem; }
.encart { padding: .75rem 1rem; border-radius: var(--rayon); background: var(--bleu-tres-pale); border: 1px solid var(--bleu-pale); margin-bottom: 1rem; }
.encart-attente { background: var(--orange-pale); border-color: #F6C9A8; color: var(--orange-texte); }
.encart-alerte { background: var(--rouge-pale); border-color: #F3B5B6; color: var(--rouge-texte); }

.etat { padding: 2.5rem 1.5rem; text-align: center; color: var(--encre-2); }
.etat p + p { margin-top: .375rem; }
.etat .bouton { margin-top: 1rem; }
.etat-titre { color: var(--encre); font-weight: 700; font-size: 1.0625rem; }
.etat-vide { background: var(--surface); border: 1px dashed var(--filet-champ); border-radius: var(--rayon-carte); }
.etat-erreur { background: var(--rouge-pale); border: 1px solid #F3B5B6; border-radius: var(--rayon-carte); color: var(--rouge-texte); }
.etat-erreur .etat-titre { color: var(--rouge-texte); }
.etat-chargement { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.rond-attente {
  display: inline-block; width: 1.75rem; height: 1.75rem; flex: none; border-radius: 50%;
  border: 3px solid var(--orange-pale); border-top-color: var(--orange); animation: tourne 1s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rond-attente { animation: none; border-color: var(--orange); } }

/* ---- pastilles ---- */

.pastille {
  display: inline-flex; align-items: center; gap: .375rem; padding: .1875rem .625rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 700; line-height: 1.3; white-space: nowrap;
}
.pastille::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.ton-attente { background: var(--orange-pale); color: var(--orange-texte); }
.ton-attente::before { background: var(--orange); }
.ton-relire { background: var(--bleu-pale); color: var(--bleu); }
.ton-ok { background: var(--bleu); color: #fff; }
.ton-refus { background: #ECEEF3; color: #3E4459; }
.ton-refus::before { background: #7A8095; }
.ton-echec { background: var(--rouge-pale); color: var(--rouge-texte); }
.ton-echec::before { background: var(--rouge); }
.echeance { display: inline-block; padding: .1875rem .625rem; border-radius: 999px; font-size: .8125rem; font-weight: 600; white-space: nowrap; background: #ECEEF3; color: #3E4459; }
.echeance-proche { background: var(--orange-pale); color: var(--orange-texte); font-weight: 700; }
.echeance-depassee { background: var(--rouge-pale); color: var(--rouge-texte); font-weight: 700; border: 1px solid var(--rouge); }

/* ---- listes ---- */

.liste { list-style: none; margin: 0; padding: 0; }
.liste.carte { padding: 0; overflow: hidden; }
.ligne { display: flex; align-items: center; gap: 1rem 1.5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--filet); }
.ligne:first-child { border-top: 0; }
.ligne-cliquable { position: relative; }
.ligne-cliquable:hover { background: var(--bleu-tres-pale); }
.ligne-corps { flex: 1; min-width: 0; }
.ligne-tete { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .75rem; }
.ligne-titre { font-weight: 700; font-size: 1.0625rem; color: var(--bleu); text-decoration: none; overflow-wrap: anywhere; }
.ligne-titre::after { content: ""; position: absolute; inset: 0; }
.ligne-titre:hover { text-decoration: underline; }
.ligne-titre:focus-visible { outline: none; }
.ligne-cliquable:has(.ligne-titre:focus-visible) { outline: 3px solid var(--bleu); outline-offset: -3px; }
.ligne-titre-simple { font-size: 1.0625rem; color: var(--encre); overflow-wrap: anywhere; }
.ligne-meta { color: var(--encre-2); font-size: .875rem; margin-top: .25rem; }
.ligne-note { color: var(--encre-2); font-size: .875rem; margin-top: .375rem; }
.ligne-actions { display: flex; flex-wrap: wrap; gap: .5rem; flex: none; position: relative; z-index: 1; }
.ligne-tete .pastille, .ligne-tete .echeance { position: relative; z-index: 1; }
.motif { margin-top: .5rem; padding: .5rem .75rem; border-left: 3px solid #9AA0B4; background: var(--fond); border-radius: 0 var(--rayon) var(--rayon) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.liste-simple .ligne { padding: .75rem 0; }
.adresse { font-weight: 600; overflow-wrap: anywhere; }
.compte { color: var(--encre-2); font-size: .875rem; margin: 0 0 .75rem; min-height: 1.3em; }

@media (max-width: 640px) {
  .ligne { flex-direction: column; align-items: stretch; }
  /* Même base pour le lien et l'enveloppe du bouton Word : sans elle, le padding du lien s'ajoute à sa part. */
  .ligne-actions > .bouton, .ligne-actions > .word { flex: 1 1 8rem; }
  .entete-page .word { width: 100%; }
}

/* ---- bibliothèque, demande ---- */

.recherche { margin-bottom: 1rem; max-width: 36rem; }
.recherche label { display: block; font-weight: 700; font-size: .875rem; margin-bottom: .375rem; }
.proches { margin: -.25rem 0 1.25rem; padding: 1rem 1.125rem; border-radius: var(--rayon); background: var(--bleu-tres-pale); border: 1px solid var(--bleu-pale); }
.proches h2 { font-size: 1rem; }
.proches .aide { margin: .125rem 0 .5rem; }
.proches ul { margin: 0; padding-left: 1.25rem; }
.proches li + li { margin-top: .25rem; }
.proches a { font-weight: 600; }
.confirmation h2 { font-size: 1.25rem; }
.confirmation h2:focus { outline: none; }
.confirmation p { margin-top: .5rem; }

/* ---- connexion ---- */

.corps-connexion .barre-interieur { justify-content: center; }
.carte-connexion { padding: 2rem; }
.carte-connexion h1 { margin-bottom: .25rem; }
.carte-connexion .chapeau { margin-bottom: 1.5rem; }
.pied-connexion { margin-top: 1.25rem; text-align: center; }

/* ---- onglets ---- */

.onglets { display: flex; gap: .25rem; border-bottom: 1px solid var(--filet); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: thin; }
.onglet {
  display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1rem; margin-bottom: -1px; white-space: nowrap;
  font: 700 .9375rem var(--corps); color: var(--encre-2); background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer;
}
.onglet:hover { color: var(--bleu); }
.onglet[aria-selected="true"] { color: var(--bleu); border-bottom-color: var(--bleu); }
.onglet-compte { min-width: 1.5rem; padding: .0625rem .5rem; border-radius: 999px; background: #ECEEF3; color: #3E4459; font-size: .75rem; text-align: center; }
.onglet[aria-selected="true"] .onglet-compte { background: var(--bleu); color: #fff; }
.panneau:focus { outline: none; }
.panneau:focus-visible { outline: 3px solid var(--bleu); outline-offset: 4px; }
.panneau-aide { margin: 0 0 .75rem; }
/* À 390 px, les quatre onglets ne tiennent pas sur une ligne : une grille de deux sur deux, sans défilement caché. */
@media (max-width: 640px) {
  .onglets { display: grid; grid-template-columns: 1fr 1fr; gap: .375rem; border-bottom: 0; overflow: visible; }
  .onglet { justify-content: center; margin: 0; padding: .625rem .5rem; border: 1px solid var(--filet); border-radius: var(--rayon); background: var(--surface); }
  .onglet[aria-selected="true"] { border-color: var(--bleu); background: var(--bleu-pale); }
}

/* ---- équipe ---- */

.titre-compte { color: var(--encre-2); font-weight: 600; }
.tableau-conteneur { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-size: .8125rem; color: var(--encre-2); font-weight: 700; padding: .5rem .75rem; border-bottom: 1px solid var(--filet); }
.tableau td { padding: .625rem .75rem; border-bottom: 1px solid var(--filet); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau select { min-width: 13rem; min-height: 2.5rem; padding: .375rem .5rem; font-size: .9375rem; }
@media (max-width: 640px) {
  .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau tr { padding: .75rem 0; border-bottom: 1px solid var(--filet); }
  .tableau td { border: 0; padding: .25rem 0; }
  .tableau td::before { content: attr(data-libelle); display: block; font-size: .75rem; font-weight: 700; color: var(--encre-2); }
  .tableau select { min-width: 0; }
}

/* ---- éditeur ---- */

.demande-entete { margin-bottom: 1.25rem; }
.demande-titre { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
.demande-infos { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .75rem 1.5rem; margin: 0; }
.demande-infos dt { font-size: .75rem; font-weight: 700; color: var(--encre-2); text-transform: uppercase; letter-spacing: .04em; }
.demande-infos dd { margin: .125rem 0 0; overflow-wrap: anywhere; }
.dd-detail { display: block; color: var(--encre-2); font-size: .8125rem; }
.demande-couvrir { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--filet); }
.demande-couvrir h2 { font-size: .75rem; font-weight: 700; color: var(--encre-2); text-transform: uppercase; letter-spacing: .04em; }
.texte-libre { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: .25rem; max-width: 60rem; }

.editeur-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.editeur-formulaire { min-width: 0; }
.section-form { background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon-carte); box-shadow: var(--ombre); padding: 1.25rem; }
.section-form + .section-form { margin-top: 1rem; }
.section-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .875rem; }
.section-titre { font-size: 1.0625rem; }
.section-compte { color: var(--encre-2); font-size: .8125rem; font-weight: 600; }
.section-form .champ { margin-bottom: .75rem; }
.section-form .champ > label { font-size: .8125rem; }
.section-form input[type=text], .section-form textarea { font-size: .9375rem; min-height: 2.5rem; }
.section-form textarea { min-height: 2.75rem; }
.element { border: 1px solid var(--filet); border-radius: var(--rayon); background: #FAFBFD; padding: .875rem 1rem .75rem; margin-bottom: .75rem; }
.element-tete { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .625rem; }
.element-titre { font-size: .875rem; color: var(--encre); text-transform: uppercase; letter-spacing: .04em; }
.element-outils { display: flex; align-items: center; gap: .375rem; }
.element-outils .bouton-lien { margin-left: .375rem; }
.champs-ligne { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.champs-ligne > .champ { flex: 1 1 12rem; }
.champs-ligne > .champ-court { flex: 0 1 11rem; }
.contient-marqueur { border-left: 4px solid var(--rouge) !important; background: #FFF8F8 !important; }
.sous-liste { margin: .25rem 0 .5rem; }
.sous-liste-titre { font-size: .8125rem; font-weight: 700; margin-bottom: .375rem; }
.sous-liste ul { list-style: none; margin: 0 0 .375rem; padding: 0; }
.sous-element { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem; margin-bottom: .375rem; }
.sous-element .tiret { width: .75rem; padding-top: .55rem; text-align: center; font-weight: 700; color: var(--encre-2); flex: none; }
.sous-element textarea { flex: 1 1 0; min-width: 0; width: auto; min-height: 2.5rem; }
.sous-element .erreur-champ { flex-basis: 100%; padding-left: 1.25rem; margin-top: 0; }
.ajouter { margin-top: .25rem; }

.renvois-bloc { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem .625rem; margin-top: .25rem; }
.renvois-titre { font-size: .75rem; font-weight: 700; color: var(--encre-2); text-transform: uppercase; letter-spacing: .04em; }
.renvois { display: flex; flex-wrap: wrap; gap: .375rem; list-style: none; margin: 0; padding: 0; }
.renvois-vide { font-size: .8125rem; color: var(--encre-2); }
.renvoi-pastille { display: inline-flex; align-items: stretch; border-radius: 999px; background: var(--bleu-pale); overflow: hidden; }
.renvoi-voir, .renvoi-retirer { font: 700 .75rem var(--corps); color: var(--bleu); background: none; border: 0; cursor: pointer; padding: .25rem .5rem; min-height: 1.75rem; }
.renvoi-voir { padding-left: .625rem; }
.renvoi-retirer { padding-right: .625rem; border-left: 1px solid rgba(6, 21, 140, .15); font-size: .875rem; line-height: 1; }
.renvoi-voir:hover, .renvoi-retirer:hover { background: rgba(6, 21, 140, .1); }
.renvoi-retirer:hover { color: var(--rouge-texte); }
.renvoi-voir:focus-visible, .renvoi-retirer:focus-visible { outline-offset: -3px; }

.editeur-apercu {
  position: sticky; top: 1rem; max-height: calc(100vh - 8.5rem); overflow: auto; min-width: 0;
  background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon-carte); box-shadow: var(--ombre);
  padding: 1rem 1.25rem 1.5rem; overscroll-behavior: contain;
}
.colonne-titre { font-size: .8125rem; font-weight: 800; color: var(--encre-2); text-transform: uppercase; letter-spacing: .06em; }
.editeur-apercu .aide { margin: .125rem 0 .875rem; }
.editeur-apercu .colonne-titre + .sources, .lecture-sources .colonne-titre + .sources { margin-top: .5rem; }
.editeur-apercu #titre-sources { margin-top: 1.75rem; }

.sources { list-style: none; margin: 0; padding: 0; }
.source { display: flex; gap: .75rem; padding: .625rem .375rem; border-top: 1px solid var(--filet); border-radius: var(--rayon); transition: background-color .3s; }
.source:first-child { border-top: 0; }
.source:focus { outline: none; }
.source:focus-visible { outline: 3px solid var(--bleu); outline-offset: -3px; }
.source.eclaire { background: var(--orange-pale); }
.source-id { flex: none; min-width: 2.25rem; padding: .0625rem .375rem; border-radius: 999px; background: var(--bleu-pale); color: var(--bleu); font-size: .75rem; font-weight: 800; text-align: center; align-self: flex-start; }
.source-corps { min-width: 0; }
.source-corps a, .source-titre { font-weight: 600; overflow-wrap: anywhere; }
.source mark.a-completer { background: #FFE1E1; color: var(--rouge-texte); font-weight: 700; padding: 0 .125em; box-shadow: inset 0 -2px 0 var(--rouge); }
.source-meta { font-size: .8125rem; color: var(--encre-2); margin-top: .125rem; overflow-wrap: anywhere; }

.barre-actions {
  position: sticky; bottom: 0; z-index: 5; margin-top: 1.25rem; padding: .75rem 1.25rem;
  background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon-carte) var(--rayon-carte) 0 0;
  box-shadow: 0 -6px 18px rgba(16, 24, 64, .08);
}
.barre-actions-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .625rem 1rem; }
.barre-actions-gauche, .barre-actions-droite { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.etat-enregistrement { color: var(--encre-2); font-size: .8125rem; margin-left: .25rem; }
.compteur-marqueurs {
  min-height: 2.75rem; padding: .375rem .875rem; font: 700 .875rem var(--corps); color: var(--rouge-texte);
  background: var(--rouge-pale); border: 1px solid #F3B5B6; border-radius: var(--rayon); cursor: pointer;
}
.compteur-marqueurs:hover:not(:disabled) { border-color: var(--rouge-texte); }
.compteur-marqueurs.compteur-zero { color: var(--bleu); background: var(--bleu-tres-pale); border-color: var(--bleu-pale); cursor: default; }
.raison { font-size: .8125rem; color: var(--encre-2); text-align: right; margin-top: .375rem; }
.raison:empty { display: none; }
.raison-insiste { color: var(--rouge-texte); font-weight: 700; animation: insiste .4s ease-in-out; }
@keyframes insiste { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .raison-insiste { animation: none; } }
.erreurs-fiche { margin-bottom: .75rem; padding: .75rem 1rem; border-radius: var(--rayon); background: var(--rouge-pale); color: var(--rouge-texte); max-height: 12rem; overflow: auto; }
.erreurs-fiche ul { margin: .375rem 0 0; padding-left: 1.25rem; }
.erreurs-fiche .bouton-lien { color: var(--rouge-texte); font-size: .875rem; padding: .125rem 0; }

.attente { display: flex; gap: 1rem; align-items: flex-start; border-left: 4px solid var(--orange); }
.attente-titre, .bandeau-titre { font-weight: 800; font-size: 1.125rem; color: var(--encre); margin-bottom: .25rem; }
.alerte { border-left: 4px solid var(--rouge); }
.alerte h2 { color: var(--rouge-texte); margin-bottom: .5rem; }
.succes { border-left: 4px solid var(--bleu); }
.refus { border-left: 4px solid #7A8095; }
.detail-technique { margin-top: .75rem; }
.detail-technique summary { cursor: pointer; font-weight: 600; color: var(--encre-2); }
.detail-technique pre { margin: .5rem 0 0; padding: .75rem; background: var(--fond); border-radius: var(--rayon); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8125rem; }

.lecture-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
.lecture-apercu .colonne-titre { margin-bottom: .75rem; }
.lecture-sources { background: var(--surface); border: 1px solid var(--filet); border-radius: var(--rayon-carte); box-shadow: var(--ombre); padding: 1rem 1.25rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }

.historique { margin-top: 1.25rem; padding: 0; }
.historique summary { padding: 1rem 1.5rem; cursor: pointer; font-weight: 700; color: var(--bleu); }
.versions { list-style: none; margin: 0; padding: 0 1.5rem 1rem; }
.versions li { padding: .625rem 0; border-top: 1px solid var(--filet); }
.consigne { margin-top: .25rem; color: var(--encre); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .875rem; }

@media (max-width: 1100px) {
  .editeur-colonnes, .lecture-colonnes { grid-template-columns: minmax(0, 1fr); }
  .editeur-apercu, .lecture-sources { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .page { padding: 1.25rem 1rem 3rem; }
  .page-etroite { padding-top: 1.5rem; }
  h1 { font-size: 1.375rem; }
  .carte, .carte-connexion { padding: 1.125rem; }
  .entete-page .bouton { width: 100%; }
  .barre-actions { position: static; padding: .75rem; border-radius: var(--rayon-carte); }
  .barre-actions-gauche .bouton, .barre-actions-droite .bouton { flex: 1 1 auto; }
  .raison { text-align: left; }
}

/* ---- fenêtres de confirmation ---- */

.fenetre {
  width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 0;
  border-radius: var(--rayon-carte); box-shadow: 0 24px 60px rgba(6, 21, 140, .28); color: var(--encre);
}
.fenetre::backdrop { background: rgba(10, 14, 40, .5); }
.fenetre-corps { padding: 1.5rem; }
.fenetre-corps h2 { margin-bottom: 1rem; font-size: 1.25rem; }
.fenetre-corps > p { margin-bottom: 1rem; }
.fenetre-corps .message { margin: 0 0 1rem; }
.fenetre-actions { justify-content: flex-end; margin-top: .5rem; }

/* ---- aperçu de la fiche : l'image du Word du Pôle Projet (Times New Roman 11, A4, marges 2,54 cm) ---- */

/* Les marges suivent la largeur réelle de la page (unités de conteneur) : 2,54 cm sur 21 cm, soit 12,1 %. */
.fiche-lecture, .lecture-apercu, .editeur-apercu { container-type: inline-size; }
.fiche-lecture { display: flex; justify-content: center; }
.page-a4 {
  width: 100%; max-width: 210mm; aspect-ratio: 210 / 297; padding: min(2.54cm, 12.1cqi);
  background: #fff; color: #000; box-shadow: 0 1px 3px rgba(16, 24, 64, .12), 0 6px 20px rgba(16, 24, 64, .08);
  border: 1px solid #D9DCE5;
}
.page-a4-editeur { padding: min(2.54cm, 8cqi); }
.apercu { font-family: "Times New Roman", Times, serif; font-size: 11pt; line-height: 1.15; text-align: justify; hyphens: auto; overflow-wrap: break-word; }
.apercu p { margin: 0; }
.apercu p.vide { height: 1.15em; }
.apercu .cartouche { border: 1pt solid #000; padding: 2pt 4pt; text-align: center; font-weight: bold; }
.apercu h2 {
  margin: 0; padding-left: 1.27cm; text-indent: -.63cm; font: bold 11pt/1.15 "Times New Roman", Times, serif;
  color: #000; letter-spacing: 0;
}
.apercu h2 span { display: inline-block; width: .63cm; text-indent: 0; }
.apercu h2 span.intitule { display: inline; width: auto; text-decoration: underline; }
.apercu ul.tirets { list-style: none; margin: 0; padding: 0 0 0 1.27cm; }
.apercu ul.tirets li { position: relative; }
.apercu ul.tirets li::before { content: "-"; position: absolute; left: -.63cm; }
.apercu strong { font-weight: bold; }
.apercu mark.a-completer { background: #FFE1E1; color: var(--rouge-texte); font-weight: bold; padding: 0 .125em; box-shadow: inset 0 -2px 0 var(--rouge); }
.apercu sup.renvoi {
  display: inline-block; margin-left: .125em; padding: 0 .375em; border-radius: 999px; background: var(--bleu-pale);
  color: var(--bleu); font: 700 .625rem/1.5 var(--corps); vertical-align: super; text-indent: 0;
}
@media (max-width: 640px) {
  .page-a4, .page-a4-editeur { padding: 1.25rem 1rem; aspect-ratio: auto; }
  .apercu { text-align: left; }
}
