/* ═══════════════════════════════════════════════════════════════════════════
   GAIA — feuille de style unique.
   Charte Smart BlueDing : marine #144074 et cyan #009fe3 (ceux du logo). Poppins pour le texte,
   Saira Semi Expanded pour les titres et la marque — une grotesque large et carrée, de la même
   famille que le lettrage du logo. Jour et nuit par variables ; le choix du compte (data-theme)
   l'emporte sur celui du système.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --marine: #144074;
  --cyan: #009fe3;
  --fond: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ligne: #e2e8f0;
  --ligne-douce: #eef2f7;
  --encre: #0f1b33;
  --encre-douce: #475069;
  --encre-pale: #8a93a8;
  --lien: #1558b0;
  --bleu: #1558b0;   --bleu-doux: #e6effb;
  --vert: #177245;   --vert-doux: #e2f4ea;
  --ambre: #8f5b0a;  --ambre-doux: #fcf0da;
  --rouge: #b42318;  --rouge-doux: #fde8e6;
  --gris: #475069;   --gris-doux: #eef1f5;
  --menu-haut: #1b4f8e;
  --menu-bas: #0b2748;
  --ombre: 0 1px 2px rgb(15 27 51 / 6%), 0 1px 3px rgb(15 27 51 / 4%);
  --rayon: 10px;
  --texte: "Poppins", "Segoe UI", system-ui, sans-serif;
  --titre: "Saira Semi Expanded", "Poppins", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0d1220; --surface: #151c2d; --surface-2: #1e273c; --ligne: #28334a; --ligne-douce: #20293e;
    --encre: #e2e8f5; --encre-douce: #a2adc4; --encre-pale: #7884a0; --lien: #6fb2ff;
    --bleu: #7ab4ff; --bleu-doux: #1b2c4a; --vert: #5fd39b; --vert-doux: #14301f;
    --ambre: #eab563; --ambre-doux: #33260f; --rouge: #ff8a80; --rouge-doux: #3a1b19;
    --gris: #a2adc4; --gris-doux: #222c42; --menu-haut: #12325c; --menu-bas: #070f1d;
    --ombre: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0d1220; --surface: #151c2d; --surface-2: #1e273c; --ligne: #28334a; --ligne-douce: #20293e;
  --encre: #e2e8f5; --encre-douce: #a2adc4; --encre-pale: #7884a0; --lien: #6fb2ff;
  --bleu: #7ab4ff; --bleu-doux: #1b2c4a; --vert: #5fd39b; --vert-doux: #14301f;
  --ambre: #eab563; --ambre-doux: #33260f; --rouge: #ff8a80; --rouge-doux: #3a1b19;
  --gris: #a2adc4; --gris-doux: #222c42; --menu-haut: #12325c; --menu-bas: #070f1d;
  --ombre: none; color-scheme: dark;
}

/* Logos : version claire ou sombre selon le thème. */
.logo-sombre { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-clair { display: none; }
  :root:not([data-theme="light"]) .logo-sombre { display: inline; }
}
:root[data-theme="dark"] .logo-clair { display: none; }
:root[data-theme="dark"] .logo-sombre { display: inline; }

/* ── Base ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 14.5px/1.55 var(--texte); }
a { color: var(--lien); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font: 700 23px/1.2 var(--titre); letter-spacing: -.01em; overflow-wrap: anywhere; }
@media (max-width: 600px) { h1 { font-size: 19px; } .chiffre .valeur { font-size: 17px; } }
h2 { font: 600 15px/1.3 var(--texte); display: flex; gap: 8px; align-items: baseline; }
h3 { font: 600 14px/1.3 var(--texte); }
img { max-width: 100%; }
.cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icone { flex: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Structure : menu à gauche, contenu à droite ─────────────────────────── */
body.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.menu {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 12px 18px;
  background: linear-gradient(180deg, var(--menu-haut), var(--menu-bas)); color: #dbe7f7;
  display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 20%) transparent;
}
.menu-tete { display: flex; align-items: center; gap: 8px; padding: 4px 6px 14px; }
.menu-marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; }
.pastille-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #fff; box-shadow: 0 0 0 3px rgb(0 159 227 / 25%); }
.pastille-logo img { width: 30px; height: 30px; object-fit: contain; display: block; }
.menu-nom { display: grid; line-height: 1.1; }
.menu-nom .gaia { font: 700 17px/1.1 var(--titre); letter-spacing: .08em; }
.menu-nom .sb { font-size: 11px; color: rgb(219 231 247 / 65%); }
.menu-fermer { display: none; margin-left: auto; padding: 6px; border-radius: 8px; cursor: pointer; color: #dbe7f7; }
.menu-bloc { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; margin-top: 4px; border-top: 1px solid rgb(255 255 255 / 9%); }
.menu-tete + .menu-bloc { border-top: 0; margin-top: 0; }
details.menu-bloc > summary {
  list-style: none; display: flex; align-items: center; cursor: pointer; padding: 2px 12px 6px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: rgb(219 231 247 / 50%);
}
details.menu-bloc > summary::-webkit-details-marker { display: none; }
details.menu-bloc > summary:hover { color: #dbe7f7; }
details.menu-bloc > summary .chevron { margin-left: auto; display: flex; transition: transform .15s; }
details.menu-bloc > summary .chevron .icone { width: 13px; height: 13px; }
details[open].menu-bloc > summary .chevron { transform: rotate(90deg); }
details.menu-bloc > nav { display: flex; flex-direction: column; gap: 2px; }
.menu-lien {
  display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: 8px;
  color: rgb(219 231 247 / 85%); font-size: 13.5px; font-weight: 500; text-decoration: none !important; position: relative;
}
.menu-lien .icone { opacity: .85; }
.menu-lien:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.menu-lien.actif { background: rgb(255 255 255 / 14%); color: #fff; }
.menu-lien.actif::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan); }
.menu-lien.actif .icone { opacity: 1; color: #7fd3ff; }
.menu-pied { margin: auto 0 0; padding: 16px 12px 0; font-size: 11px; color: rgb(219 231 247 / 40%); }

.cadre { display: flex; flex-direction: column; min-width: 0; }
.haut {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px 28px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ligne);
}
.menu-ouvrir { display: none; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--encre-douce); }
.recherche-globale { flex: 1; min-width: 0; max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--ligne); border-radius: 10px; background: var(--fond); color: var(--encre-pale); }
.recherche-globale:focus-within { border-color: var(--cyan); }
.recherche-globale input { flex: 1; border: 0; background: none; padding: 8px 0; min-width: 0; outline: none; }
.moi { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.moi-nom { display: flex; align-items: center; gap: 8px; color: var(--encre-douce); font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.moi-nom:hover { background: var(--surface-2); text-decoration: none; }
.moi form { margin: 0; }
.bouton-icone { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--encre-douce); cursor: pointer; }
.bouton-icone:hover { background: var(--surface-2); color: var(--encre); }

/* minmax(0, 1fr) : sans cela, un tableau large élargit toute la grille au lieu de défiler dans son cadre. */
main#contenu { width: 100%; max-width: 1240px; margin: 0 auto; padding: 26px 28px 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: start; }
main#contenu > *, .bloc, .deux-colonnes > * { min-width: 0; }

/* Mobile : le menu devient un tiroir, ouvert par une case à cocher (aucun JavaScript). */
.voile { display: none; }
@media (max-width: 900px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .menu { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .menu-fermer, .menu-ouvrir { display: grid; place-items: center; }
  #menu-ouvert:checked ~ .menu { transform: none; box-shadow: 0 0 40px rgb(0 0 0 / 35%); }
  #menu-ouvert:checked ~ .voile { display: block; position: fixed; inset: 0; z-index: 40; background: rgb(8 15 30 / 45%); }
  .haut { padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .moi-nom span { display: none; }
  main#contenu { padding: 18px 16px 56px; }
}

/* Menu latéral replié (bureau, 08/10/2026) : le bouton de la barre du haut le masque et le contenu
   prend toute la largeur (la grille passe à une colonne, la borne de 1240 px tombe). Sur
   téléphone, rien ne change : le menu reste un tiroir et le bouton disparaît. */
.menu-replier { margin: 0; }
@media (min-width: 901px) {
  body.app.menu-replie { grid-template-columns: minmax(0, 1fr); }
  body.app.menu-replie > .menu { display: none; }
  body.app.menu-replie main#contenu { max-width: none; }
}
@media (max-width: 900px) { .menu-replier { display: none; } }
@media print { .menu-replier { display: none; } }

/* En-têtes de tableau qui trient (liste des devis) : un lien, ▲ / ▼ sur la colonne active. */
th > a.tri { color: inherit; text-decoration: none; white-space: nowrap; }
th > a.tri:hover, th > a.tri:focus-visible { text-decoration: underline; }
th > a.tri.actif { color: var(--encre); }

/* ── Pages hors connexion ─────────────────────────────────────────────────── */
body.nue main { max-width: 440px; margin: 0 auto; padding: 10vh 16px 40px; }
.connexion { background: var(--surface); border: 1px solid var(--ligne); border-radius: 16px; padding: 34px 30px 30px; display: grid; gap: 6px; box-shadow: var(--ombre); }
.logo-connexion { width: 100%; max-width: 300px; height: auto; margin: 0 auto 18px; }
.connexion h1 { font-size: 28px; letter-spacing: .12em; color: var(--marine); text-align: center; }
:root[data-theme="dark"] .connexion h1 { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .connexion h1 { color: #fff; } }
.connexion .sous-titre { text-align: center; margin-bottom: 14px; }
.connexion form { display: grid; gap: 6px; }
.connexion label { font-size: 13px; font-weight: 500; margin-top: 8px; }
.connexion .bouton { margin-top: 16px; justify-content: center; padding: 10px; }

/* ── Formulaires et boutons ──────────────────────────────────────────────── */
input, select, textarea { font: inherit; color: var(--encre); background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgb(0 159 227 / 18%); }
.mdp-oeil { position: relative; display: block; }
.mdp-oeil > input { width: 100%; padding-right: 40px; box-sizing: border-box; }
.mdp-oeil-bouton { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--encre-douce); cursor: pointer; }
.mdp-oeil-bouton:hover { color: var(--encre); background: var(--surface-2); }
.mdp-oeil-bouton:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
textarea { resize: vertical; min-height: 84px; }
/* Dictée commune (scripts/dictee.js) : le micro dans le coin d'un champ `data-dictee`. Cible de
   44 px (doigt), le champ garde la place du bouton à droite. */
.dictee-cadre { position: relative; display: block; min-width: 0; }
.dictee-cadre > textarea, .dictee-cadre > input { width: 100%; min-width: 0; box-sizing: border-box; padding-right: 50px; }
.dictee-ligne > input { min-height: 44px; }
.dictee-bouton { position: absolute; right: 2px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--encre-douce); cursor: pointer; }
/* Textarea : à gauche de la barre de défilement et de la poignée de redimensionnement. */
.dictee-zone > .dictee-bouton { bottom: 4px; right: 16px; }
.dictee-zone > textarea { padding-right: 64px; }
.dictee-ligne > .dictee-bouton { top: 50%; transform: translateY(-50%); }
.dictee-bouton:hover { color: var(--bleu); background: var(--surface-2); }
.dictee-bouton:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.dictee-bouton .icone { width: 20px; height: 20px; }
.dictee-bouton.en-cours { color: #fff; background: var(--rouge); animation: dictee-pouls 1.4s ease-in-out infinite; }
.dictee-bouton.occupe { cursor: wait; color: var(--bleu); }
.dictee-bouton.occupe .icone { animation: dictee-pouls 1s ease-in-out infinite; }
.dictee-etat { font-size: 12.5px; color: var(--encre-douce); }
.dictee-etat.rouge { color: var(--rouge); }
.dictee-etat[hidden] { display: none; }
@keyframes dictee-pouls { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .dictee-bouton.en-cours, .dictee-bouton.occupe .icone { animation: none; } }
label { font-size: 13px; font-weight: 500; color: var(--encre-douce); }
.bouton {
  display: inline-flex; align-items: center; gap: 7px; font: 500 13.5px/1.2 var(--texte);
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--ligne); background: var(--surface); color: var(--encre);
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.bouton:hover { background: var(--surface-2); }
.bouton.principal { background: var(--marine); border-color: var(--marine); color: #fff; }
.bouton.principal:hover { background: #0f335e; }
:root[data-theme="dark"] .bouton.principal { background: #1f6fd1; border-color: #1f6fd1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bouton.principal { background: #1f6fd1; border-color: #1f6fd1; } }
.bouton.danger { color: var(--rouge); border-color: color-mix(in srgb, var(--rouge) 35%, var(--ligne)); }
.bouton.danger:hover { background: var(--rouge-doux); }
.bouton .icone { width: 16px; height: 16px; }
button.lien { background: none; border: 0; padding: 0; color: var(--lien); font: inherit; cursor: pointer; }

/* Formulaire en grille : .formulaire > .champ { label + input } */
.formulaire { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 18px; }
/* min-width: 0 et largeur 100 % : sans cela un champ garde sa largeur naturelle et déborde de sa colonne. */
.champ { display: grid; gap: 5px; align-content: start; min-width: 0; }
.champ > input, .champ > select, .champ > textarea { width: 100%; min-width: 0; }
.champ.large { grid-column: 1 / -1; }
/* Un tableau dans un formulaire (lignes à cocher) prend toute la largeur, pas une colonne de 220 px. */
.formulaire > .tableau { grid-column: 1 / -1; }
.champ .aide { font-size: 12px; color: var(--encre-pale); }
.formulaire .boutons { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ── Mise en page du contenu ─────────────────────────────────────────────── */
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px 20px; flex-wrap: wrap; }
.entete .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sous-titre, .retour, .pied, .suite { margin: 0; color: var(--encre-douce); }
.sous-titre { margin-top: 4px; }
.retour { font-size: 13.5px; margin-bottom: -10px; }
.pied, .suite { font-size: 13px; }
.ref { font-variant-numeric: tabular-nums; color: var(--encre-pale); font-size: 12.5px; margin: 0 0 3px; white-space: nowrap; }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filtres input[type=search] { flex: 1 1 280px; min-width: 0; }
.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--ligne); overflow-x: auto; }
.onglets a { padding: 8px 14px; color: var(--encre-douce); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.onglets a:hover { color: var(--encre); }
.onglets a.actif { color: var(--encre); border-color: var(--cyan); }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 18px; align-items: start; }
.actions-rapides { display: flex; gap: 10px; flex-wrap: wrap; }

.bloc { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px 18px; display: grid; gap: 12px; box-shadow: var(--ombre); align-content: start; }
.bloc > .tableau, .bloc > .liste { margin: 0 -18px; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
.bloc > .liste:last-child, .bloc > .tableau:last-child { margin-bottom: -16px; border-bottom: 0; border-radius: 0 0 var(--rayon) var(--rayon); }
.compte { font-size: 12.5px; color: var(--encre-pale); font-weight: 500; }

.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; }
.chiffre { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 13px 15px; display: grid; gap: 2px; box-shadow: var(--ombre); }
.chiffre .libelle { font-size: 12px; color: var(--encre-douce); }
.chiffre .valeur { font: 700 20px/1.25 var(--titre); font-variant-numeric: tabular-nums; }
.chiffre .detail { font-size: 12px; color: var(--encre-pale); }

/* ── Tableaux ────────────────────────────────────────────────────────────── */
.tableau { overflow-x: auto; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--ligne-douce); vertical-align: top; }
th { font-size: 11.5px; font-weight: 600; color: var(--encre-pale); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.ref { padding-top: 11px; }
.nb { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 600; background: var(--surface-2); }
.note { display: block; color: var(--encre-pale); font-size: 12px; }
/* L'objet d'un devis InterFast est souvent tout le descriptif : deux lignes, le reste au survol. */
.objet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 64ch; }

/* ── Listes ──────────────────────────────────────────────────────────────── */
.liste { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); }
.liste > li { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--ligne-douce); }
.liste > li:last-child { border-bottom: 0; }
.liste .titre { font-weight: 500; color: var(--encre); }
a.titre:hover { color: var(--lien); }
.liste .meta { color: var(--encre-douce); font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.liste > li.faite .titre { color: var(--encre-pale); text-decoration: line-through; }
.retard { color: var(--rouge); font-weight: 500; }

/* ── Pastilles, avis, vide ──────────────────────────────────────────────── */
.pastille { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.6; background: var(--gris-doux); color: var(--gris); }
.pastille.bleu { background: var(--bleu-doux); color: var(--bleu); }
.pastille.vert { background: var(--vert-doux); color: var(--vert); }
.pastille.ambre { background: var(--ambre-doux); color: var(--ambre); }
.pastille.rouge { background: var(--rouge-doux); color: var(--rouge); }
.avis { margin: 0; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; background: var(--bleu-doux); color: var(--bleu); }
.avis.vert { background: var(--vert-doux); color: var(--vert); }
.bandeau-essai { margin: 0 0 12px; padding: 8px 14px; border-radius: 8px; font-size: 13.5px; background: var(--ambre-doux); color: var(--encre); border: 1px solid var(--ambre); }
.avis.ambre { background: var(--ambre-doux); color: var(--ambre); }
.avis.rouge { background: var(--rouge-doux); color: var(--rouge); }
/* Relecture du rendu : un choix par remarque, un seul bouton (05/11/2026). */
.relecture-choix { margin: 6px 0 0; }
.relecture-choix ul { margin: 6px 0 10px; padding-left: 18px; }
.relecture-choix li { margin: 6px 0; }
.choix-remarque { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; vertical-align: middle; }
.choix-remarque label { position: relative; display: inline-flex; align-items: center; padding: 2px 10px; border: 1px solid currentColor; border-radius: 999px; font-size: 12.5px; cursor: pointer; opacity: .7; }
.choix-remarque input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choix-remarque label:has(input:checked) { opacity: 1; background: var(--surface); color: var(--encre); border-color: var(--cyan); font-weight: 600; }
.choix-remarque label:focus-within { outline: 2px solid var(--cyan); outline-offset: 1px; }
.suite-remarque { margin-left: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.relecture-faites { margin: 8px 0 0; font-weight: 600; }
.vide { margin: 0; padding: 22px; text-align: center; color: var(--encre-pale); background: var(--surface); border: 1px dashed var(--ligne); border-radius: var(--rayon); }
.bloc .vide { border: 0; padding: 10px 0; text-align: left; background: none; }

/* Contenu brut (couche bronze) : défile dans son cadre, jamais la page. */
pre.brut { margin: 8px 0 0; max-height: 70vh; overflow: auto; padding: 12px 14px; border-radius: 8px; background: var(--surface-2); font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre; }
details.bloc > summary { cursor: pointer; }

/* ── Barre du haut : aide, nouvelle tâche, menu utilisateur (tour 3) ──────── */
.aller-au-contenu { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: var(--surface); color: var(--lien); box-shadow: var(--ombre); }
.aller-au-contenu:focus { left: 8px; }
kbd, .touche { font: 500 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; padding: 3px 6px; border-radius: 5px; border: 1px solid var(--ligne); background: var(--surface); color: var(--encre-pale); }
.recherche-globale .touche { flex: none; }
@media (max-width: 900px) { .recherche-globale .touche { display: none; } }
.moi-menu { position: relative; }
.moi-menu > summary { list-style: none; cursor: pointer; }
.moi-menu > summary::-webkit-details-marker { display: none; }
.moi-volet {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(300px, calc(100vw - 24px));
  display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--ligne);
  border-radius: 12px; box-shadow: 0 10px 30px rgb(15 27 51 / 18%);
}
.moi-qui { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--ligne-douce); overflow-wrap: anywhere; }
.moi-qui .meta { color: var(--encre-douce); font-size: 12.5px; }
.moi-liens { display: grid; gap: 2px; }
.moi-liens a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--encre); }
.moi-liens a:hover { background: var(--surface-2); text-decoration: none; }
.moi-liens .icone { width: 16px; height: 16px; color: var(--encre-douce); }
.moi-liens .compteur { margin-left: auto; }
.moi-theme { display: grid; gap: 6px; margin: 0; }
.moi-theme .meta { font-size: 12px; color: var(--encre-pale); }
.bascule { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.bascule button { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; border: 0; border-radius: 8px; background: none; color: var(--encre-douce); font: 500 12.5px/1.2 var(--texte); cursor: pointer; }
.bascule button .icone { width: 15px; height: 15px; }
.bascule button:hover { color: var(--encre); }
.bascule button.actif { background: var(--surface); color: var(--encre); box-shadow: var(--ombre); }
.moi-volet form:last-child .bouton { width: 100%; justify-content: center; }
.compteur { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: #e5484d; color: #fff; font: 600 11px/1 var(--texte); font-variant-numeric: tabular-nums; }
.menu-lien .compteur { margin-left: auto; }
.moi-nom .compteur { margin-left: -2px; }
@media (max-width: 900px) { .moi-nom span.compteur { display: inline-grid; } }

/* Info-bulle « ⓘ » (details/summary : au survol et au toucher, sans JavaScript). */
.info { display: inline-block; position: relative; margin-left: 4px; vertical-align: middle; }
.info > summary {
  list-style: none; cursor: help; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid currentColor; color: var(--encre-pale); font: italic 600 10px/1 Georgia, serif;
}
.info > summary::-webkit-details-marker { display: none; }
.info-texte {
  position: absolute; z-index: 30; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: min(300px, 80vw);
  padding: 8px 10px; border-radius: 8px; background: var(--encre); color: var(--fond); font: 400 12px/1.45 var(--texte); text-transform: none; letter-spacing: 0; white-space: normal; box-shadow: var(--ombre);
}
.chiffre .libelle { display: flex; align-items: center; gap: 2px; }

/* Fenêtre de bienvenue (premier lancement). */
.bienvenue { border-color: color-mix(in srgb, var(--cyan) 45%, var(--ligne)); background: linear-gradient(135deg, var(--bleu-doux), var(--surface) 60%); }
.bienvenue ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--encre-douce); }
.bienvenue form { margin: 0; }

