:root {
  --encre: #1f3a5f;
  --encre-2: #2c4f7c;
  --texte: #1d2430;
  --doux: #5b6473;
  --trait: #dfe3ea;
  --fond: #f5f3ee;
  --carte: #ffffff;
  --accent: #c8702a;
  --accent-fonce: #a85a1c;
  --ok: #2f7d4f;
  --ok-fond: #e7f3ec;
  --alerte: #9a5b00;
  --alerte-fond: #fdf3e2;
  --erreur: #a3302a;
  --erreur-fond: #fbe9e8;
  --rayon: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texte);
  background: var(--fond);
}
a { color: var(--encre-2); }
h1, h2, h3 { color: var(--encre); line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }

/* Structure : menu latéral fixe, contenu centré (1280 px au plus) dans l'espace à droite du menu */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.barre {
  background: var(--encre);
  color: #dbe4f0;
  padding: 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.marque { color: #fff; text-decoration: none; display: block; }
.marque strong { display: block; font-size: 1.25rem; letter-spacing: .08em; }
.marque span { font-size: .78rem; color: #a9bbd3; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: #dbe4f0; text-decoration: none; padding: .55rem .7rem; border-radius: 7px; font-size: .95rem;
}
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.actif { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
.barre .pied { margin-top: auto; font-size: .82rem; color: #a9bbd3; display: flex; flex-wrap: wrap; align-items: center;
  gap: .25rem .5rem; }
.barre .pied .utilisateur::after { content: "·"; margin-left: .5rem; }
.barre .pied form { display: inline; margin: 0; }
.barre .pied .etat-ia { flex-basis: 100%; white-space: normal; margin-bottom: .2rem; text-align: left; }
.barre .pied button { all: unset; cursor: pointer; text-decoration: underline; }
.barre-haut, .fond-menu { display: none; }

:root { --marge: clamp(1.5rem, 3.5vw, 3rem); }
.contenu { width: 100%; max-width: calc(1280px + 2 * var(--marge)); margin: 0 auto; padding: 2rem var(--marge) 3rem;
  min-width: 0; }
.entete { display: flex; justify-content: space-between; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap;
          margin-bottom: 1.5rem; }
.entete > div:first-child { flex: 1 1 320px; min-width: 0; }
.entete > div:first-child p { max-width: 75ch; }
.entete .sur { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux);
               margin-bottom: .2rem; }

/* Cartes et grilles */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.25rem; }
.carte + .carte, .bloc + .bloc { margin-top: 1.25rem; }
.grille > .carte { margin-top: 0; display: flex; flex-direction: column; }
.grille > .carte > .actions:last-child { margin-top: auto; padding-top: .75rem; }
.grille { display: grid; gap: 1rem; }
.grille > * { min-width: 0; }
code, .meta, .liste .titre { overflow-wrap: anywhere; }
.grille-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bloc h2 { margin-bottom: .75rem; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--trait);
  background: #fff; color: var(--encre); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--encre-2); }
.btn-principal { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-principal:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
.btn-encre { background: var(--encre); border-color: var(--encre); color: #fff; }
.btn-encre:hover { background: var(--encre-2); }
.btn-lien { all: unset; color: var(--erreur); cursor: pointer; font-size: .88rem; text-decoration: underline; }
.btn-petit { padding: .35rem .7rem; font-size: .88rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Documents */
.doc {
  display: flex; flex-direction: column; gap: .5rem;
  background: #fff; border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem;
}
.doc .code { font-weight: 800; font-size: 1.35rem; color: var(--encre); letter-spacing: .02em; }
.doc .desc { color: var(--doux); font-size: .9rem; flex: 1; }
.doc.bientot { background: transparent; border-style: dashed; }
.doc.bientot .code { color: var(--doux); font-size: 1rem; }
.etiquette {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px;
  background: #eef1f6; color: var(--encre); white-space: nowrap; align-self: flex-start;
}
.etiquette.ok { background: var(--ok-fond); color: var(--ok); }
.etiquette.alerte { background: var(--alerte-fond); color: var(--alerte); }
.etiquette.urgent { background: var(--erreur-fond); color: var(--erreur); }

/* Listes de consultations */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0;
            border-top: 1px solid var(--trait); }
.liste li:first-child { border-top: 0; }
.liste .titre { font-weight: 600; color: var(--texte); text-decoration: none; }
.liste .titre:hover { color: var(--encre-2); text-decoration: underline; }
.liste .meta { color: var(--doux); font-size: .87rem; }
.vide { color: var(--doux); font-style: italic; }

/* Jauge de complétude */
.jauge { height: 8px; background: #eceff4; border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.jauge span { display: block; height: 100%; background: var(--ok); }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .5rem; }
.message { padding: .7rem 1rem; border-radius: 8px; border: 1px solid; }
.message.success { background: var(--ok-fond); border-color: #bfe0cc; color: var(--ok); }
.message.warning { background: var(--alerte-fond); border-color: #f1d6a8; color: var(--alerte); }
.message.error { background: var(--erreur-fond); border-color: #efc4c1; color: var(--erreur); }
.encart { padding: .9rem 1rem; border-radius: 8px; background: var(--alerte-fond); color: var(--alerte);
          border: 1px solid #f1d6a8; margin-bottom: 1.25rem; }
.encart strong { color: var(--alerte); }

/* Tableaux */
table.donnees { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.donnees th, table.donnees td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--trait);
                                     vertical-align: top; }
table.donnees th { color: var(--doux); font-weight: 600; font-size: .82rem; text-transform: uppercase;
                   letter-spacing: .04em; }
.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
dl.fiche { display: grid; grid-template-columns: 180px 1fr; gap: .4rem 1rem; margin: 0; }
dl.fiche dt { color: var(--doux); font-size: .9rem; }
dl.fiche dd { margin: 0; }

/* Formulaires */
fieldset { border: 1px solid var(--trait); border-radius: var(--rayon); background: #fff; padding: 1.1rem 1.25rem;
           margin: 0 0 1.25rem; }
legend { font-weight: 700; color: var(--encre); padding: 0 .4rem; }
.champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.25rem; }
.champ { display: flex; flex-direction: column; gap: .3rem; }
.champ.large { grid-column: 1 / -1; }
.champ label { font-weight: 600; font-size: .9rem; }
.champ .aide { color: var(--doux); font-size: .8rem; }
.champ .err { color: var(--erreur); font-size: .85rem; }
.champ.case { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem; }
.champ.case .aide { flex-basis: 100%; padding-left: 1.65rem; margin-top: -.2rem; }
.defile { overflow-x: auto; }
h1 { overflow-wrap: anywhere; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=date],
input[type=datetime-local], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: .5rem .65rem; border: 1px solid #cdd3dd; border-radius: 7px; background: #fff;
  color: var(--texte);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9db6d6; outline-offset: 0; border-color: var(--encre-2); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--encre); }
.barre-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap;
                 position: sticky; bottom: 0; padding: .9rem 0; background: linear-gradient(transparent, var(--fond) 30%); }

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.connexion .carte { width: 100%; max-width: 380px; }
.connexion h1 { font-size: 1.3rem; }

/* Mobile et tablette : barre du haut compacte, menu en panneau par-dessus le contenu */
@media (max-width: 899px) {
  .barre-haut { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
    height: 56px; padding: 0 8px 0 16px; background: var(--encre); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.15); }
  .barre-haut .marque strong { font-size: 1.1rem; }
  .bouton-menu { all: unset; box-sizing: border-box; cursor: pointer; width: 44px; height: 44px; display: grid;
    place-items: center; font-size: 1.45rem; line-height: 1; color: #fff; border-radius: 8px; }
  .bouton-menu:hover { background: rgba(255,255,255,.1); }
  .bouton-menu:focus-visible { outline: 2px solid #9db6d6; }
  .app { display: block; }
  .barre { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(300px, 85vw); height: auto;
    transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  body.menu-ouvert .barre { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.menu-ouvert { overflow: hidden; }
  .fond-menu { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(20, 30, 45, .5); }
  .fond-menu[hidden] { display: none; }
  .barre .nav a { padding: .7rem .75rem; font-size: 1rem; }
  .contenu { padding: 1.25rem 16px 2.5rem; }
  h1 { font-size: 1.4rem; }
  .grille-2, .grille-3, .champs { grid-template-columns: 1fr; }
  dl.fiche { grid-template-columns: 1fr; }
  dl.fiche dd { margin-bottom: .5rem; }
  .liste li { flex-direction: column; align-items: flex-start; }
  /* boutons principaux en pleine largeur */
  .entete > .btn, .entete > .actions:last-child { width: 100%; }
  .entete > .actions:last-child > .btn, .entete > .actions:last-child > form { flex: 1 1 auto; }
  .entete > .actions:last-child > form .btn { width: 100%; }
  .btn-principal { width: 100%; }
  .barre-actions > .btn { flex: 1 1 auto; }
  form > .actions:last-child > .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .barre { transition: none; } }
fieldset { min-width: 0; }

/* Contradictions entre pièces du DCE (analyse IA) */
.contradictions { border: 2px solid var(--erreur); background: var(--erreur-fond); border-radius: var(--rayon);
  padding: 1rem 1.1rem; margin-bottom: 1.5rem; }
.contradictions .titre { color: var(--erreur); font-size: 1.05rem; display: block; margin-bottom: .6rem; }
.contradiction { background: var(--carte); border-radius: 8px; padding: .75rem .9rem; margin-top: .6rem; }
.contradiction .sujet { font-weight: 600; margin-bottom: .4rem; }
.contradiction .versions { gap: .75rem; font-size: .92rem; }
.contradiction .piece { display: block; color: var(--erreur); font-size: .8rem; font-weight: 600; margin-bottom: .15rem; }
.contradiction .question { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--trait); font-size: .92rem; }

/* Citations de l'IA non retrouvées dans les pièces */
.contradictions.non-verifiees { border: 1px dashed var(--doux); background: #f1f1f1; color: var(--doux); }
.contradictions.non-verifiees .titre, .contradictions.non-verifiees .piece { color: var(--doux); }
.contradictions.non-verifiees .contradiction { background: #fafafa; }
.mention-verif { margin-top: .4rem; font-size: .82rem; font-style: italic; color: var(--doux); }
.citation { margin-top: .3rem; font-size: .85rem; color: var(--doux); }
tr.non-verifie td { color: var(--doux); background: #f4f4f4; }
.pieces-analysees { margin-bottom: 1rem; padding: .6rem .8rem; border: 1px solid var(--trait); border-radius: 8px;
  font-size: .9rem; line-height: 1.9; }
.consequence { margin-top: .35rem; font-size: .88rem; }
li.non-verifie { color: var(--doux); }

/* Fenêtre « Nouvelle consultation » */
.modale { width: min(860px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0;
  border-radius: var(--rayon); background: var(--fond); color: var(--texte); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modale::backdrop { background: rgba(20, 30, 45, .55); }
.modale-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; position: sticky; top: 0;
  z-index: 1; background: var(--carte); border-bottom: 1px solid var(--trait); padding: .9rem 1.25rem; }
.modale-tete h2 { margin: 0; }
.modale-fermer { all: unset; cursor: pointer; font-size: 1.6rem; line-height: 1; color: var(--doux); padding: 0 .3rem; }
.modale-fermer:hover { color: var(--texte); }
.modale-corps { padding: 1.1rem 1.25rem 0; }
.modale-intro { color: var(--doux); font-size: .92rem; }
.modale-actions { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap;
  position: sticky; bottom: 0; padding: .9rem 0 1.1rem; background: linear-gradient(transparent, var(--fond) 30%); }
.lien-discret { color: var(--doux); font-size: .88rem; }
.zones-depot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.zone-depot { display: flex; flex-direction: column; gap: .45rem; justify-content: center; min-height: 150px;
  padding: 1.1rem; border: 2px dashed #b9c3d2; border-radius: var(--rayon); background: var(--carte); cursor: pointer;
  text-align: center; align-items: center; }
.zone-depot:hover, .zone-depot.survol { border-color: var(--encre-2); background: #f3f6fb; }
.zone-depot.remplie { border-style: solid; border-color: var(--ok); }
.zone-titre { font-weight: 700; color: var(--encre); }
.zone-aide { color: var(--doux); font-size: .85rem; }
.zone-fichier { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: center;
  font-size: .9rem; font-weight: 600; color: var(--ok); overflow-wrap: anywhere; }
.err[data-erreur] { margin: .75rem 0 0; color: var(--erreur); }
.progression { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .6rem; }
.progression li { padding: .65rem .9rem; border-radius: 8px; background: var(--carte); border: 1px solid var(--trait);
  color: var(--doux); }
.progression li.en-cours { color: var(--encre); font-weight: 600; border-color: var(--encre-2); }
.progression li.en-cours::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .6rem;
  border: 2px solid var(--encre-2); border-right-color: transparent; border-radius: 50%; vertical-align: -.05em;
  animation: tourne 1s linear infinite; }
.progression li.fait { color: var(--ok); }
.progression li.fait::before { content: "✓ "; }
@keyframes tourne { to { transform: rotate(360deg); } }
.fichiers-joints { font-size: .9rem; color: var(--doux); margin: 0 0 1rem; }
.encart-erreur { background: var(--erreur-fond); color: var(--erreur); border-color: #efc4c1; }
.encart-erreur strong { color: var(--erreur); }
button.etiquette { border: 0; font: inherit; font-size: .72rem; font-weight: 600; cursor: help; margin-left: .35rem;
  vertical-align: .1em; }
.origine-vide { margin-left: .35rem; font-size: .72rem; color: var(--doux); background: #f0f0f0; font-style: italic; }
.citation-ia { display: block; font-size: .82rem; color: var(--doux); background: #f7f7f4; border-left: 3px solid var(--trait);
  padding: .3rem .55rem; }
.choix-lots .libelle { font-weight: 600; font-size: .9rem; }
.case-lot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.case-lot .citation-ia { flex-basis: 100%; }
.citation-ia[hidden] { display: none; }
.notes-ia { font-size: .88rem; color: var(--doux); gap: .2rem; }
@media (max-width: 899px) {
  .modale { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; margin: 0; border-radius: 0; }
  .modale-tete { padding: .75rem 16px; }
  .modale-corps { padding: 1rem 16px 0; }
  .zones-depot { grid-template-columns: 1fr; }
  .zone-depot { min-height: 110px; }
}

/* Lecture des pièces (texte numérique, OCR) */
.message.info { background: #eef3fa; border-color: #c9d8ec; color: var(--encre); }
.lecture-en-cours::before { content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .4rem;
  border: 2px solid var(--encre-2); border-right-color: transparent; border-radius: 50%; vertical-align: -.05em;
  animation: tourne 1s linear infinite; }
.lecture-en-cours { white-space: normal; }

/* « Lot(s) visé(s) » en lecture seule : il découle des cases des lots */
input[readonly] { background: #f4f5f7; color: var(--doux); cursor: default; }

/* Suivi des documents des sous-traitants */
.pastille { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; padding: .15rem .55rem;
  border-radius: 999px; white-space: nowrap; }
.pastille::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.pastille.valide { background: var(--ok-fond); color: var(--ok); }
.pastille.bientot { background: #fdf0d8; color: #9a6400; }
.pastille.expire { background: var(--erreur-fond); color: var(--erreur); }
.pastille.manquant { background: #eef0f3; color: #6b7380; }
.pastille.verifier { background: #efecfa; color: #5a4aa6; }
.zone-documents { min-height: 110px; margin-bottom: .75rem; position: relative; }
.zone-documents .champ-fichiers { position: absolute; width: 1px; height: 1px; opacity: 0; }
.zone-documents .zone-titre { cursor: pointer; }
.zone-documents:focus-within { outline: 2px solid #9db6d6; }
table.documents .nom-fichier { font-size: .82rem; margin-top: .15rem; overflow-wrap: anywhere; }
table.documents tr.ancien td { color: var(--doux); background: #fafaf8; }
table.documents tr.details-document td { border-top: 0; padding-top: 0; }
table.documents tr.details-document + tr.correction td, table.documents tr.correction td { background: #f7f8fb; }
.alerte-document { color: #5a4aa6; font-size: .86rem; margin-bottom: .2rem; }
.valeurs-lues { font-size: .82rem; color: var(--doux); }
.valeurs-lues ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.formulaire-correction { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; }
.formulaire-correction label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; }
.formulaire-correction select, .formulaire-correction input { width: auto; }
.formulaire-correction .aide { flex-basis: 100%; color: var(--doux); font-size: .8rem; }
table.types-documents input[type=text], table.types-documents input[type=number] { min-width: 4rem; }
tr.historique details summary { cursor: pointer; color: var(--encre-2); font-size: .88rem; }

/* Onglets (Vue d'ensemble, Types de documents, Alertes et e-mail) : défilent sans passer à la ligne */
.onglets { display: flex; gap: .3rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin;
  margin: -.5rem 0 1.25rem; border-bottom: 1px solid var(--trait); -webkit-overflow-scrolling: touch; }
.onglets a { flex: 0 0 auto; white-space: nowrap; padding: .55rem .85rem; text-decoration: none; color: var(--doux);
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: .92rem; }
.onglets a.actif { color: var(--encre); border-bottom-color: var(--accent); }

/* Compteurs : conformité globale mise en avant, puis les cinq statuts */
.compteurs { display: grid; grid-template-columns: minmax(240px, 1fr) 3fr; gap: .75rem; margin-bottom: 1.25rem; }
.compteurs-statuts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.compteur { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .8rem .95rem;
  border-top: 4px solid var(--encre); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.compteur .valeur { display: block; font-size: 1.6rem; font-weight: 800; color: var(--encre); line-height: 1.15; }
.compteur .libelle { color: var(--doux); font-size: .82rem; }
.compteur.valide { border-top-color: var(--ok); }
.compteur.bientot { border-top-color: #d99a1e; }
.compteur.expire { border-top-color: var(--erreur); }
.compteur.manquant { border-top-color: #9aa3b0; }
.compteur.verifier { border-top-color: #6c5bb3; }
.compteur-principal { border-top-color: var(--accent); gap: .2rem; }
.compteur-principal .libelle { font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; }
.compteur-principal .valeur { font-size: 2.3rem; }
.compteur-principal .jauge { margin: .3rem 0 .2rem; }
.compteur-principal .detail { color: var(--doux); font-size: .8rem; }

/* Filtres appliqués automatiquement */
.filtres { display: flex; gap: .6rem; flex-wrap: nowrap; align-items: center; margin-bottom: 1rem; }
.filtres input[type=search] { flex: 2 1 260px; min-width: 0; font: inherit; padding: .5rem .65rem;
  border: 1px solid #cdd3dd; border-radius: 7px; background: #fff; }
.filtres select { flex: 1 1 200px; width: auto; min-width: 0; }
.filtres .lien-discret { flex: 0 0 auto; white-space: nowrap; }

/* Tableau sous-traitants × types : colonnes de pastilles de même largeur */
table.matrice { table-layout: fixed; min-width: 860px; }
table.matrice col.col-nom { width: 22%; }
table.matrice col.col-conformite { width: 118px; }
table.matrice th { padding-left: .35rem; padding-right: .35rem; }
table.matrice th:last-child { text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--encre); }
table.matrice th.type { text-align: center; text-transform: none; letter-spacing: 0; font-size: .82rem; color: var(--encre);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help; }
table.matrice td.case { text-align: center; vertical-align: middle; }
table.matrice td { vertical-align: middle; }
.pastille.compacte { font-size: .72rem; padding: .15rem .45rem; gap: .25rem; }
.pastille.compacte::before { width: .5rem; height: .5rem; }
table.matrice .echeance { font-size: .75rem; color: var(--doux); margin-top: .2rem; }
table.matrice .jauge { width: 100%; max-width: 90px; margin: .3rem 0 0 auto; }
.nom-st { font-weight: 700; color: var(--encre-2); overflow-wrap: anywhere; }
.meta-st { display: block; color: var(--doux); font-size: .8rem; }

/* Mobile : une carte par sous-traitant à la place du tableau */
.cartes-st { display: none; }
.carte-st { display: flex; flex-direction: column; gap: .55rem; background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--rayon); padding: .95rem 1rem; color: inherit; text-decoration: none; }
.carte-st:hover, .carte-st:focus-visible { border-color: var(--encre-2); }
.carte-st + .carte-st { margin-top: .75rem; }
.carte-st-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.carte-st-taux { font-size: 1.25rem; font-weight: 800; color: var(--encre); white-space: nowrap; }
.carte-st .jauge { margin: 0; }
.carte-st-documents { display: grid; gap: .35rem; }
.carte-st-document { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .88rem; }
.carte-st-document > span:first-child { min-width: 0; }

/* État vide */
.etat-vide { text-align: center; padding: 2.5rem 1.5rem; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.etat-vide p { max-width: 60ch; color: var(--doux); }
.etat-vide .btn { width: auto; }
.etat-vide-icone { font-size: 2.4rem; line-height: 1; }
.etat-vide-petit { padding: 1.5rem; }

@media (max-width: 1100px) {
  .compteurs { grid-template-columns: 1fr; }
}
@media (max-width: 899px) {
  .compteurs-statuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compteur-principal .valeur { font-size: 2rem; }
  .filtres { flex-direction: column; align-items: stretch; }
  .filtres input[type=search], .filtres select { flex: 0 0 auto; width: 100%; }
  .filtres .lien-discret { align-self: flex-end; }
  .vue-tableau, .vue-tableau-seule { display: none; }
  .cartes-st { display: block; margin-bottom: 1rem; }
}
@media (max-width: 559px) {
  .compteurs-statuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Tableaux sur téléphone : lignes empilées, intitulé de colonne au-dessus de chaque valeur (mise_en_page.js) */
@media (max-width: 699px) {
  table.empilable, table.empilable > tbody, table.empilable > tbody > tr, table.empilable > tbody > tr > td {
    display: block; width: 100%; }
  table.empilable > thead { display: none; }
  table.empilable > tbody > tr { padding: .65rem 0; border-bottom: 1px solid var(--trait); }
  table.empilable > tbody > tr[hidden] { display: none; }
  table.empilable > tbody > tr > td { border: 0; padding: .2rem 0; text-align: left; white-space: normal; }
  table.empilable > tbody > tr > td:empty { display: none; }
  table.empilable > tbody > tr > td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem;
    font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); margin-bottom: .1rem; }
  table.empilable td .actions { justify-content: flex-start; }
}

/* Visionneuse des documents : grande fenêtre sur ordinateur, plein écran sur mobile */
.visionneuse { width: min(1200px, calc(100vw - 2rem)); height: calc(100vh - 2rem); max-height: none; max-width: none;
  padding: 0; border: 0; border-radius: var(--rayon); background: var(--fond); color: var(--texte);
  box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden; }
.visionneuse.avec-panneau { width: min(1440px, calc(100vw - 2rem)); }
.visionneuse::backdrop { background: rgba(20, 30, 45, .7); }
.visionneuse-cadre { display: flex; flex-direction: column; height: 100%; }
.visionneuse-tete { display: flex; align-items: center; gap: .75rem 1rem; padding: .6rem 1rem; background: var(--carte);
  border-bottom: 1px solid var(--trait); flex-wrap: wrap; }
.visionneuse-tete h2 { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 1rem; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.visionneuse-navigation { display: flex; align-items: center; gap: .3rem; }
.visionneuse-fleche { all: unset; box-sizing: border-box; cursor: pointer; width: 36px; height: 36px; display: grid;
  place-items: center; font-size: 1.6rem; line-height: 1; border-radius: 8px; color: var(--encre); border: 1px solid var(--trait); }
.visionneuse-fleche:hover { border-color: var(--encre-2); }
.visionneuse-fleche:disabled { opacity: .35; cursor: default; }
.visionneuse-fleche[hidden] { display: none; }
.visionneuse-position { font-size: .85rem; color: var(--doux); min-width: 3.2em; text-align: center; }
.visionneuse-actions { display: flex; align-items: center; gap: .5rem; }
.visionneuse-actions [hidden] { display: none; }
.visionneuse .texte-court { display: none; }
.visionneuse-corps { flex: 1; min-height: 0; display: flex; }
.visionneuse-document { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #525659; }
.visionneuse-document iframe { flex: 1; width: 100%; border: 0; background: #525659; }
.visionneuse-document.genre-texte { background: var(--fond); overflow: auto; }
.visionneuse-message { margin: .75rem; padding: .7rem 1rem; border-radius: 8px; background: var(--alerte-fond);
  color: var(--alerte); border: 1px solid #f1d6a8; }
.visionneuse-message.attente { background: #eef3fa; color: var(--encre); border-color: #c9d8ec; }
.visionneuse-message.erreur { background: var(--erreur-fond); color: var(--erreur); border-color: #efc4c1; }
.genre-pdf .visionneuse-message + .btn { align-self: center; margin: 1rem; }
.visionneuse-texte { margin: 0 .75rem .75rem; padding: 1rem; background: var(--carte); border: 1px solid var(--trait);
  border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; line-height: 1.5; flex: 1; }
.visionneuse-image { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.visionneuse-image img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.visionneuse-image.zoom { cursor: zoom-out; display: block; }
.visionneuse-image.zoom img { max-width: none; max-height: none; }
.visionneuse-panneau { width: 380px; flex: 0 0 380px; overflow-y: auto; background: var(--carte); border-left: 1px solid var(--trait);
  padding: 1rem 1.1rem; }
.verification h3 { font-size: .95rem; margin: 0 0 .5rem; }
.verification-statut { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.verification-valeurs { display: grid; grid-template-columns: 1fr; gap: .1rem; margin: .5rem 0 1rem; font-size: .9rem; }
.verification-valeurs dt { color: var(--doux); font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; margin-top: .55rem; }
.verification-valeurs dd { margin: 0; }
.verification-valeurs .mention-verif, .valeur-lue { display: block; }
.valeur-lue { font-size: .82rem; color: var(--doux); margin-top: .1rem; }
.valeur-lue.non-verifie em { color: #5a4aa6; }
.verification-correction { display: grid; gap: .6rem; border-top: 1px solid var(--trait); padding-top: .9rem; }
.verification-correction label { display: grid; gap: .25rem; font-size: .85rem; font-weight: 600; }
.verification-correction .aide { color: var(--doux); font-size: .8rem; }
.verification-message { margin: 0; padding: .5rem .7rem; border-radius: 7px; font-size: .88rem; }
.verification-message.ok { background: var(--ok-fond); color: var(--ok); }
.verification-message.erreur { background: var(--erreur-fond); color: var(--erreur); }

/* Vignettes de la liste des documents */
.document-titre { display: flex; gap: .65rem; align-items: flex-start; }
.vignette-lien { flex: 0 0 auto; line-height: 0; }
.vignette { width: 48px; height: auto; max-height: 66px; object-fit: cover; object-position: top; border: 1px solid var(--trait);
  border-radius: 4px; background: #fff; }
a.nom-piece { font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 899px) {
  .visionneuse, .visionneuse.avec-panneau { width: 100vw; height: 100%; max-height: 100%; margin: 0; border-radius: 0; }
  .visionneuse-tete { position: relative; padding: .55rem .75rem; gap: .5rem; flex-wrap: wrap; }
  .visionneuse-tete h2 { order: -1; flex: 1 1 100%; white-space: normal; padding-right: 40px; }
  .visionneuse-tete .modale-fermer { position: absolute; top: .3rem; right: .55rem; padding: .3rem .5rem; }
  .visionneuse-navigation { flex: 0 0 auto; gap: .2rem; }
  .visionneuse-fleche { width: 34px; height: 34px; }
  .visionneuse-position { min-width: 2.8em; }
  .visionneuse-actions { flex: 1 1 auto; justify-content: flex-end; flex-wrap: nowrap; gap: .4rem; }
  .visionneuse-actions .btn { padding: .3rem .5rem; font-size: .8rem; }
  .visionneuse .texte-long { display: none; }
  .visionneuse .texte-court { display: inline; }
  .visionneuse-corps { flex-direction: column; overflow-y: auto; }
  .visionneuse-document { flex: 0 0 auto; height: 72vh; }
  .visionneuse-document.genre-texte { height: auto; min-height: 40vh; }
  .visionneuse-panneau { width: auto; flex: 0 0 auto; border-left: 0; border-top: 1px solid var(--trait); overflow: visible; }
}

/* Colonne des actions d'un document : largeur de son contenu, boutons empilés */
table.documents > tbody > tr > td:last-child:not([colspan]) { width: 1%; }
table.documents th, table.documents td { padding-left: .45rem; padding-right: .45rem; }
table.documents .etiquette { white-space: normal; }
table.documents td:last-child .btn-lien { white-space: normal; }
table.documents > tbody > tr > td:last-child > .actions { flex-direction: column; align-items: stretch; gap: .3rem; }
table.documents > tbody > tr > td:last-child > .actions form { display: block; }
table.donnees > tbody > tr > td:last-child > .actions .btn { width: 100%; }
@media (max-width: 699px) {
  table.documents > tbody > tr > td:last-child:not([colspan]) { width: 100%; }
  table.documents > tbody > tr > td:last-child > .actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  table.donnees > tbody > tr > td:last-child > .actions .btn { width: auto; }
}

/* ===== Listes de documents (fiche sous-traitant, pièces du DCE) ===== */
.icone { flex: 0 0 auto; vertical-align: -.2em; }
.btn .icone { margin-right: .1rem; }
.btn-discret { border-color: transparent; background: transparent; color: var(--doux); }
.btn-discret:hover { color: var(--encre); border-color: var(--trait); }
.btn-danger { color: var(--erreur); }
.btn-danger:hover { border-color: var(--erreur); }

/* En-tête de la fiche */
.entete-fiche .identite { display: flex; gap: 1rem; align-items: center; flex: 1 1 360px; min-width: 0; }
.identite-icone { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: #e9eef6; color: var(--encre); }
.entete-fiche h1 { margin: 0; }
.identite-meta { color: var(--doux); font-size: .9rem; margin: .2rem 0 0; line-height: 1.7; }
.identite-meta > span { white-space: nowrap; }
.identite-conformite { display: inline-flex; align-items: center; gap: .5rem; vertical-align: middle; }
.identite-conformite .jauge { width: 90px; margin: 0; display: inline-block; }
.fiche-compacte { grid-template-columns: max-content 1fr; gap: .3rem 1.5rem; font-size: .92rem; }
.coordonnees { padding: .9rem 1.25rem; }

/* Zone de dépôt : toute la liste */
.liste-documents { position: relative; border-radius: var(--rayon); }
.liste-documents.survol { outline: 2px dashed var(--accent); outline-offset: 6px; }
.liste-documents.survol::after { content: "Déposez vos fichiers ici"; position: absolute; inset: 0; display: grid;
  place-items: center; background: rgba(245, 243, 238, .85); color: var(--accent-fonce); font-weight: 700; font-size: 1.1rem;
  border-radius: var(--rayon); pointer-events: none; }
.depot-sans-script { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.depot-indication { margin-bottom: .75rem; padding: .6rem .9rem; border-radius: 8px; background: #eef3fa; color: var(--encre);
  font-weight: 600; }
.pied-liste { margin-top: .6rem; }

/* Filtres */
.filtres-documents { display: flex; gap: .6rem; align-items: center; padding: .7rem .8rem; margin-bottom: .9rem; }
.filtres-documents .recherche { flex: 2 1 280px; position: relative; display: flex; align-items: center; min-width: 0; }
.filtres-documents .recherche .icone { position: absolute; left: .65rem; color: var(--doux); pointer-events: none; }
.filtres-documents .recherche input { width: 100%; font: inherit; padding: .5rem .65rem .5rem 2.2rem; border: 1px solid #cdd3dd;
  border-radius: 7px; background: #fff; }
.filtres-documents select { flex: 1 1 150px; width: auto; min-width: 0; }
.filtres-documents .btn { flex: 0 0 auto; }

/* Barre de sélection */
.barre-selection { display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap;
  padding: .6rem .9rem; margin-bottom: .75rem; border-radius: var(--rayon); background: var(--encre); color: #fff; }
.barre-selection[hidden] { display: none; }
.barre-selection [data-selection-compte] { font-weight: 700; }
.barre-selection .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.barre-selection .btn:hover { background: rgba(255,255,255,.2); }
.barre-selection .btn-encre { background: #fff; color: var(--encre); border-color: #fff; }
.barre-selection .btn-danger { color: #ffd6d2; }

/* Tableau */
.carte-tableau { padding: 0; overflow: visible; }
.table-docs { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.table-docs th { text-align: left; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--doux); padding: .8rem .75rem; border-bottom: 1px solid var(--trait); background: #fafaf8; white-space: nowrap; }
.table-docs th:first-child { border-top-left-radius: var(--rayon); }
.table-docs th:last-child { border-top-right-radius: var(--rayon); }
.table-docs td { padding: .95rem .75rem; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
.table-docs tbody tr:last-child td { border-bottom: 0; }
.table-docs tbody tr:hover td { background: #f8f9fb; }
.table-docs tr[hidden] { display: none; }
.tri { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .25rem; }
.tri .icone { opacity: .45; }
.tri:hover .icone, .tri.tri-actif .icone { opacity: 1; color: var(--accent); }
.tri.tri-descendant .icone { transform: scaleY(-1); }
.tri:focus-visible { outline: 2px solid #9db6d6; border-radius: 4px; }
.col-case { width: 2.4rem; text-align: center; }
.col-case input { width: 16px; height: 16px; }
.col-taille { white-space: nowrap; color: var(--doux); }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.document { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.document-texte { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; min-width: 0; }
.titre-doc { all: unset; font-weight: 700; color: var(--encre); cursor: pointer; overflow-wrap: anywhere; }
a.titre-doc, button.titre-doc:hover, .nom-doc:hover { text-decoration: underline; }
span.titre-doc { cursor: default; text-decoration: none; }
.nom-doc { all: unset; font-size: .82rem; color: var(--doux); cursor: pointer; overflow-wrap: anywhere; }
span.nom-doc { cursor: default; }
.titre-doc:focus-visible, .nom-doc:focus-visible { outline: 2px solid #9db6d6; border-radius: 3px; }
.lecture-doc .etiquette { font-size: .68rem; padding: .05rem .45rem; }
.date { display: block; white-space: nowrap; }
.meta-doc { display: block; font-size: .8rem; color: var(--doux); }
.meta-doc.depasse { color: var(--erreur); }
.ligne-manquante td { color: var(--doux); }
.ligne-manquante .titre-doc { color: var(--doux); }
.ligne-manquante td:not(.col-actions) { opacity: .85; }
.ligne-vide td { text-align: center; color: var(--doux); padding: 1.5rem; }
.alerte-document { display: block; margin-top: .3rem; font-size: .78rem; color: #5a4aa6; max-width: 26ch; }

/* Icône du format */
.icone-format { flex: 0 0 auto; width: 34px; height: 40px; display: grid; place-items: center; }
.icone-format svg { display: block; }
.icone-format .fond { fill: #f3f4f6; stroke: #c8cdd6; stroke-width: 1.5; }
.icone-format .pli { fill: none; stroke: #c8cdd6; stroke-width: 1.5; }
.icone-format text { font: 700 9px system-ui, sans-serif; fill: #6b7380; letter-spacing: .02em; }
.format-pdf .fond { fill: #fdecec; stroke: #e7a3a0; } .format-pdf .pli { stroke: #e7a3a0; } .format-pdf text { fill: #c0392b; }
.format-word .fond { fill: #e8f0fb; stroke: #9db6d6; } .format-word .pli { stroke: #9db6d6; } .format-word text { fill: #2b5797; }
.format-excel .fond { fill: #e7f3ec; stroke: #9fcfb2; } .format-excel .pli { stroke: #9fcfb2; } .format-excel text { fill: #217346; }
.format-manquant { color: #b6bcc7; border: 1.5px dashed #c8cdd6; border-radius: 6px; }

/* Étiquettes de type : une couleur douce par type */
.type-doc { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  white-space: nowrap; background: #eef0f3; color: #4b5563; }
.type-doc.couleur-1 { background: #e6eefb; color: #2a4f86; }
.type-doc.couleur-2 { background: #e5f4ec; color: #22703f; }
.type-doc.couleur-3 { background: #efeafb; color: #5a3fa0; }
.type-doc.couleur-4 { background: #fdeedd; color: #a3561a; }
.type-doc.couleur-5 { background: #e2f3f4; color: #1f6b70; }
.type-doc.couleur-6 { background: #fbe8f0; color: #a0335f; }
.type-doc.couleur-7 { background: #fbf3d9; color: #8a6a00; }

/* Statut avec icône */
.statut { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem .22rem .45rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap; }
.statut-valide { background: var(--ok-fond); color: var(--ok); }
.statut-bientot { background: #fdf0d8; color: #9a6400; }
.statut-expire { background: var(--erreur-fond); color: var(--erreur); }
.statut-verifier { background: #efecfa; color: #5a4aa6; cursor: help; }
.statut-manquant { background: #eef0f3; color: #6b7380; }
.statut-ocr { background: #e6eefb; color: #2a4f86; }
.statut-cours { background: #eef3fa; color: var(--encre); white-space: normal; }

/* Actions et menu « ⋮ » */
.actions-doc { display: inline-flex; gap: .4rem; align-items: center; }
.btn-menu { padding: .35rem .45rem; }
.menu-doc { position: relative; }
.menu-doc-liste { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 230px; padding: .35rem;
  background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; box-shadow: 0 10px 30px rgba(20,30,45,.18);
  text-align: left; white-space: normal; }
.menu-doc-liste.vers-le-haut { top: auto; bottom: calc(100% + 4px); }
.menu-doc-liste[hidden] { display: none; }
.menu-doc-liste form { margin: 0; }
.menu-doc-liste button, .menu-doc-type label { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center;
  gap: .55rem; padding: .5rem .6rem; border-radius: 7px; cursor: pointer; font-size: .9rem; color: var(--texte); }
.menu-doc-liste button:hover, .menu-doc-liste button:focus-visible { background: #f1f4f8; }
.menu-doc-liste .danger { color: var(--erreur); }
.menu-doc-liste .danger:hover { background: var(--erreur-fond); }
.menu-doc-type label { flex-wrap: wrap; cursor: default; }
.menu-doc-type select { flex-basis: 100%; margin-top: .2rem; }
tr.menu-ouvert td { position: relative; z-index: 5; }

/* Historique des versions */
.fenetre-historique { width: min(640px, calc(100vw - 2rem)); }
.liste-versions { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .5rem; }
.liste-versions li { display: flex; align-items: center; gap: .75rem; padding: .6rem; border: 1px solid var(--trait);
  border-radius: 8px; background: var(--carte); flex-wrap: wrap; }
.version-texte { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }

/* Pièces du DCE */
.entete-section { margin-bottom: .75rem; }
.depot-pieces input[type=file] { max-width: 260px; font-size: .88rem; }

/* Mobile : une carte par document */
@media (max-width: 899px) {
  .entete-fiche .actions { width: 100%; }
  .entete-fiche .actions .btn { flex: 1 1 auto; }
  .filtres-documents { flex-direction: column; align-items: stretch; }
  .filtres-documents .recherche, .filtres-documents select { flex: 0 0 auto; width: 100%; }
  .filtres-documents .btn { align-self: flex-end; }
  .carte-tableau { background: transparent; border: 0; }
  .table-docs, .table-docs tbody { display: block; }
  .table-docs thead { display: none; }
  .table-docs tr.ligne-doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem .75rem; align-items: start;
    background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .85rem .9rem;
    margin-bottom: .7rem; }
  .table-docs tr.ligne-doc[hidden] { display: none; }
  .table-docs tbody tr:hover td { background: transparent; }
  .table-docs td { display: block; padding: 0; border: 0; }
  .table-docs .col-case { grid-column: 2; grid-row: 1; width: auto; }
  .table-docs .col-document { grid-column: 1; grid-row: 1; }
  .table-docs .col-type { grid-column: 1; grid-row: 2; }
  .table-docs .col-statut { grid-column: 2; grid-row: 2; text-align: right; max-width: 52vw; }
  .table-docs .col-statut .alerte-document { margin-left: auto; }
  .table-docs .col-emission { display: none; }
  .table-docs .col-expiration { grid-column: 1 / -1; grid-row: 3; }
  .table-docs .col-taille { display: none; }
  .table-docs .col-actions { grid-column: 1 / -1; grid-row: 4; width: auto; text-align: left; padding-top: .4rem;
    border-top: 1px solid #eef0f3; }
  .table-docs .col-expiration .date { display: inline; }
  .table-docs .col-expiration .meta-doc { display: inline; margin-left: .35rem; }
  .table-docs .col-expiration .meta-doc + .meta-doc { display: none; }
  .table-pieces .col-emission { display: block; grid-column: 1; grid-row: 3; }
  .table-pieces .col-emission .date, .table-pieces .col-emission .meta-doc { display: inline; margin-right: .35rem; }
  .table-pieces .col-taille { display: block; grid-column: 2; grid-row: 3; text-align: right; }
  .table-docs .actions-doc { display: flex; width: 100%; }
  .table-docs .actions-doc > .btn { flex: 1; }
  .table-docs .ligne-vide { display: block; background: var(--carte); border-radius: var(--rayon); }
  .table-docs .ligne-vide td { display: block; }
  .alerte-document { max-width: none; }
  .depot-pieces { width: 100%; }
  .depot-pieces input[type=file] { max-width: none; flex: 1 1 100%; }
}

/* Vignette de la première page au survol de l'icône du format */
.avec-vignette { position: relative; display: inline-flex; }
.vignette-survol { display: none; position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  z-index: 15; width: 120px; height: auto; border: 1px solid var(--trait); border-radius: 6px; background: #fff;
  box-shadow: 0 8px 24px rgba(20,30,45,.2); pointer-events: none; }
.avec-vignette:hover .vignette-survol { display: block; }
@media (hover: none) { .vignette-survol { display: none !important; } }

/* Largeur du tableau : marges resserrées ; entre 900 et 1440 px, « Télécharger » réduit à son icône */
.table-docs th, .table-docs td { padding-left: .55rem; padding-right: .55rem; }
.table-docs th:first-child, .table-docs td:first-child { padding-left: .9rem; }
.table-docs th:last-child, .table-docs td:last-child { padding-right: .9rem; }
.table-docs .alerte-document { max-width: 24ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; cursor: help; }
@media (min-width: 900px) and (max-width: 1439px) {
  .bouton-telecharger > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bouton-telecharger { padding: .4rem .5rem; }
  .bouton-telecharger .icone { margin: 0; }
}
.date-courte { display: none; }
@media (min-width: 900px) and (max-width: 1439px) { .date-longue { display: none; } .date-courte { display: inline; } }

/* Explication du statut : dans la colonne Statut sur grand écran, sur sa propre ligne de la carte sur mobile */
.table-docs td.col-alerte { display: none; }
@media (max-width: 899px) {
  .table-docs .col-statut .alerte-large { display: none; }
  .table-docs .col-statut { max-width: none; }
  .table-docs td.col-alerte { grid-column: 1 / -1; grid-row: 3; }
  .table-docs td.col-alerte:not(:empty) { display: block; }
  .table-docs td.col-alerte .alerte-document { margin: 0; -webkit-line-clamp: 3; max-width: none; }
  .table-docs .col-expiration { grid-row: 4; }
  .table-docs .col-actions { grid-row: 5; }
  /* pièces du DCE : texte extrait en pleine largeur */
  .table-pieces .col-statut { grid-column: 1 / -1; grid-row: 3; text-align: left; display: flex; flex-wrap: wrap;
    align-items: center; gap: .3rem .5rem; }
  .table-pieces .col-statut .meta-doc { display: inline; }
  .table-pieces .col-emission { grid-row: 4; }
  .table-pieces .col-taille { grid-row: 4; }
}
@media (max-width: 899px) {
  /* type à gauche, statut à droite sur la même ligne : la colonne de droite ne garde que la case à cocher */
  .table-docs:not(.table-pieces) .col-type { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .table-docs:not(.table-pieces) .col-statut { grid-column: 1 / -1; grid-row: 2; justify-self: end; }
  .titre-doc, .nom-doc { overflow-wrap: break-word; }
}
.table-docs .etiquette { white-space: normal; }
.table-docs .col-document { min-width: 200px; }
.titre-doc, .nom-doc { overflow-wrap: break-word; word-break: normal; }
input[type=file] { font: inherit; font-size: .88rem; color: var(--doux); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--encre); background: #fff;
  border: 1px solid var(--trait); border-radius: 8px; padding: .4rem .8rem; margin-right: .6rem; cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--encre-2); }
.doc .code-sous-titre { display: block; font-size: .85rem; font-weight: 700; color: var(--doux); letter-spacing: 0; }

/* Analyse : nature du prix (encart en haut de l'analyse) */
.encart-prix { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem 1rem;
  margin-bottom: 1rem; border: 1px solid var(--trait); border-left: 5px solid var(--doux); border-radius: 8px;
  background: var(--carte); }
.pastille-prix { display: inline-block; padding: .25rem .75rem; border-radius: 999px; font-weight: 700;
  letter-spacing: .02em; background: #eceef2; color: var(--doux); }
.prix-details { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; flex: 1; min-width: 0; }
.prix-source { color: var(--doux); font-size: .85rem; }
.prix-lien { font-size: .88rem; }
.nature-revisable { border-left-color: var(--ok); }
.nature-revisable .pastille-prix { background: var(--ok-fond); color: var(--ok); }
.nature-actualisable { border-left-color: var(--encre-2); }
.nature-actualisable .pastille-prix { background: #e6edf7; color: var(--encre-2); }
.nature-ferme { border-left-color: var(--alerte); }
.nature-ferme .pastille-prix { background: var(--alerte-fond); color: var(--alerte); }
.encart-prix.prix-contradiction { border-left-color: var(--erreur); }
.prix-contradiction .pastille-prix { background: var(--erreur-fond); color: var(--erreur); }
.table-prix td:first-child { width: 26%; }
.doc .btn { white-space: normal; text-align: center; max-width: 100%; }

/* Analyse pièce par pièce : pastille d'état, bouton « Analyser », file d'attente */
.pastille-analyse { display: inline-block; width: fit-content; margin-top: .2rem; padding: .05rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; background: #eceef2; color: var(--doux); }
.pastille-analyse.etat-analysee { background: var(--ok-fond); color: var(--ok); }
.pastille-analyse.etat-modifiee { background: var(--alerte-fond); color: var(--alerte); }
.pastille-analyse.etat-erreur { background: var(--erreur-fond); color: var(--erreur); }
.pastille-analyse.etat-a_relancer { background: var(--alerte-fond); color: var(--alerte); font-weight: 600; }
.pastille-analyse.etat-entreprise, .pastille-analyse.etat-doublon, .pastille-analyse.etat-exclue { background: #eef0f3; color: var(--doux); }
.pastille-analyse.etat-attente, .pastille-analyse.etat-en_cours { background: #e6edf7; color: var(--encre-2); }
.form-analyser, .menu-analyser { display: contents; }
.menu-doc-liste .menu-analyser button { display: none; }
@media (min-width: 900px) and (max-width: 1439px) {
  .bouton-analyser > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bouton-analyser { padding: .4rem .5rem; }
  .bouton-analyser .icone { margin: 0; }
}
@media (max-width: 899px) {
  .form-analyser { display: none; }
  .menu-doc-liste .menu-analyser button { display: flex; }
}
.actions-analyse { align-items: center; }
.file-analyse { margin: 0 0 1rem; padding: .7rem 1rem; border-radius: 8px; background: #e6edf7; color: var(--encre-2); }
.file-analyse ul { margin: .4rem 0 0; padding: 0; list-style: none; }
.file-analyse li { display: flex; align-items: center; gap: .5rem; padding: .15rem 0; overflow-wrap: anywhere; }
.roue { flex: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: tourner 1s linear infinite; }
@keyframes tourner { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .roue { animation: none; } }

/* Questions-Réponses */
.filtre-qr { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--doux); }
.filtre-qr select { max-width: 100%; min-width: 0; }
.qr-documents { margin: 0 0 1rem; padding: 0; list-style: none; display: grid; gap: .3rem; }
.qr-documents li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.qr-documents .btn-lien { color: var(--encre-2); font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.qr-groupe { margin-bottom: 1rem; }
.qr-groupe h3 { margin: .5rem 0; }
.qr-groupe > summary { cursor: pointer; font-weight: 700; color: var(--doux); padding: .3rem 0; }
.qr-echange { padding: .7rem .9rem; margin-bottom: .5rem; border: 1px solid var(--trait); border-radius: 8px; background: var(--carte); }
.qr-important .qr-echange { border-left: 4px solid var(--erreur); background: #fffafa; }
.qr-utile .qr-echange { border-left: 4px solid var(--ok); }
.qr-tete { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: baseline; }
.qr-source { margin-left: auto; color: var(--doux); font-size: .8rem; }
.qr-reponse { margin: .35rem 0; }
.citation-lien { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; cursor: pointer;
  padding: 0; color: inherit; }
.citation-lien:hover, .citation-lien:focus-visible { text-decoration: underline; }
.reglee, .question-repondue { margin-top: .4rem; padding: .4rem .6rem; border-radius: 6px; background: var(--ok-fond); color: var(--ok); }
.proposition { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; }
.proposition > div { flex: 1 1 260px; min-width: 0; }
.historique-analyse { margin-top: 1rem; }
.historique-analyse summary { cursor: pointer; font-weight: 600; color: var(--encre-2); }
.historique-analyse ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.historique-analyse li { margin-bottom: .3rem; overflow-wrap: anywhere; }
.actions-analyse .btn { white-space: normal; text-align: center; max-width: 100%; }
.actions-analyse form { max-width: 100%; }
.compte-qr { font-weight: 400; font-size: .85rem; color: var(--doux); }
.qr-documents .meta-doc, .qr-tete .meta-doc, .qr-echange .consequence .meta-doc { display: inline; }

/* « Poser une question » : bouton de la pièce, fenêtre de discussion, ajouts à l'analyse */
.form-question { display: contents; }
.bouton-question:disabled { opacity: .45; cursor: not-allowed; }
@media (min-width: 900px) and (max-width: 1439px) {
  .bouton-question > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bouton-question { padding: .4rem .5rem; }
  .bouton-question .icone { margin: 0; }
}
@media (max-width: 899px) { .form-question { display: none; } }
.fenetre-discussion[open] { display: flex; flex-direction: column; height: min(760px, calc(100vh - 2rem)); overflow: hidden; }
.fenetre-discussion .modale-tete { flex: none; }
.discussion-entete { min-width: 0; }
.discussion-entete h2 { overflow-wrap: anywhere; font-size: 1.1rem; }
.discussion-boutons { display: flex; align-items: center; gap: .5rem; flex: none; }
.discussion-corps { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 1.25rem; background: var(--fond); }
.discussion-alerte { margin-bottom: .75rem; }
.discussion-choix { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; font-size: .85rem; color: var(--doux); }
.discussion-choix select { min-width: 0; max-width: 100%; }
.fil-discussion { display: flex; flex-direction: column; gap: .6rem; }
.bulle { max-width: min(85%, 620px); padding: .6rem .85rem; border-radius: 14px; overflow-wrap: anywhere; line-height: 1.45; }
.bulle-question { align-self: flex-end; background: var(--encre); color: #fff; border-bottom-right-radius: 4px; }
.bulle-reponse { align-self: flex-start; background: var(--carte); border: 1px solid var(--trait); border-bottom-left-radius: 4px; }
.bulle-absente { border-color: #e7d3a6; }
.bulle-erreur { align-self: flex-start; background: var(--erreur-fond); color: var(--erreur); }
.bulle .citation-lien { margin-top: .4rem; }
.bulle .citation-lien.non-verifie { color: var(--doux); text-decoration: line-through dotted; }
.avertissement-citation { font-style: normal; color: var(--alerte); }
.bulle-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .5rem; }
.bulle-attente { color: var(--doux); display: flex; align-items: center; gap: .5rem; }
.points { display: inline-flex; gap: 3px; }
.points span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: clignoter 1.2s infinite; }
.points span:nth-child(2) { animation-delay: .2s; }
.points span:nth-child(3) { animation-delay: .4s; }
@keyframes clignoter { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .points span { animation: none; } }
.discussion-vide { color: var(--doux); }
.suggestions { display: flex; flex-wrap: wrap; gap: .5rem; }
.suggestion { font: inherit; font-size: .88rem; padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--trait);
  background: var(--carte); color: var(--encre-2); cursor: pointer; text-align: left; }
.suggestion:hover, .suggestion:focus-visible { border-color: var(--encre-2); }
.discussion-saisie { flex: none; display: flex; gap: .6rem; align-items: flex-end; padding: .75rem 1.25rem;
  border-top: 1px solid var(--trait); background: var(--carte); }
.discussion-saisie textarea { flex: 1; min-width: 0; resize: vertical; min-height: 2.6rem; max-height: 10rem; font: inherit;
  padding: .55rem .7rem; border: 1px solid var(--trait); border-radius: 8px; }
.discussion-erreur { flex: none; margin: 0; padding: 0 1.25rem .6rem; background: var(--carte); }
@media (max-width: 899px) {
  .fenetre-discussion[open] { height: 100%; }
  .discussion-corps { padding: 1rem 16px; }
  .discussion-saisie { padding: .6rem 16px; }
  .discussion-boutons .btn { padding: .35rem .6rem; }
  .bulle { max-width: 92%; }
}
.fenetre-ajout { width: min(560px, calc(100vw - 2rem)); }
.fenetre-ajout .champ { margin-bottom: .8rem; }
.fenetre-ajout textarea, .fenetre-ajout select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--trait); border-radius: 8px; }
.fenetre-ajout .modale-actions { padding: 0 1.25rem 1.1rem; }
.bloc-ajouts { margin: 0 0 1.25rem; }
.bloc-ajouts h3 { font-size: .98rem; }
.ajout-analyse { padding: .6rem .85rem; margin-bottom: .5rem; border: 1px dashed #b9c6da; border-radius: 8px; background: #f7f9fc; }
.ajout-pied { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; margin-top: .4rem; font-size: .85rem; }
.ajout-pied form { display: inline; }
.ajout-pied .btn-lien { color: var(--encre-2); }
.ajout-pied .lien-retirer { color: var(--erreur); }
.discussion-saisie .btn { width: auto; flex: none; }
.discussion-saisie textarea { flex: 1 1 auto; }

/* ===== Tableau de bord ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.entete-tableau h1 { margin-bottom: .1rem; }
.date-du-jour { color: var(--doux); font-size: .95rem; }
.profil-a-completer { margin-bottom: 1rem; }
.compteurs-tableau { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.5rem; }
.compteurs-tableau .compteur { font: inherit; text-align: left; cursor: pointer; color: inherit; text-decoration: none;
  border-top-color: var(--trait); transition: border-color .15s, box-shadow .15s; }
.compteurs-tableau .compteur:hover { box-shadow: 0 2px 10px rgba(20,30,45,.08); }
.compteurs-tableau .compteur:focus-visible { outline: 3px solid var(--encre-2); outline-offset: 2px; }
.compteurs-tableau .compteur.actif { border-color: var(--encre); border-top-color: var(--encre); background: #f4f7fb; }
.compteurs-tableau .compteur-urgent { border-top-color: var(--erreur); }
.compteurs-tableau .compteur-visite, .compteurs-tableau .compteur-analyse { border-top-color: #d99a1e; }
.compteurs-tableau .compteur-alerte { border-top-color: var(--erreur); }
.compteur-nombre { display: block; font-size: 1.7rem; font-weight: 800; color: var(--encre); line-height: 1.1; }
.compteur-libelle { color: var(--doux); font-size: .82rem; line-height: 1.3; }

.tableau-colonnes { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.5rem; align-items: start; }
.tableau-principal > h2, .tableau-cote h2 { margin-bottom: .75rem; }
.tableau-cote { display: grid; gap: 1.25rem; position: sticky; top: 1rem; }
.tableau-cote .carte + .carte { margin-top: 0; }
.outils-liste { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.outils-liste .recherche { flex: 2 1 260px; position: relative; display: flex; align-items: center; min-width: 0; }
.outils-liste .recherche .icone { position: absolute; left: .65rem; color: var(--doux); pointer-events: none; }
.outils-liste .recherche input { width: 100%; font: inherit; padding: .55rem .65rem .55rem 2.2rem; border: 1px solid #cdd3dd;
  border-radius: 8px; background: var(--carte); }
.outils-liste select { flex: 1 1 150px; min-width: 0; font: inherit; padding: .5rem .6rem; border: 1px solid #cdd3dd;
  border-radius: 8px; background: var(--carte); }

/* Carte d'un appel d'offres : identité à gauche, échéance à droite, avancement et alertes en bas */
.liste-ao { display: grid; gap: .9rem; }
.carte-ao { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas:
  "corps echeance" "pied pied"; gap: .6rem 1.25rem; padding: 1rem 3.2rem 1rem 1.15rem; background: var(--carte);
  border: 1px solid var(--trait); border-left: 5px solid #b8c0cc; border-radius: var(--rayon); transition: box-shadow .15s; }
.carte-ao:hover { box-shadow: 0 4px 16px rgba(20,30,45,.1); }
.carte-ao:focus-within { box-shadow: 0 0 0 3px rgba(44,79,124,.35); }
.carte-ao[hidden] { display: none; }
.carte-ao.echeance-vert { border-left-color: var(--ok); }
.carte-ao.echeance-orange { border-left-color: #d99a1e; }
.carte-ao.echeance-rouge { border-left-color: var(--erreur); }
.carte-ao-corps { grid-area: corps; min-width: 0; }
.carte-ao-tete { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; font-size: .85rem; margin-bottom: .35rem; }
.numero-ao { color: var(--encre); font-weight: 800; letter-spacing: .01em; }
.ref-ao { color: var(--doux); }
.ref-manquante { position: relative; z-index: 2; color: #8a919c; font-style: italic; text-decoration: underline dotted; }
.ref-manquante:hover { color: var(--encre-2); }
.pastille-statut { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: #eceef2; color: var(--doux); }
.pastille-statut.statut-etude { background: #e6edf7; color: var(--encre-2); }
.pastille-statut.statut-en_cours { background: var(--alerte-fond); color: var(--alerte); }
.pastille-statut.statut-deposee { background: var(--ok-fond); color: var(--ok); }
.objet-ao { margin: 0 0 .2rem; font-size: 1.05rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: anywhere; }
.lien-carte { color: inherit; text-decoration: none; }
.lien-carte::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.lien-carte:focus-visible { outline: none; }
.acheteur-ao { color: var(--doux); font-size: .9rem; margin-bottom: .45rem; }
.lots-ao { display: flex; flex-wrap: wrap; gap: .3rem; }
.lots-ao .etiquette { white-space: normal; }
.etiquette-vide { color: #8a919c; font-style: italic; }
.carte-ao-echeance { grid-area: echeance; text-align: right; display: flex; flex-direction: column; align-items: flex-end;
  gap: .25rem; min-width: 8.5rem; }
.date-limite-ao { font-weight: 700; color: var(--encre); white-space: nowrap; }
.date-limite-ao .jour { font-size: 1rem; }
.date-limite-ao .heure { font-size: .9rem; color: var(--encre-2); }
.rebours { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-weight: 800; font-size: .9rem; white-space: nowrap; }
.rebours-vert { background: var(--ok-fond); color: var(--ok); }
.rebours-orange { background: #fdf0d8; color: #9a5b00; }
.rebours-rouge { background: var(--erreur); color: #fff; }
.rebours-gris { background: #eceef2; color: #6b7280; }
.visite-ao { font-size: .82rem; color: var(--texte); }
.visite-ao .etiquette { font-size: .72rem; }
.carte-ao-pied { grid-area: pied; display: grid; gap: .45rem; border-top: 1px solid #edf0f4; padding-top: .6rem; }
.etapes-ao { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: 0; padding: 0; list-style: none; font-size: .8rem; color: #8a919c; }
.etapes-ao li { display: inline-flex; align-items: center; gap: .3rem; }
.etapes-ao .coche { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid #c3c9d2; font-size: .62rem; font-weight: 800; line-height: 1; }
.etapes-ao .fait { color: var(--ok); }
.etapes-ao .fait .coche { background: var(--ok); border-color: var(--ok); color: #fff; }
.etapes-ao .a-venir { opacity: .65; }
.etapes-ao em { font-style: normal; }
.alertes-ao { margin: 0; padding: 0; list-style: none; display: grid; gap: .15rem; font-size: .82rem; }
.alertes-ao li { padding-left: 1rem; position: relative; overflow-wrap: anywhere; }
.alertes-ao li::before { content: ""; position: absolute; left: .2rem; top: .5em; width: 6px; height: 6px; border-radius: 50%; }
.alertes-ao .alerte-urgent { color: var(--erreur); }
.alertes-ao .alerte-urgent::before { background: var(--erreur); }
.alertes-ao .alerte-alerte { color: var(--alerte); }
.alertes-ao .alerte-alerte::before { background: #d99a1e; }
.carte-ao-menu { position: absolute; top: .7rem; right: .6rem; z-index: 3; }
.menu-doc-liste a { box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem;
  border-radius: 7px; font-size: .9rem; color: var(--texte); text-decoration: none; }
.menu-doc-liste a:hover, .menu-doc-liste a:focus-visible { background: #f1f4f8; }
.aucun-ao { margin: 0; }
.etat-vide-tableau { background: var(--carte); border: 1px dashed #c8cfda; border-radius: var(--rayon); }
.etat-vide-icone { color: var(--encre-2); opacity: .7; }
.cloturees { margin-top: 1.25rem; padding: .8rem 1.15rem; }
.cloturees summary { cursor: pointer; font-weight: 700; color: var(--encre); }
.cloturees ul { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.cloturees li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; font-size: .9rem; }
.cloturees li a { color: var(--texte); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloturees li a:hover { color: var(--encre-2); text-decoration: underline; }

/* Colonne de droite */
.chronologie { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.chrono-jour { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); margin-bottom: .25rem; }
.chrono-jour.chrono-proche { color: var(--erreur); }
.chronologie ul { list-style: none; margin: 0; padding: 0 0 0 .75rem; border-left: 2px solid var(--trait); display: grid; gap: .35rem; }
.chronologie ul li { position: relative; }
.chronologie ul li::before { content: ""; position: absolute; left: calc(-.75rem - 6px); top: .45rem; width: 10px; height: 10px;
  border-radius: 50%; background: var(--encre-2); border: 2px solid var(--carte); }
.chronologie .chrono-visite::before { background: #d99a1e; }
.chronologie .chrono-questions::before { background: #8a919c; }
.chronologie a { display: grid; color: var(--texte); text-decoration: none; font-size: .88rem; }
.chronologie a:hover .chrono-ao { text-decoration: underline; }
.chrono-libelle { font-weight: 700; color: var(--encre); }
.chrono-ao { color: var(--doux); overflow-wrap: anywhere; }
.st-chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .75rem; }
.st-chiffre { display: grid; padding: .6rem .7rem; border-radius: 8px; background: #f4f6f9; color: var(--doux); text-decoration: none;
  font-size: .82rem; }
.st-chiffre strong { font-size: 1.4rem; color: var(--encre); }
.st-chiffre.st-expire { background: var(--erreur-fond); color: var(--erreur); }
.st-chiffre.st-expire strong { color: var(--erreur); }
.st-chiffre.st-bientot { background: #fdf0d8; color: #9a5b00; }
.st-chiffre.st-bientot strong { color: #9a5b00; }
.profil-discret { margin-top: 2rem; color: var(--doux); font-size: .85rem; }
.identifiants-ao .numero-ao { font-size: .95rem; }

@media (max-width: 1199px) {
  .tableau-colonnes { grid-template-columns: minmax(0, 1fr); }
  .tableau-cote { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 1099px) {
  .compteurs-tableau { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .compteurs-tableau { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .compteurs-tableau .compteur { padding: .65rem .75rem; }
  .compteur-nombre { font-size: 1.4rem; }
  .tableau-cote { grid-template-columns: minmax(0, 1fr); }
  .carte-ao { grid-template-columns: minmax(0, 1fr); grid-template-areas: "corps" "echeance" "pied"; padding-right: 1rem; }
  .carte-ao-tete { padding-right: 2.4rem; }
  .carte-ao-echeance { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; text-align: left;
    min-width: 0; gap: .4rem .6rem; }
  .outils-liste .recherche { flex-basis: 100%; }
}
.cloturees ul { grid-template-columns: minmax(0, 1fr); }
.cloturees li { min-width: 0; }
.cloturees li a { flex: 1 1 auto; }
.cloturees .pastille-statut { flex: none; }
.sous-titre-bloc { margin: -.6rem 0 .9rem; color: var(--doux); font-size: .82rem; }
@media (max-width: 899px) {
  .compteurs-tableau .compteur:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.visite-passee { color: var(--doux); }

/* --- Mon entreprise : informations trouvées, documents, bloc de la consultation ----------------------------- */
.entete-documents { margin-bottom: .75rem; }
.entete-documents h2 { margin: 0; }
.entete-documents .sous-titre-bloc { max-width: 80ch; }
.entete-documents .sous-titre-bloc, .entete-bloc .sous-titre-bloc, .informations-trouvees .sous-titre-bloc,
.choix-zip .sous-titre-bloc { margin: .25rem 0 .5rem; }
.entete-bloc { margin-bottom: .5rem; align-items: flex-start; }
.entete-bloc h2 { margin: 0; }

.informations-trouvees { border-left: 4px solid var(--accent); }
.informations-trouvees h2 { margin-bottom: .2rem; }
.propositions { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.proposition { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2.2fr) auto; gap: .5rem 1rem;
  align-items: center; padding: .65rem .75rem; border: 1px solid var(--trait); border-radius: var(--rayon);
  background: #fcfbf8; }
.proposition-champ { display: flex; flex-direction: column; min-width: 0; }
.proposition-champ .btn-lien { padding: 0; font-size: inherit; text-align: left; overflow-wrap: anywhere; }
.proposition-valeurs { min-width: 0; overflow-wrap: anywhere; }
.proposition-valeurs .valeur-actuelle { color: var(--doux); text-decoration: line-through; }
.proposition-valeurs .fleche { color: var(--accent); margin: 0 .4rem; font-weight: 700; }
.proposition-valeurs .valeur-trouvee { color: var(--encre); }
.proposition-valeurs .valeur-lue { display: block; }
.proposition-actions { display: flex; gap: .4rem; margin: 0; }

.docs-entreprise h3 { margin-top: 1.1rem; }
.alerte-renouveler { max-width: none; font-size: .9rem; color: var(--erreur); background: var(--erreur-fond);
  border-radius: 6px; padding: .35rem .6rem; margin: 0 0 .35rem; }
.liste-docs-entreprise { list-style: none; margin: .75rem 0 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: .35rem 1.25rem; }
.liste-docs-entreprise li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: baseline;
  column-gap: .6rem; min-width: 0; padding: .4rem 0; border-bottom: 1px solid var(--trait); }
.liste-docs-entreprise .statut { justify-self: start; }
.doc-entreprise-libelle { font-weight: 600; color: var(--texte); min-width: 0; overflow-wrap: anywhere; }
.liste-docs-entreprise .meta-doc { grid-column: 2; }
.pieces-rapprochees { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .3rem; }
.pieces-rapprochees li { display: flex; gap: .6rem; align-items: baseline; min-width: 0; }
.case-piece { font-size: 1.1rem; line-height: 1; color: var(--doux); }
.piece-a_jour .case-piece { color: var(--ok); }
.piece-texte { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.piece-texte .meta-doc { display: block; }
.etiquette-a_jour { background: var(--ok-fond); color: var(--ok); }
.etiquette-a_renouveler, .etiquette-manquant { background: var(--erreur-fond); color: var(--erreur); }
.etiquette-a_verifier { background: var(--alerte-fond); color: var(--alerte); }
a.etiquette { text-decoration: none; white-space: nowrap; }
.choix-zip { margin-top: .5rem; padding-top: .25rem; border-top: 1px solid var(--trait); }
.choix-zip ul { list-style: none; margin: .25rem 0 .9rem; padding: 0; display: grid; gap: .35rem; }
.choix-zip label { display: flex; gap: .55rem; align-items: baseline; cursor: pointer; }
.choix-zip label .meta-doc { margin-left: .3rem; overflow-wrap: anywhere; }

@media (max-width: 899px) {
  .proposition { grid-template-columns: minmax(0, 1fr); }
  .proposition-actions .btn { flex: 1; }
  .entete-documents .btn-principal { width: 100%; }
  .choix-zip .btn-principal { width: 100%; justify-content: center; }
}

/* --- Références : liste, fiche, import, bloc de la consultation --------------------------------------------- */
.compteurs-references { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.compteurs-references .compteur { border-top-color: var(--trait); }
.compteurs-references .compteur:first-child { border-top-color: var(--accent); }
.panneau-repli h2 { margin-bottom: .2rem; }
.panneau-repli .sous-titre-bloc { margin: .2rem 0 .75rem; max-width: 90ch; }
.panneau-repli input[type=file] { max-width: 100%; }
.champs-filtres { grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.menu-doc-liste a[role=menuitem] { box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: .55rem;
  padding: .5rem .6rem; border-radius: 7px; font-size: .9rem; color: var(--texte); text-decoration: none; }
.menu-doc-liste a[role=menuitem]:hover, .menu-doc-liste a[role=menuitem]:focus-visible { background: #f1f4f8; }
.table-refs .col-annee { white-space: nowrap; color: var(--doux); }
.table-refs .col-type .meta-doc { display: block; }
.table-refs .col-montant { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-refs .document-texte .etiquette { margin-top: .25rem; align-self: flex-start; }
.table-refs a.titre-doc { text-decoration: none; }
.table-refs a.titre-doc:hover { text-decoration: underline; }

.champ-incertain input, .champ-incertain select, .champ-incertain textarea, td.champ-incertain input,
td.champ-incertain select { background: var(--alerte-fond); border-color: #e3b25f; }
.champ-deduit input, .champ-deduit select, td.champ-deduit input, td.champ-deduit select { background: #eef3fa;
  border-color: #b9c9df; border-style: dashed; }
.legende-import span.champ-incertain, .legende-import span.champ-deduit { padding: .05rem .45rem; border-radius: 5px;
  border: 1px solid #e3b25f; background: var(--alerte-fond); }
.legende-import span.champ-deduit { border: 1px dashed #b9c9df; background: #eef3fa; }
.remarques-import { margin: .25rem 0 0; padding-left: 1.1rem; color: var(--doux); }
.table-import td { padding: .3rem .35rem; vertical-align: top; }
.table-import input[type=text], .table-import select { width: 100%; min-width: 9rem; font-size: .86rem; padding: .3rem .4rem; }
.table-import .cellule-large input { min-width: 18rem; }
.table-import .cellule-annee input { min-width: 4.2rem; width: 4.6rem; }
.table-import .cellule-montant input { min-width: 7rem; text-align: right; }
.table-import .ligne-doublon td { opacity: .6; }
.table-import .source-import { color: var(--doux); font-size: .78rem; white-space: nowrap; }
.form-import .barre-actions { margin-top: 1rem; }

.cases-corps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .3rem 1rem;
  list-style: none; margin: .2rem 0 0; padding: 0; }
.cases-corps label { display: flex; gap: .45rem; align-items: center; font-weight: 400; }
.fichiers-reference { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.encart-chantier { background: #eef3fa; color: var(--encre-2); margin-bottom: 1rem; }
.encart-chantier strong { color: var(--encre); }

.bilan-exigences { list-style: none; margin: .25rem 0 .5rem; padding: 0; display: grid; gap: .25rem; }
.bilan-exigences li { padding: .3rem .6rem; border-radius: 6px; font-size: .9rem; }
.exigence-ok { background: var(--ok-fond); color: var(--ok); }
.exigence-ko { background: var(--erreur-fond); color: var(--erreur); }
.exigence-info { background: #f1f4f8; color: var(--doux); }
.refs-choisies { margin: .75rem 0 0; padding-left: 1.4rem; display: grid; gap: .6rem; }
.refs-choisies li, .refs-autres li { padding-bottom: .55rem; border-bottom: 1px solid var(--trait); }
.refs-choisies li { display: list-item; }
.refs-choisies li > *, .refs-autres li > * { vertical-align: top; }
.ref-texte { display: flex; flex-direction: column; gap: .15rem; min-width: 0; overflow-wrap: anywhere; }
.ref-texte a { text-decoration: none; }
.raisons { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.raison { font-size: .74rem; padding: .08rem .5rem; border-radius: 999px; background: var(--ok-fond); color: var(--ok); }
.raison-vide { background: #f1f4f8; color: var(--doux); }
.ref-actions { display: flex; gap: .35rem; margin: .35rem 0 0; flex-wrap: wrap; }
.refs-autres { margin-top: .9rem; }
.refs-autres summary { cursor: pointer; font-weight: 600; color: var(--encre-2); }
.refs-autres ul { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.choix-zip h2 { margin-bottom: .2rem; }
.choix-zip h3 { margin-top: .9rem; }
.pastille-statut.statut-gagnee, .pastille-statut.statut-receptionnee { background: var(--ok-fond); color: var(--ok); }
.pastille-statut.statut-travaux { background: #e6edf7; color: var(--encre-2); }

@media (min-width: 900px) {
  .refs-choisies li, .refs-autres li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; }
  .ref-actions { margin: 0; }
}
@media (max-width: 899px) {
  .compteurs-references { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .table-refs .col-document { grid-column: 1 / -1; grid-row: 1; }
  .table-refs .col-annee { grid-column: 2; grid-row: 2; text-align: right; }
  .table-refs .col-type { grid-column: 1; grid-row: 2; }
  .table-refs .col-montant { grid-column: 1; grid-row: 3; text-align: left; font-weight: 600; }
  .table-refs .col-statut { grid-column: 2; grid-row: 3; }
  .table-refs .col-actions { grid-row: 4; }
  .table-import input[type=text], .table-import select, .table-import .cellule-large input,
  .table-import .cellule-annee input { min-width: 0; width: 100%; }
}
.carte-import { padding: .25rem; min-width: 0; }
.form-import { min-width: 0; }
.filtres-references { flex-wrap: wrap; }
.filtres-references select { flex: 1 1 170px; }
.filtres-references .recherche { flex: 3 1 260px; }
.annee-mobile { display: none; }
@media (max-width: 899px) {
  .annee-mobile { display: inline; }
  .table-refs .col-annee { display: none; }
}
.bloc-references .entete-bloc .btn { white-space: normal; text-align: center; justify-content: center; }
.choix-corps { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.choix-corps select { flex: 1 1 160px; min-width: 0; font-size: .86rem; }

/* --- Appels d'offres (veille du BOAMP) ---------------------------------------------------------------------- */
.grille-annonces { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 1rem;
  margin-bottom: 1.25rem; align-items: start; }
.annonce { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.annonce-decouverte { border-left: 4px solid #6c5bb3; }
.annonce-tete { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: start; }
.annonce-note { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem;
  border-radius: 50%; font-weight: 800; font-size: 1.05rem; background: #f1f4f8; color: var(--encre); }
.note-haute { background: var(--ok-fond); color: var(--ok); }
.note-moyenne { background: var(--alerte-fond); color: var(--alerte); }
.note-basse, .note-vide { background: #f1f4f8; color: var(--doux); }
.annonce-titre { min-width: 0; overflow-wrap: anywhere; }
.annonce-titre .sur { font-size: .76rem; color: var(--doux); }
.annonce-objet { font-weight: 700; color: var(--encre); text-decoration: none; display: block; line-height: 1.35; }
.annonce-objet:hover { text-decoration: underline; }
.badge-decouverte { background: #eeeafc; color: #5a4aa6; }
.annonce-raison { margin: 0; font-size: .92rem; }
.phrases-citees { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .85rem; }
.phrases-citees li { padding: .3rem .55rem; border-radius: 6px; overflow-wrap: anywhere; }
.phrase-plus { background: var(--ok-fond); color: var(--ok); }
.phrase-moins { background: var(--erreur-fond); color: var(--erreur); }
.annonce-lots { margin: 0; overflow-wrap: anywhere; }
.annonce-ecartee { margin: 0; font-size: .85rem; color: var(--alerte); }
.annonce-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: flex-start; margin-top: auto;
  padding-top: .4rem; border-top: 1px solid var(--trait); }
.annonce-actions form { margin: 0; }
.action-retour summary { list-style: none; }
.action-retour summary::-webkit-details-marker { display: none; }
.action-retour[open] { flex-basis: 100%; }
.form-retour { display: grid; gap: .45rem; margin-top: .45rem; padding: .6rem; background: #f8f9fb; border-radius: 8px; }
.form-retour label { display: grid; gap: .2rem; font-size: .85rem; }
.form-retour .motifs { display: flex; flex-wrap: wrap; gap: .35rem; }
.ecartees li { flex-wrap: wrap; }
.bloc-jetons .jetons-cumul { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .25rem 0 .5rem; }
.jetons-passes { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .88rem; }
.jetons-passes li { display: flex; flex-wrap: wrap; gap: .2rem .75rem; justify-content: space-between; }
.repartition { list-style: none; margin: .25rem 0 .75rem; padding: 0; display: grid; gap: .3rem; }
.repartition li { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr) 3.5rem; gap: .6rem; align-items: center; }
.regles-proposees { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.regles-proposees li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.cases-ligne { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.cases-ligne label { display: flex; gap: .35rem; align-items: center; font-weight: 400; }
@media (max-width: 899px) {
  .annonce-tete { grid-template-columns: auto minmax(0, 1fr); }
  .annonce-tete .rebours { grid-column: 2; justify-self: start; }
  .repartition li { grid-template-columns: minmax(0, 1fr) 3.5rem; }
  .repartition .jauge { grid-column: 1 / -1; grid-row: 2; }
}
.action-retour { min-width: 0; max-width: 100%; }
.form-retour, .form-retour label { min-width: 0; }
.form-retour input[type=text] { width: 100%; min-width: 0; box-sizing: border-box; }
.grille-annonces > .carte { margin: 0; }

/* Chiffres d'affaires de « Mon entreprise » : exercice, CA global, suppression */
.table-ca { table-layout: fixed; }
.table-ca th:nth-child(1) { width: 38%; }
.table-ca th:nth-child(2) { width: 44%; }
.table-ca .col-supprimer { width: 18%; text-align: center; }
.table-ca input[type=text], .table-ca input[type=number] { width: 100%; }
.table-ca td.nombre input { text-align: right; }
table.donnees.table-ca td { vertical-align: middle; }
table.donnees.table-ca td.col-supprimer input { margin: 0; vertical-align: middle; }
.table-ca th.nombre { text-align: right; padding-right: 1rem; }
@media (max-width: 699px) {
  .table-ca .col-supprimer { text-align: left; width: auto; }
  .table-ca th.nombre { text-align: left; }
}
/* Avis sur une annonce : 👍 / 👎 / ⏸️, choix unique (le bouton actif est mis en évidence) */
.bouton-avis { line-height: 1.2; }
.bouton-avis .emoji { font-size: 1.05rem; line-height: 1; }
.bouton-avis.actif { background: var(--ok-fond); border-color: var(--ok); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.bouton-avis.actif-negatif { background: var(--erreur-fond); border-color: var(--erreur); color: var(--erreur);
  box-shadow: inset 0 0 0 1px var(--erreur); }
.bouton-avis.actif-attente { background: #eef3fa; border-color: var(--encre-2); color: var(--encre-2);
  box-shadow: inset 0 0 0 1px var(--encre-2); }
.avis-motif { font-size: .78rem; font-weight: 600; }
.mises-de-cote li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.mises-de-cote form { margin: 0; }
.bouton-icone { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4rem; }
.badge-dossier { background: #e6edf7; color: var(--encre-2); }
.depot-zip{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem 1rem;margin:0 0 1rem;padding:.75rem 1rem;border:1px dashed var(--trait);border-radius:var(--rayon);background:var(--carte)}
.depot-zip label{display:flex;flex-direction:column;gap:.15rem;min-width:0}
.depot-zip input[type=file]{max-width:100%}
.annonce-actions .bouton-avis { padding-left: .6rem; padding-right: .6rem; }
.annonce-actions .bouton-icone { min-width: 2.2rem; }
@media (max-width: 419px) { .annonce-actions .avis-texte { display: none; } }
/* Fenêtre « Nouvelle consultation » : DCE en .zip, rappel de l'annonce BOAMP, choix du RC, écarts BOAMP / RC */
.zone-depot.zone-zip { grid-column: 1 / -1; min-height: 90px; }
.rappel-annonce { margin: 0 0 1rem; overflow-wrap: anywhere; }
.rappel-annonce .meta-doc { display: block; }
.origine-boamp { margin-left: .35rem; font-size: .72rem; background: #e6edf7; color: var(--encre-2); }
.encart-annonce .ecarts ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.encart-annonce .ecart-important { color: var(--erreur); }
.pieces-zip { display: inline; }
.pieces-zip summary { display: inline; cursor: pointer; color: var(--encre-2); }
.pieces-zip ul { margin: .35rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
.choix-fichiers { border: 1px solid var(--trait); border-radius: var(--rayon); max-height: 50vh; overflow-y: auto; }
.choix-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 3.2rem 3.2rem; align-items: center; gap: .5rem;
  padding: .45rem .75rem; border-top: 1px solid var(--trait); }
.choix-ligne:first-child { border-top: 0; }
.choix-ligne > span:not(.choix-nom) { text-align: center; }
.choix-ligne input[type=radio] { width: 1.15rem; height: 1.15rem; }
.choix-entete { font-weight: 600; font-size: .85rem; background: #f6f7f9; position: sticky; top: 0; }
.choix-nom { overflow-wrap: anywhere; }
.choix-nom .meta-doc { display: block; }
.choix-grise { color: var(--doux); }
/* Allotissement (fenêtre de création et « Modifier ») */
.bloc-lots { display: contents; }
.bloc-lots[hidden] { display: none; }
.mention-allotissement:not(:has(p, span)) { display: none; }
.mention-non-alloti { margin: -.4rem 0 0; color: var(--erreur); font-size: .9rem; font-weight: 600; }
.mention-non-alloti .btn-lien { font-weight: 400; margin-left: .3rem; color: var(--encre-2); }
.mention-neutre { margin: -.4rem 0 0; color: var(--doux); font-size: .9rem; }
.citation-allotissement { font-weight: 400; font-style: italic; }
.estimation-lot { font-size: .82rem; color: var(--doux); white-space: nowrap; }
/* Points clés (fenêtre « Nouvelle consultation », page « Modifier », fiche) */
fieldset.points-cles, section.points-cles { border: 2px solid var(--encre-2); background: #f5f8fc; }
fieldset.points-cles > legend { font-size: 1.05rem; }
.points-cles h3 { font-size: .92rem; margin: 1rem 0 .4rem; color: var(--encre-2); }
.points-cles h3:first-of-type { margin-top: .3rem; }
.alertes-points { margin: 0 0 .8rem; padding: .6rem .8rem .6rem 1.8rem; border-radius: var(--rayon);
  background: var(--erreur-fond); color: var(--erreur); font-weight: 600; font-size: .92rem; }
.point-origine { display: block; font-size: .8rem; color: var(--doux); overflow-wrap: anywhere; }
.point-source { font-weight: 600; color: var(--encre-2); font-size: .8rem; }
.point-citation { display: block; font-style: italic; font-size: .8rem; color: var(--doux); }
.point-calcul { display: block; font-size: .78rem; color: var(--encre-2); margin-top: .15rem; }
.origine-python { font-size: .72rem; background: #eef3e6; color: #3d5a1e; }
.points-cles .sous-titre-points { font-size: .85rem; margin: .7rem 0 .3rem; color: var(--doux); font-weight: 600; }
.point-jours { justify-content: flex-end; }
.point-jours strong { font-size: 1.15rem; color: var(--encre); }
.points-cles-fiche dd > div { margin-top: .15rem; }

/* Type de travaux d'une référence : index INSEE BT / TP */
.types-travaux .aide-inline { font-weight: normal; color: var(--doux); font-size: .85rem; }
.recherche-index { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .25rem 0 .5rem; }
.recherche-index input[type=search] { flex: 1 1 16rem; max-width: 28rem; }
.liste-index { border: 1px solid var(--trait); border-radius: 8px; padding: .5rem .75rem .6rem; margin: 0 0 .5rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: .15rem 1rem;
  max-height: 22rem; overflow-y: auto; }
.liste-index legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.champ .case-index { display: flex; gap: .45rem; align-items: flex-start; font-weight: normal; font-size: .88rem; line-height: 1.3;
  padding: .2rem 0; cursor: pointer; }
.champ .case-index input { margin-top: .15rem; flex: none; }
.champ .case-index strong { font-weight: 600; }
.case-index[hidden], .liste-index[hidden] { display: none; }
.case-index input:disabled + span { color: var(--doux); }
.liste-index .aucun-index { grid-column: 1 / -1; margin: 0; }
.liste-index.travaux-principaux { border-color: var(--encre-2); background: #f3f6fb; max-height: none; }
.liste-index.travaux-principaux legend { color: var(--encre); }

/* Références à présenter : critères remplis, mise en avant */
.badge-avant { font-size: .95rem; }
.criteres-ref { display: block; font-size: .85rem; color: var(--texte); margin-top: .2rem; }
.criteres-ref .critere-avant { font-weight: 600; color: var(--accent-fonce); }
.criteres-ref .critere-non-pertinente { color: var(--doux); font-style: italic; }
.criteres-ref .raison-vide { padding: 0; background: none; color: var(--doux); }
.detail-score summary { font-size: .78rem; color: var(--doux); cursor: pointer; margin-top: .15rem; }

/* Rôle « lecteur » (consultation seulement) : le serveur refuse toute écriture ; les formulaires d'envoi et les boutons
   d'action sont masqués pour ne pas proposer ce qui sera refusé. La déconnexion (classe « toujours ») reste. */
.bandeau-lecture { margin: 0 0 1rem; padding: .55rem .8rem; border-radius: 8px; background: var(--fond);
  color: var(--encre); border: 1px solid var(--trait); font-size: .9rem; }
.lecture-seule form[method="post"]:not(.toujours), .lecture-seule form[method="POST"]:not(.toujours),
.lecture-seule [data-nouvelle-consultation], .lecture-seule [data-confirmer], .lecture-seule [data-depot-documents],
.lecture-seule [data-ecriture] { display: none !important; }