/* Page d'impression et impression de n'importe quelle page. */
body.impression { background: #fff; color: #0f1b33; }
body.impression main { max-width: 980px; margin: 0 auto; padding: 24px 28px 48px; display: grid; gap: 16px; }
.barre-impression { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; max-width: 980px; margin: 0 auto; padding: 16px 28px 0; }
@media print {
  .menu, .haut, .voile, .barre-impression, .aller-au-contenu, .actions, .filtres, .onglets, form, .bienvenue { display: none !important; }
  body.app { display: block; background: #fff; }
  main#contenu { max-width: none; padding: 0; }
  .bloc, .tableau, .chiffre, .liste { box-shadow: none; break-inside: avoid; }
  a { color: inherit; }
}
.point-aide { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.8px solid currentColor; font: 700 12.5px/1 var(--texte); }

/* Documents rédigés : édition sur place (sections, blocs, tableaux). */
.section-doc { display: grid; gap: 10px; margin-bottom: 14px; }
.section-doc + .section-doc { padding-top: 12px; border-top: 1px dashed var(--ligne); }
.titre-section-doc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.titre-section-doc > form.en-ligne:first-child, .titre-section-doc > form.en-ligne:first-child label { display: flex; flex: 1; gap: 6px; align-items: center; min-width: min(28rem, 100%); }
.titre-section-doc input[name="titre"] { flex: 1; min-width: 0; font-weight: 600; }
.section-doc > form.en-ligne, .bloc > form.en-ligne { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bloc > form.en-ligne input[name="titre"] { flex: 1; min-width: 12rem; max-width: 28rem; }
.bloc-doc { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface); }
/* Un bloc s'écrit sur toute la largeur : sans cela, il prenait la grille de .formulaire (colonnes de
   220 px) et le paragraphe tenait dans une colonne étroite (26/10/2026). */
.bloc-doc .formulaire { grid-template-columns: minmax(0, 1fr); padding: 0; border: 0; background: none; gap: 8px; }
.bloc-doc textarea, .bloc-doc input[name="intitule"], .bloc-doc input[name="titre"] { width: 100%; }
.bloc-doc textarea { field-sizing: content; min-height: 4lh; max-height: 70vh; }
.gestes-bloc { display: flex; gap: 4px; justify-content: flex-end; }
figure.image-doc { margin: 8px 0; display: grid; justify-items: center; gap: 4px; }
figure.image-doc img { max-width: 100%; max-height: 36rem; object-fit: contain; border-radius: 6px; background: #fff; }
figure.image-doc figcaption { font-size: 13px; font-style: italic; color: var(--encre-douce); }
table.tableau-edition input { width: 100%; min-width: 6rem; }
table.tableau-edition th { white-space: nowrap; }
details.demander-gaia summary { cursor: pointer; color: var(--lien); }
/* L'assistant dans la barre du haut, de partout (14/10/2026). */
.assistant-haut { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; }
@media (max-width: 900px) { .assistant-haut span { display: none; } .assistant-haut { padding: 6px 8px; } }
/* Styles propres au module commercial. La base commune est dans ../style.css : ne la redéfinir ici que si le module en a vraiment besoin. */

/* Fiche client : coordonnées en liste de définitions. */
dl.fiche-client { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 6px 14px; margin: 0; }
dl.fiche-client dt { color: var(--encre-pale); font-size: 12.5px; }
dl.fiche-client dd { margin: 0; overflow-wrap: anywhere; }

/* Petits formulaires posés dans une ligne (retirer, fait, monter…). */
form.en-ligne { display: inline; margin: 0 0 0 6px; }
form.en-ligne input.court, input.court { width: 70px; }
form.relance { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
form.relance input { min-width: 0; flex: 1 1 120px; }

/* Blocs repliables : un résumé en forme de bouton. */
details > summary.bouton, details > summary.lien { list-style: none; cursor: pointer; width: fit-content; }
details > summary.bouton::-webkit-details-marker, details > summary.lien::-webkit-details-marker { display: none; }
details > summary.lien { color: var(--lien); font-size: 12.5px; }
details[open] > summary { margin-bottom: 10px; }
details > .formulaire { margin-top: 4px; }
.ajouts { display: grid; gap: 10px; }

/* Éditeur de devis. */
table.lignes-devis tr.section td { background: var(--surface-2); }
table.lignes-devis tr.option td { color: var(--encre-douce); }
/* Gestes d'une ligne : une icône par action, info-bulle au survol (title). */
.actions-ligne { display: flex; gap: 2px; align-items: center; white-space: nowrap; }
.actions-ligne form.en-ligne { margin: 0; }
.actions-ligne .geste { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--encre-douce); cursor: pointer; list-style: none; }
.actions-ligne .geste svg { width: 16px; height: 16px; }
.actions-ligne .geste:hover, .actions-ligne .geste:focus-visible { background: var(--surface-2); border-color: var(--ligne); color: var(--lien); }
.actions-ligne .geste.actif { color: var(--ambre); background: var(--surface-2); }
.actions-ligne .geste.danger:hover, .actions-ligne .geste.danger:focus-visible { color: var(--rouge); border-color: currentColor; background: none; }
.actions-ligne .geste.vide { visibility: hidden; }
.actions-ligne summary.geste::-webkit-details-marker { display: none; }
.actions-ligne .geste-deroulant { position: relative; }
.actions-ligne .geste-deroulant[open] > summary.geste { color: var(--lien); background: var(--surface-2); }
.actions-ligne .panneau-geste { position: absolute; right: 0; top: 32px; z-index: 5; display: flex; gap: 6px; align-items: center; padding: 8px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px; box-shadow: 0 6px 18px rgba(15, 27, 51, 0.12); }
/* Menu « ⋯ » d'une ligne : chaque geste écrit en toutes lettres. */
.actions-ligne .menu-ligne { position: relative; }
.actions-ligne .menu-ligne > summary { list-style: none; }
.actions-ligne .menu-ligne > summary::-webkit-details-marker { display: none; }
.actions-ligne .menu-ligne[open] > summary.geste { color: var(--lien); background: var(--surface-2); border-color: var(--ligne); }
.menu-ligne-panneau { position: absolute; right: 0; top: 32px; z-index: 6; display: grid; min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 10px; box-shadow: 0 8px 22px rgba(15, 27, 51, 0.14); }
.menu-ligne-panneau form.en-ligne { margin: 0; }
.menu-ligne-panneau .entree-menu { display: flex; width: 100%; gap: 10px; align-items: center; padding: 7px 10px; border: 0; border-radius: 7px; background: none; color: var(--encre); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; white-space: nowrap; }
.menu-ligne-panneau .entree-menu svg, .menu-ligne-panneau .entree-formulaire svg { width: 16px; height: 16px; flex: none; color: var(--encre-douce); }
.menu-ligne-panneau .entree-menu:hover, .menu-ligne-panneau .entree-menu:focus-visible { background: var(--surface-2); color: var(--lien); }
.menu-ligne-panneau .entree-menu.actif { color: var(--ambre); }
.menu-ligne-panneau .entree-menu.danger { color: var(--rouge); border-top: 1px solid var(--ligne); border-radius: 0 0 7px 7px; margin-top: 4px; }
.menu-ligne-panneau .entree-formulaire { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 7px 10px; border-top: 1px solid var(--ligne); }
.menu-ligne-panneau .entree-formulaire label { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.menu-ligne-panneau .entree-formulaire input { min-width: 0; }

/* Aperçu client. */
.apercu-devis { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 22px; }
.apercu-devis tr.section td { background: var(--surface-2); }

/* Pipeline : une colonne par statut, qui défile à l'horizontale sur téléphone. */
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.pipeline .colonne { background: var(--surface-2); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px; display: grid; gap: 8px; align-content: start; }
.pipeline .colonne header { display: grid; gap: 2px; padding: 2px 4px 6px; }
.pipeline .colonne .total { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pipeline .colonne .vide { padding: 14px; background: none; }
.pipeline .carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px; padding: 9px 11px; display: grid; gap: 2px; box-shadow: var(--ombre); }
.pipeline .carte .titre { font-weight: 500; }
.pipeline .carte .meta { color: var(--encre-douce); font-size: 12.5px; }
.pipeline .carte .objet { font-size: 12.5px; }

ul.supplements > li { display: grid; gap: 4px; }

/* Éditeur de devis, tour 2 : barre d'outils, actions de ligne repliables, analyses. */
.outils-devis { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.outils-devis details.vider { display: inline-block; }
details.en-ligne { display: inline-block; margin-left: 4px; }
details.en-ligne[open] > summary { margin-bottom: 4px; }
.bloc-ia .actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* Refus au champ (28/09/2026) : le champ en cause, son message juste dessous. */
.formulaire [aria-invalid="true"] { border-color: var(--rouge); box-shadow: 0 0 0 2px var(--rouge-doux); }
p.erreur-champ { margin: 4px 0 0; padding: 6px 9px; border-radius: 6px; background: var(--rouge-doux); color: var(--rouge); font-size: 13px; }
/* Main d'œuvre à plusieurs métiers : une rangée par métier. */
fieldset.rangee-mo { grid-column: 1 / -1; border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 10px; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 12px; }
fieldset.rangee-mo legend { font-weight: 600; padding: 0 4px; }
form.adresse-rapide { margin-top: 6px; }
strong.alerte { color: var(--rouge); }
.barre-part { display: inline-block; vertical-align: middle; width: 90px; height: 8px; margin: 0 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.barre-part > span { display: block; height: 100%; background: var(--bleu); }
details.poste { border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
details.poste > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
details.poste .part { min-width: 52px; font-weight: 600; font-variant-numeric: tabular-nums; }
div.poste { border-left: 3px solid var(--ligne); padding-left: 10px; margin-bottom: 8px; }
.description-devis p, .conditions-devis p { margin: 0 0 6px; }
.conditions-devis { font-size: 13px; }

/* Devis imprimable (A4). */
body.devis-imprimable { background: var(--surface); }
.devis-feuille { max-width: 880px; margin: 0 auto; padding: 18px 16px 40px; display: grid; gap: 16px; }
.devis-outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.devis-entete { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; }
.devis-entete img { max-width: 220px; height: auto; }
.devis-titre { text-align: right; }
.devis-titre h1 { margin: 0; font-size: 26px; }
.devis-titre p { margin: 2px 0; }
.devis-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.devis-parties h2, .devis-accord h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--encre-douce); margin: 0 0 4px; }
.devis-parties p { margin: 0 0 2px; }
.devis-feuille table tr.section td { background: var(--surface-2); }
.devis-accord { display: flex; justify-content: flex-end; }
.devis-accord > div { border: 1px solid var(--ligne); border-radius: 8px; padding: 10px 14px; min-width: 260px; min-height: 90px; }
@media print {
  @page { size: A4; margin: 14mm; }
  body.devis-imprimable { background: #fff; color: #000; }
  body.devis-imprimable .devis-outils { display: none; }
  body.devis-imprimable .devis-feuille { max-width: none; padding: 0; }
  body.devis-imprimable table tr { break-inside: avoid; }
  body.devis-imprimable .tableau { overflow: visible; }
  body.devis-imprimable .pastille { border: 1px solid #000; background: none; color: #000; }
}

/* Parcours demande → validation → devis (tour 3). */
ol.etapes-parcours { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
ol.etapes-parcours li { border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 12px; background: var(--surface); font-weight: 500; }
ol.etapes-parcours li.fait { border-color: var(--vert); background: var(--vert-doux); }
ol.etapes-parcours li.courant { border-color: var(--bleu); box-shadow: 0 0 0 2px var(--bleu-doux); }
ol.etapes-parcours li.a-faire { color: var(--encre-pale); }
tr.proposee td, li.proposee { background: var(--bleu-doux); }
details.courrier { border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 12px; }
details.courrier > summary { cursor: pointer; }
div.corps-mail, p.texte-long { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; margin: 8px 0; max-height: 60vh; overflow-y: auto; }
pre.texte-piece { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; margin: 0; }
span.echeance { white-space: nowrap; }
.markdown { display: grid; gap: 6px; overflow-wrap: anywhere; }
.markdown h3, .markdown h4, .markdown h5 { margin: 8px 0 0; }
.markdown p, .markdown ul, .markdown ol, .markdown blockquote { margin: 0; }
.markdown blockquote { border-left: 3px solid var(--ligne); padding-left: 10px; color: var(--encre-douce); }
.markdown code { font-size: 12.5px; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
details.notes-internes > summary, details.titre-complet > summary { cursor: pointer; font-weight: 600; }
table.lignes-devis tr[draggable="true"] { cursor: grab; }
table.lignes-devis tr.tiree { opacity: .45; }

/* Titre complet de l'affaire retenue sous la liste déroulante (les listes coupent les titres longs). */
.affaire-retenue { font-size: 13px; color: var(--encre-douce); overflow-wrap: anywhere; }

/* Retouche directe des lignes d'un devis : chaque cellule est un champ qui se lit comme du texte
   et se révèle au survol ; le focus est toujours visible. */
table.lignes-devis .cellule { font: inherit; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin: -3px 0; width: 100%; min-width: 0; box-sizing: border-box; }
table.lignes-devis .cellule:hover { border-color: var(--ligne); background: var(--surface); }
table.lignes-devis .cellule:focus, table.lignes-devis .cellule:focus-visible { outline: 2px solid var(--bleu); outline-offset: 0; border-color: var(--bleu); background: var(--surface); }
table.lignes-devis textarea.cellule { resize: vertical; min-height: 1.9em; field-sizing: content; line-height: 1.4; min-width: 100%; }
table.lignes-devis .cellule.montant { text-align: right; font-variant-numeric: tabular-nums; width: 6em; }
table.lignes-devis .cellule.qte { width: 3.8em; }
table.lignes-devis .cellule.unite { width: 4em; }
table.lignes-devis .cellule.court { width: 5em; }
table.lignes-devis .cellule.reference { width: 12em; }
table.lignes-devis .cellule.titre-section { font-weight: 600; }
table.lignes-devis select.cellule { width: auto; max-width: 16em; padding-right: 2px; }
table.lignes-devis .cellule.calcule { color: var(--encre-douce); font-style: italic; }
table.lignes-devis .cellule[aria-invalid="true"] { border-color: var(--rouge); outline-color: var(--rouge); background: var(--rouge-doux); }
table.lignes-devis .cellule.en-cours { opacity: .6; }
table.lignes-devis td.designation { min-width: 18em; }
/* Les colonnes de chiffres prennent juste leur place : tout le reste va à la désignation. */
table.lignes-devis thead th:not(:first-child) { width: 1%; white-space: nowrap; }
/* Les colonnes de chiffres se serrent sur leur contenu : la désignation prend toute la place restante. */
table.lignes-devis td.nb, table.lignes-devis th.nb { padding-left: 6px; padding-right: 6px; }
table.lignes-devis td.nb { white-space: nowrap; }
table.lignes-devis .sous-cellules { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 4px; }
table.lignes-devis .sous-cellule { display: inline-flex; gap: 4px; align-items: center; }
table.lignes-devis .sous-cellule .etiquette { color: var(--encre-pale); font-size: 12px; white-space: nowrap; }
table.lignes-devis .sous-cellule .cellule { font-size: 12.5px; }
.refus-cellule { display: block; margin-top: 4px; color: var(--rouge); font-size: 12.5px; font-style: normal; text-align: left; white-space: normal; min-width: 14em; }
.refus-cellule a { color: var(--lien); }
table.lignes-devis .retouche-libre { display: block; color: var(--ambre); }
table.lignes-devis tr.enregistree td { background: var(--vert-doux); transition: background .6s; }
/* Les cadres remplaçables du tableau et de la synthèse ne doivent pas élargir la page : le tableau défile dans son cadre. */
#devis-tableau, #devis-synthese { min-width: 0; max-width: 100%; }
#devis-tableau { display: grid; gap: 12px; }
#devis-tableau > .tableau { margin: 0 -18px; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
/* Vérification d'un devis : la ligne visée par une alerte ressort quand on y arrive par son lien. */
table.lignes-devis tr:target td { background: var(--ambre-doux); }
ul.alertes-verif li .titre { display: inline; line-height: 1.5; }
ul.alertes-verif li .meta { display: block; margin-top: 2px; }
form.verifier .champ.large label { display: flex; gap: 8px; align-items: flex-start; }
/* Bordereau du client : colonnes retenues en évidence, ligne d'en-tête marquée. */
.apercu-bordereau th.choisie, .apercu-bordereau td.choisie { background: var(--surface-2); }
.apercu-bordereau tr.entete-bordereau td { font-weight: 600; border-bottom: 2px solid var(--lien); }
.apercu-bordereau td { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.appariement input.court { min-width: 110px; }
table.appariement tr.sous-total td { color: var(--encre-douce); }

/* Nouveau devis en une phrase (30/09/2026) : « Pour qui et pour quoi ? » en tête, le reste replié,
   les affaires candidates en boutons radio. */
.demande-phrase textarea { font-size: 16px; }
details.plus-options { grid-column: 1 / -1; margin: 16px 0; }
/* 04/10/2026 : la phrase est dans la zone « Dis-le en une phrase » en tête ; le formulaire détaillé est replié dessous. */
details.plus-options > form { margin-top: 12px; }
details.plus-options > summary { cursor: pointer; font-weight: 600; }
.plus-options-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; margin-top: 12px; }
fieldset.choix-phrase { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px 14px; display: grid; gap: 8px; margin: 0; }
fieldset.choix-phrase legend { font-weight: 600; padding: 0 4px; }
fieldset.choix-phrase label.case { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; cursor: pointer; }
fieldset.choix-phrase input[name="nouvelle_affaire"] { flex: 1; min-width: 200px; }

/* ═══ Fiche devis refondue (04/10/2026, maquette validée par Alexis) ═══════════════════════════
   En-tête compact, barre d'étapes, document au centre, assistant à droite, pied collant. */
:root {
  --sur-accent: #ffffff;
  --ombre-haute: 0 8px 22px rgb(15 27 51 / 14%);
  --ombre-pied: 0 -8px 22px rgb(15 27 51 / 16%);
}
.fiche-devis { display: grid; gap: 14px; min-width: 0; }
.devis-tete { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px 18px; display: grid; gap: 10px; box-shadow: var(--ombre); }
.devis-tete-ligne { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; }
.devis-ident { flex: 1 1 420px; min-width: 0; display: grid; gap: 4px; }
.devis-ident h1 { font-size: 21px; color: var(--encre); }
.devis-ident .sous-titre { margin: 0; font-size: 12.5px; color: var(--encre-pale); }
.devis-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--encre-douce); }
.devis-meta .ref { font-weight: 600; color: var(--encre); }
.pastille-affaire { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 99px; background: var(--bleu-doux); color: var(--bleu); font-weight: 600; text-decoration: none !important; max-width: 100%; }
.pastille-affaire span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pastille-affaire .icone { width: 14px; height: 14px; }
a.pastille-affaire:hover { background: color-mix(in srgb, var(--bleu-doux) 70%, var(--cyan)); }
.pastille-affaire.sans { background: var(--gris-doux); color: var(--gris); font-weight: 500; }
.devis-meta a.changer { font-size: 12px; display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; }
.devis-tete-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.devis-tete-actions > .bouton, .devis-tete-actions summary.bouton, .devis-tete-actions .bouton.etape-suivante { min-height: 44px; }
.bouton.etape-suivante { background: var(--cyan); border-color: var(--cyan); color: var(--sur-accent); font-weight: 600; }
.bouton.etape-suivante:hover { background: color-mix(in srgb, var(--cyan) 85%, var(--marine)); }
form.action-principale { margin: 0; }

/* La barre d'étapes. */
.etapes-devis { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13.5px; }
.etapes-ligne { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.etapes-ligne li { display: flex; align-items: center; gap: 7px; color: var(--encre-pale); }
.etapes-ligne li + li::before { content: ""; width: 24px; height: 2px; background: var(--ligne); }
.etapes-ligne .point { width: 12px; height: 12px; border-radius: 99px; border: 2px solid var(--ligne); background: var(--surface); flex: none; }
.etapes-ligne li.fait { color: var(--encre); }
.etapes-ligne li.fait .point { background: var(--cyan); border-color: var(--cyan); }
.etapes-ligne li.fait + li::before { background: var(--cyan); }
.etapes-ligne li.courante { color: var(--encre); font-weight: 700; }
.etapes-ligne li.courante .point { border-color: var(--cyan); }
.lien-historique { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; font-size: 13px; }
.lien-historique .icone { width: 15px; height: 15px; }

/* Le menu « Plus ». */
.menu-plus { position: relative; }
.menu-plus > summary { list-style: none; }
.menu-plus > summary::-webkit-details-marker { display: none; }
.menu-plus[open] > summary { margin-bottom: 0; background: var(--surface-2); }
.menu-plus-panneau { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; min-width: 290px; max-width: min(92vw, 400px); padding: 6px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 10px; box-shadow: var(--ombre-haute); }
.menu-plus-panneau .entree-menu { display: flex; width: 100%; gap: 10px; align-items: center; min-height: 44px; padding: 7px 10px; border: 0; border-radius: 7px; background: none; color: var(--encre); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; text-decoration: none !important; list-style: none; }
.menu-plus-panneau .entree-menu::-webkit-details-marker { display: none; }
.menu-plus-panneau .entree-menu svg { width: 16px; height: 16px; flex: none; color: var(--encre-douce); }
.menu-plus-panneau .entree-menu:hover, .menu-plus-panneau .entree-menu:focus-visible { background: var(--surface-2); color: var(--lien); }
.menu-plus-panneau .entree-menu.danger { color: var(--rouge); }
.menu-plus-panneau form.en-ligne { margin: 0; display: block; }
.menu-plus-panneau details.vider[open] > summary { margin-bottom: 4px; }
.menu-plus-titre { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-pale); padding: 10px 10px 4px; border-top: 1px solid var(--ligne); margin-top: 4px; }

/* Les volets repliés (réglages, historique) : avec le script, un volet fermé disparaît ; les
   boutons de l'en-tête l'ouvrent. Sans script, ils restent en bandeaux repliés. */
details.volet-devis > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; }
details.volet-devis > summary::-webkit-details-marker { display: none; }
details.volet-devis > summary h2 { margin: 0; }
details.volet-devis[open] > summary { margin-bottom: 4px; }
.avec-script details.volet-devis:not([open]) { display: none; }
details.volet-devis section { display: grid; gap: 10px; }
dl.resume-reglages { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 20px; margin: 0; }
dl.resume-reglages dt { font-size: 12px; color: var(--encre-pale); }
dl.resume-reglages dd { margin: 0; font-weight: 600; }

/* Le corps : le document, l'assistant à droite. */
.devis-corps { display: grid; gap: 16px; align-items: start; min-width: 0; }
.devis-corps.avec-assistant { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
.devis-principal { min-width: 0; display: grid; gap: 14px; }
.devis-document { background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; padding: 22px; display: grid; gap: 14px; box-shadow: var(--ombre); min-width: 0; }
.devis-document #devis-tableau > .tableau { margin: 0; border-radius: var(--rayon); border: 1px solid var(--ligne); }
/* Le tableau défile dans son cadre : ses étiquettes cachées (position absolue) y restent, sans
   élargir la page sur téléphone. */
.devis-document .tableau, .comparaison-article { position: relative; }
.devis-description { color: var(--encre-douce); max-width: 75ch; }
.devis-document details.notes-internes { background: var(--surface-2); border-radius: var(--rayon); padding: 8px 12px; }
.devis-document details.notes-internes > summary { cursor: pointer; font-weight: 600; }
.devis-document .a-preciser { margin-block: 0 10px; }
.devis-document .a-preciser ul { margin: 6px 0 0; padding-left: 20px; }
.devis-document .a-preciser li + li { margin-top: 2px; }
p.devis-vide { margin: 0; padding: 18px; border: 1.5px dashed var(--ligne); border-radius: var(--rayon); color: var(--encre-douce); }
.aide-edition { margin: 0; }
table.lignes-devis tr.ia-ajout td { background: var(--bleu-doux); }
table.lignes-devis tr.nouvelle td { animation: ligne-nouvelle 3s ease-out; }
@keyframes ligne-nouvelle { from { background: color-mix(in srgb, var(--cyan) 35%, var(--surface)); } }
.marque-ligne { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--bleu); }
.marque-ligne.stock { color: var(--vert); }
.ajouts-devis { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; min-width: 0; }
#lignes { min-width: 0; display: grid; gap: 12px; }
details.ajout-volet { min-width: 0; max-width: 100%; }
details.ajout-volet[open] { flex: 1 1 100%; }
.comparaison-article td.article { font-weight: 500; }
.comparaison-article td.stock .note { overflow-wrap: anywhere; }
details.ajout-volet > summary { list-style: none; }
details.ajout-volet > summary::-webkit-details-marker { display: none; }
summary.bouton.ajout { border-style: dashed; min-height: 44px; color: var(--encre); }
.ajout-contenu { display: grid; gap: 10px; border: 1.5px solid var(--cyan); border-radius: 12px; padding: 14px; min-width: 0; }
.ajout-sep { margin: 6px 0 0; font-size: 12.5px; color: var(--encre-pale); }
form.recherche-article { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.recherche-article label { font-weight: 600; }
form.recherche-article input[type="search"] { flex: 1 1 240px; min-width: 0; min-height: 44px; }
form.recherche-article .bouton { min-height: 44px; }
.comparaison-article table { min-width: 720px; }
.comparaison-article td.moins-cher { background: var(--vert-doux); color: var(--vert); font-weight: 600; }
.comparaison-article td.en-stock { color: var(--vert); font-weight: 600; }
.comparaison-article td.ajouter { white-space: nowrap; }
.comparaison-article td.ajouter form.en-ligne { margin: 0 4px 0 0; }
.comparaison-article td.ajouter .bouton { min-height: 40px; }
.vue-annexe h3 { margin-top: 6px; }

/* Le panneau de l'assistant. */
.devis-assistant { position: sticky; top: 72px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; box-shadow: var(--ombre); overflow: hidden; min-width: 0; }
.assistant-repli > summary { display: none; }
.assistant-tete { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--ligne); }
.assistant-liens { font-size: 12px; }
.assistant-fil { padding: 14px 16px; display: grid; gap: 10px; overflow-y: auto; max-height: calc(100vh - 360px); min-height: 140px; align-content: start; }
.assistant-fil .ia-fil { gap: 8px; }
.assistant-fil .ia-message { border: 0; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; background: var(--surface-2); max-width: 94%; }
.assistant-fil .ia-message.utilisateur { justify-self: end; background: var(--marine); color: var(--sur-accent); }
.assistant-fil .ia-message.utilisateur a { color: inherit; text-decoration: underline; }
.assistant-fil .ia-message .ia-tete { font-size: 11.5px; opacity: .75; }
.assistant-fil .ia-texte { white-space: pre-wrap; overflow-wrap: anywhere; }
.ia-accueil { margin: 0; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.assistant-saisie { margin: 4px 12px 8px; border: 1.5px dashed var(--ligne); border-radius: 12px; padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.assistant-saisie > * { min-width: 0; }
.assistant-saisie.survol { border-color: var(--cyan); background: var(--bleu-doux); }
.assistant-bulle { display: grid; gap: 6px; }
.assistant-bulle textarea { width: 100%; min-height: 44px; resize: vertical; }
.assistant-outils { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.assistant-outils .bouton-icone { width: 44px; height: 44px; border: 1px solid var(--ligne); }
.assistant-outils .bouton { min-height: 44px; }
.cache-fichier { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.assistant-trombone { cursor: pointer; }
.assistant-trombone:has(+ .cache-fichier:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.piece-choisie { justify-self: start; font-size: 12.5px; background: var(--surface-2); border-radius: 99px; padding: 3px 10px; }
.piece-choisie[hidden] { display: none; }
.assistant-aide { margin: 0; font-size: 12px; color: var(--encre-pale); }

/* Le pied collant : totaux, contrôles, marge (interne). */
.devis-pied { position: sticky; bottom: 0; z-index: 15; background: var(--marine); color: var(--sur-accent); border-radius: 12px 12px 0 0; padding: 8px 18px; }
.pied-barre { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.pied-total { font: 600 15px/1.2 var(--texte); }
.pied-total strong { font: 700 19px/1.2 var(--titre); font-variant-numeric: tabular-nums; }
.pied-detail { font-size: 13.5px; opacity: .9; }
.pied-alerte { font-size: 12.5px; background: var(--ambre-doux); color: var(--ambre); border-radius: 99px; padding: 2px 10px; }
.pied-espace { flex: 1 1 auto; }
.pied-volet > summary { list-style: none; }
.pied-volet > summary::-webkit-details-marker { display: none; }
.pied-volet[open] > summary { margin-bottom: 0; }
.pied-pastille { cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 4px 14px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--sur-accent) 40%, transparent); background: color-mix(in srgb, var(--sur-accent) 12%, transparent); font-size: 13px; }
.pied-pastille.a-voir { border-color: var(--ambre); }
.pied-volet[open] > .pied-pastille { background: color-mix(in srgb, var(--sur-accent) 24%, transparent); }
.pied-panneau { position: absolute; left: 0; right: 0; bottom: 100%; max-height: 60vh; overflow-y: auto; background: var(--surface); color: var(--encre); border: 1px solid var(--ligne); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 14px 18px; display: grid; gap: 10px; box-shadow: var(--ombre-pied); }
.pied-panneau h3 { display: flex; gap: 8px; align-items: baseline; }
ul.controles { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
li.controle { display: flex; gap: 10px; align-items: flex-start; }
li.controle ul { margin: 4px 0 0; padding-left: 18px; color: var(--encre-douce); }
li.controle .signe { flex: none; width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; background: var(--ambre-doux); color: var(--ambre); font-weight: 700; font-size: 13px; }
li.controle.ok .signe { background: var(--vert-doux); color: var(--vert); }
dl.recap-marge { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; margin: 0; max-width: 640px; }
dl.recap-marge dt .note { display: inline; margin-left: 6px; }
dl.recap-marge dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 1419px) {
  .devis-corps.avec-assistant { grid-template-columns: minmax(0, 1fr); }
  .devis-assistant { position: static; }
  .assistant-repli > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; font-weight: 600; cursor: pointer; list-style: none; }
  .assistant-repli > summary::-webkit-details-marker { display: none; }
  .assistant-repli[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--ligne); }
  .assistant-repli .assistant-tete h2 { display: none; }
  .assistant-fil { max-height: 55vh; }
}
@media (max-width: 600px) {
  .devis-tete { padding: 12px; }
  .devis-document { padding: 14px; }
  .devis-tete-actions { width: 100%; }
  .devis-tete-actions .action-principale, .devis-tete-actions > .bouton.etape-suivante { flex: 1 1 100%; }
  .devis-tete-actions .action-principale .bouton { width: 100%; justify-content: center; }
  .lien-historique { margin-left: 0; }
  .etapes-ligne li + li::before { width: 12px; }
  .devis-pied { padding: 6px 12px; border-radius: 0; }
  .pied-barre { gap: 4px 10px; }
  .pied-total strong { font-size: 17px; }
  .pied-espace { display: none; }
  .pied-detail { font-size: 12.5px; }
  .pied-pastille { padding: 4px 10px; font-size: 12.5px; }
}
@media print {
  .devis-pied, .devis-assistant, .devis-tete-actions, .ajouts-devis, .etapes-devis { display: none !important; }
}

/* 05/10/2026 : à 1440 px (menu latéral + assistant), la colonne des actions et le montant
   sortaient du cadre. Assistant à côté : cellules moins rembourrées, désignation plus souple ;
   sous 1600 px, assistant un peu plus étroit ; sous 1420 px, il passe SOUS le document (repliable),
   sinon le montant sortait du cadre à 1280 px. Le tableau tient sans défiler à 1280, 1440 et 1600 px. */
@media (min-width: 1420px) and (max-width: 1599px) {
  .devis-corps.avec-assistant { grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); }
}
@media (min-width: 1101px) {
  .devis-document { padding: 18px 16px; }
  table.lignes-devis th, table.lignes-devis td { padding-left: 7px; padding-right: 7px; }
  table.lignes-devis th { letter-spacing: .02em; }
  table.lignes-devis td.designation { min-width: 13em; }
  table.lignes-devis .cellule.montant { width: 5.4em; }
  table.lignes-devis .cellule.unite { width: 3.6em; }
  table.lignes-devis .cellule.reference { width: 10.5em; }
}

/* Menu latéral replié (08/10/2026) : le document regagne ses 256 px ; entre 1164 et 1419 px de
   fenêtre, l'assistant reste donc À CÔTÉ du document au lieu de passer dessous (même largeur utile
   qu'à 1420-1599 px avec le menu). */
@media (min-width: 1164px) and (max-width: 1419px) {
  body.menu-replie .devis-corps.avec-assistant { grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); }
  body.menu-replie .devis-assistant { position: sticky; }
  body.menu-replie .assistant-repli > summary { display: none; }
  body.menu-replie .assistant-repli .assistant-tete h2 { display: block; }
  body.menu-replie .assistant-fil { max-height: calc(100vh - 360px); }
}

/* Bibliothèque : la copie d'un code ou d'une désignation en un clic. */
button.copie { border: 0; background: none; padding: 0 3px; color: var(--encre-douce); cursor: pointer; font-size: .95em; line-height: 1; }
button.copie:hover, button.copie:focus-visible { color: var(--cyan); }

/* Fiche dépliée sous sa ligne (menu.js, `a[data-panneau]`) : la ligne s'ouvre en glissant, la
   liste reste en place autour. L'animation passe par grid-template-rows (0fr -> 1fr). */
tr.deroule > td { padding: 0; border: 0; background: transparent; }
li.deroule { list-style: none; padding: 0; }
.deroule-cadre {
  display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(-6px);
  transition: grid-template-rows .26s ease, opacity .2s ease, transform .26s ease;
}
.deroule.ouvert .deroule-cadre { grid-template-rows: 1fr; opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .deroule-cadre { transition: none; } }
.deroule-boite {
  min-height: 0; overflow: hidden; margin: 2px 0 10px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon);
  box-shadow: inset 0 2px 6px rgb(15 27 51 / 6%);
}
.deroule-tete {
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--ligne-douce); background: var(--bleu-doux);
}
.deroule-titre { flex: 1; min-width: 0; margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deroule-pleine { font-size: .9em; white-space: nowrap; }
.deroule-fermer { border: 0; background: none; font-size: 1.5em; line-height: 1; padding: 2px 8px; color: var(--encre-douce); cursor: pointer; border-radius: 8px; }
.deroule-fermer:hover, .deroule-fermer:focus-visible { background: var(--surface); color: var(--encre); }
.deroule-corps { padding: 12px 16px 16px; white-space: normal; }
.deroule[aria-busy="true"] .deroule-corps { opacity: .5; transition: opacity .15s; }
.deroule-corps h2 { font-size: 1.05em; margin-top: 14px; }
tr.choisi > td { background: var(--bleu-doux); }
@media (max-width: 700px) { .deroule-corps { padding: 10px 10px 14px; } }

/* Devis Batigest de l'archive : lignes indentées dans les ouvrages, descriptif sur plusieurs lignes. */
td.niveau-1 { padding-left: 26px; }
td.niveau-2 { padding-left: 44px; }
td.niveau-3, td.niveau-4 { padding-left: 62px; }
.descriptif-batigest { white-space: pre-line; margin-top: 2px; }
tr.titre-batigest > td { background: var(--ligne-douce); }

/* Atelier armoire : l'appareillage par groupe, dépliable ; le résultat en tête. */
details.groupe-armoire { margin-block: 6px; }
details.groupe-armoire > summary { cursor: pointer; font-weight: 600; padding-block: 4px; }
.resultat-armoire h3 { margin-top: 16px; }
fieldset.nouveau-devis { grid-column: 1 / -1; border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
fieldset.nouveau-devis legend { padding-inline: 6px; color: var(--encre-douce); font-size: .9em; }

/* ═══ La fenêtre « Récapitulatif » de la fiche devis (15/11/2026), copiée sur Sage Batigest ═══
   Interne (vit dans le pied, jamais imprimée), lecture seule. Cases grisées = valeurs calculées :
   gris foncé dans le tableau, gris clair en haut et en bas, comme dans Batigest. */
dialog.recapitulatif {
  --recap-gris: color-mix(in srgb, var(--encre-pale) 45%, var(--surface));
  --recap-trait: color-mix(in srgb, var(--encre-pale) 55%, var(--surface));
  --recap-clair: color-mix(in srgb, var(--encre-pale) 18%, var(--surface));
  width: min(1000px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--recap-trait); border-radius: 8px; background: var(--surface); color: var(--encre);
  font: 400 14px/1.35 var(--texte); box-shadow: 0 18px 48px rgb(15 27 51 / 30%); overflow: auto;
}
dialog.recapitulatif::backdrop { background: rgb(15 27 51 / 45%); }
.recap-titre { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; padding: 4px 6px; }
.recap-titre h2 { display: block; margin: 0; text-align: center; font: 500 19px/1.2 var(--texte); color: var(--encre); }
.recap-icone { display: grid; place-items: center; color: var(--vert); }
.recap-titre form { margin: 0; }
.recap-croix { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--encre-pale); cursor: pointer; }
.recap-croix:hover, .recap-croix:focus-visible { background: var(--surface-2); color: var(--encre); }
/* minmax(0, 1fr) : sans cela, le tableau (860 px au moins) élargit toute la fenêtre au lieu de défiler dans son cadre. */
.recap-corps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 6px 18px 18px; }
.recap-haut { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 56px; }
dl.recap-champs { display: grid; gap: 6px; margin: 0; align-content: start; }
.recap-champ { display: grid; grid-template-columns: 11.5em minmax(0, 1fr); align-items: center; gap: 8px; }
.recap-champ dt { white-space: nowrap; }
.recap-champ dd { margin: 0; display: flex; align-items: center; gap: 4px; min-width: 0; }
.recap-champ .case { flex: 1 1 auto; min-width: 0; min-height: 30px; display: flex; align-items: center; justify-content: flex-end; padding: 3px 8px; border: 1px solid var(--recap-trait); background: var(--surface); font-variant-numeric: tabular-nums; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.recap-champ .case.calcule { background: var(--recap-clair); }
.recap-champ[data-recap="mo-pose"] .case { justify-content: flex-start; }
.recap-champ .case.liste { justify-content: space-between; }
.recap-champ .case.liste::after { content: "▾"; margin-left: 8px; color: var(--encre-douce); }
.recap-champ .unite { flex: none; width: 1.1em; }
.recap-tableau { min-width: 0; overflow-x: auto; border: 1px solid var(--recap-trait); }
.recap-tableau table { width: 100%; min-width: 860px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.recap-tableau th { text-transform: none; letter-spacing: normal; font: 500 14px/1.3 var(--texte); color: var(--encre); background: var(--surface); padding: 7px 8px; text-align: center; white-space: nowrap; border: 0; vertical-align: middle; }
.recap-tableau thead th { border-bottom: 1px solid var(--recap-trait); }
.recap-tableau thead th + th { border-left: 1px solid var(--recap-trait); }
.recap-tableau tbody th, .recap-tableau tfoot th { text-align: left; font-weight: 400; }
.recap-tableau td { padding: 5px 8px; text-align: right; white-space: nowrap; border: 0; vertical-align: middle; }
.recap-tableau tfoot td { font-weight: 400; background: var(--surface); }
.recap-tableau td.calcule { background: var(--recap-gris); }
.recap-tableau td .unite { display: inline-block; width: 1em; margin-left: 4px; text-align: left; }
.recap-tableau td.figer { text-align: center; width: 4.5em; }
.recap-tableau td.figer input { width: 18px; height: 18px; margin: 0; padding: 0; }
.recap-tableau tbody tr:hover { background: none; }
.recap-tableau tfoot tr { border-top: 1px solid var(--recap-trait); }
.recap-tableau tfoot th, .recap-tableau tfoot td { padding-block: 8px; }
.recap-tableau td.total-vente .case { display: inline-block; min-width: 8.5em; padding: 3px 8px; border: 1px solid var(--recap-trait); background: var(--surface); text-align: right; }
.recap-bas { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1.2fr); gap: 8px 28px; align-items: start; }
.recap-champ[data-recap^="marge"] { grid-template-columns: 12.5em minmax(0, 8em); }
.recap-tva .recap-champ { grid-template-columns: 2.5em minmax(0, 1fr); }
.recap-etoile { margin: 6px 0 0; font-style: italic; font-size: 13px; color: var(--encre-douce); }
.recap-notes { display: grid; gap: 6px; }
.recap-notes p { margin: 0; }
.recap-boutons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.recap-boutons form { margin: 0; }
.recap-boutons .bouton { min-height: 44px; min-width: 120px; justify-content: center; }
@media (max-width: 700px) {
  dialog.recapitulatif { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .recap-corps { padding: 6px 16px 16px; }
  .recap-haut, .recap-bas { grid-template-columns: minmax(0, 1fr); }
  .recap-champ, .recap-champ[data-recap^="marge"] { grid-template-columns: minmax(0, 11em) minmax(0, 1fr); }
  .recap-tva .recap-champ { grid-template-columns: minmax(0, 11em) minmax(0, 1fr); }
}
@media print { dialog.recapitulatif { display: none !important; } }
/* Styles propres au module travail. La base commune est dans ../style.css : ne la redéfinir ici que si le module en a vraiment besoin. */

/* ── Tâches ─────────────────────────────────────────────────────────────── */
.taches > li { align-items: center; }
.tache-tete { display: grid; gap: 3px; min-width: 0; flex: 1 1 320px; }
.tache-rapide .bouton { padding: 5px 10px; font-size: 12.5px; }
.tache-description { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.fiche-tache { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.fiche-tache dt { color: var(--encre-pale); }
.fiche-tache dd { margin: 0; }
.boutons-statut { display: flex; gap: 8px; flex-wrap: wrap; }
.formulaire.compact { padding: 0; border: 0; background: none; }
fieldset.cases { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
fieldset.cases legend { font-size: 13px; font-weight: 500; color: var(--encre-douce); padding: 0; margin-bottom: 6px; width: 100%; }
fieldset.cases .aide { width: 100%; }
.case { display: inline-flex; align-items: center; gap: 6px; }
.case label { font-weight: 400; color: var(--encre); }
.televerser { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.televerser label { width: 100%; }
.televerser input[type=file] { flex: 1 1 220px; min-width: 0; }

/* ── Feuille d'heures ───────────────────────────────────────────────────── */
.hr-semaine th, .hr-semaine td { text-align: right; }
.hr-ligne-droite { display: inline-flex; align-items: center; gap: 6px; }
.hr-ligne-droite form { display: inline; }

/* ── Calendrier ─────────────────────────────────────────────────────────── */
.cal-legende { margin: 0; font-size: 12.5px; color: var(--encre-douce); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cal-puce { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 6px; background: var(--gris); }
.cal-puce.conf-2 { background: var(--ambre); }
.cal-puce.conf-3 { background: var(--vert); }
.cal-evt { display: grid; gap: 1px; padding: 4px 7px; border-radius: 6px; font-size: 12.5px; line-height: 1.3; text-decoration: none; color: var(--encre);
  background: var(--gris-doux); border-left: 3px solid var(--gris); overflow-wrap: anywhere; }
.cal-evt.conf-2 { background: var(--ambre-doux); border-left-color: var(--ambre); }
.cal-evt.conf-3 { background: var(--vert-doux); border-left-color: var(--vert); }
.cal-evt:hover { filter: brightness(0.97); }
.cal-evt.cal-rappel { background: var(--bleu-doux, #eef2ff); border-left-color: #7c3aed; border-left-style: dashed; }
.hr-semaine th.actif { background: var(--bleu-doux, #eef2ff); }
.hr-grille input { width: 100%; min-width: 6em; }
.cal-heure { font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-titre { font-weight: 500; }
.cal-qui { color: var(--encre-douce); font-size: 11.5px; }
.cal-ajout { margin-left: auto; font-weight: 600; text-decoration: none; color: var(--encre-pale); padding: 0 6px; border-radius: 6px; }
.cal-ajout:hover { background: var(--surface-2); color: var(--lien); }

.cal-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--ligne); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
.cal-entete { background: var(--surface-2); font-size: 11.5px; font-weight: 600; text-transform: uppercase; color: var(--encre-pale); padding: 6px 8px; }
.cal-case { background: var(--surface); min-height: 96px; padding: 5px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.cal-case.hors-mois { background: var(--fond); }
.cal-case.hors-mois .cal-num { color: var(--encre-pale); }
.cal-case.aujourdhui .cal-num span { color: var(--cyan); font-weight: 700; }
.cal-num { display: flex; align-items: center; font-size: 12.5px; font-weight: 500; }
.cal-jour-long { display: none; }

.cal-semaine { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-colonne { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 8px; display: grid; gap: 6px; align-content: start; min-height: 140px; min-width: 0; }
.cal-colonne h2 { font-size: 13px; margin: 0; display: flex; align-items: center; gap: 4px; }
.cal-colonne.aujourdhui { border-color: var(--cyan); }
.cal-rien { margin: 0; color: var(--encre-pale); font-size: 12px; }

/* Sur téléphone : une liste de jours, les jours vides repliés. */
@media (max-width: 760px) {
  .cal-semaine { grid-template-columns: 1fr; }
  .cal-colonne { min-height: 0; }
  .cal-colonne.sans .cal-rien { display: none; }
  .cal-mois { grid-template-columns: 1fr; background: none; border: 0; gap: 6px; }
  .cal-entete, .cal-case.hors-mois, .cal-case.sans { display: none; }
  .cal-case { min-height: 0; border: 1px solid var(--ligne); border-radius: var(--rayon); }
  .cal-jour-long { display: inline; }
  .cal-jour-court { display: none; }
}

/* ── Carnet ─────────────────────────────────────────────────────────────── */
.carnet-ajout > summary { cursor: pointer; list-style: none; }
.carnet-ajout > summary::-webkit-details-marker { display: none; }
.carnet-ajout > summary h2 { display: inline-flex; align-items: center; gap: 6px; margin: 0; }

/* Consigne mise en forme (intertitres, puces, gras). */
.tache-description .texte-riche { white-space: normal; }
.texte-riche h4 { margin: 12px 0 4px; font-size: 14px; color: var(--marine); }
.texte-riche ul { margin: 4px 0 8px; padding-left: 20px; }
.texte-riche p { margin: 0 0 8px; }
/* Deux gestes dans la ligne d'une tâche : « En cours » et « Faite ». */
.tache-gestes { display: flex; gap: 6px; flex-wrap: wrap; }
/* #25 : sélection de plusieurs tâches. */
.taches-lot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.tache-choix { display: flex; align-items: center; padding: 4px; cursor: pointer; }
.tache-choix input { width: 18px; height: 18px; margin: 0; }
.taches-lot .tache-choix { gap: 6px; font-weight: 600; }
ul.taches > li.choisie { background: var(--surface-choisie, rgba(0, 159, 227, 0.08)); }
/* Le terrain posé sur le planning : visites de maintenance et jalons de chantier. */
.cal-evt.cal-terrain { border-left-color: var(--vert); border-left-style: solid; background: var(--vert-doux); }
/* Accueil : explication d'un chiffre, gestes sur les suppléments. */
abbr.info { text-decoration: none; cursor: help; color: var(--encre-pale); font-size: 12px; }
.supplement-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12.5px; }
.supplement-actions details { display: inline-block; }
.supplement-actions summary { cursor: pointer; color: var(--lien); }
nav.actions-rapides { margin: 4px 0 14px; }
@media (max-width: 600px) { nav.actions-rapides .bouton { flex: 1 1 45%; justify-content: center; } }
.taches-lot .tache-choix { gap: 6px; font-weight: 600; }
ul.taches > li.choisie, tr.choisie { background: var(--surface-choisie, rgba(0, 159, 227, 0.08)); }

/* Notes d'affaire (12/11/2026) : onglet « Notes » de la fiche affaire. */
.liste.notes-affaire > li { display: block; }
.notes-affaire .entete-note { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.notes-affaire .texte-note { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--encre); font-size: 13.5px; line-height: 1.5; }
.notes-affaire details { margin: 6px 0 0; }
.notes-affaire details > summary { cursor: pointer; color: var(--encre-douce); font-size: 12.5px; }
.notes-affaire .pieces-note { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; }
.notes-affaire .pieces-note a { color: var(--lien); overflow-wrap: anywhere; }
.notes-affaire .pieces-note .note { display: inline; }
/* Styles propres au module terrain. La base commune est dans ../style.css : ne la redéfinir ici que si le module en a vraiment besoin. */

/* Barre d'avancement : un élément <progress> (la CSP interdit les styles en ligne). */
.avancement { display: inline-flex; align-items: center; gap: 8px; min-width: 150px; }
.avancement progress { flex: 1; height: 8px; min-width: 90px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--gris-doux); overflow: hidden; }
.avancement progress::-webkit-progress-bar { background: var(--gris-doux); border-radius: 99px; }
.avancement progress::-webkit-progress-value { background: var(--cyan); border-radius: 99px; }
.avancement progress::-moz-progress-bar { background: var(--cyan); border-radius: 99px; }
.avancement .nb { font-size: 12.5px; color: var(--encre-douce); min-width: 3.2em; }
main > .avancement { display: flex; }

/* Liste des chantiers : titre à gauche, suivi à droite ; empilés sur téléphone. */
.liste.chantiers > li { align-items: center; }
.chantier-titre { display: grid; gap: 2px; min-width: 0; flex: 1 1 260px; }
.chantier-suivi { display: grid; gap: 3px; justify-items: end; flex: 0 1 320px; }
.chantier-suivi .meta { justify-content: flex-end; text-align: right; }
@media (max-width: 600px) {
  .chantier-suivi { justify-items: start; flex-basis: 100%; }
  .chantier-suivi .meta { justify-content: flex-start; text-align: left; }
}

/* Formulaires plus serrés dans un bloc, formulaires d'un seul bouton dans le texte. */
.bloc .formulaire.compact, .bloc .formulaire { border: 0; padding: 4px 0 0; background: none; }
.formulaire h2.champ { font-size: 15px; margin-top: 6px; color: var(--marine); }
form.en-ligne { display: inline; margin: 0; }
button.lien.danger { color: var(--rouge); }
p.aide { margin: 0; font-size: 12.5px; color: var(--encre-pale); }
p.notes { margin: 0; white-space: pre-line; }
.boutons-bas { display: flex; justify-content: flex-end; margin: 12px 0 0; }

/* Cases à cocher en liste (intervenants, visite). */
fieldset.cases { border: 1px solid var(--ligne); border-radius: 8px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
fieldset.cases legend { font-size: 13px; font-weight: 500; color: var(--encre-douce); padding: 0 4px; }
label.case { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--encre); cursor: pointer; }
label.case input { width: 18px; height: 18px; accent-color: var(--marine); }

/* Fiches en définitions. */
dl.fiche-infos, dl.cr-infos { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 0; }
dl.fiche-infos dt, dl.cr-infos dt { color: var(--encre-douce); font-size: 13px; }
dl.fiche-infos dd, dl.cr-infos dd { margin: 0; }
@media (max-width: 480px) { dl.fiche-infos, dl.cr-infos { grid-template-columns: 1fr; gap: 0 0; } dl.fiche-infos dd, dl.cr-infos dd { margin-bottom: 8px; } }

/* Galerie de photos. */
ul.galerie { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
ul.galerie li { display: grid; gap: 4px; align-content: start; }
ul.galerie img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--ligne); background: var(--surface-2); display: block; }
ul.galerie .legende { font-size: 12px; color: var(--encre-douce); }

/* Arborescence du bâtiment (audits). */
.arbre { display: grid; gap: 10px; }
details.niveau { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px 14px; box-shadow: var(--ombre); }
details.niveau > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
details.niveau > summary::-webkit-details-marker { display: none; }
details.niveau > summary::before { content: "▸"; color: var(--encre-pale); }
details.niveau[open] > summary::before { content: "▾"; }
details.niveau .liste { margin-top: 8px; }
details.niveau .suite { margin-top: 8px; }
details.bloc > summary { cursor: pointer; }

/* Checklist de visite. */
ul.visite > li { display: grid; grid-template-columns: 1fr minmax(180px, 300px); gap: 6px 14px; align-items: center; }
.visite-point { display: grid; gap: 2px; }
@media (max-width: 600px) { ul.visite > li { grid-template-columns: 1fr; } }

/* Compte rendu : la fiche à l'écran et à l'impression. */
article.compte-rendu { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 24px 26px; display: grid; gap: 16px; box-shadow: var(--ombre); }
.cr-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--marine); padding-bottom: 12px; }
.cr-logo { max-width: 170px; height: auto; }
.cr-meta { text-align: right; font-size: 13px; color: var(--encre-douce); }
.cr-titre { font: 700 20px/1.25 var(--titre); color: var(--marine); }
.cr-rubrique { display: grid; gap: 6px; }
.cr-rubrique h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--marine); border-bottom: 1px solid var(--ligne); padding-bottom: 4px; }
.cr-rubrique p { margin: 0; }
.cr-reserves { border-left: 3px solid var(--rouge); padding-left: 12px; }
/* La trame : sous-parties et tableaux comme dans le Word (en-têtes bleu marine, texte blanc). */
.cr-trame { display: grid; gap: 16px; }
.cr-trame h4 { margin: 8px 0 2px; font-size: 13.5px; }
.cr-trame ul { margin: 0; padding-left: 20px; }
.cr-trame .tableau th { background: #144074; color: #fff; }
.cr-pied { font-size: 11.5px; color: var(--encre-pale); border-top: 1px solid var(--ligne); padding-top: 8px; }
:root[data-theme="dark"] .cr-titre, :root[data-theme="dark"] .cr-rubrique h3 { color: var(--bleu); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cr-titre, :root:not([data-theme="light"]) .cr-rubrique h3 { color: var(--bleu); } }
@media (max-width: 600px) { article.compte-rendu { padding: 16px; } .cr-meta { text-align: left; } }

/* Impression : seule la fiche imprimable reste, en noir sur blanc. Ne s'applique qu'aux pages
   qui en portent une, pour ne rien changer à l'impression des autres modules. */
@media print {
  body:has(.imprimable) { background: #fff; color: #000; }
  body:has(.imprimable) .menu, body:has(.imprimable) .haut, body:has(.imprimable) .voile,
  body:has(.imprimable) .pas-imprime, body:has(.imprimable) .avis { display: none !important; }
  body.app:has(.imprimable) { display: block; }
  body:has(.imprimable) main#contenu { padding: 0; max-width: none; }
  .imprimable { border: 0 !important; box-shadow: none !important; padding: 0 !important; color: #000; background: #fff !important; }
  .imprimable .cr-titre, .imprimable .cr-rubrique h3 { color: #144074 !important; }
  .imprimable ul.galerie { grid-template-columns: repeat(3, 1fr); }
  .imprimable ul.galerie li { break-inside: avoid; }
  .imprimable .cr-rubrique { break-inside: avoid-page; }
  @page { margin: 14mm; }
}

/* Sous-menu du terrain : le même en tête de chaque liste (comptes rendus, chantiers, sites,
   maintenance, audits), avec l'accès direct à un nouveau compte rendu. */
nav.sous-menu { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
nav.sous-menu a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--ligne); background: var(--surface); color: var(--encre-douce); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
nav.sous-menu a:hover { color: var(--encre); border-color: var(--cyan); }
nav.sous-menu a.actif { background: var(--marine); border-color: var(--marine); color: #fff; }
nav.sous-menu a.nouveau-cr { margin-left: auto; border-color: var(--cyan); color: var(--lien); }
@media (max-width: 600px) { nav.sous-menu a.nouveau-cr { margin-left: 0; } }

/* Sites : la carte (Leaflet) et la liste. */
#carte.carte-sites { height: 440px; border: 1px solid var(--ligne); border-radius: var(--rayon); background: var(--surface-2); overflow: hidden; z-index: 0; }
#carte.carte-sites.petite { height: 260px; }
#carte.carte-sites:not(.carte-active) { display: grid; place-items: center; }
@media (max-width: 600px) { #carte.carte-sites { height: 320px; } }
.bulle-site { display: grid; gap: 2px; font: 13px/1.35 var(--texte); }
.bulle-site a { font-weight: 600; }
.bulle-site .meta { color: #475069; font-size: 12px; }
ul.liste.sites li { align-items: flex-start; }
.bloc.acces p.notes { white-space: pre-line; }
form.proposition { border-top: 1px solid var(--ligne); padding-top: 10px; }
form.proposition .case { display: block; }

/* Enchaînements (22/09/2026) : gestes rapides sur téléphone, suites d'une panne, légendes,
   rentabilité. */
form.avancement-rapide { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
form.avancement-rapide .bouton, form.etat-rapide .bouton { min-width: 64px; justify-content: center; }
form.avancement-rapide .bouton.actif, form.etat-rapide .bouton.actif { background: var(--marine); border-color: var(--marine); color: #fff; }
form.etat-rapide { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 14px; }
.bloc.suite-panne { border-left: 4px solid var(--rouge); }
details.legende-photo { font-size: 12.5px; margin-top: 4px; }
details.legende-photo summary { cursor: pointer; color: var(--lien); }
details.legende-photo .formulaire { margin-top: 6px; }
details.modifier-materiel { flex-basis: 100%; font-size: 13px; }
details.modifier-materiel summary { cursor: pointer; color: var(--lien); }
table.rentabilite td:first-child { width: 50%; }
table.rentabilite tfoot td { font-weight: 600; border-top: 2px solid var(--ligne); }
table.rentabilite .note { display: block; font-size: 11.5px; color: var(--encre-pale); }
.entete .actions { flex-wrap: wrap; }
@media (max-width: 600px) {
  .entete .actions .bouton { flex: 1 1 auto; justify-content: center; }
  form.avancement-rapide .bouton, form.etat-rapide .bouton { flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px; }
}

/* Déposer une intervention : zone de dépôt, boutons de capture, liste des fichiers, progression. */
.depot-filtre { margin-bottom: 6px; }
.depot-zone { display: grid; gap: 10px; padding: 16px; border: 2px dashed var(--ligne); border-radius: var(--rayon); background: var(--fond); }
.depot-zone.survol { border-color: var(--bleu); background: var(--bleu-doux); }
.depot-invite { margin: 0; color: var(--encre-douce); }
.depot-boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.depot-boutons .bouton { cursor: pointer; }
.depot-zone:not(.avec-script) .depot-boutons { display: none; }
.depot-zone.avec-script .cache-fichier { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
/* Un texte collé (12/11/2026) : sans script, la saisie a ses propres champs. */
.depot-texte { display: grid; gap: 6px; }
.depot-texte label { font-size: 13px; color: var(--encre-douce); }
.depot-texte textarea { width: 100%; min-height: 90px; resize: vertical; font: inherit; color: var(--encre); background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 10px; }
.depot-zone:not(.avec-script) .depot-texte { display: none; }
.depot-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.depot-liste:empty { display: none; }
.depot-liste li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--ligne); }
.depot-liste li.refuse { border-color: var(--rouge); }
.depot-liste .depot-nom { font-weight: 500; overflow-wrap: anywhere; flex: 1 1 180px; min-width: 0; }
.depot-avance { display: grid; gap: 4px; }
.depot-avance progress { width: 100%; height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: var(--gris-doux); overflow: hidden; }
.depot-avance progress::-webkit-progress-bar { background: var(--gris-doux); border-radius: 99px; }
.depot-avance progress::-webkit-progress-value { background: var(--bleu); border-radius: 99px; }
.depot-avance progress::-moz-progress-bar { background: var(--bleu); border-radius: 99px; }
.pieces-cr li { justify-content: space-between; }
@media (max-width: 600px) {
  .depot-boutons .bouton { flex: 1 1 100%; justify-content: center; }
}
.depot-avance[hidden], .depot-filtre[hidden] { display: none; }
/* La zone de dépôt dans la saisie du compte rendu (cachée sans script). */
.cr-depot[hidden], .cr-depot [hidden] { display: none !important; }
.etiquette-champ { font-size: 13px; font-weight: 500; color: var(--encre-douce); }
.formulaire textarea.rempli-ia { border-color: var(--bleu); background: var(--bleu-doux); }
.aide.rouge { color: var(--rouge); }
.aide.vert { color: var(--vert); }
.cr-aiguillage { display: grid; gap: 12px; margin-top: 12px; }
.cr-aiguillage[hidden] { display: none; }

/* Comptes rendus en tableau façon tableur (07/11/2026) : tri par les en-têtes, filtre par colonne. */
.filtres label.case { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.filtres-actifs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; font-size: 13px; color: var(--encre-pale); }
.tableur-compte { margin: 0 0 6px; font-size: 13px; color: var(--encre-pale); }
table.tableur th button.tri { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
table.tableur th button.tri:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 3px; }
table.tableur th[aria-sort="ascending"], table.tableur th[aria-sort="descending"] { color: var(--encre); }
table.tableur tr.filtres-colonnes th { padding: 6px 8px; background: var(--surface); text-transform: none; letter-spacing: 0; font-weight: 400; }
table.tableur tr.filtres-colonnes input, table.tableur tr.filtres-colonnes select { width: 100%; min-width: 5.5rem; font: inherit; font-size: 13px; padding: 4px 6px; }
table.tableur td.date { white-space: nowrap; }
table.tableur td.titre-cr { min-width: 14rem; }
table.tableur td.nb, table.tableur th[data-tri="nombre"] { text-align: right; font-variant-numeric: tabular-nums; }
/* Styles propres au module technique. La base commune est dans ../style.css : ne la redéfinir ici que si le module en a vraiment besoin. */

/* Contrôle d'intégrité d'un .gfx : les échecs se voient d'un coup d'œil. */
.liste.controles > li.echec .titre { color: var(--rouge, #b42318); font-weight: 600; }
/* Contrôle souple en échec (01/11/2026) : à vérifier, ne bloque pas la livraison. */
.liste.controles > li.a-verifier .titre { color: var(--ambre, #b54708); font-weight: 600; }
.familles .pastille { margin: 0 .25rem .25rem 0; }
.examen { margin-top: 1rem; }

/* La clé busscan, montrée une seule fois : lisible et facile à sélectionner. */
.cle-neuve input.cle { width: 100%; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95rem; }

/* Schémas : visionneuse des pièces (PDF scanné, photos). */
.visionneuse { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: 1rem; align-items: start; }
.visionneuse nav.pieces li.actif .titre a { font-weight: 600; }
.page-piece img { display: block; max-width: 100%; height: auto; margin: .5rem auto; border: 1px solid var(--bord, #d0d7e2); border-radius: 4px; background: #fff; }
.page-piece .pagination { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.page-piece nav.pages { display: flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0; }
.page-piece nav.pages a { min-width: 2rem; text-align: center; padding: .15rem .35rem; border: 1px solid var(--bord, #d0d7e2); border-radius: 4px; text-decoration: none; }
.page-piece nav.pages a.actif { background: var(--bleu, #1d4ed8); color: #fff; border-color: transparent; }
pre.texte-page { white-space: pre-wrap; max-height: 30rem; overflow: auto; font-size: .85rem; }
fieldset.cases { border: 0; padding: 0; margin: 0 0 .75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .25rem .75rem; }
fieldset.cases .case { display: flex; gap: .4rem; align-items: baseline; }
form.en-ligne { display: inline-block; margin-left: .5rem; }
form.en-ligne .bouton { padding: .1rem .5rem; font-size: .85rem; }
@media (max-width: 700px) {
  .visionneuse { grid-template-columns: 1fr; }
}
/* Styles propres au module finances. La base commune est dans ../style.css : ne la redéfinir ici que si le module en a vraiment besoin. */

/* Fiche : paires libellé / valeur (facture, facture fournisseur). */
dl.fiche { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; }
dl.fiche dt { color: var(--encre-pale); font-size: 12.5px; padding-top: 1px; }
dl.fiche dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.fiche { grid-template-columns: minmax(0, 1fr); } dl.fiche dd { margin-bottom: 6px; } }

/* Un petit formulaire (un bouton) posé dans une ligne de texte. */
form.en-ligne { display: inline; margin: 0 0 0 6px; }
form.en-ligne .bouton { padding: 3px 10px; font-size: 12.5px; }

/* Relevé : crédits en vert, rapprochement et proposition sur plusieurs lignes. */
table.operations td.credit { color: var(--vert); }
table.operations .rapproche + .rapproche { margin-top: 6px; }
table.operations .proposition, table.operations .rapproche { min-width: 220px; }
details.manuel summary { cursor: pointer; color: var(--lien); font-size: 12.5px; }
details.manuel form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
details.manuel select { max-width: 320px; }

/* Formulaires de saisie repliables (nouvelle note, nouvelle facture). */
details.saisie > summary { list-style: none; display: inline-flex; width: max-content; }
details.saisie > summary::-webkit-details-marker { display: none; }
details.saisie[open] > summary { margin-bottom: 12px; }

/* Filtres avec libellés visibles (dates). */
.filtres label { display: inline-flex; align-items: center; gap: 4px; }

/* Graphique du chiffre d'affaires signé (accueil) */
.graphique-ca { display: block; width: 100%; height: auto; max-height: 240px; }
.graphique-ca rect { fill: var(--bleu, #1d4ed8); }
.graphique-ca rect:hover { fill: var(--bleu-fonce, #144074); }
.graphique-ca text { font-size: 11px; fill: currentColor; opacity: .7; }
code.cle-api { font-size: 1.05em; word-break: break-all; user-select: all; }

/* Le justificatif d'une note de frais, regardé sur la fiche (14/11/2026). Sur téléphone, il passe avant le formulaire de correction. */
.justificatif-apercu { display: block; }
.justificatif-apercu img { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; object-fit: contain; border-radius: 6px; background: #fff; }
@media (max-width: 760px) { .deux-colonnes > .colonne-piece { order: -1; } }
/* Styles propres au module stock. La base commune est dans ../style.css : ne la redéfinir ici que si le module en a vraiment besoin. */

/* Codes (EAN, emplacements, références) : chiffres alignés, lisibles d'un coup d'œil. */
.code { font-variant-numeric: tabular-nums; letter-spacing: .02em; word-break: break-all; }

/* Formulaires en ligne (un bouton dans une liste ou un tableau). */
form.en-ligne { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
form.en-ligne input.qte, td input.qte { width: 5.5em; }
label.case { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; color: var(--encre-douce); white-space: nowrap; }

/* Champ de scan : le champ prend la place, le bouton caméra reste à côté. */
form.scan { grid-template-columns: 1fr auto; align-items: end; }
@media (max-width: 600px) { form.scan { grid-template-columns: 1fr; } }
.scan-champ { display: flex; gap: 8px; }
.scan-champ input { flex: 1; min-width: 0; }
.scan-camera { flex: none; }

/* La caméra, en plein écran le temps du scan (ouverte par scripts/stock.js). */
.scan-voile { position: fixed; inset: 0; z-index: 100; background: rgb(8 12 24 / 92%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; color: #fff; }
.scan-voile p { margin: 0; text-align: center; }
.scan-haut { display: flex; gap: 10px; align-items: center; justify-content: space-between; width: min(100%, 520px); }
.scan-cameras { max-width: 55%; background: rgb(255 255 255 / 15%); color: #fff; border: 0; border-radius: 999px; padding: 4px 10px; }
.scan-cameras option { color: #000; }
.scan-cadre { position: relative; width: min(100%, 520px); }
.scan-cadre video { display: block; width: 100%; max-height: 60vh; border-radius: 12px; background: #000; object-fit: cover; box-shadow: 0 0 0 3px rgb(0 159 227 / 60%); }
/* Le viseur : le carré central, là où le lecteur embarqué relit en pleine résolution. */
.scan-viseur { position: absolute; left: 50%; top: 50%; width: 60%; aspect-ratio: 1; max-height: 80%; transform: translate(-50%, -50%); border: 2px solid rgb(255 255 255 / 85%); border-radius: 16px; pointer-events: none; transition: border-color .15s; }
.scan-voile.flash .scan-viseur { border-color: #34d399; }
.scan-voile.flash .scan-cadre video { box-shadow: 0 0 0 4px #34d399; }
.scan-dernier { min-height: 1.4em; font-weight: 600; max-width: 520px; }
.scan-dernier[data-ton="vert"] { color: #6ee7b7; }
.scan-dernier[data-ton="rouge"] { color: #fda4af; }
.scan-dernier[data-ton="ambre"] { color: #fcd34d; }
.scan-aide { font-size: 13px; opacity: .8; }

/* Poste de scan : les deux cases (produit, emplacement), pleines une fois scannées. */
.poste-case { border-style: dashed; }
.poste-case.pleine { border-style: solid; border-color: var(--bleu); }
.poste-titre { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
fieldset.poste-actions { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; grid-column: 1 / -1; }
fieldset.poste-actions legend { font-size: 13px; color: var(--encre-douce); margin-bottom: 4px; }
details.poste-reglages > summary { cursor: pointer; font-weight: 500; }

/* Liste des produits : quantité à droite, en évidence ; en rouge sous le seuil. */
.stock-liste .stock-qte { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-liste .stock-qte.bas { color: var(--rouge); }
.stock-liste .meta { flex-basis: 100%; }

/* Actions repliables de la fiche produit. */
details.action { border-top: 1px solid var(--ligne); padding-top: 10px; }
details.action > summary { cursor: pointer; font-weight: 500; color: var(--lien, var(--bleu)); padding: 4px 0; }
details.action > .formulaire { margin-top: 10px; }

.stock-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--ligne); }

dl.stock-fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.stock-fiche dt { color: var(--encre-pale); }
dl.stock-fiche dd { margin: 0; }
@media (max-width: 480px) { dl.stock-fiche { grid-template-columns: 1fr; } dl.stock-fiche dd { margin-bottom: 6px; } }

/* Mouvements : entrées en vert, sorties en rouge. */
td.entree { color: var(--vert); font-weight: 500; }
td.sortie { color: var(--rouge); font-weight: 500; }

/* Comparateur : la meilleure offre. */
tr.meilleur td { background: var(--vert-doux); }

/* Aperçu d'un classeur de tarif : la ligne d'en-tête retenue. */
table.classeur td, table.classeur th { font-size: 12px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
tr.entete-classeur td { background: var(--bleu-doux); font-weight: 600; }

/* ── Bon de commande imprimable ─────────────────────────────────────────── */
body.bc-imprimable { background: var(--fond); }
.bc-feuille { max-width: 820px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 18px; }
.bc-outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
.bc-entete { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.bc-entete img { max-width: 220px; height: auto; }
.bc-titre { text-align: right; }
.bc-titre h1 { margin: 0; }
.bc-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.bc-parties h2, .bc-feuille section h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--encre-pale); margin: 0 0 4px; }
.bc-parties p { margin: 0; }
table.bc-lignes { width: 100%; border-collapse: collapse; font-size: 13px; }
table.bc-lignes th, table.bc-lignes td { border-bottom: 1px solid var(--ligne); padding: 7px 6px; text-align: left; vertical-align: top; }
table.bc-lignes .nb { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.bc-lignes tfoot td { border-bottom: 0; font-size: 14px; }
.bc-pied { font-size: 12px; color: var(--encre-douce); }

@media print {
  @page { size: A4; margin: 14mm; }
  body.bc-imprimable { background: #fff; color: #000; }
  body.bc-imprimable .bc-outils { display: none; }
  body.bc-imprimable .bc-feuille { max-width: none; padding: 0; }
  body.bc-imprimable table.bc-lignes tr { break-inside: avoid; }
  body.bc-imprimable .pastille { border: 1px solid #000; background: none; color: #000; }
}

/* Photos d'un produit : chacune se retire de la fiche (le fichier reste archivé). */
.stock-photos figure { margin: 0; display: grid; justify-items: center; gap: 2px; font-size: 12px; }
/* Commander le matériel d'un devis : une ligne par article, cochable, quantité et fournisseur. */
ul.liste.commande-devis li { display: grid; gap: 4px; align-items: start; }
ul.liste.commande-devis .titre label { font-weight: 500; }
.commande-devis-saisie { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.commande-devis-saisie input.qte { width: 5.5em; }
.commande-devis-saisie input[list] { min-width: 12em; flex: 1 1 12em; }
/* Styles propres au module administration. La base commune est dans ../style.css : ne la redéfinir ici que si le module en a vraiment besoin. */

/* Un petit formulaire (un bouton) au fil d'une ligne. */
form.en-ligne { display: inline; }
.nul { color: var(--encre-pale); }

/* Cases à cocher en colonnes (groupes d'une personne, membres d'un groupe). */
ul.cases { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; }
ul.cases li { display: flex; align-items: center; gap: 8px; }
ul.cases input { width: auto; }

/* Effet sur les comptes : un tableau large qui défile dans son cadre. */
.tableau.effet td, .tableau.effet th { white-space: nowrap; }

/* Journal : avant / après. */
table.difference td { vertical-align: top; overflow-wrap: anywhere; }
table.difference tr.change td { background: var(--ambre-doux); }

/* Archive : détail d'une erreur. */
details pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; background: var(--surface-2); padding: 8px; border-radius: 6px; max-height: 260px; overflow: auto; }

/* Fil d'un ticket. */
ul.fil { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.fil .message { max-width: 85%; padding: 8px 12px; border-radius: 12px; background: var(--bleu-doux); justify-self: end; }
ul.fil .message.support { background: var(--surface-2); justify-self: start; }
ul.fil .meta { margin: 0 0 4px; font-size: 12px; color: var(--encre-pale); }
ul.fil .texte { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
ul.fil .pieces { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
img.apercu { max-height: 140px; max-width: 100%; border-radius: 6px; border: 1px solid var(--ligne); }

/* Aide. */
h2.famille { margin: 22px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-pale); }
section.bloc.aide h2 { display: flex; align-items: center; gap: 8px; }
section.bloc.aide.ferme { opacity: .6; }

@media (max-width: 600px) {
  ul.fil .message { max-width: 100%; }
}

/* Premiers pas : un point par ligne, le bouton à droite (dessous sur un écran étroit). */
.premiers-pas > li { align-items: center; }
.premiers-pas > li > div { flex: 1 1 260px; min-width: 0; }
.premiers-pas p.meta { margin: 4px 0 0; }
.premiers-pas .bouton { white-space: nowrap; }
.moi-liens .reste-a-faire { margin-left: auto; font-size: 12px; color: var(--encre-douce); }

/* Messages à l'équipe : le texte garde ses retours à la ligne. */
p.message-texte { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; }
/* ── Agents IA (/ia) ─────────────────────────────────────────────────────── */
.ia-fil { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* Le plus récent en haut (09/11/2026) : un échange (demande, réponse) se détache du précédent. */
.ia-fil > .ia-debut-tour { margin-top: 12px; }
.ia-fil > .ia-suite { list-style: none; }
/* Une seule colonne, jamais plus large que le panneau (10/11/2026 : dans le panneau d'un compte
   rendu, un élément trop large élargissait tout le fil, le texte ne revenait plus à la ligne et
   il fallait faire défiler en diagonale). */
.ia-fil, .assistant-fil, .bulle-ia-fil { grid-template-columns: minmax(0, 1fr); }
.ia-fil > li, .ia-fil .ia-message, .ia-flux > * { min-width: 0; overflow-wrap: anywhere; }
.assistant-fil, .bulle-ia-fil { overflow-x: hidden; }
.ia-a-voir .bouton { white-space: normal; text-align: left; }
.ia-message { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px 12px; background: var(--surface); }
.ia-message.utilisateur { border-left: 4px solid var(--bleu, #1f6feb); }
.ia-message.assistant { border-left: 4px solid var(--vert, #2da44e); }
.ia-message.systeme, .ia-message.contexte, .ia-message.outil { opacity: .85; font-size: .92em; }
.ia-tete { font-size: .85em; color: var(--texte-doux, #6b7280); margin-bottom: 4px; }
.ia-texte { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-family: inherit; }
pre.ia-texte { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; max-height: 480px; overflow: auto; }
.ia-outils { margin: 6px 0 0; padding-left: 18px; font-size: .9em; }
.ia-outils li { margin: 4px 0; }

/* ── Assistant : réponse au fil de l'eau, pièce jointe ──────────────── */
.ia-flux { display: grid; gap: 8px; }
.ia-flux [data-flux-texte]:empty, .ia-flux [data-flux-outils]:empty { display: none; }
.ia-flux [data-flux-texte] { border: 1px solid var(--ligne); border-left: 4px solid var(--vert, #2da44e); border-radius: var(--rayon); padding: 10px 12px; background: var(--surface); }
/* La réflexion : le raisonnement du modèle et ses recherches dans GAIA, au fil de l'eau. */
.ia-reflexion { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 6px 12px; background: var(--surface); font-size: .9em; }
.ia-reflexion > summary { cursor: pointer; font-weight: 600; color: var(--encre-douce, #57606a); }
.ia-etapes { list-style: none; margin: 8px 0 2px; padding: 0; display: grid; gap: 6px; }
.ia-etape { position: relative; padding-left: 18px; }
.ia-etape::before { content: ""; position: absolute; left: 3px; top: .45em; width: 8px; height: 8px; border-radius: 50%; background: var(--ligne); }
.ia-etape.en-cours::before { background: var(--bleu, #1f6feb); animation: ia-battre 0.9s ease-in-out infinite alternate; }
.ia-etape.fait::before, .ia-etape.propose::before { background: var(--vert, #2da44e); }
.ia-etape.refuse::before, .ia-etape.erreur::before { background: var(--rouge, #cf222e); }
.ia-etape .ia-detail { display: block; color: var(--encre-douce, #57606a); overflow-wrap: anywhere; white-space: pre-wrap; }
.ia-etape .ia-bilan { font-weight: normal; color: var(--encre-douce, #57606a); }
.ia-pensee { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--encre-douce, #57606a); font-style: italic; max-height: 240px; overflow: auto; margin-top: 2px; }
@keyframes ia-battre { from { opacity: .3; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ia-etape.en-cours::before { animation: none; } }
/* Assistant ouvert sur un devis (fiche du devis) : le devis visé, la pièce jointe mise en avant. */
.ia-cible { border: 1px solid var(--ligne); border-left: 4px solid var(--bleu); border-radius: var(--rayon); padding: 8px 12px; margin-bottom: 10px; background: var(--surface-2); }
.ia-cible p { margin: 0 0 4px; }
.ia-joindre.en-avant { border: 1px dashed var(--bleu); border-radius: var(--rayon); padding: 8px 10px; }

/* ── Relecture d'un compte rendu proposé par l'agent (/assistant/lectures/{id}) ──
   Pleine largeur, la trame rendue comme dans le Word, photos en grille avant / après. */
.relecture-origine { margin: 0; font-size: 13px; color: var(--encre-douce); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.relecture-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.relecture-actions.relecture-bas { justify-content: flex-end; }
.relecture-actions .bouton { min-height: 44px; }
form.relecture { display: grid; gap: 18px; }
.relecture .case { min-height: 44px; }
.relecture .case input { width: 20px; height: 20px; }
.relecture-apercu { border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 18px 20px; background: var(--surface); }
.relecture-apercu .cr-trame { gap: 18px; }
.relecture-json textarea, .relecture-rubrique textarea { width: 100%; field-sizing: content; min-height: 6em; line-height: 1.45; }
.relecture-json textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; max-height: 70vh; }
.relecture-json > summary, details.relecture-rubriques > summary, details.relecture-source > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.relecture-rubrique { gap: 6px; }
.controle-bilan ul { margin: 6px 0 0; padding-left: 20px; }
.controle-bilan li { margin: 2px 0; }

/* Les tableaux de la trame : lisibles, le texte se replie, la première colonne (Obs., État) étroite ;
   trop larges pour l'écran, ils défilent dans leur cadre. */
.cr-trame table td { min-width: 12ch; }
.cr-trame table td:first-child { min-width: 0; white-space: nowrap; }
.cr-trame .tableau th { white-space: normal; }

/* Photos : une réserve = un groupe ; avant à gauche, après à droite. */
.grille-groupes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 18px 28px; }
.groupe-photos { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--ligne-douce); align-content: start; }
.groupe-photos h3 { margin: 0; font-size: 14px; color: var(--marine); }
:root[data-theme="dark"] .groupe-photos h3 { color: var(--bleu); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .groupe-photos h3 { color: var(--bleu); } }
.paires-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.photo-relue { margin: 0; display: grid; gap: 6px; align-content: start; }
.photo-relue-image { position: relative; display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--ligne); background: var(--surface-2); }
.photo-relue-image img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-moment { position: absolute; left: 6px; top: 6px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgb(15 27 51 / 72%); color: #fff; }
.photo-relue figcaption { display: grid; gap: 4px; }
.photo-relue figcaption input[type="text"] { width: 100%; font-size: 13px; min-height: 40px; }
.photo-absente { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px dashed var(--ligne); border-radius: 8px; color: var(--encre-pale); font-size: 12.5px; }
.photo-absente:empty { border: 0; }
@media (max-width: 600px) {
  .relecture-apercu { padding: 12px; }
  .paires-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .relecture-actions .bouton { flex: 1 1 100%; justify-content: center; }
  .relecture-actions form.en-ligne { display: contents; }
}
/* Les réponses de l'assistant sont du Markdown rendu (gras, listes) : plus de pre-wrap. */
.ia-texte.ia-md, .assistant-fil .ia-texte.ia-md { white-space: normal; }

/* ── La bulle de l'assistant (toutes les pages, 28/10/2026) ───────────────── */
.bulle-ia {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 96px));
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--encre);
  border: 1px solid var(--ligne); border-radius: 16px;
  box-shadow: 0 12px 32px rgb(15 27 51 / 22%), 0 2px 6px rgb(15 27 51 / 10%);
  overflow: hidden;
}
.bulle-ia[hidden] { display: none !important; }
/* Déplacée (prise par la tête) ou agrandie (coin bas-droit) : posée en left / top, retenue
   d'une page à l'autre ; double-clic sur la tête : retour à sa place (09/11/2026). */
.bulle-ia { resize: both; min-width: 300px; min-height: 320px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
.bulle-ia.deplacee { right: auto; bottom: auto; }
.bulle-ia-tete { cursor: move; touch-action: none; }
.bulle-ia-tete button, .bulle-ia-tete a { cursor: pointer; }
/* Agrandie sur place (« Agrandir », 09/11/2026) : la page /assistant perdait la pièce en attente
   et n'avait qu'un sélecteur de fichier ; ici tout reste (pièces, collage, glisser-déposer). */
.bulle-ia.grande { left: 24px !important; top: 24px !important; right: 24px !important; bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; height: auto !important; max-width: none; max-height: none; resize: none; }
.bulle-ia.grande .bulle-ia-tete { cursor: default; }
.bulle-ia.grande .bulle-ia-fil, .bulle-ia.grande .bulle-ia-saisie { padding-inline: max(12px, calc((100% - 960px) / 2)); }
.bulle-ia.en-deplacement { user-select: none; box-shadow: 0 18px 44px rgb(15 27 51 / 30%), 0 2px 6px rgb(15 27 51 / 12%); }
.bulle-ia.survol { outline: 2px dashed var(--cyan); outline-offset: -6px; background: var(--bleu-doux); }
.bulle-ia-tete { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: 1px solid var(--ligne); background: var(--surface-2); }
.bulle-ia-tete h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 6px; flex: 1; }
.bulle-ia-actions { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.bouton-lien { background: none; border: 0; padding: 4px 6px; border-radius: 6px; color: var(--lien); font: inherit; cursor: pointer; text-decoration: none; }
.bouton-lien:hover { text-decoration: underline; }
.bouton-lien:focus-visible, .bulle-ia .bouton-icone:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }
.bulle-ia-fil { flex: 1; overflow-y: auto; padding: 12px; display: grid; align-content: start; gap: 8px; }
.bulle-ia-accueil { color: var(--encre-douce); font-size: 13.5px; margin: 0; }
.bulle-ia .ia-fil { gap: 8px; }
.bulle-ia .ia-message { border: 0; border-radius: 12px; padding: 8px 11px; font-size: 13.5px; background: var(--surface-2); max-width: 94%; }
.bulle-ia .ia-message.utilisateur { justify-self: end; margin-left: auto; background: var(--marine); color: #fff; }
.bulle-ia .ia-message.utilisateur .ia-texte { max-height: 9em; overflow-y: auto; white-space: pre-wrap; }
.bulle-ia .ia-message.utilisateur a, .bulle-ia .ia-message.utilisateur .meta { color: inherit; opacity: .85; }
.bulle-ia .ia-message .ia-tete { font-size: 11.5px; opacity: .75; }
.bulle-ia .ia-flux .ia-texte { white-space: pre-wrap; font-size: 13.5px; }
/* Une colonne qui ne s'élargit jamais au contenu : sans `minmax(0, 1fr)`, le nom d'une pièce sur
   une ligne (un mail .msg au long objet) élargissait la grille, le champ débordait à droite et le
   micro, posé dans son coin, sortait de la bulle (09/11/2026, Alexis : « le micro disparaît »). */
.bulle-ia-saisie { border-bottom: 1px solid var(--ligne); padding: 10px 10px 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.bulle-ia-saisie > * { min-width: 0; }
.bulle-ia-saisie textarea { width: 100%; min-height: 44px; max-height: 30vh; resize: vertical; }
.bulle-ia-outils { display: flex; align-items: center; gap: 6px; }
.bulle-ia-astuce { flex: 1; font-size: 11.5px; color: var(--encre-pale); }
.bulle-ia-outils label.bouton-icone:has(+ .cache-fichier:focus-visible) { outline: 2px solid var(--cyan); outline-offset: 2px; }
.bulle-ia-pieces { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 12.5px; }
.bulle-ia-pieces li { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--surface-2); border-radius: 8px; padding: 3px 4px 3px 8px; }
.bulle-ia-pieces li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulle-ia-vignette { flex: none; width: 36px; height: 36px; object-fit: cover; border-radius: 5px; background: var(--surface); }
.bulle-ia-retirer { flex: none; font-size: 18px; line-height: 1; padding: 0 6px; }
.bulle-ia-dit { margin: 0; font-size: 12.5px; color: var(--encre-douce); }
.bulle-ia-dit.rouge { color: var(--rouge); }
.bulle-ia-dit.ambre { color: var(--ambre); }
.bulle-ia-dit.vert { color: var(--vert); }
.assistant-haut[aria-expanded="true"] { background: var(--bleu-doux); border-color: var(--cyan); }
@media (max-width: 640px) {
  .bulle-ia { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bulle-ia, .bulle-ia.deplacee, .bulle-ia.grande { inset: 0 !important; width: auto !important; height: auto !important; resize: none; min-width: 0; min-height: 0; max-width: none; max-height: none; }
  .bulle-ia-tete { cursor: default; touch-action: auto; }
  .bulle-ia-astuce { display: none; }
}
@media print { .bulle-ia { display: none !important; } }

/* ── Éditer avec l'assistant (31/10/2026, issue #24) ────────────────────────
   L'aperçu imprimé à gauche, l'assistant à droite ; sous 1000 px, l'un sous l'autre (assistant
   repliable). Ce qui change s'éclaire en vert puis s'estompe, ce qui est retiré s'efface en rouge.
   Couleurs : variables du thème uniquement, jour comme nuit. */
.cote-a-cote { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 16px; align-items: start; margin-top: 12px; }
.cote-apercu { display: grid; gap: 10px; min-width: 0; }
.cote-barre { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.cote-onglets { display: flex; gap: 6px; }
.cote-onglets .bouton { min-height: 40px; }
.cote-onglets .bouton.actif { border-color: var(--cyan); background: var(--bleu-doux); color: var(--bleu); }
.cote-barre form .bouton { min-height: 40px; }
.cote-barre form .bouton[disabled] { opacity: .55; cursor: not-allowed; }
.cote-legende { margin: 0; font-size: 12px; color: var(--encre-pale); }
.feuille-cadre { background: var(--surface-2); border: 1px solid var(--ligne); border-radius: 14px; padding: 18px; overflow: auto; max-height: calc(100vh - 230px); }
.feuille { --feuille-titre: #144074; --feuille-ajout: var(--vert-doux); --feuille-retrait: var(--rouge-doux);
  background: var(--surface); color: var(--encre); max-width: 800px; margin: 0 auto; padding: 40px 48px; border-radius: 4px; box-shadow: 0 1px 3px rgb(15 27 51 / 12%), 0 6px 18px rgb(15 27 51 / 8%); font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .feuille { --feuille-titre: #6fb2ff; box-shadow: none; border: 1px solid var(--ligne); } }
:root[data-theme="dark"] .feuille { --feuille-titre: #6fb2ff; box-shadow: none; border: 1px solid var(--ligne); }
.feuille-tete { border-bottom: 2px solid var(--feuille-titre); padding-bottom: 12px; margin-bottom: 18px; }
.feuille-genre { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--encre-douce); }
.feuille-titre { margin: 4px 0 6px; color: var(--feuille-titre); font-size: 21px; }
.feuille-meta { margin: 0; font-size: 12.5px; color: var(--encre-douce); }
.feuille h2 { color: var(--feuille-titre); font: 700 16px/1.3 var(--titre); margin: 22px 0 8px; display: block; }
.feuille h3 { color: var(--feuille-titre); font-size: 14.5px; margin: 16px 0 6px; }
.feuille h4 { font-size: 13.5px; margin: 12px 0 4px; }
.feuille p { margin: 0 0 8px; }
.feuille ul { margin: 0 0 8px; padding-left: 20px; }
.feuille .tableau { overflow-x: auto; margin: 6px 0 10px; }
.feuille table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.feuille th, .feuille td { border: 1px solid var(--ligne); padding: 4px 8px; text-align: left; vertical-align: top; }
.feuille th { background: var(--surface-2); }
.feuille figure.image-doc { margin: 10px 0; text-align: center; }
.feuille figure.image-doc figcaption { font-size: 12px; color: var(--encre-douce); }
.feuille .grille-photos { display: grid; grid-template-columns: minmax(0, 92%); justify-content: center; gap: 14px; margin: 8px 0 12px; }
figure.photo-doc { margin: 0; text-align: center; }
figure.photo-doc img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; margin: 0 auto; border-radius: 3px; background: var(--surface-2); }
figure.photo-doc figcaption { font-size: 12px; color: var(--encre-douce); margin-top: 4px; }
@media (max-width: 520px) { .feuille .grille-photos { grid-template-columns: 1fr; } }
.feuille .a-verifier-imprime { border-left: 3px solid var(--ambre); background: var(--ambre-doux); padding: 6px 10px; }
.feuille .a-verifier-imprime strong { color: var(--ambre); }
.feuille .bloc-doc, .feuille [data-bloc] { border-radius: 4px; }
.feuille .bloc-ajoute { animation: bloc-ajoute 2.6s ease-out; }
.feuille .bloc-retire { animation: bloc-retire 1.4s ease-in forwards; overflow: hidden; pointer-events: none; }
@keyframes bloc-ajoute {
  0%, 35% { background: var(--feuille-ajout); box-shadow: 0 0 0 4px var(--feuille-ajout); }
  100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
}
@keyframes bloc-retire {
  0% { background: var(--feuille-retrait); opacity: 1; max-height: 600px; }
  60% { background: var(--feuille-retrait); opacity: .35; max-height: 600px; text-decoration: line-through; }
  100% { opacity: 0; max-height: 0; margin: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  /* Pas de mouvement : l'ajout reste éclairé un temps (sans fondu), le retrait disparaît net. */
  .feuille .bloc-ajoute { animation: none; background: var(--feuille-ajout); }
  .feuille .bloc-retire { animation: none; display: none; }
}
/* Le PDF envoyé, page par page (images rendues par pdftoppm, voir cote_a_cote.rs). */
.pdf-cadre { border: 1px solid var(--ligne); border-radius: 14px; background: var(--surface-2); padding: 14px; overflow: auto; max-height: calc(100vh - 230px); transition: opacity .2s ease; }
.pdf-cadre.se-refait { opacity: .72; }
.pdf-pages { display: grid; gap: 14px; justify-items: center; }
.pdf-attente { margin: 24px 8px; color: var(--encre-douce); text-align: center; }
.pdf-page { margin: 0; width: 100%; max-width: 820px; }
.pdf-page img { display: block; width: 100%; height: auto; border-radius: 3px; box-shadow: 0 1px 3px rgb(15 27 51 / 14%), 0 6px 18px rgb(15 27 51 / 8%); outline: 3px solid transparent; outline-offset: 3px; }
.pdf-page figcaption { margin-top: 4px; font-size: 11.5px; color: var(--encre-pale); text-align: center; }
.pdf-page.page-changee img { animation: page-changee 2.6s ease-out; }
@keyframes page-changee { 0%, 40% { outline-color: var(--vert); } 100% { outline-color: transparent; } }
.pdf-etat { margin: 0; flex: 1; min-width: 0; font-size: 12.5px; color: var(--encre-douce); }
.pdf-etat:empty { display: none; }
.feuille-avertissement { margin: 0 auto 12px; max-width: 800px; font-size: 12.5px; color: var(--encre-douce); }
/* Le bandeau : ce que la dernière modification a changé. */
.cote-changements { border: 1px solid var(--ligne); border-left: 4px solid var(--cyan); border-radius: var(--rayon); background: var(--surface); padding: 8px 12px; display: grid; gap: 6px; font-size: 13px; }
.cote-changements[hidden], .cote-onglets [hidden], [data-vue-cadre][hidden] { display: none; }
.cote-changements.apparait { animation: changements-apparaissent .35s ease-out; }
@keyframes changements-apparaissent { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.chg-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.chg-resume { color: var(--encre-douce); flex: 1; }
.chg-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chg { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; overflow-wrap: anywhere; }
.chg-genre { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); }
.chg-ajoute .chg-genre { background: var(--vert-doux); color: var(--vert); }
.chg-retire .chg-genre { background: var(--rouge-doux); color: var(--rouge); }
.chg-remplace .chg-genre { background: var(--bleu-doux); color: var(--bleu); }
.chg-ou { color: var(--encre-douce); font-size: 12.5px; }
.chg-avant { color: var(--encre-douce); text-decoration: line-through; }
.chg-apres { color: var(--encre); }
.chg-fleche { color: var(--encre-pale); }
.chg-plus { color: var(--encre-pale); }
.chg-pages { margin: 0; font-size: 12px; color: var(--encre-pale); }
.chg-pages:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
  .cote-changements.apparait, .pdf-page.page-changee img { animation: none; }
  .pdf-page.page-changee img { outline-color: var(--vert); }
  .pdf-cadre { transition: none; }
}
.cote-assistant .assistant-fil { max-height: calc(100vh - 330px); }
/* « Agrandir » : l'assistant prend la moitié de la largeur, le document reste à gauche. */
.assistant-agrandir .si-agrandi, .cote-a-cote.assistant-grand .assistant-agrandir .si-reduit { display: none; }
.cote-a-cote.assistant-grand .assistant-agrandir .si-agrandi { display: inline; }
.cote-assistant .assistant-tete h2 { margin-right: auto; }
.assistant-agrandir { font-size: 12.5px; }
@media (min-width: 1001px) {
  .cote-a-cote.assistant-grand { grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr); }
  .cote-a-cote .devis-assistant { position: sticky; top: 72px; }
  .cote-a-cote .assistant-repli > summary { display: none; }
  .cote-a-cote .assistant-repli .assistant-tete h2 { display: flex; }
  .cote-a-cote .assistant-fil { max-height: calc(100vh - 330px); }
}
@media (max-width: 1000px) {
  .cote-a-cote, .cote-a-cote.assistant-grand { grid-template-columns: minmax(0, 1fr); }
  .assistant-agrandir { display: none; }
  .feuille-cadre { max-height: none; padding: 10px; }
  .pdf-cadre { max-height: none; padding: 8px; }
}
@media (max-width: 600px) {
  .feuille { padding: 20px 16px; }
  .cote-barre form, .cote-barre form .bouton { width: 100%; justify-content: center; }
}
